Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: webrtc/video/vie_encoder.h

Issue 2510583002: Reland #2 of Issue 2434073003: Extract bitrate allocation ... (Closed)
Patch Set: Addressed comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/video/video_send_stream_tests.cc ('k') | webrtc/video/vie_encoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 #ifndef WEBRTC_VIDEO_VIE_ENCODER_H_ 11 #ifndef WEBRTC_VIDEO_VIE_ENCODER_H_
12 #define WEBRTC_VIDEO_VIE_ENCODER_H_ 12 #define WEBRTC_VIDEO_VIE_ENCODER_H_
13 13
14 #include <memory> 14 #include <memory>
15 #include <string> 15 #include <string>
16 #include <vector> 16 #include <vector>
17 17
18 #include "webrtc/base/criticalsection.h" 18 #include "webrtc/base/criticalsection.h"
19 #include "webrtc/base/event.h" 19 #include "webrtc/base/event.h"
20 #include "webrtc/base/sequenced_task_checker.h" 20 #include "webrtc/base/sequenced_task_checker.h"
21 #include "webrtc/base/task_queue.h" 21 #include "webrtc/base/task_queue.h"
22 #include "webrtc/call.h" 22 #include "webrtc/call.h"
23 #include "webrtc/common_types.h" 23 #include "webrtc/common_types.h"
24 #include "webrtc/common_video/include/video_bitrate_allocator.h"
24 #include "webrtc/common_video/rotation.h" 25 #include "webrtc/common_video/rotation.h"
25 #include "webrtc/media/base/videosinkinterface.h" 26 #include "webrtc/media/base/videosinkinterface.h"
26 #include "webrtc/modules/video_coding/include/video_coding_defines.h" 27 #include "webrtc/modules/video_coding/include/video_coding_defines.h"
27 #include "webrtc/modules/video_coding/utility/simulcast_rate_allocator.h"
28 #include "webrtc/modules/video_coding/video_coding_impl.h" 28 #include "webrtc/modules/video_coding/video_coding_impl.h"
29 #include "webrtc/modules/video_processing/include/video_processing.h" 29 #include "webrtc/modules/video_processing/include/video_processing.h"
30 #include "webrtc/system_wrappers/include/atomic32.h" 30 #include "webrtc/system_wrappers/include/atomic32.h"
31 #include "webrtc/video/overuse_frame_detector.h" 31 #include "webrtc/video/overuse_frame_detector.h"
32 #include "webrtc/video_encoder.h" 32 #include "webrtc/video_encoder.h"
33 #include "webrtc/video_send_stream.h" 33 #include "webrtc/video_send_stream.h"
34 #include "webrtc/typedefs.h" 34 #include "webrtc/typedefs.h"
35 35
36 namespace webrtc { 36 namespace webrtc {
37 37
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 177
178 SendStatisticsProxy* const stats_proxy_; 178 SendStatisticsProxy* const stats_proxy_;
179 rtc::VideoSinkInterface<VideoFrame>* const pre_encode_callback_; 179 rtc::VideoSinkInterface<VideoFrame>* const pre_encode_callback_;
180 ProcessThread* module_process_thread_; 180 ProcessThread* module_process_thread_;
181 rtc::ThreadChecker module_process_thread_checker_; 181 rtc::ThreadChecker module_process_thread_checker_;
182 // |thread_checker_| checks that public methods that are related to lifetime 182 // |thread_checker_| checks that public methods that are related to lifetime
183 // of ViEEncoder are called on the same thread. 183 // of ViEEncoder are called on the same thread.
184 rtc::ThreadChecker thread_checker_; 184 rtc::ThreadChecker thread_checker_;
185 185
186 VideoEncoderConfig encoder_config_ ACCESS_ON(&encoder_queue_); 186 VideoEncoderConfig encoder_config_ ACCESS_ON(&encoder_queue_);
187 // TODO(sprang): Change |rate_allocator_| to be a codec type 187 std::unique_ptr<VideoBitrateAllocator> rate_allocator_
188 // agnostic interface. It is currently VP8 simulcast specific if more than
189 // one layer is specified.
190 std::unique_ptr<SimulcastRateAllocator> rate_allocator_
191 ACCESS_ON(&encoder_queue_); 188 ACCESS_ON(&encoder_queue_);
192 189
193 // Set when ConfigureEncoder has been called in order to lazy reconfigure the 190 // Set when ConfigureEncoder has been called in order to lazy reconfigure the
194 // encoder on the next frame. 191 // encoder on the next frame.
195 bool pending_encoder_reconfiguration_ ACCESS_ON(&encoder_queue_); 192 bool pending_encoder_reconfiguration_ ACCESS_ON(&encoder_queue_);
196 rtc::Optional<VideoFrameInfo> last_frame_info_ ACCESS_ON(&encoder_queue_); 193 rtc::Optional<VideoFrameInfo> last_frame_info_ ACCESS_ON(&encoder_queue_);
197 uint32_t encoder_start_bitrate_bps_ ACCESS_ON(&encoder_queue_); 194 uint32_t encoder_start_bitrate_bps_ ACCESS_ON(&encoder_queue_);
198 size_t max_data_payload_length_ ACCESS_ON(&encoder_queue_); 195 size_t max_data_payload_length_ ACCESS_ON(&encoder_queue_);
199 uint32_t last_observed_bitrate_bps_ ACCESS_ON(&encoder_queue_); 196 uint32_t last_observed_bitrate_bps_ ACCESS_ON(&encoder_queue_);
200 bool encoder_paused_and_dropped_frame_ ACCESS_ON(&encoder_queue_); 197 bool encoder_paused_and_dropped_frame_ ACCESS_ON(&encoder_queue_);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 // All public methods are proxied to |encoder_queue_|. It must must be 229 // All public methods are proxied to |encoder_queue_|. It must must be
233 // destroyed first to make sure no tasks are run that use other members. 230 // destroyed first to make sure no tasks are run that use other members.
234 rtc::TaskQueue encoder_queue_; 231 rtc::TaskQueue encoder_queue_;
235 232
236 RTC_DISALLOW_COPY_AND_ASSIGN(ViEEncoder); 233 RTC_DISALLOW_COPY_AND_ASSIGN(ViEEncoder);
237 }; 234 };
238 235
239 } // namespace webrtc 236 } // namespace webrtc
240 237
241 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ 238 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_
OLDNEW
« no previous file with comments | « webrtc/video/video_send_stream_tests.cc ('k') | webrtc/video/vie_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698