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

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

Issue 3007683002: Let VideoEncoderSoftwareFallbackWrapper own the wrapped encoder (Closed)
Patch Set: Created 3 years, 4 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
Index: webrtc/media/engine/webrtcvideoengine.cc
diff --git a/webrtc/media/engine/webrtcvideoengine.cc b/webrtc/media/engine/webrtcvideoengine.cc
index 9c11bb946930a5b5f09a48c4a65c617fc302702d..274b801625d7730930aaef47bfa1154e14f04090 100644
--- a/webrtc/media/engine/webrtcvideoengine.cc
+++ b/webrtc/media/engine/webrtcvideoengine.cc
@@ -1415,16 +1415,15 @@ WebRtcVideoChannel::WebRtcVideoSendStream::VideoSendStreamParameters::
WebRtcVideoChannel::WebRtcVideoSendStream::AllocatedEncoder::AllocatedEncoder(
std::unique_ptr<webrtc::VideoEncoder> encoder,
- std::unique_ptr<webrtc::VideoEncoder> external_encoder,
+ bool is_external,
const cricket::VideoCodec& codec,
bool has_internal_source)
: encoder_(std::move(encoder)),
- external_encoder_(std::move(external_encoder)),
+ is_external_(is_external),
codec_(codec),
has_internal_source_(has_internal_source) {}
void WebRtcVideoChannel::WebRtcVideoSendStream::AllocatedEncoder::Reset() {
- external_encoder_.reset();
encoder_.reset();
codec_ = cricket::VideoCodec();
}
@@ -1602,13 +1601,13 @@ WebRtcVideoChannel::WebRtcVideoSendStream::CreateVideoEncoder(
if (external_encoder) {
std::unique_ptr<webrtc::VideoEncoder> internal_encoder(
new webrtc::VideoEncoderSoftwareFallbackWrapper(
- codec, external_encoder.get()));
+ codec, std::move(external_encoder)));
andersc 2017/08/29 07:27:33 Is it normal to call std::move both here and in th
magjed_webrtc 2017/08/29 07:56:48 Yes, it won't compile otherwise. Every time you cr
const webrtc::VideoCodecType codec_type =
webrtc::PayloadStringToCodecType(codec.name);
const bool has_internal_source =
external_encoder_factory_->EncoderTypeHasInternalSource(codec_type);
return AllocatedEncoder(std::move(internal_encoder),
- std::move(external_encoder), codec,
+ true /* is_external */, codec,
has_internal_source);
}
}
@@ -1629,7 +1628,7 @@ WebRtcVideoChannel::WebRtcVideoSendStream::CreateVideoEncoder(
internal_encoder_factory_->CreateVideoEncoder(codec));
}
return AllocatedEncoder(std::move(internal_encoder),
- nullptr /* external_encoder */, codec,
+ false /* is_external */, codec,
false /* has_internal_source */);
}

Powered by Google App Engine
This is Rietveld 408576698