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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 int64_t capture_time_ms, | 52 int64_t capture_time_ms, |
53 const uint8_t* payload_data, | 53 const uint8_t* payload_data, |
54 size_t payload_size, | 54 size_t payload_size, |
55 const RTPFragmentationHeader* fragmentation, | 55 const RTPFragmentationHeader* fragmentation, |
56 const RTPVideoHeader* video_header); | 56 const RTPVideoHeader* video_header); |
57 | 57 |
58 int32_t SendRTPIntraRequest(); | 58 int32_t SendRTPIntraRequest(); |
59 | 59 |
60 void SetVideoCodecType(RtpVideoCodecTypes type); | 60 void SetVideoCodecType(RtpVideoCodecTypes type); |
61 | 61 |
62 // FEC | 62 // ULPFEC. |
63 void SetUlpfecConfig(bool enabled, | 63 void SetUlpfecConfig(int red_payload_type, int ulpfec_payload_type); |
64 int red_payload_type, | 64 void GetUlpfecConfig(int* red_payload_type, int* ulpfec_payload_type) const; |
65 int ulpfec_payload_type); | |
66 | |
67 void GetUlpfecConfig(bool* enabled, | |
68 int* red_payload_type, | |
69 int* ulpfec_payload_type) const; | |
70 | 65 |
71 void SetFecParameters(const FecProtectionParams* delta_params, | 66 void SetFecParameters(const FecProtectionParams* delta_params, |
72 const FecProtectionParams* key_params); | 67 const FecProtectionParams* key_params); |
73 | 68 |
74 uint32_t VideoBitrateSent() const; | 69 uint32_t VideoBitrateSent() const; |
75 uint32_t FecOverheadRate() const; | 70 uint32_t FecOverheadRate() const; |
76 | 71 |
77 int SelectiveRetransmissions() const; | 72 int SelectiveRetransmissions() const; |
78 void SetSelectiveRetransmissions(uint8_t settings); | 73 void SetSelectiveRetransmissions(uint8_t settings); |
79 | 74 |
80 private: | 75 private: |
81 void SendVideoPacket(std::unique_ptr<RtpPacketToSend> packet, | 76 void SendVideoPacket(std::unique_ptr<RtpPacketToSend> packet, |
82 StorageType storage); | 77 StorageType storage); |
83 | 78 |
84 void SendVideoPacketAsRed(std::unique_ptr<RtpPacketToSend> media_packet, | 79 void SendVideoPacketAsRed(std::unique_ptr<RtpPacketToSend> media_packet, |
85 StorageType media_packet_storage, | 80 StorageType media_packet_storage, |
86 bool protect); | 81 bool protect); |
87 | 82 |
| 83 bool red_enabled() const EXCLUSIVE_LOCKS_REQUIRED(crit_) { |
| 84 return red_payload_type_ >= 0; |
| 85 } |
| 86 |
| 87 bool ulpfec_enabled() const EXCLUSIVE_LOCKS_REQUIRED(crit_) { |
| 88 return ulpfec_payload_type_ >= 0; |
| 89 } |
| 90 |
88 RTPSender* const rtp_sender_; | 91 RTPSender* const rtp_sender_; |
89 Clock* const clock_; | 92 Clock* const clock_; |
90 | 93 |
91 // Should never be held when calling out of this class. | 94 // Should never be held when calling out of this class. |
92 rtc::CriticalSection crit_; | 95 rtc::CriticalSection crit_; |
93 rtc::SequencedTaskChecker encoder_checker_; | 96 rtc::SequencedTaskChecker encoder_checker_; |
94 | 97 |
95 RtpVideoCodecTypes video_type_; | 98 RtpVideoCodecTypes video_type_; |
96 int32_t retransmission_settings_ GUARDED_BY(crit_); | 99 int32_t retransmission_settings_ GUARDED_BY(crit_); |
97 VideoRotation last_rotation_ GUARDED_BY(encoder_checker_); | 100 VideoRotation last_rotation_ GUARDED_BY(encoder_checker_); |
98 | 101 |
99 // FEC | 102 // RED/ULPFEC. |
100 bool fec_enabled_ GUARDED_BY(crit_); | |
101 int red_payload_type_ GUARDED_BY(crit_); | 103 int red_payload_type_ GUARDED_BY(crit_); |
102 int fec_payload_type_ GUARDED_BY(crit_); | 104 int ulpfec_payload_type_ GUARDED_BY(crit_); |
103 FecProtectionParams delta_fec_params_ GUARDED_BY(crit_); | 105 FecProtectionParams delta_fec_params_ GUARDED_BY(crit_); |
104 FecProtectionParams key_fec_params_ GUARDED_BY(crit_); | 106 FecProtectionParams key_fec_params_ GUARDED_BY(crit_); |
105 UlpfecGenerator ulpfec_generator_ GUARDED_BY(crit_); | 107 UlpfecGenerator ulpfec_generator_ GUARDED_BY(crit_); |
106 | 108 |
107 rtc::CriticalSection stats_crit_; | 109 rtc::CriticalSection stats_crit_; |
108 // Bitrate used for FEC payload, RED headers, RTP headers for FEC packets | 110 // Bitrate used for FEC payload, RED headers, RTP headers for FEC packets |
109 // and any padding overhead. | 111 // and any padding overhead. |
110 RateStatistics fec_bitrate_ GUARDED_BY(stats_crit_); | 112 RateStatistics fec_bitrate_ GUARDED_BY(stats_crit_); |
111 // Bitrate used for video payload and RTP headers. | 113 // Bitrate used for video payload and RTP headers. |
112 RateStatistics video_bitrate_ GUARDED_BY(stats_crit_); | 114 RateStatistics video_bitrate_ GUARDED_BY(stats_crit_); |
113 OneTimeEvent first_frame_sent_; | 115 OneTimeEvent first_frame_sent_; |
114 }; | 116 }; |
115 | 117 |
116 } // namespace webrtc | 118 } // namespace webrtc |
117 | 119 |
118 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ | 120 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ |
OLD | NEW |