mflodman@webrtc.org | 69b0d2c | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 1 | /* |
| 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.org | b581c90 | 2013-10-28 16:32:01 +0000 | [diff] [blame] | 11 | // TODO(pbos): Move Config from common.h to here. |
| 12 | |
pbos@webrtc.org | 266d5f6 | 2013-05-29 11:34:32 +0000 | [diff] [blame] | 13 | #ifndef WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_ |
| 14 | #define WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_ |
mflodman@webrtc.org | 69b0d2c | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 15 | |
| 16 | #include <string> |
pbos@webrtc.org | f952fce | 2013-09-16 13:01:47 +0000 | [diff] [blame] | 17 | #include <vector> |
mflodman@webrtc.org | 69b0d2c | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 18 | |
sprang@webrtc.org | ca72300 | 2014-01-07 09:54:34 +0000 | [diff] [blame] | 19 | #include "webrtc/common_types.h" |
pbos@webrtc.org | 60108c2 | 2013-11-20 11:48:56 +0000 | [diff] [blame] | 20 | #include "webrtc/typedefs.h" |
| 21 | |
mflodman@webrtc.org | 69b0d2c | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 22 | namespace webrtc { |
mflodman@webrtc.org | 69b0d2c | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 23 | |
mflodman@webrtc.org | 69b0d2c | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 24 | struct RtpStatistics { |
pbos@webrtc.org | a6ca12e | 2013-05-28 08:04:45 +0000 | [diff] [blame] | 25 | RtpStatistics() |
| 26 | : ssrc(0), |
| 27 | fraction_loss(0), |
| 28 | cumulative_loss(0), |
| 29 | extended_max_sequence_number(0) {} |
mflodman@webrtc.org | 69b0d2c | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 30 | 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.org | ca72300 | 2014-01-07 09:54:34 +0000 | [diff] [blame] | 37 | struct 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.org | ca72300 | 2014-01-07 09:54:34 +0000 | [diff] [blame] | 44 | }; |
| 45 | |
mflodman@webrtc.org | 69b0d2c | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 46 | // Settings for NACK, see RFC 4585 for details. |
| 47 | struct NackConfig { |
pbos@webrtc.org | a6ca12e | 2013-05-28 08:04:45 +0000 | [diff] [blame] | 48 | NackConfig() : rtp_history_ms(0) {} |
mflodman@webrtc.org | 69b0d2c | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 49 | // 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.org | a6ca12e | 2013-05-28 08:04:45 +0000 | [diff] [blame] | 52 | // Set to '0' to disable. |
mflodman@webrtc.org | 69b0d2c | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 53 | 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. |
| 58 | struct FecConfig { |
pbos@webrtc.org | a6ca12e | 2013-05-28 08:04:45 +0000 | [diff] [blame] | 59 | FecConfig() : ulpfec_payload_type(-1), red_payload_type(-1) {} |
pbos@webrtc.org | b4bc1a6 | 2014-05-15 09:35:06 +0000 | [diff] [blame] | 60 | std::string ToString() const; |
mflodman@webrtc.org | 69b0d2c | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 61 | // 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.org | 69b0d2c | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 68 | // RTP header extension to use for the video stream, see RFC 5285. |
| 69 | struct RtpExtension { |
pbos@webrtc.org | b4bc1a6 | 2014-05-15 09:35:06 +0000 | [diff] [blame] | 70 | 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.org | 60108c2 | 2013-11-20 11:48:56 +0000 | [diff] [blame] | 73 | static const char* kTOffset; |
| 74 | static const char* kAbsSendTime; |
mflodman@webrtc.org | 69b0d2c | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 75 | std::string name; |
| 76 | int id; |
| 77 | }; |
pbos@webrtc.org | b4bc1a6 | 2014-05-15 09:35:06 +0000 | [diff] [blame] | 78 | |
| 79 | struct 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.org | 69b0d2c | 2013-04-18 12:02:52 +0000 | [diff] [blame] | 104 | } // namespace webrtc |
| 105 | |
pbos@webrtc.org | 266d5f6 | 2013-05-29 11:34:32 +0000 | [diff] [blame] | 106 | #endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_ |