Remove unused callbacks from VideoStreamDecoder

VCMReceiveStatisticsCallback originates in the old jitter buffer, and
is no longer used.

VCMFrameTypeCallback originates in VideoReceiver::RequestKeyFrame,
which is called from OncomingPacket, Process, Decode(uint16_t
maxWaitTimeMs), all of which are unused by VideoReceiveStream.

So delete the code to wire them up via VideoStreamDecoder.

Bug: webrtc:7408
Change-Id: I173bc94eb32f2641f943c125083db038c3bcaeb1
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/128870
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27277}
This commit is contained in:
Niels Möller 2019-03-25 15:51:03 +01:00 committed by Commit Bot
parent 39903df628
commit 4168437782
7 changed files with 6 additions and 57 deletions

View File

@ -132,7 +132,6 @@ class VideoReceiver : public Module {
// These callbacks are set on the construction thread before being attached
// to the module thread or decoding started, so a lock is not required.
VCMFrameTypeCallback* _frameTypeCallback;
VCMReceiveStatisticsCallback* _receiveStatsCallback;
VCMPacketRequestCallback* _packetRequestCallback;
// Used on both the module and decoder thread.

View File

@ -54,7 +54,6 @@ VideoReceiver::VideoReceiver(Clock* clock,
keyframe_request_sender),
_decodedFrameCallback(_timing, clock_),
_frameTypeCallback(nullptr),
_receiveStatsCallback(nullptr),
_packetRequestCallback(nullptr),
_scheduleKeyRequest(false),
drop_frames_until_keyframe_(false),
@ -197,9 +196,8 @@ int32_t VideoReceiver::RegisterReceiveStatisticsCallback(
// |_receiver| is used on both the decoder and module threads.
// However, since we make sure that we never do anything on the module thread
// when the decoder thread is not running, we don't need a lock for the
// |_receiver| or |_receiveStatsCallback| here.
// |_receiver| here.
_receiver.RegisterStatsCallback(receiveStats);
_receiveStatsCallback = receiveStats;
return VCM_OK;
}

View File

@ -368,8 +368,8 @@ void RtpVideoStreamReceiver::OnRtpPacket(const RtpPacketReceived& packet) {
}
}
int32_t RtpVideoStreamReceiver::RequestKeyFrame() {
return rtp_rtcp_->RequestKeyFrame();
void RtpVideoStreamReceiver::RequestKeyFrame() {
rtp_rtcp_->RequestKeyFrame();
}
void RtpVideoStreamReceiver::SendLossNotification(

View File

@ -59,7 +59,6 @@ class UlpfecReceiver;
class RtpVideoStreamReceiver : public LossNotificationSender,
public RecoveredPacketReceiver,
public RtpPacketSinkInterface,
public VCMFrameTypeCallback,
public VCMPacketRequestCallback,
public video_coding::OnAssembledFrameCallback,
public video_coding::OnCompleteFrameCallback,
@ -118,8 +117,8 @@ class RtpVideoStreamReceiver : public LossNotificationSender,
// Implements RecoveredPacketReceiver.
void OnRecoveredPacket(const uint8_t* packet, size_t packet_length) override;
// Implements VCMFrameTypeCallback.
int32_t RequestKeyFrame() override;
// Send an RTCP keyframe request.
void RequestKeyFrame();
// Implements LossNotificationSender.
void SendLossNotification(uint16_t last_decoded_seq_num,

View File

@ -377,7 +377,6 @@ void VideoReceiveStream::Start() {
RTC_DCHECK(renderer != nullptr);
video_stream_decoder_.reset(new VideoStreamDecoder(
&video_receiver_, &rtp_video_stream_receiver_,
&rtp_video_stream_receiver_,
rtp_video_stream_receiver_.IsRetransmissionsEnabled(), protected_by_fec,
&stats_proxy_, renderer));

View File

@ -19,7 +19,6 @@ namespace webrtc {
VideoStreamDecoder::VideoStreamDecoder(
vcm::VideoReceiver* video_receiver,
VCMFrameTypeCallback* vcm_frame_type_callback,
VCMPacketRequestCallback* vcm_packet_request_callback,
bool enable_nack,
bool enable_fec,
@ -34,8 +33,6 @@ VideoStreamDecoder::VideoStreamDecoder(
static const int kMaxNackListSize = 250;
video_receiver_->SetNackSettings(kMaxNackListSize, kMaxPacketAgeToNack, 0);
video_receiver_->RegisterReceiveCallback(this);
video_receiver_->RegisterFrameTypeCallback(vcm_frame_type_callback);
video_receiver_->RegisterReceiveStatisticsCallback(this);
VCMVideoProtection video_protection =
enable_nack ? (enable_fec ? kProtectionNackFEC : kProtectionNack)
@ -54,8 +51,6 @@ VideoStreamDecoder::~VideoStreamDecoder() {
// Unset all the callback pointers that we set in the ctor.
video_receiver_->RegisterPacketRequestCallback(nullptr);
video_receiver_->RegisterReceiveStatisticsCallback(nullptr);
video_receiver_->RegisterFrameTypeCallback(nullptr);
video_receiver_->RegisterReceiveCallback(nullptr);
}
@ -86,27 +81,4 @@ void VideoStreamDecoder::OnDecoderImplementationName(
receive_stats_callback_->OnDecoderImplementationName(implementation_name);
}
void VideoStreamDecoder::OnDiscardedPacketsUpdated(int discarded_packets) {
receive_stats_callback_->OnDiscardedPacketsUpdated(discarded_packets);
}
void VideoStreamDecoder::OnFrameCountsUpdated(const FrameCounts& frame_counts) {
receive_stats_callback_->OnFrameCountsUpdated(frame_counts);
}
void VideoStreamDecoder::OnFrameBufferTimingsUpdated(int decode_ms,
int max_decode_ms,
int current_delay_ms,
int target_delay_ms,
int jitter_buffer_ms,
int min_playout_delay_ms,
int render_delay_ms) {}
void VideoStreamDecoder::OnTimingFrameInfoUpdated(const TimingFrameInfo& info) {
}
void VideoStreamDecoder::OnCompleteFrame(bool is_keyframe,
size_t size_bytes,
VideoContentType content_type) {}
} // namespace webrtc

View File

@ -31,12 +31,10 @@ namespace vcm {
class VideoReceiver;
} // namespace vcm
class VideoStreamDecoder : public VCMReceiveCallback,
public VCMReceiveStatisticsCallback {
class VideoStreamDecoder : public VCMReceiveCallback {
public:
VideoStreamDecoder(
vcm::VideoReceiver* video_receiver,
VCMFrameTypeCallback* vcm_frame_type_callback,
VCMPacketRequestCallback* vcm_packet_request_callback,
bool enable_nack,
bool enable_fec,
@ -52,22 +50,6 @@ class VideoStreamDecoder : public VCMReceiveCallback,
void OnIncomingPayloadType(int payload_type) override;
void OnDecoderImplementationName(const char* implementation_name) override;
// Implements VCMReceiveStatisticsCallback.
void OnDiscardedPacketsUpdated(int discarded_packets) override;
void OnFrameCountsUpdated(const FrameCounts& frame_counts) override;
void OnCompleteFrame(bool is_keyframe,
size_t size_bytes,
VideoContentType content_type) override;
void OnFrameBufferTimingsUpdated(int decode_ms,
int max_decode_ms,
int current_delay_ms,
int target_delay_ms,
int jitter_buffer_ms,
int min_playout_delay_ms,
int render_delay_ms) override;
void OnTimingFrameInfoUpdated(const TimingFrameInfo& info) override;
void RegisterReceiveStatisticsProxy(
ReceiveStatisticsProxy* receive_statistics_proxy);