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

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

Issue 3009973002: Prepare for injectable SW decoders (Closed)
Patch Set: Remove wrapping in AllocatedDecoder struct Created 3 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
Index: webrtc/media/engine/webrtcvideoengine.h
diff --git a/webrtc/media/engine/webrtcvideoengine.h b/webrtc/media/engine/webrtcvideoengine.h
index 3224d0027fa0fe2e2b976962ac841572f34545e5..8f7a7904410599a9463ef23b94399181233656c0 100644
--- a/webrtc/media/engine/webrtcvideoengine.h
+++ b/webrtc/media/engine/webrtcvideoengine.h
@@ -47,6 +47,7 @@ class Thread;
namespace cricket {
+class DecoderFactoryAdapter;
class EncoderFactoryAdapter;
class VideoCapturer;
class VideoProcessor;
@@ -121,7 +122,7 @@ class WebRtcVideoEngine {
private:
bool initialized_;
- WebRtcVideoDecoderFactory* external_decoder_factory_;
+ std::unique_ptr<DecoderFactoryAdapter> decoder_factory_;
std::unique_ptr<EncoderFactoryAdapter> encoder_factory_;
};
@@ -131,7 +132,7 @@ class WebRtcVideoChannel : public VideoMediaChannel, public webrtc::Transport {
const MediaConfig& config,
const VideoOptions& options,
const EncoderFactoryAdapter& encoder_factory,
- WebRtcVideoDecoderFactory* external_decoder_factory);
+ const DecoderFactoryAdapter& decoder_factory);
~WebRtcVideoChannel() override;
// VideoMediaChannel implementation
@@ -369,7 +370,7 @@ class WebRtcVideoChannel : public VideoMediaChannel, public webrtc::Transport {
webrtc::Call* call,
const StreamParams& sp,
webrtc::VideoReceiveStream::Config config,
- WebRtcVideoDecoderFactory* external_decoder_factory,
+ const DecoderFactoryAdapter& decoder_factory,
bool default_stream,
const std::vector<VideoCodecSettings>& recv_codecs,
const webrtc::FlexfecReceiveStream::Config& flexfec_config);
@@ -394,30 +395,17 @@ class WebRtcVideoChannel : public VideoMediaChannel, public webrtc::Transport {
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::vector<AllocatedDecoder>* old_codecs);
+ void ConfigureCodecs(
+ const std::vector<VideoCodecSettings>& recv_codecs,
+ std::map<webrtc::VideoCodecType, std::unique_ptr<webrtc::VideoDecoder>>*
+ 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);
@@ -433,8 +421,9 @@ class WebRtcVideoChannel : public VideoMediaChannel, public webrtc::Transport {
webrtc::FlexfecReceiveStream::Config flexfec_config_;
webrtc::FlexfecReceiveStream* flexfec_stream_;
- WebRtcVideoDecoderFactory* const external_decoder_factory_;
- std::vector<AllocatedDecoder> allocated_decoders_;
+ std::unique_ptr<DecoderFactoryAdapter> decoder_factory_;
+ std::map<webrtc::VideoCodecType, std::unique_ptr<webrtc::VideoDecoder>>
+ allocated_decoders_;
rtc::CriticalSection sink_lock_;
rtc::VideoSinkInterface<webrtc::VideoFrame>* sink_ GUARDED_BY(sink_lock_);
@@ -497,7 +486,7 @@ class WebRtcVideoChannel : public VideoMediaChannel, public webrtc::Transport {
rtc::Optional<std::vector<webrtc::RtpExtension>> send_rtp_extensions_;
std::unique_ptr<EncoderFactoryAdapter> encoder_factory_;
- WebRtcVideoDecoderFactory* const external_decoder_factory_;
+ std::unique_ptr<DecoderFactoryAdapter> 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
« no previous file with comments | « webrtc/media/engine/videodecodersoftwarefallbackwrapper_unittest.cc ('k') | webrtc/media/engine/webrtcvideoengine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698