Delete pre_decode_image_callback
Followup to https://webrtc-review.googlesource.com/c/src/+/97580. Bug: webrtc:9106 Change-Id: I1181dabe82f1ca63bd2ba124152f5103972a8bcc Reviewed-on: https://webrtc-review.googlesource.com/c/103100 Reviewed-by: Åsa Persson <asapersson@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24945}
This commit is contained in:
@ -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",
|
||||
|
@ -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
|
@ -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_
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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(
|
||||
|
@ -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,
|
||||
|
Reference in New Issue
Block a user