Index: webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc |
diff --git a/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc b/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc |
index 8407451bd4d7658595c28acba9ec04bcb7d1c997..c26b94c04d53421fd583c5ae9099c0ac271f5e45 100644 |
--- a/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc |
+++ b/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc |
@@ -357,14 +357,7 @@ |
video_frame->video_frame_buffer()->DataV()); |
video_frame->set_timestamp(input_image._timeStamp); |
- rtc::Optional<uint8_t> qp; |
- // TODO(sakal): Maybe it is possible to get QP directly from FFmpeg. |
- h264_bitstream_parser_.ParseBitstream(input_image._buffer, |
- input_image._length); |
- int qp_int; |
- if (h264_bitstream_parser_.GetLastSliceQp(&qp_int)) { |
- qp.emplace(qp_int); |
- } |
+ int32_t ret; |
// The decoded image may be larger than what is supposed to be visible, see |
// |AVGetBuffer2|'s use of |avcodec_align_dimensions|. This crops the image |
@@ -383,17 +376,19 @@ |
video_frame->rotation()); |
// TODO(nisse): Timestamp and rotation are all zero here. Change decoder |
// interface to pass a VideoFrameBuffer instead of a VideoFrame? |
- decoded_image_callback_->Decoded(cropped_frame, rtc::Optional<int32_t>(), |
- qp); |
+ ret = decoded_image_callback_->Decoded(cropped_frame); |
} else { |
// Return decoded frame. |
- decoded_image_callback_->Decoded(*video_frame, rtc::Optional<int32_t>(), |
- qp); |
+ ret = decoded_image_callback_->Decoded(*video_frame); |
} |
// Stop referencing it, possibly freeing |video_frame|. |
av_frame_unref(av_frame_.get()); |
video_frame = nullptr; |
+ if (ret) { |
+ LOG(LS_WARNING) << "DecodedImageCallback::Decoded returned " << ret; |
+ return ret; |
+ } |
return WEBRTC_VIDEO_CODEC_OK; |
} |