blob: 2e96ec1c02d9b0077cb3bce3a4e619aac7945481 [file] [log] [blame]
mflodman@webrtc.org06e80262013-04-18 12:02:521/*
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:0111// TODO(pbos): Move Config from common.h to here.
12
pbos@webrtc.org4988d942013-05-29 11:34:3213#ifndef WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_
14#define WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_
mflodman@webrtc.org06e80262013-04-18 12:02:5215
16#include <string>
pbos@webrtc.org041d54b2013-09-16 13:01:4717#include <vector>
mflodman@webrtc.org06e80262013-04-18 12:02:5218
sprang@webrtc.org49812e62014-01-07 09:54:3419#include "webrtc/common_types.h"
pbos@webrtc.org346dbe72013-11-20 11:48:5620#include "webrtc/typedefs.h"
21
mflodman@webrtc.org06e80262013-04-18 12:02:5222namespace webrtc {
mflodman@webrtc.org06e80262013-04-18 12:02:5223
mflodman@webrtc.org06e80262013-04-18 12:02:5224struct RtpStatistics {
pbos@webrtc.orgb2d1a402013-05-28 08:04:4525 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:5230 uint32_t ssrc;
31 int fraction_loss;
32 int cumulative_loss;
33 int extended_max_sequence_number;
mflodman@webrtc.org06e80262013-04-18 12:02:5234};
35
sprang@webrtc.org49812e62014-01-07 09:54:3436struct StreamStats {
stefan@webrtc.org55b0f2e2014-07-11 13:44:0237 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.org49812e62014-01-07 09:54:3443 uint32_t key_frames;
44 uint32_t delta_frames;
45 int32_t bitrate_bps;
stefan@webrtc.org55b0f2e2014-07-11 13:44:0246 int avg_delay_ms;
47 int max_delay_ms;
sprang@webrtc.org49812e62014-01-07 09:54:3448 StreamDataCounters rtp_stats;
49 RtcpStatistics rtcp_stats;
sprang@webrtc.org49812e62014-01-07 09:54:3450};
51
mflodman@webrtc.org06e80262013-04-18 12:02:5252// Settings for NACK, see RFC 4585 for details.
53struct NackConfig {
pbos@webrtc.orgb2d1a402013-05-28 08:04:4554 NackConfig() : rtp_history_ms(0) {}
mflodman@webrtc.org06e80262013-04-18 12:02:5255 // 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.orgb2d1a402013-05-28 08:04:4558 // Set to '0' to disable.
mflodman@webrtc.org06e80262013-04-18 12:02:5259 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.orgb2d1a402013-05-28 08:04:4565 FecConfig() : ulpfec_payload_type(-1), red_payload_type(-1) {}
pbos@webrtc.org7e686932014-05-15 09:35:0666 std::string ToString() const;
mflodman@webrtc.org06e80262013-04-18 12:02:5267 // 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.org06e80262013-04-18 12:02:5274// RTP header extension to use for the video stream, see RFC 5285.
75struct RtpExtension {
pbos@webrtc.org7e686932014-05-15 09:35:0676 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.org346dbe72013-11-20 11:48:5679 static const char* kTOffset;
80 static const char* kAbsSendTime;
mflodman@webrtc.org06e80262013-04-18 12:02:5281 std::string name;
82 int id;
83};
pbos@webrtc.org7e686932014-05-15 09:35:0684
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.org06e80262013-04-18 12:02:52110} // namespace webrtc
111
pbos@webrtc.org4988d942013-05-29 11:34:32112#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_