diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index a414153b6b..0db4a24bf9 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -123,8 +123,6 @@ rtc_static_library("video_coding") { "nack_fec_tables.h", "packet_buffer.cc", "packet_buffer.h", - "qp_parser.cc", - "qp_parser.h", "receiver.cc", "receiver.h", "rtp_frame_reference_finder.cc", diff --git a/modules/video_coding/qp_parser.cc b/modules/video_coding/qp_parser.cc deleted file mode 100644 index 2adbca9b71..0000000000 --- a/modules/video_coding/qp_parser.cc +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include "modules/video_coding/qp_parser.h" - -#include "common_types.h" // NOLINT(build/include) -#include "modules/video_coding/utility/vp8_header_parser.h" -#include "modules/video_coding/utility/vp9_uncompressed_header_parser.h" - -namespace webrtc { - -bool QpParser::GetQp(const VCMEncodedFrame& frame, int* qp) { - switch (frame.CodecSpecific()->codecType) { - case kVideoCodecVP8: - // QP range: [0, 127]. - return vp8::GetQp(frame.Buffer(), frame.Length(), qp); - case kVideoCodecVP9: - // QP range: [0, 255]. - return vp9::GetQp(frame.Buffer(), frame.Length(), qp); - default: - return false; - } -} - -} // namespace webrtc diff --git a/modules/video_coding/qp_parser.h b/modules/video_coding/qp_parser.h deleted file mode 100644 index a6dbf5368d..0000000000 --- a/modules/video_coding/qp_parser.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef MODULES_VIDEO_CODING_QP_PARSER_H_ -#define MODULES_VIDEO_CODING_QP_PARSER_H_ - -#include "modules/video_coding/encoded_frame.h" - -namespace webrtc { - -class QpParser { - public: - QpParser() {} - ~QpParser() {} - - // Parses an encoded |frame| and extracts the |qp|. - // Returns true on success, false otherwise. - bool GetQp(const VCMEncodedFrame& frame, int* qp); -}; - -} // namespace webrtc - -#endif // MODULES_VIDEO_CODING_QP_PARSER_H_ diff --git a/modules/video_coding/video_coding_impl.cc b/modules/video_coding/video_coding_impl.cc index e02d4c0e14..a061c18fd7 100644 --- a/modules/video_coding/video_coding_impl.cc +++ b/modules/video_coding/video_coding_impl.cc @@ -83,14 +83,12 @@ class VideoCodingModuleImpl : public VideoCodingModule { VideoCodingModuleImpl(Clock* clock, EventFactory* event_factory, NackSender* nack_sender, - KeyFrameRequestSender* keyframe_request_sender, - EncodedImageCallback* pre_decode_image_callback) + KeyFrameRequestSender* keyframe_request_sender) : VideoCodingModule(), sender_(clock, &post_encode_callback_), timing_(new VCMTiming(clock)), receiver_(clock, event_factory, - pre_decode_image_callback, timing_.get(), nack_sender, keyframe_request_sender) {} @@ -227,8 +225,7 @@ VideoCodingModule* VideoCodingModule::Create(Clock* clock, EventFactory* event_factory) { RTC_DCHECK(clock); RTC_DCHECK(event_factory); - return new VideoCodingModuleImpl(clock, event_factory, nullptr, nullptr, - nullptr); + return new VideoCodingModuleImpl(clock, event_factory, nullptr, nullptr); } } // namespace webrtc diff --git a/modules/video_coding/video_coding_impl.h b/modules/video_coding/video_coding_impl.h index 75dc889d81..3c09f96e26 100644 --- a/modules/video_coding/video_coding_impl.h +++ b/modules/video_coding/video_coding_impl.h @@ -25,7 +25,6 @@ #include "modules/video_coding/generic_encoder.h" #include "modules/video_coding/jitter_buffer.h" #include "modules/video_coding/media_optimization.h" -#include "modules/video_coding/qp_parser.h" #include "modules/video_coding/receiver.h" #include "modules/video_coding/timing.h" #include "rtc_base/onetimeevent.h" @@ -130,8 +129,6 @@ class VideoReceiver : public Module { public: VideoReceiver(Clock* clock, EventFactory* event_factory, - // TODO(nisse): Delete. - EncodedImageCallback* pre_decode_image_callback, VCMTiming* timing, NackSender* nack_sender = nullptr, KeyFrameRequestSender* keyframe_request_sender = nullptr); @@ -226,12 +223,10 @@ class VideoReceiver : public Module { // Once the decoder thread has been started, usage of |_codecDataBase| moves // over to the decoder thread. VCMDecoderDataBase _codecDataBase; - EncodedImageCallback* const pre_decode_image_callback_; VCMProcessTimer _receiveStatsTimer RTC_GUARDED_BY(module_thread_checker_); VCMProcessTimer _retransmissionTimer RTC_GUARDED_BY(module_thread_checker_); VCMProcessTimer _keyRequestTimer RTC_GUARDED_BY(module_thread_checker_); - QpParser qp_parser_ RTC_GUARDED_BY(decoder_thread_checker_); ThreadUnsafeOneTimeEvent first_frame_received_ RTC_GUARDED_BY(decoder_thread_checker_); // Modified on the construction thread. Can be read without a lock and assumed diff --git a/modules/video_coding/video_receiver.cc b/modules/video_coding/video_receiver.cc index 5baf430b5d..d94ba5e69f 100644 --- a/modules/video_coding/video_receiver.cc +++ b/modules/video_coding/video_receiver.cc @@ -27,7 +27,6 @@ namespace vcm { VideoReceiver::VideoReceiver(Clock* clock, EventFactory* event_factory, - EncodedImageCallback* pre_decode_image_callback, VCMTiming* timing, NackSender* nack_sender, KeyFrameRequestSender* keyframe_request_sender) @@ -46,7 +45,6 @@ VideoReceiver::VideoReceiver(Clock* clock, drop_frames_until_keyframe_(false), max_nack_list_size_(0), _codecDataBase(), - pre_decode_image_callback_(pre_decode_image_callback), _receiveStatsTimer(1000, clock_), _retransmissionTimer(10, clock_), _keyRequestTimer(500, clock_) { @@ -297,16 +295,6 @@ int32_t VideoReceiver::Decode(uint16_t maxWaitTimeMs) { return VCM_FRAME_NOT_READY; } - if (pre_decode_image_callback_) { - EncodedImage encoded_image(frame->EncodedImage()); - int qp = -1; - if (qp_parser_.GetQp(*frame, &qp)) { - encoded_image.qp_ = qp; - } - pre_decode_image_callback_->OnEncodedImage(encoded_image, - frame->CodecSpecific(), nullptr); - } - // If this frame was too late, we should adjust the delay accordingly _timing->UpdateCurrentDelay(frame->RenderTimeMs(), clock_->TimeInMilliseconds()); @@ -327,15 +315,6 @@ int32_t VideoReceiver::Decode(uint16_t maxWaitTimeMs) { // VCMEncodedFrame with FrameObject. int32_t VideoReceiver::Decode(const webrtc::VCMEncodedFrame* frame) { RTC_DCHECK_RUN_ON(&decoder_thread_checker_); - if (pre_decode_image_callback_) { - EncodedImage encoded_image(frame->EncodedImage()); - int qp = -1; - if (qp_parser_.GetQp(*frame, &qp)) { - encoded_image.qp_ = qp; - } - pre_decode_image_callback_->OnEncodedImage(encoded_image, - frame->CodecSpecific(), nullptr); - } return Decode(*frame); } diff --git a/modules/video_coding/video_receiver_unittest.cc b/modules/video_coding/video_receiver_unittest.cc index 0b32daaaa2..b7a46f92ea 100644 --- a/modules/video_coding/video_receiver_unittest.cc +++ b/modules/video_coding/video_receiver_unittest.cc @@ -37,8 +37,7 @@ class TestVideoReceiver : public ::testing::Test { virtual void SetUp() { timing_.reset(new VCMTiming(&clock_)); - receiver_.reset( - new VideoReceiver(&clock_, &event_factory_, nullptr, timing_.get())); + receiver_.reset(new VideoReceiver(&clock_, &event_factory_, timing_.get())); receiver_->RegisterExternalDecoder(&decoder_, kUnusedPayloadType); const size_t kMaxNackListSize = 250; const int kMaxPacketAgeToNack = 450; diff --git a/video/video_quality_test.cc b/video/video_quality_test.cc index 0cf303b33b..224e4a8a81 100644 --- a/video/video_quality_test.cc +++ b/video/video_quality_test.cc @@ -93,10 +93,11 @@ class FrameDumpingDecoder : public VideoDecoder { bool missing_frames, const CodecSpecificInfo* codec_specific_info, int64_t render_time_ms) override { + int32_t ret = decoder_->Decode(input_image, missing_frames, + codec_specific_info, render_time_ms); writer_->WriteFrame(input_image, codec_specific_info->codecType); - return decoder_->Decode(input_image, missing_frames, codec_specific_info, - render_time_ms); + return ret; } int32_t RegisterDecodeCompleteCallback( diff --git a/video/video_receive_stream.cc b/video/video_receive_stream.cc index 9fc424c85a..86b93686ca 100644 --- a/video/video_receive_stream.cc +++ b/video/video_receive_stream.cc @@ -130,7 +130,7 @@ VideoReceiveStream::VideoReceiveStream( call_stats_(call_stats), rtp_receive_statistics_(ReceiveStatistics::Create(clock_)), timing_(new VCMTiming(clock_)), - video_receiver_(clock_, nullptr, nullptr, timing_.get(), this, this), + video_receiver_(clock_, nullptr, timing_.get(), this, this), stats_proxy_(&config_, clock_), rtp_video_stream_receiver_(&transport_adapter_, call_stats,