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

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

Issue 2521203002: Move VideoDecoder::Create() logic to separate internal video decoder factory (Closed)
Patch Set: Add unittest Created 4 years 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
« no previous file with comments | « webrtc/media/BUILD.gn ('k') | webrtc/media/engine/internaldecoderfactory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/internaldecoderfactory.h
diff --git a/webrtc/media/engine/videodecodersoftwarefallbackwrapper.h b/webrtc/media/engine/internaldecoderfactory.h
similarity index 21%
copy from webrtc/media/engine/videodecodersoftwarefallbackwrapper.h
copy to webrtc/media/engine/internaldecoderfactory.h
index 8e1a97d8179ce0e5170fc894eab81cd09dc2191f..20ceecc188c6d07c4264176e66c83cb86181e922 100644
--- a/webrtc/media/engine/videodecodersoftwarefallbackwrapper.h
+++ b/webrtc/media/engine/internaldecoderfactory.h
@@ -8,54 +8,27 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef WEBRTC_MEDIA_ENGINE_VIDEODECODERSOFTWAREFALLBACKWRAPPER_H_
-#define WEBRTC_MEDIA_ENGINE_VIDEODECODERSOFTWAREFALLBACKWRAPPER_H_
+#ifndef WEBRTC_MEDIA_ENGINE_INTERNALDECODERFACTORY_H_
+#define WEBRTC_MEDIA_ENGINE_INTERNALDECODERFACTORY_H_
-#include <memory>
-#include <string>
+#include <vector>
-#include "webrtc/video_decoder.h"
+#include "webrtc/media/engine/webrtcvideodecoderfactory.h"
-namespace webrtc {
+namespace cricket {
-// Class used to wrap external VideoDecoders to provide a fallback option on
-// software decoding when a hardware decoder fails to decode a stream due to
-// hardware restrictions, such as max resolution.
-class VideoDecoderSoftwareFallbackWrapper : public webrtc::VideoDecoder {
+class InternalDecoderFactory : public WebRtcVideoDecoderFactory {
public:
- VideoDecoderSoftwareFallbackWrapper(VideoCodecType codec_type,
- VideoDecoder* decoder);
+ InternalDecoderFactory();
+ virtual ~InternalDecoderFactory();
- int32_t InitDecode(const VideoCodec* codec_settings,
- int32_t number_of_cores) override;
+ // WebRtcVideoDecoderFactory implementation.
+ webrtc::VideoDecoder* CreateVideoDecoder(
+ webrtc::VideoCodecType type) override;
- int32_t Decode(const EncodedImage& input_image,
- bool missing_frames,
- const RTPFragmentationHeader* fragmentation,
- const CodecSpecificInfo* codec_specific_info,
- int64_t render_time_ms) override;
-
- int32_t RegisterDecodeCompleteCallback(
- DecodedImageCallback* callback) override;
-
- int32_t Release() override;
- bool PrefersLateDecoding() const override;
-
- const char* ImplementationName() const override;
-
- private:
- bool InitFallbackDecoder();
-
- const DecoderType decoder_type_;
- VideoDecoder* const decoder_;
-
- VideoCodec codec_settings_;
- int32_t number_of_cores_;
- std::string fallback_implementation_name_;
- std::unique_ptr<VideoDecoder> fallback_decoder_;
- DecodedImageCallback* callback_;
+ void DestroyVideoDecoder(webrtc::VideoDecoder* decoder) override;
};
-} // namespace webrtc
+} // namespace cricket
-#endif // WEBRTC_MEDIA_ENGINE_VIDEODECODERSOFTWAREFALLBACKWRAPPER_H_
+#endif // WEBRTC_MEDIA_ENGINE_INTERNALDECODERFACTORY_H_
« no previous file with comments | « webrtc/media/BUILD.gn ('k') | webrtc/media/engine/internaldecoderfactory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698