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

Unified Diff: webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc

Issue 1599353003: Name SimulcastEncoderApdater on InitEncode. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: unittest + implementation fix Created 4 years, 11 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/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
diff --git a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
index 3e03cda21aed2eb3e5b72ba5891ab2a7a7a51642..0a17e743f7ce20ddefd1e370579c50decbfc70b8 100644
--- a/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc
@@ -136,7 +136,9 @@ class AdapterEncodedImageCallback : public webrtc::EncodedImageCallback {
namespace webrtc {
SimulcastEncoderAdapter::SimulcastEncoderAdapter(VideoEncoderFactory* factory)
- : factory_(factory), encoded_complete_callback_(NULL) {
+ : factory_(factory),
+ encoded_complete_callback_(NULL),
+ implementation_name_("SimulcastEncoderAdapter") {
memset(&codec_, 0, sizeof(webrtc::VideoCodec));
}
@@ -192,6 +194,7 @@ int SimulcastEncoderAdapter::InitEncode(const VideoCodec* inst,
codec_.codecSpecific.VP8.tl_factory = screensharing_tl_factory_.get();
}
+ std::string implementation_name;
// Create |number_of_streams| of encoder instances and init them.
for (int i = 0; i < number_of_streams; ++i) {
VideoCodec stream_codec;
@@ -221,7 +224,12 @@ int SimulcastEncoderAdapter::InitEncode(const VideoCodec* inst,
encoder->RegisterEncodeCompleteCallback(callback);
streaminfos_.push_back(StreamInfo(encoder, callback, stream_codec.width,
stream_codec.height, send_stream));
+ if (i != 0)
+ implementation_name += ", ";
+ implementation_name += streaminfos_[i].encoder->ImplementationName();
}
+ implementation_name_ =
+ "SimulcastEncoderAdapter (" + implementation_name + ")";
return WEBRTC_VIDEO_CODEC_OK;
}
@@ -494,10 +502,7 @@ bool SimulcastEncoderAdapter::SupportsNativeHandle() const {
}
const char* SimulcastEncoderAdapter::ImplementationName() const {
- // We should not be calling this method before streaminfos_ are configured.
- RTC_DCHECK(!streaminfos_.empty());
- // TODO(pbos): Support multiple implementation names for different encoders.
- return streaminfos_[0].encoder->ImplementationName();
+ return implementation_name_.c_str();
}
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698