blob: 2e96ec1c02d9b0077cb3bce3a4e619aac7945481 [file] [log] [blame]
mflodman@webrtc.org69b0d2c2013-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.orgb581c902013-10-28 16:32:01 +000011// TODO(pbos): Move Config from common.h to here.
12
pbos@webrtc.org266d5f62013-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.org69b0d2c2013-04-18 12:02:52 +000015
16#include <string>
pbos@webrtc.orgf952fce2013-09-16 13:01:47 +000017#include <vector>
mflodman@webrtc.org69b0d2c2013-04-18 12:02:52 +000018
sprang@webrtc.orgca723002014-01-07 09:54:34 +000019#include "webrtc/common_types.h"
pbos@webrtc.org60108c22013-11-20 11:48:56 +000020#include "webrtc/typedefs.h"
21
mflodman@webrtc.org69b0d2c2013-04-18 12:02:52 +000022namespace webrtc {
mflodman@webrtc.org69b0d2c2013-04-18 12:02:52 +000023
mflodman@webrtc.org69b0d2c2013-04-18 12:02:52 +000024struct RtpStatistics {
pbos@webrtc.orga6ca12e2013-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.org69b0d2c2013-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.org69b0d2c2013-04-18 12:02:52 +000034};
35
sprang@webrtc.orgca723002014-01-07 09:54:34 +000036struct StreamStats {
stefan@webrtc.org84ac6d02014-07-11 13:44:02 +000037 StreamStats()
38 : key_frames(0),
39 delta_frames(0),
40 bitrate_bps(0),
41 avg_delay_ms(0),
42 max_delay_ms(0) {}
sprang@webrtc.orgca723002014-01-07 09:54:34 +000043 uint32_t key_frames;
44 uint32_t delta_frames;
45 int32_t bitrate_bps;
stefan@webrtc.org84ac6d02014-07-11 13:44:02 +000046 int avg_delay_ms;
47 int max_delay_ms;
sprang@webrtc.orgca723002014-01-07 09:54:34 +000048 StreamDataCounters rtp_stats;
49 RtcpStatistics rtcp_stats;
sprang@webrtc.orgca723002014-01-07 09:54:34 +000050};
51
mflodman@webrtc.org69b0d2c2013-04-18 12:02:52 +000052// Settings for NACK, see RFC 4585 for details.
53struct NackConfig {
pbos@webrtc.orga6ca12e2013-05-28 08:04:45 +000054 NackConfig() : rtp_history_ms(0) {}
mflodman@webrtc.org69b0d2c2013-04-18 12:02:52 +000055 // Send side: the time RTP packets are stored for retransmissions.
56 // Receive side: the time the receiver is prepared to wait for
57 // retransmissions.
pbos@webrtc.orga6ca12e2013-05-28 08:04:45 +000058 // Set to '0' to disable.
mflodman@webrtc.org69b0d2c2013-04-18 12:02:52 +000059 int rtp_history_ms;
60};
61
62// Settings for forward error correction, see RFC 5109 for details. Set the
63// payload types to '-1' to disable.
64struct FecConfig {
pbos@webrtc.orga6ca12e2013-05-28 08:04:45 +000065 FecConfig() : ulpfec_payload_type(-1), red_payload_type(-1) {}
pbos@webrtc.orgb4bc1a62014-05-15 09:35:06 +000066 std::string ToString() const;
mflodman@webrtc.org69b0d2c2013-04-18 12:02:52 +000067 // Payload type used for ULPFEC packets.
68 int ulpfec_payload_type;
69
70 // Payload type used for RED packets.
71 int red_payload_type;
72};
73
mflodman@webrtc.org69b0d2c2013-04-18 12:02:52 +000074// RTP header extension to use for the video stream, see RFC 5285.
75struct RtpExtension {
pbos@webrtc.orgb4bc1a62014-05-15 09:35:06 +000076 RtpExtension(const char* name, int id) : name(name), id(id) {}
77 std::string ToString() const;
78 // TODO(mflodman) Add API to query supported extensions.
pbos@webrtc.org60108c22013-11-20 11:48:56 +000079 static const char* kTOffset;
80 static const char* kAbsSendTime;
mflodman@webrtc.org69b0d2c2013-04-18 12:02:52 +000081 std::string name;
82 int id;
83};
pbos@webrtc.orgb4bc1a62014-05-15 09:35:06 +000084
85struct VideoStream {
86 VideoStream()
87 : width(0),
88 height(0),
89 max_framerate(-1),
90 min_bitrate_bps(-1),
91 target_bitrate_bps(-1),
92 max_bitrate_bps(-1),
93 max_qp(-1) {}
94 std::string ToString() const;
95
96 size_t width;
97 size_t height;
98 int max_framerate;
99
100 int min_bitrate_bps;
101 int target_bitrate_bps;
102 int max_bitrate_bps;
103
104 int max_qp;
105
106 // Bitrate thresholds for enabling additional temporal layers.
107 std::vector<int> temporal_layers;
108};
109
mflodman@webrtc.org69b0d2c2013-04-18 12:02:52 +0000110} // namespace webrtc
111
pbos@webrtc.org266d5f62013-05-29 11:34:32 +0000112#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_