Chromium Code Reviews| Index: webrtc/video/video_decoder.cc |
| diff --git a/webrtc/video/video_decoder.cc b/webrtc/video/video_decoder.cc |
| index d699175274d54630d14003b613a4651edace018a..d1f109e258b95e22c8584867b4c74eb7de6b0ccf 100644 |
| --- a/webrtc/video/video_decoder.cc |
| +++ b/webrtc/video/video_decoder.cc |
| @@ -27,8 +27,7 @@ VideoDecoder* VideoDecoder::Create(VideoDecoder::DecoderType codec_type) { |
| case kVp9: |
| return VP9Decoder::Create(); |
| case kUnsupportedCodec: |
| - RTC_NOTREACHED(); |
| - return nullptr; |
| + return new NullVideoDecoder(); |
|
pbos-webrtc
2016/02/02 13:59:13
I'd prefer a log here as well.
joachim
2016/02/02 14:31:33
Done.
|
| } |
| RTC_NOTREACHED(); |
| return nullptr; |
| @@ -146,4 +145,40 @@ const char* VideoDecoderSoftwareFallbackWrapper::ImplementationName() const { |
| return decoder_->ImplementationName(); |
| } |
| +NullVideoDecoder::NullVideoDecoder() {} |
| + |
| +int32_t NullVideoDecoder::InitDecode(const VideoCodec* codec_settings, |
| + int32_t number_of_cores) { |
| + LOG(LS_ERROR) << "Can't initialize NullVideoDecoder."; |
| + return WEBRTC_VIDEO_CODEC_OK; |
| +} |
| + |
| +int32_t NullVideoDecoder::Decode(const EncodedImage& input_image, |
| + bool missing_frames, |
| + const RTPFragmentationHeader* fragmentation, |
| + const CodecSpecificInfo* codec_specific_info, |
| + int64_t render_time_ms) { |
| + LOG(LS_ERROR) << "The NullVideoDecoder doesn't support decoding."; |
| + return WEBRTC_VIDEO_CODEC_OK; |
| +} |
| + |
| +int32_t NullVideoDecoder::RegisterDecodeCompleteCallback( |
| + DecodedImageCallback* callback) { |
| + LOG(LS_ERROR) |
| + << "Can't register decode complete callback on NullVideoDecoder."; |
| + return WEBRTC_VIDEO_CODEC_OK; |
| +} |
| + |
| +int32_t NullVideoDecoder::Release() { |
| + return WEBRTC_VIDEO_CODEC_OK; |
| +} |
| + |
| +int32_t NullVideoDecoder::Reset() { |
| + return WEBRTC_VIDEO_CODEC_OK; |
| +} |
| + |
| +const char* NullVideoDecoder::ImplementationName() const { |
| + return "null"; |
|
noahric
2016/02/02 14:06:43
Maybe NullVideoDecoder, so the logging doesn't loo
joachim
2016/02/02 14:31:33
Done.
|
| +} |
| + |
| } // namespace webrtc |