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

Unified Diff: webrtc/video/vie_encoder.cc

Issue 1984243003: Set ViEEncoder sink_ on construction. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/vie_encoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/vie_encoder.cc
diff --git a/webrtc/video/vie_encoder.cc b/webrtc/video/vie_encoder.cc
index 2871c4045c94db53cb3f9db3685cf476f2456a94..d10e8fc5cda67313556eddbcb1cfa48875020394 100644
--- a/webrtc/video/vie_encoder.cc
+++ b/webrtc/video/vie_encoder.cc
@@ -33,8 +33,10 @@ static const float kStopPaddingThresholdMs = 2000;
ViEEncoder::ViEEncoder(uint32_t number_of_cores,
ProcessThread* module_process_thread,
SendStatisticsProxy* stats_proxy,
- OveruseFrameDetector* overuse_detector)
+ OveruseFrameDetector* overuse_detector,
+ EncodedImageCallback* sink)
: number_of_cores_(number_of_cores),
+ sink_(sink),
vp_(VideoProcessing::Create()),
video_sender_(Clock::GetRealTimeClock(), this, this, this),
stats_proxy_(stats_proxy),
@@ -84,10 +86,10 @@ int32_t ViEEncoder::DeRegisterExternalEncoder(uint8_t pl_type) {
video_sender_.RegisterExternalEncoder(nullptr, pl_type, false);
return 0;
}
+
void ViEEncoder::SetEncoder(const webrtc::VideoCodec& video_codec,
int min_transmit_bitrate_bps,
- size_t max_data_payload_length,
- EncodedImageCallback* sink) {
+ size_t max_data_payload_length) {
// Setting target width and height for VPM.
RTC_CHECK_EQ(VPM_OK,
vp_->SetTargetResolution(video_codec.width, video_codec.height,
@@ -100,10 +102,6 @@ void ViEEncoder::SetEncoder(const webrtc::VideoCodec& video_codec,
encoder_config_ = video_codec;
min_transmit_bitrate_bps_ = min_transmit_bitrate_bps;
}
- {
- rtc::CritScope lock(&sink_cs_);
- sink_ = sink;
- }
bool success = video_sender_.RegisterSendCodec(
&video_codec, number_of_cores_,
@@ -294,11 +292,8 @@ int32_t ViEEncoder::Encoded(const EncodedImage& encoded_image,
stats_proxy_->OnSendEncodedImage(encoded_image, codec_specific_info);
}
- int success = 0;
- {
- rtc::CritScope lock(&sink_cs_);
- success = sink_->Encoded(encoded_image, codec_specific_info, fragmentation);
- }
+ int success =
+ sink_->Encoded(encoded_image, codec_specific_info, fragmentation);
overuse_detector_->FrameSent(encoded_image._timeStamp);
return success;
« no previous file with comments | « webrtc/video/vie_encoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698