blob: 9c8a902a09df3e35005fd87d6ad3c4b61d50dd44 [file] [log] [blame]
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +00001/*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
pbos@webrtc.org16e03b72013-10-28 16:32:01 +000011// TODO(pbos): Move Config from common.h to here.
12
pbos@webrtc.org1ecee9a2013-05-29 11:34:32 +000013#ifndef WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_
14#define WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000015
16#include <string>
pbos@webrtc.org5860de02013-09-16 13:01:47 +000017#include <vector>
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000018
sprang@webrtc.orgccd42842014-01-07 09:54:34 +000019#include "webrtc/common_types.h"
pbos@webrtc.orgce90eff2013-11-20 11:48:56 +000020#include "webrtc/typedefs.h"
21
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000022namespace webrtc {
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000023
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000024struct RtpStatistics {
pbos@webrtc.orgeceb5322013-05-28 08:04:45 +000025 RtpStatistics()
26 : ssrc(0),
27 fraction_loss(0),
28 cumulative_loss(0),
29 extended_max_sequence_number(0) {}
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000030 uint32_t ssrc;
31 int fraction_loss;
32 int cumulative_loss;
33 int extended_max_sequence_number;
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000034};
35
sprang@webrtc.orgccd42842014-01-07 09:54:34 +000036struct StreamStats {
37 StreamStats() : key_frames(0), delta_frames(0), bitrate_bps(0) {}
38 uint32_t key_frames;
39 uint32_t delta_frames;
40 int32_t bitrate_bps;
41 StreamDataCounters rtp_stats;
42 RtcpStatistics rtcp_stats;
sprang@webrtc.orgccd42842014-01-07 09:54:34 +000043};
44
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000045// Settings for NACK, see RFC 4585 for details.
46struct NackConfig {
pbos@webrtc.orgeceb5322013-05-28 08:04:45 +000047 NackConfig() : rtp_history_ms(0) {}
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000048 // Send side: the time RTP packets are stored for retransmissions.
49 // Receive side: the time the receiver is prepared to wait for
50 // retransmissions.
pbos@webrtc.orgeceb5322013-05-28 08:04:45 +000051 // Set to '0' to disable.
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000052 int rtp_history_ms;
53};
54
55// Settings for forward error correction, see RFC 5109 for details. Set the
56// payload types to '-1' to disable.
57struct FecConfig {
pbos@webrtc.orgeceb5322013-05-28 08:04:45 +000058 FecConfig() : ulpfec_payload_type(-1), red_payload_type(-1) {}
pbos@webrtc.org1e92b0a2014-05-15 09:35:06 +000059 std::string ToString() const;
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000060 // Payload type used for ULPFEC packets.
61 int ulpfec_payload_type;
62
63 // Payload type used for RED packets.
64 int red_payload_type;
65};
66
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000067// RTP header extension to use for the video stream, see RFC 5285.
68struct RtpExtension {
pbos@webrtc.org1e92b0a2014-05-15 09:35:06 +000069 RtpExtension(const char* name, int id) : name(name), id(id) {}
70 std::string ToString() const;
71 // TODO(mflodman) Add API to query supported extensions.
pbos@webrtc.orgce90eff2013-11-20 11:48:56 +000072 static const char* kTOffset;
73 static const char* kAbsSendTime;
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000074 std::string name;
75 int id;
76};
pbos@webrtc.org1e92b0a2014-05-15 09:35:06 +000077
78struct VideoStream {
79 VideoStream()
80 : width(0),
81 height(0),
82 max_framerate(-1),
83 min_bitrate_bps(-1),
84 target_bitrate_bps(-1),
85 max_bitrate_bps(-1),
86 max_qp(-1) {}
87 std::string ToString() const;
88
89 size_t width;
90 size_t height;
91 int max_framerate;
92
93 int min_bitrate_bps;
94 int target_bitrate_bps;
95 int max_bitrate_bps;
96
97 int max_qp;
98
99 // Bitrate thresholds for enabling additional temporal layers.
100 std::vector<int> temporal_layers;
101};
102
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +0000103} // namespace webrtc
104
pbos@webrtc.org1ecee9a2013-05-29 11:34:32 +0000105#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_