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 <vector> | 15 #include <vector> |
16 | 16 |
17 #include "webrtc/call/bitrate_allocator.h" | 17 #include "webrtc/call/bitrate_allocator.h" |
| 18 #include "webrtc/base/criticalsection.h" |
18 #include "webrtc/call.h" | 19 #include "webrtc/call.h" |
19 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 20 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
20 #include "webrtc/video/encoded_frame_callback_adapter.h" | 21 #include "webrtc/video/encoded_frame_callback_adapter.h" |
21 #include "webrtc/video/encoder_state_feedback.h" | 22 #include "webrtc/video/encoder_state_feedback.h" |
22 #include "webrtc/video/payload_router.h" | 23 #include "webrtc/video/payload_router.h" |
23 #include "webrtc/video/send_statistics_proxy.h" | 24 #include "webrtc/video/send_statistics_proxy.h" |
24 #include "webrtc/video/video_capture_input.h" | 25 #include "webrtc/video/video_capture_input.h" |
25 #include "webrtc/video/vie_channel.h" | 26 #include "webrtc/video/vie_channel.h" |
26 #include "webrtc/video/vie_encoder.h" | 27 #include "webrtc/video/vie_encoder.h" |
27 #include "webrtc/video_receive_stream.h" | 28 #include "webrtc/video_receive_stream.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 int64_t rtt) override; | 84 int64_t rtt) override; |
84 | 85 |
85 // Implements webrtc::VCMProtectionCallback. | 86 // Implements webrtc::VCMProtectionCallback. |
86 int ProtectionRequest(const FecProtectionParams* delta_params, | 87 int ProtectionRequest(const FecProtectionParams* delta_params, |
87 const FecProtectionParams* key_params, | 88 const FecProtectionParams* key_params, |
88 uint32_t* sent_video_rate_bps, | 89 uint32_t* sent_video_rate_bps, |
89 uint32_t* sent_nack_rate_bps, | 90 uint32_t* sent_nack_rate_bps, |
90 uint32_t* sent_fec_rate_bps) override; | 91 uint32_t* sent_fec_rate_bps) override; |
91 | 92 |
92 private: | 93 private: |
| 94 struct EncoderSettings { |
| 95 VideoCodec video_codec; |
| 96 int min_transmit_bitrate_bps; |
| 97 }; |
93 static bool EncoderThreadFunction(void* obj); | 98 static bool EncoderThreadFunction(void* obj); |
94 void EncoderProcess(); | 99 void EncoderProcess(); |
95 | 100 |
96 void ConfigureProtection(); | 101 void ConfigureProtection(); |
97 void ConfigureSsrcs(); | 102 void ConfigureSsrcs(); |
98 | 103 |
99 SendStatisticsProxy stats_proxy_; | 104 SendStatisticsProxy stats_proxy_; |
100 EncodedFrameCallbackAdapter encoded_frame_proxy_; | 105 EncodedFrameCallbackAdapter encoded_frame_proxy_; |
101 const VideoSendStream::Config config_; | 106 const VideoSendStream::Config config_; |
102 std::map<uint32_t, RtpState> suspended_ssrcs_; | 107 std::map<uint32_t, RtpState> suspended_ssrcs_; |
103 | 108 |
104 ProcessThread* const module_process_thread_; | 109 ProcessThread* const module_process_thread_; |
105 CallStats* const call_stats_; | 110 CallStats* const call_stats_; |
106 CongestionController* const congestion_controller_; | 111 CongestionController* const congestion_controller_; |
107 BitrateAllocator* const bitrate_allocator_; | 112 BitrateAllocator* const bitrate_allocator_; |
108 VieRemb* const remb_; | 113 VieRemb* const remb_; |
109 | 114 |
110 rtc::PlatformThread encoder_thread_; | 115 rtc::PlatformThread encoder_thread_; |
111 rtc::Event encoder_wakeup_event_; | 116 rtc::Event encoder_wakeup_event_; |
112 volatile int stop_encoder_thread_; | 117 volatile int stop_encoder_thread_; |
| 118 rtc::CriticalSection encoder_settings_crit_; |
| 119 rtc::Optional<EncoderSettings> pending_encoder_settings_ |
| 120 GUARDED_BY(encoder_settings_crit_); |
113 | 121 |
114 OveruseFrameDetector overuse_detector_; | 122 OveruseFrameDetector overuse_detector_; |
115 EncoderStateFeedback encoder_feedback_; | 123 EncoderStateFeedback encoder_feedback_; |
116 ViEEncoder vie_encoder_; | 124 ViEEncoder vie_encoder_; |
117 VideoCodingModule* const vcm_; | 125 VideoCodingModule* const vcm_; |
118 | 126 |
119 const std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_; | 127 const std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_; |
120 // RtpRtcp modules, declared here as they use other members on construction. | 128 // RtpRtcp modules, declared here as they use other members on construction. |
121 const std::vector<RtpRtcp*> rtp_rtcp_modules_; | 129 const std::vector<RtpRtcp*> rtp_rtcp_modules_; |
122 PayloadRouter payload_router_; | 130 PayloadRouter payload_router_; |
123 VideoCaptureInput input_; | 131 VideoCaptureInput input_; |
124 }; | 132 }; |
125 } // namespace internal | 133 } // namespace internal |
126 } // namespace webrtc | 134 } // namespace webrtc |
127 | 135 |
128 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ | 136 #endif // WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_ |
OLD | NEW |