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 11 // TODO(pbos): Move Config from common.h to here. 12 13 #ifndef WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_ 14 #define WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_ 15 16 #include <string> 17 #include <vector> 18 19 #include "webrtc/common_types.h" 20 #include "webrtc/typedefs.h" 21 22 namespace webrtc { 23 24 struct RtpStatistics { 25 RtpStatistics() 26 : ssrc(0), 27 fraction_loss(0), 28 cumulative_loss(0), 29 extended_max_sequence_number(0) {} 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 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; 44 }; 45 46 // Settings for NACK, see RFC 4585 for details. 47 struct NackConfig { 48 NackConfig() : rtp_history_ms(0) {} 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. 52 // Set to '0' to disable. 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 { 59 FecConfig() : ulpfec_payload_type(-1), red_payload_type(-1) {} 60 std::string ToString() const; 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 68 // RTP header extension to use for the video stream, see RFC 5285. 69 struct RtpExtension { 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. 73 static const char* kTOffset; 74 static const char* kAbsSendTime; 75 std::string name; 76 int id; 77 }; 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 104 } // namespace webrtc 105 106 #endif // WEBRTC_VIDEO_ENGINE_NEW_INCLUDE_CONFIG_H_ 107