From 5d34dcfe60f64b14400efa7ddceb48b668a1eb05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Thu, 11 Apr 2019 15:39:39 +0200 Subject: [PATCH] Reland "Delete deprecated variant of VideoDecoder::Decode" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a reland of 3a86d9520c9692abe4c6d2a73faf4fb7a0cb80b2 Original change's description: > Delete deprecated variant of VideoDecoder::Decode > > Bug: webrtc:10379 > Change-Id: I4dd8b503625a9ea2a71177165238e128ac3e49bb > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132554 > Reviewed-by: Sami Kalliomäki > Reviewed-by: Rasmus Brandt > Reviewed-by: Kári Helgason > Reviewed-by: Erik Språng > Commit-Queue: Niels Moller > Cr-Commit-Position: refs/heads/master@{#27712} Bug: webrtc:10379 Change-Id: I7206756eb5cdbeb320fae74f286a97852fa4368b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133889 Reviewed-by: Erik Språng Reviewed-by: Sami Kalliomäki Reviewed-by: Kári Helgason Commit-Queue: Niels Moller Cr-Commit-Position: refs/heads/master@{#27750} --- api/video_codecs/video_decoder.cc | 13 ------------- api/video_codecs/video_decoder.h | 13 +------------ sdk/android/src/jni/android_media_decoder.cc | 2 -- sdk/android/src/jni/video_decoder_wrapper.cc | 1 - sdk/android/src/jni/video_decoder_wrapper.h | 1 - sdk/objc/native/src/objc_video_decoder_factory.mm | 14 +------------- video/video_stream_decoder_impl.cc | 1 - 7 files changed, 2 insertions(+), 43 deletions(-) diff --git a/api/video_codecs/video_decoder.cc b/api/video_codecs/video_decoder.cc index b0a1c874b7..1044ae4d39 100644 --- a/api/video_codecs/video_decoder.cc +++ b/api/video_codecs/video_decoder.cc @@ -28,19 +28,6 @@ int32_t DecodedImageCallback::ReceivedDecodedFrame(const uint64_t pictureId) { return -1; } -int32_t VideoDecoder::Decode(const EncodedImage& input_image, - bool missing_frames, - int64_t render_time_ms) { - return Decode(input_image, missing_frames, nullptr, render_time_ms); -} - -int32_t VideoDecoder::Decode(const EncodedImage& input_image, - bool missing_frames, - const CodecSpecificInfo* codec_specific_info, - int64_t render_time_ms) { - return Decode(input_image, missing_frames, render_time_ms); -} - bool VideoDecoder::PrefersLateDecoding() const { return true; } diff --git a/api/video_codecs/video_decoder.h b/api/video_codecs/video_decoder.h index d0341b184b..e9039343c4 100644 --- a/api/video_codecs/video_decoder.h +++ b/api/video_codecs/video_decoder.h @@ -22,10 +22,6 @@ namespace webrtc { -// TODO(pbos): Expose these through a public (root) header or change these APIs. -struct CodecSpecificInfo; -class VideoCodec; - class RTC_EXPORT DecodedImageCallback { public: virtual ~DecodedImageCallback() {} @@ -55,14 +51,7 @@ class RTC_EXPORT VideoDecoder { virtual int32_t Decode(const EncodedImage& input_image, bool missing_frames, - int64_t render_time_ms); - - // TODO(bugs.webrtc.org/10379): Deprecated. Delete, and make above method pure - // virtual, as soon as downstream applications are updated. - virtual int32_t Decode(const EncodedImage& input_image, - bool missing_frames, - const CodecSpecificInfo* codec_specific_info, - int64_t render_time_ms); + int64_t render_time_ms) = 0; virtual int32_t RegisterDecodeCompleteCallback( DecodedImageCallback* callback) = 0; diff --git a/sdk/android/src/jni/android_media_decoder.cc b/sdk/android/src/jni/android_media_decoder.cc index 6506a86810..60250d84be 100644 --- a/sdk/android/src/jni/android_media_decoder.cc +++ b/sdk/android/src/jni/android_media_decoder.cc @@ -65,7 +65,6 @@ class MediaCodecVideoDecoder : public VideoDecoder, public rtc::MessageHandler { int32_t Decode(const EncodedImage& inputImage, bool missingFrames, - const CodecSpecificInfo* codecSpecificInfo = NULL, int64_t renderTimeMs = -1) override; int32_t RegisterDecodeCompleteCallback( @@ -350,7 +349,6 @@ int32_t MediaCodecVideoDecoder::ProcessHWErrorOnCodecThread() { int32_t MediaCodecVideoDecoder::Decode( const EncodedImage& inputImage, bool missingFrames, - const CodecSpecificInfo* codecSpecificInfo, int64_t renderTimeMs) { if (sw_fallback_required_) { ALOGE << "Decode() - fallback to SW codec"; diff --git a/sdk/android/src/jni/video_decoder_wrapper.cc b/sdk/android/src/jni/video_decoder_wrapper.cc index e3140746b6..1a157155a7 100644 --- a/sdk/android/src/jni/video_decoder_wrapper.cc +++ b/sdk/android/src/jni/video_decoder_wrapper.cc @@ -88,7 +88,6 @@ int32_t VideoDecoderWrapper::InitDecodeInternal(JNIEnv* jni) { int32_t VideoDecoderWrapper::Decode( const EncodedImage& image_param, bool missing_frames, - const CodecSpecificInfo* codec_specific_info, int64_t render_time_ms) { RTC_DCHECK_RUN_ON(&decoder_thread_checker_); if (!initialized_) { diff --git a/sdk/android/src/jni/video_decoder_wrapper.h b/sdk/android/src/jni/video_decoder_wrapper.h index 55a395bee7..a2bc072705 100644 --- a/sdk/android/src/jni/video_decoder_wrapper.h +++ b/sdk/android/src/jni/video_decoder_wrapper.h @@ -35,7 +35,6 @@ class VideoDecoderWrapper : public VideoDecoder { int32_t Decode(const EncodedImage& input_image, bool missing_frames, - const CodecSpecificInfo* codec_specific_info, int64_t render_time_ms) override; int32_t RegisterDecodeCompleteCallback( diff --git a/sdk/objc/native/src/objc_video_decoder_factory.mm b/sdk/objc/native/src/objc_video_decoder_factory.mm index 00fac0c260..d1d8ca23d5 100644 --- a/sdk/objc/native/src/objc_video_decoder_factory.mm +++ b/sdk/objc/native/src/objc_video_decoder_factory.mm @@ -43,25 +43,13 @@ class ObjCVideoDecoder : public VideoDecoder { int32_t Decode(const EncodedImage &input_image, bool missing_frames, - const CodecSpecificInfo *codec_specific_info = NULL, int64_t render_time_ms = -1) override { RTCEncodedImage *encodedImage = [[RTCEncodedImage alloc] initWithNativeEncodedImage:input_image]; - // webrtc::CodecSpecificInfo only handles a hard coded list of codecs - id rtcCodecSpecificInfo = nil; - if (codec_specific_info) { - if (codec_specific_info->codecType == kVideoCodecH264) { - RTCCodecSpecificInfoH264 *h264Info = [[RTCCodecSpecificInfoH264 alloc] init]; - h264Info.packetizationMode = - (RTCH264PacketizationMode)codec_specific_info->codecSpecific.H264.packetization_mode; - rtcCodecSpecificInfo = h264Info; - } - } - return [decoder_ decode:encodedImage missingFrames:missing_frames - codecSpecificInfo:rtcCodecSpecificInfo + codecSpecificInfo:nil renderTimeMs:render_time_ms]; } diff --git a/video/video_stream_decoder_impl.cc b/video/video_stream_decoder_impl.cc index c3c1d0dc47..42a543451c 100644 --- a/video/video_stream_decoder_impl.cc +++ b/video/video_stream_decoder_impl.cc @@ -210,7 +210,6 @@ VideoStreamDecoderImpl::DecodeResult VideoStreamDecoderImpl::DecodeNextFrame( int32_t decode_result = decoder->Decode(frame->EncodedImage(), false, // missing_frame - nullptr, // codec specific info frame->RenderTimeMs()); return decode_result == WEBRTC_VIDEO_CODEC_OK ? kOk : kDecodeFailure;