blob: f42895ae2156a9f7e7c46eed9f9624f02b5ba9a8 [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;
34 std::string c_name;
35};
36
sprang@webrtc.orgccd42842014-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;
44
45 bool operator==(const StreamStats& other) const {
46 return key_frames == other.key_frames &&
47 delta_frames == other.delta_frames &&
48 bitrate_bps == other.bitrate_bps && rtp_stats == other.rtp_stats &&
49 rtcp_stats == other.rtcp_stats;
50 }
51};
52
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000053// Settings for NACK, see RFC 4585 for details.
54struct NackConfig {
pbos@webrtc.orgeceb5322013-05-28 08:04:45 +000055 NackConfig() : rtp_history_ms(0) {}
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000056 // Send side: the time RTP packets are stored for retransmissions.
57 // Receive side: the time the receiver is prepared to wait for
58 // retransmissions.
pbos@webrtc.orgeceb5322013-05-28 08:04:45 +000059 // Set to '0' to disable.
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000060 int rtp_history_ms;
61};
62
63// Settings for forward error correction, see RFC 5109 for details. Set the
64// payload types to '-1' to disable.
65struct FecConfig {
pbos@webrtc.orgeceb5322013-05-28 08:04:45 +000066 FecConfig() : ulpfec_payload_type(-1), red_payload_type(-1) {}
mflodman@webrtc.org65f995a2013-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
74// Settings for RTP retransmission payload format, see RFC 4588 for details.
75struct RtxConfig {
pbos@webrtc.org5860de02013-09-16 13:01:47 +000076 RtxConfig() : rtx_payload_type(0), video_payload_type(0) {}
77 // SSRCs to use for the RTX streams.
78 std::vector<uint32_t> ssrcs;
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000079
80 // Payload type to use for the RTX stream.
81 int rtx_payload_type;
82
83 // Original video payload this RTX stream is used for.
84 int video_payload_type;
85};
86
87// RTP header extension to use for the video stream, see RFC 5285.
88struct RtpExtension {
pbos@webrtc.orgce90eff2013-11-20 11:48:56 +000089 static const char* kTOffset;
90 static const char* kAbsSendTime;
pbos@webrtc.org29023282013-09-11 10:14:56 +000091 RtpExtension(const char* name, int id) : name(name), id(id) {}
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000092 // TODO(mflodman) Add API to query supported extensions.
93 std::string name;
94 int id;
95};
mflodman@webrtc.org65f995a2013-04-18 12:02:52 +000096} // namespace webrtc
97
pbos@webrtc.org1ecee9a2013-05-29 11:34:32 +000098#endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_