diff options
Diffstat (limited to 'third_party/libwebrtc/media/engine/multiplex_codec_factory.cc')
-rw-r--r-- | third_party/libwebrtc/media/engine/multiplex_codec_factory.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/third_party/libwebrtc/media/engine/multiplex_codec_factory.cc b/third_party/libwebrtc/media/engine/multiplex_codec_factory.cc index 90df02a77e..cf17b46d7d 100644 --- a/third_party/libwebrtc/media/engine/multiplex_codec_factory.cc +++ b/third_party/libwebrtc/media/engine/multiplex_codec_factory.cc @@ -11,10 +11,12 @@ #include "media/engine/multiplex_codec_factory.h" #include <map> +#include <memory> #include <string> #include <utility> #include "absl/strings/match.h" +#include "api/environment/environment.h" #include "api/video_codecs/sdp_video_format.h" #include "media/base/codec.h" #include "media/base/media_constants.h" @@ -95,20 +97,21 @@ std::vector<SdpVideoFormat> MultiplexDecoderFactory::GetSupportedFormats() return augmented_formats; } -std::unique_ptr<VideoDecoder> MultiplexDecoderFactory::CreateVideoDecoder( +std::unique_ptr<VideoDecoder> MultiplexDecoderFactory::Create( + const Environment& env, const SdpVideoFormat& format) { - if (!IsMultiplexCodec(cricket::CreateVideoCodec(format))) - return factory_->CreateVideoDecoder(format); - const auto& it = - format.parameters.find(cricket::kCodecParamAssociatedCodecName); + if (!IsMultiplexCodec(cricket::CreateVideoCodec(format))) { + return factory_->Create(env, format); + } + auto it = format.parameters.find(cricket::kCodecParamAssociatedCodecName); if (it == format.parameters.end()) { RTC_LOG(LS_ERROR) << "No assicated codec for multiplex."; return nullptr; } SdpVideoFormat associated_format = format; associated_format.name = it->second; - return std::unique_ptr<VideoDecoder>(new MultiplexDecoderAdapter( - factory_.get(), associated_format, supports_augmenting_data_)); + return std::make_unique<MultiplexDecoderAdapter>( + env, factory_.get(), associated_format, supports_augmenting_data_); } } // namespace webrtc |