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

Unified Diff: webrtc/media/engine/webrtcvideoengine2.cc

Issue 2344923002: Revert of Replace interface VideoCapturerInput with VideoSinkInterface. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 3 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/media/engine/webrtcvideoengine2.h ('k') | webrtc/test/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvideoengine2.cc
diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine2.cc
index 8a2b373d914510502a2f71b7a9ec8e487f5f8081..60f51be8d1615aff560bfe43407bcab06acc770d 100644
--- a/webrtc/media/engine/webrtcvideoengine2.cc
+++ b/webrtc/media/engine/webrtcvideoengine2.cc
@@ -1580,7 +1580,6 @@
source_(nullptr),
external_encoder_factory_(external_encoder_factory),
stream_(nullptr),
- encoder_sink_(nullptr),
parameters_(std::move(config), options, max_bitrate_bps, codec_settings),
rtp_parameters_(CreateRtpParametersWithOneEncoding()),
pending_encoder_reconfiguration_(false),
@@ -1659,7 +1658,7 @@
<< ", texture=" << last_frame_info_.is_texture;
}
- if (encoder_sink_ == NULL) {
+ if (stream_ == NULL) {
// Frame input before send codecs are configured, dropping frame.
return;
}
@@ -1682,7 +1681,7 @@
if (cpu_restricted_counter_ > 0)
++cpu_restricted_frame_count_;
- encoder_sink_->OnFrame(video_frame);
+ stream_->Input()->IncomingCapturedFrame(video_frame);
}
bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetVideoSend(
@@ -1705,7 +1704,7 @@
if (options_present) {
VideoOptions old_options = parameters_.options;
parameters_.options.SetAll(*options);
- // Reconfigure encoder settings on the next frame or stream
+ // Reconfigure encoder settings on the naext frame or stream
// recreation if the options changed.
if (parameters_.options != old_options) {
pending_encoder_reconfiguration_ = true;
@@ -1713,7 +1712,7 @@
}
if (source_changing) {
- if (source == nullptr && encoder_sink_ != nullptr) {
+ if (source == nullptr && stream_ != nullptr) {
LOG(LS_VERBOSE) << "Disabling capturer, sending black frame.";
// Force this black frame not to be dropped due to timestamp order
// check. As IncomingCapturedFrame will drop the frame if this frame's
@@ -1726,8 +1725,9 @@
last_frame_info_.height));
black_buffer->SetToBlack();
- encoder_sink_->OnFrame(webrtc::VideoFrame(
- black_buffer, last_frame_info_.rotation, last_frame_timestamp_us_));
+ stream_->Input()->IncomingCapturedFrame(webrtc::VideoFrame(
+ black_buffer, last_frame_info_.rotation,
+ last_frame_timestamp_us_));
}
source_ = source;
}
@@ -1743,7 +1743,7 @@
void WebRtcVideoChannel2::WebRtcVideoSendStream::DisconnectSource() {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
- if (source_ == nullptr) {
+ if (source_ == NULL) {
return;
}
@@ -2047,23 +2047,6 @@
rtc::CritScope cs(&lock_);
sending_ = send;
UpdateSendState();
-}
-
-void WebRtcVideoChannel2::WebRtcVideoSendStream::AddOrUpdateSink(
- VideoSinkInterface<webrtc::VideoFrame>* sink,
- const rtc::VideoSinkWants& wants) {
- // TODO(perkj): Actually consider the encoder |wants| and remove
- // WebRtcVideoSendStream::OnLoadUpdate(Load load).
- rtc::CritScope cs(&lock_);
- RTC_DCHECK(!encoder_sink_ || encoder_sink_ == sink);
- encoder_sink_ = sink;
-}
-
-void WebRtcVideoChannel2::WebRtcVideoSendStream::RemoveSink(
- VideoSinkInterface<webrtc::VideoFrame>* sink) {
- rtc::CritScope cs(&lock_);
- RTC_DCHECK_EQ(encoder_sink_, sink);
- encoder_sink_ = nullptr;
}
void WebRtcVideoChannel2::WebRtcVideoSendStream::OnLoadUpdate(Load load) {
@@ -2258,7 +2241,6 @@
}
stream_ = call_->CreateVideoSendStream(std::move(config),
parameters_.encoder_config.Copy());
- stream_->SetSource(this);
parameters_.encoder_config.encoder_specific_settings = NULL;
pending_encoder_reconfiguration_ = false;
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.h ('k') | webrtc/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698