Index: webrtc/media/engine/webrtcvideoengine.h |
diff --git a/webrtc/media/engine/webrtcvideoengine.h b/webrtc/media/engine/webrtcvideoengine.h |
index 8f7a7904410599a9463ef23b94399181233656c0..3224d0027fa0fe2e2b976962ac841572f34545e5 100644 |
--- a/webrtc/media/engine/webrtcvideoengine.h |
+++ b/webrtc/media/engine/webrtcvideoengine.h |
@@ -47,7 +47,6 @@ |
namespace cricket { |
-class DecoderFactoryAdapter; |
class EncoderFactoryAdapter; |
class VideoCapturer; |
class VideoProcessor; |
@@ -122,7 +121,7 @@ |
private: |
bool initialized_; |
- std::unique_ptr<DecoderFactoryAdapter> decoder_factory_; |
+ WebRtcVideoDecoderFactory* external_decoder_factory_; |
std::unique_ptr<EncoderFactoryAdapter> encoder_factory_; |
}; |
@@ -132,7 +131,7 @@ |
const MediaConfig& config, |
const VideoOptions& options, |
const EncoderFactoryAdapter& encoder_factory, |
- const DecoderFactoryAdapter& decoder_factory); |
+ WebRtcVideoDecoderFactory* external_decoder_factory); |
~WebRtcVideoChannel() override; |
// VideoMediaChannel implementation |
@@ -370,7 +369,7 @@ |
webrtc::Call* call, |
const StreamParams& sp, |
webrtc::VideoReceiveStream::Config config, |
- const DecoderFactoryAdapter& decoder_factory, |
+ WebRtcVideoDecoderFactory* external_decoder_factory, |
bool default_stream, |
const std::vector<VideoCodecSettings>& recv_codecs, |
const webrtc::FlexfecReceiveStream::Config& flexfec_config); |
@@ -395,17 +394,30 @@ |
VideoReceiverInfo GetVideoReceiverInfo(bool log_stats); |
private: |
+ struct AllocatedDecoder { |
+ AllocatedDecoder(webrtc::VideoDecoder* decoder, |
+ webrtc::VideoCodecType type, |
+ bool external); |
+ webrtc::VideoDecoder* decoder; |
+ // Decoder wrapped into a fallback decoder to permit software fallback. |
+ webrtc::VideoDecoder* external_decoder; |
+ webrtc::VideoCodecType type; |
+ bool external; |
+ }; |
+ |
void RecreateWebRtcVideoStream(); |
void MaybeRecreateWebRtcFlexfecStream(); |
void MaybeAssociateFlexfecWithVideo(); |
void MaybeDissociateFlexfecFromVideo(); |
- void ConfigureCodecs( |
- const std::vector<VideoCodecSettings>& recv_codecs, |
- std::map<webrtc::VideoCodecType, std::unique_ptr<webrtc::VideoDecoder>>* |
- old_codecs); |
+ void ConfigureCodecs(const std::vector<VideoCodecSettings>& recv_codecs, |
+ std::vector<AllocatedDecoder>* old_codecs); |
void ConfigureFlexfecCodec(int flexfec_payload_type); |
+ AllocatedDecoder CreateOrReuseVideoDecoder( |
+ std::vector<AllocatedDecoder>* old_decoder, |
+ const VideoCodec& codec); |
+ void ClearDecoders(std::vector<AllocatedDecoder>* allocated_decoders); |
std::string GetCodecNameFromPayloadType(int payload_type); |
@@ -421,9 +433,8 @@ |
webrtc::FlexfecReceiveStream::Config flexfec_config_; |
webrtc::FlexfecReceiveStream* flexfec_stream_; |
- std::unique_ptr<DecoderFactoryAdapter> decoder_factory_; |
- std::map<webrtc::VideoCodecType, std::unique_ptr<webrtc::VideoDecoder>> |
- allocated_decoders_; |
+ WebRtcVideoDecoderFactory* const external_decoder_factory_; |
+ std::vector<AllocatedDecoder> allocated_decoders_; |
rtc::CriticalSection sink_lock_; |
rtc::VideoSinkInterface<webrtc::VideoFrame>* sink_ GUARDED_BY(sink_lock_); |
@@ -486,7 +497,7 @@ |
rtc::Optional<std::vector<webrtc::RtpExtension>> send_rtp_extensions_; |
std::unique_ptr<EncoderFactoryAdapter> encoder_factory_; |
- std::unique_ptr<DecoderFactoryAdapter> decoder_factory_; |
+ WebRtcVideoDecoderFactory* const external_decoder_factory_; |
std::vector<VideoCodecSettings> recv_codecs_; |
std::vector<webrtc::RtpExtension> recv_rtp_extensions_; |
// See reason for keeping track of the FlexFEC payload type separately in |