OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 |
11 #ifndef WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ | 11 #ifndef WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ |
12 #define WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ | 12 #define WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ |
13 | 13 |
14 #include <map> | 14 #include <map> |
15 #include <memory> | 15 #include <memory> |
16 #include <vector> | 16 #include <vector> |
17 | 17 |
18 #include "webrtc/call/bitrate_allocator.h" | 18 #include "webrtc/call/bitrate_allocator.h" |
19 #include "webrtc/base/criticalsection.h" | 19 #include "webrtc/base/criticalsection.h" |
20 #include "webrtc/call.h" | 20 #include "webrtc/call.h" |
21 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 21 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
| 22 #include "webrtc/modules/video_coding/protection_bitrate_calculator.h" |
22 #include "webrtc/video/encoded_frame_callback_adapter.h" | 23 #include "webrtc/video/encoded_frame_callback_adapter.h" |
23 #include "webrtc/video/encoder_state_feedback.h" | 24 #include "webrtc/video/encoder_state_feedback.h" |
24 #include "webrtc/video/payload_router.h" | 25 #include "webrtc/video/payload_router.h" |
25 #include "webrtc/video/send_delay_stats.h" | 26 #include "webrtc/video/send_delay_stats.h" |
26 #include "webrtc/video/send_statistics_proxy.h" | 27 #include "webrtc/video/send_statistics_proxy.h" |
27 #include "webrtc/video/video_capture_input.h" | 28 #include "webrtc/video/video_capture_input.h" |
28 #include "webrtc/video/vie_encoder.h" | 29 #include "webrtc/video/vie_encoder.h" |
29 #include "webrtc/video_receive_stream.h" | 30 #include "webrtc/video_receive_stream.h" |
30 #include "webrtc/video_send_stream.h" | 31 #include "webrtc/video_send_stream.h" |
31 | 32 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 typedef std::map<uint32_t, RtpState> RtpStateMap; | 85 typedef std::map<uint32_t, RtpState> RtpStateMap; |
85 RtpStateMap GetRtpStates() const; | 86 RtpStateMap GetRtpStates() const; |
86 | 87 |
87 int GetPaddingNeededBps() const; | 88 int GetPaddingNeededBps() const; |
88 | 89 |
89 // Implements BitrateAllocatorObserver. | 90 // Implements BitrateAllocatorObserver. |
90 void OnBitrateUpdated(uint32_t bitrate_bps, | 91 void OnBitrateUpdated(uint32_t bitrate_bps, |
91 uint8_t fraction_loss, | 92 uint8_t fraction_loss, |
92 int64_t rtt) override; | 93 int64_t rtt) override; |
93 | 94 |
| 95 protected: |
94 // Implements webrtc::VCMProtectionCallback. | 96 // Implements webrtc::VCMProtectionCallback. |
95 int ProtectionRequest(const FecProtectionParams* delta_params, | 97 int ProtectionRequest(const FecProtectionParams* delta_params, |
96 const FecProtectionParams* key_params, | 98 const FecProtectionParams* key_params, |
97 uint32_t* sent_video_rate_bps, | 99 uint32_t* sent_video_rate_bps, |
98 uint32_t* sent_nack_rate_bps, | 100 uint32_t* sent_nack_rate_bps, |
99 uint32_t* sent_fec_rate_bps) override; | 101 uint32_t* sent_fec_rate_bps) override; |
100 | 102 |
101 private: | 103 private: |
102 struct EncoderSettings { | 104 struct EncoderSettings { |
103 VideoCodec video_codec; | 105 VideoCodec video_codec; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 rtc::PlatformThread encoder_thread_; | 138 rtc::PlatformThread encoder_thread_; |
137 rtc::Event encoder_wakeup_event_; | 139 rtc::Event encoder_wakeup_event_; |
138 volatile int stop_encoder_thread_; | 140 volatile int stop_encoder_thread_; |
139 rtc::CriticalSection encoder_settings_crit_; | 141 rtc::CriticalSection encoder_settings_crit_; |
140 rtc::Optional<EncoderSettings> pending_encoder_settings_ | 142 rtc::Optional<EncoderSettings> pending_encoder_settings_ |
141 GUARDED_BY(encoder_settings_crit_); | 143 GUARDED_BY(encoder_settings_crit_); |
142 | 144 |
143 OveruseFrameDetector overuse_detector_; | 145 OveruseFrameDetector overuse_detector_; |
144 ViEEncoder vie_encoder_; | 146 ViEEncoder vie_encoder_; |
145 EncoderStateFeedback encoder_feedback_; | 147 EncoderStateFeedback encoder_feedback_; |
| 148 ProtectionBitrateCalculator protection_bitrate_calculator_; |
| 149 |
146 vcm::VideoSender* const video_sender_; | 150 vcm::VideoSender* const video_sender_; |
147 | 151 |
148 const std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_; | 152 const std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_; |
149 // RtpRtcp modules, declared here as they use other members on construction. | 153 // RtpRtcp modules, declared here as they use other members on construction. |
150 const std::vector<RtpRtcp*> rtp_rtcp_modules_; | 154 const std::vector<RtpRtcp*> rtp_rtcp_modules_; |
151 PayloadRouter payload_router_; | 155 PayloadRouter payload_router_; |
152 VideoCaptureInput input_; | 156 VideoCaptureInput input_; |
153 }; | 157 }; |
154 } // namespace internal | 158 } // namespace internal |
155 } // namespace webrtc | 159 } // namespace webrtc |
156 | 160 |
157 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ | 161 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ |
OLD | NEW |