blob: 7717bbad9e36b1f73a391a3a408cbfb69e6caf9f [file] [log] [blame]
mflodman@webrtc.org06e80262013-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.org24e20892013-10-28 16:32:01 +000011// TODO(pbos): Move Config from common.h to here.
12
pbos@webrtc.org4988d942013-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.org06e80262013-04-18 12:02:52 +000015
16#include <string>
pbos@webrtc.org041d54b2013-09-16 13:01:47 +000017#include <vector>
mflodman@webrtc.org06e80262013-04-18 12:02:52 +000018
sprang@webrtc.org49812e62014-01-07 09:54:34 +000019#include "webrtc/common_types.h"
pbos@webrtc.org346dbe72013-11-20 11:48:56 +000020#include "webrtc/typedefs.h"
21
mflodman@webrtc.org06e80262013-04-18 12:02:52 +000022namespace webrtc {
mflodman@webrtc.org06e80262013-04-18 12:02:52 +000023
mflodman@webrtc.org06e80262013-04-18 12:02:52 +000024struct RtpStatistics {
pbos@webrtc.orgb2d1a402013-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.org06e80262013-04-18 12:02:52 +000030 uint32_t ssrc;
31 int fraction_loss;
32 int cumulative_loss;
33 int extended_max_sequence_number;
34 std::string c_name;
35};
36
sprang@webrtc.org49812e62014-01-07 09:54:34 +000037struct StreamStats {
38 StreamStats() : key_frames(0), delta_frames(0), bitrate_bps(0) {}
39 uint32_t key_frames;
40 uint32_t delta_frames;
41 int32_t bitrate_bps;
42 StreamDataCounters rtp_stats;
43 RtcpStatistics rtcp_stats;
sprang@webrtc.org49812e62014-01-07 09:54:34 +000044};
45
mflodman@webrtc.org06e80262013-04-18 12:02:52 +000046// Settings for NACK, see RFC 4585 for details.
47struct NackConfig {
pbos@webrtc.orgb2d1a402013-05-28 08:04:45 +000048 NackConfig() : rtp_history_ms(0) {}
mflodman@webrtc.org06e80262013-04-18 12:02:52 +000049 // Send side: the time RTP packets are stored for retransmissions.
50 // Receive side: the time the receiver is prepared to wait for
51 // retransmissions.
pbos@webrtc.orgb2d1a402013-05-28 08:04:45 +000052 // Set to '0' to disable.
mflodman@webrtc.org06e80262013-04-18 12:02:52 +000053 int rtp_history_ms;
54};
55
56// Settings for forward error correction, see RFC 5109 for details. Set the
57// payload types to '-1' to disable.
58struct FecConfig {
pbos@webrtc.orgb2d1a402013-05-28 08:04:45 +000059 FecConfig() : ulpfec_payload_type(-1), red_payload_type(-1) {}
pbos@webrtc.org7e686932014-05-15 09:35:06 +000060 std::string ToString() const;
mflodman@webrtc.org06e80262013-04-18 12:02:52 +000061 // Payload type used for ULPFEC packets.
62 int ulpfec_payload_type;
63
64 // Payload type used for RED packets.
65 int red_payload_type;
66};
67
mflodman@webrtc.org06e80262013-04-18 12:02:52 +000068// RTP header extension to use for the video stream, see RFC 5285.
69struct RtpExtension {
pbos@webrtc.org7e686932014-05-15 09:35:06 +000070 RtpExtension(const char* name, int id) : name(name), id(id) {}
71 std::string ToString() const;
72 // TODO(mflodman) Add API to query supported extensions.
pbos@webrtc.org346dbe72013-11-20 11:48:56 +000073 static const char* kTOffset;
74 static const char* kAbsSendTime;
mflodman@webrtc.org06e80262013-04-18 12:02:52 +000075 std::string name;
76 int id;
77};
pbos@webrtc.org7e686932014-05-15 09:35:06 +000078
79struct VideoStream {
80 VideoStream()
81 : width(0),
82 height(0),
83 max_framerate(-1),
84 min_bitrate_bps(-1),
85 target_bitrate_bps(-1),
86 max_bitrate_bps(-1),
87 max_qp(-1) {}
88 std::string ToString() const;
89
90 size_t width;
91 size_t height;
92 int max_framerate;
93
94 int min_bitrate_bps;
95 int target_bitrate_bps;
96 int max_bitrate_bps;
97
98 int max_qp;
99
100 // Bitrate thresholds for enabling additional temporal layers.
101 std::vector<int> temporal_layers;
102};
103
mflodman@webrtc.org06e80262013-04-18 12:02:52 +0000104} // namespace webrtc
105
pbos@webrtc.org4988d942013-05-29 11:34:32 +0000106#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_