OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 int64_t capture_time_ms, | 51 int64_t capture_time_ms, |
52 const uint8_t* payload_data, | 52 const uint8_t* payload_data, |
53 size_t payload_size, | 53 size_t payload_size, |
54 const RTPFragmentationHeader* fragmentation, | 54 const RTPFragmentationHeader* fragmentation, |
55 const RTPVideoHeader* video_header); | 55 const RTPVideoHeader* video_header); |
56 | 56 |
57 int32_t SendRTPIntraRequest(); | 57 int32_t SendRTPIntraRequest(); |
58 | 58 |
59 void SetVideoCodecType(RtpVideoCodecTypes type); | 59 void SetVideoCodecType(RtpVideoCodecTypes type); |
60 | 60 |
61 // FEC | 61 // ULPFEC. |
62 void SetUlpfecConfig(bool enabled, | 62 void SetUlpfecConfig(int red_payload_type, int ulpfec_payload_type); |
63 int red_payload_type, | 63 void UlpfecConfig(int* red_payload_type, int* ulpfec_payload_type) const; |
64 int ulpfec_payload_type); | |
65 | |
66 void UlpfecConfig(bool* enabled, | |
67 int* red_payload_type, | |
68 int* ulpfec_payload_type) const; | |
69 | 64 |
70 void SetFecParameters(const FecProtectionParams* delta_params, | 65 void SetFecParameters(const FecProtectionParams* delta_params, |
71 const FecProtectionParams* key_params); | 66 const FecProtectionParams* key_params); |
72 | 67 |
73 uint32_t VideoBitrateSent() const; | 68 uint32_t VideoBitrateSent() const; |
74 uint32_t FecOverheadRate() const; | 69 uint32_t FecOverheadRate() const; |
75 | 70 |
76 int SelectiveRetransmissions() const; | 71 int SelectiveRetransmissions() const; |
77 void SetSelectiveRetransmissions(uint8_t settings); | 72 void SetSelectiveRetransmissions(uint8_t settings); |
78 | 73 |
79 private: | 74 private: |
80 void SendVideoPacket(std::unique_ptr<RtpPacketToSend> packet, | 75 void SendVideoPacket(std::unique_ptr<RtpPacketToSend> packet, |
81 StorageType storage); | 76 StorageType storage); |
82 | 77 |
83 void SendVideoPacketAsRed(std::unique_ptr<RtpPacketToSend> media_packet, | 78 void SendVideoPacketAsRed(std::unique_ptr<RtpPacketToSend> media_packet, |
84 StorageType media_packet_storage, | 79 StorageType media_packet_storage, |
85 bool protect); | 80 bool protect); |
86 | 81 |
87 RTPSender* const rtp_sender_; | 82 RTPSender* const rtp_sender_; |
88 Clock* const clock_; | 83 Clock* const clock_; |
89 | 84 |
90 // Should never be held when calling out of this class. | 85 // Should never be held when calling out of this class. |
91 rtc::CriticalSection crit_; | 86 rtc::CriticalSection crit_; |
92 | 87 |
93 RtpVideoCodecTypes video_type_ = kRtpVideoGeneric; | 88 RtpVideoCodecTypes video_type_ = kRtpVideoGeneric; |
94 int32_t retransmission_settings_ GUARDED_BY(crit_) = kRetransmitBaseLayer; | 89 int32_t retransmission_settings_ GUARDED_BY(crit_) = kRetransmitBaseLayer; |
95 | 90 |
96 // FEC | 91 // FEC |
92 bool red_enabled_ GUARDED_BY(crit_) = false; | |
danilchap
2016/10/27 11:53:40
why do you want red_enabled_ and fec_enabled_ memb
brandtr
2016/10/28 07:46:31
Yep, this makes sense!
These variables are curren
| |
93 int red_payload_type_ GUARDED_BY(crit_) = -1; | |
97 bool fec_enabled_ GUARDED_BY(crit_) = false; | 94 bool fec_enabled_ GUARDED_BY(crit_) = false; |
98 int red_payload_type_ GUARDED_BY(crit_) = -1; | |
99 int fec_payload_type_ GUARDED_BY(crit_) = -1; | 95 int fec_payload_type_ GUARDED_BY(crit_) = -1; |
96 | |
100 FecProtectionParams delta_fec_params_ GUARDED_BY(crit_) = FecProtectionParams{ | 97 FecProtectionParams delta_fec_params_ GUARDED_BY(crit_) = FecProtectionParams{ |
101 0, 1, kFecMaskRandom}; | 98 0, 1, kFecMaskRandom}; |
102 FecProtectionParams key_fec_params_ GUARDED_BY(crit_) = FecProtectionParams{ | 99 FecProtectionParams key_fec_params_ GUARDED_BY(crit_) = FecProtectionParams{ |
103 0, 1, kFecMaskRandom}; | 100 0, 1, kFecMaskRandom}; |
104 ProducerFec producer_fec_ GUARDED_BY(crit_); | 101 ProducerFec producer_fec_ GUARDED_BY(crit_); |
105 | 102 |
106 rtc::CriticalSection stats_crit_; | 103 rtc::CriticalSection stats_crit_; |
107 // Bitrate used for FEC payload, RED headers, RTP headers for FEC packets | 104 // Bitrate used for FEC payload, RED headers, RTP headers for FEC packets |
108 // and any padding overhead. | 105 // and any padding overhead. |
109 RateStatistics fec_bitrate_ GUARDED_BY(stats_crit_); | 106 RateStatistics fec_bitrate_ GUARDED_BY(stats_crit_); |
110 // Bitrate used for video payload and RTP headers. | 107 // Bitrate used for video payload and RTP headers. |
111 RateStatistics video_bitrate_ GUARDED_BY(stats_crit_); | 108 RateStatistics video_bitrate_ GUARDED_BY(stats_crit_); |
112 OneTimeEvent first_frame_sent_; | 109 OneTimeEvent first_frame_sent_; |
113 }; | 110 }; |
114 | 111 |
115 } // namespace webrtc | 112 } // namespace webrtc |
116 | 113 |
117 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ | 114 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ |
OLD | NEW |