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

Unified Diff: webrtc/video_decoder.h

Issue 1657023002: Implement NullVideoDecoder to avoid crash on unsupported decoders. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Feedback 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
« no previous file with comments | « webrtc/video/video_decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video_decoder.h
diff --git a/webrtc/video_decoder.h b/webrtc/video_decoder.h
index 3cd94e8270dfb906870e8428455a02bff9fba979..7d3f728ada9adff519757f831c16121928f94a4f 100644
--- a/webrtc/video_decoder.h
+++ b/webrtc/video_decoder.h
@@ -122,6 +122,30 @@ class VideoDecoderSoftwareFallbackWrapper : public webrtc::VideoDecoder {
DecodedImageCallback* callback_;
};
+// Video decoder class to be used for unknown codecs. Doesn't support decoding
+// but logs messages to LS_ERROR.
+class NullVideoDecoder : public VideoDecoder {
+ public:
+ NullVideoDecoder();
+
+ int32_t InitDecode(const VideoCodec* codec_settings,
+ int32_t number_of_cores) 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;
+ int32_t Reset() override;
+
+ const char* ImplementationName() const override;
+};
+
} // namespace webrtc
#endif // WEBRTC_VIDEO_DECODER_H_
« no previous file with comments | « webrtc/video/video_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698