Delete FrameToRender from VCMReceiveCallback

The `FrameToRender` method is deprecated and has been replaced by
`OnFrameToRender`.

Bug: webrtc:358039777
Change-Id: Ibe56bd43cf045d814137ba8c4374bc9b9ce8ef6c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371302
Commit-Queue: Fanny Linderborg <linderborg@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43547}
This commit is contained in:
Fanny Linderborg 2024-12-12 12:52:50 +01:00 committed by WebRTC LUCI CQ
parent 575d323671
commit 3a1f2e6a69
6 changed files with 6 additions and 87 deletions

View File

@ -53,19 +53,7 @@ class MockCorruptionScoreCalculator : public CorruptionScoreCalculator {
class ReceiveCallback : public VCMReceiveCallback { class ReceiveCallback : public VCMReceiveCallback {
public: public:
int32_t FrameToRender(VideoFrame& frame, int32_t OnFrameToRender(const FrameToRender& arguments) override {
std::optional<uint8_t> qp,
TimeDelta decode_time,
VideoContentType content_type,
VideoFrameType frame_type) override {
return OnFrameToRender({.video_frame = frame,
.qp = qp,
.decode_time = decode_time,
.content_type = content_type,
.frame_type = frame_type});
}
int32_t OnFrameToRender(const struct FrameToRender& arguments) override {
frames_.push_back(arguments.video_frame); frames_.push_back(arguments.video_frame);
last_corruption_score_ = arguments.corruption_score; last_corruption_score_ = arguments.corruption_score;
return 0; return 0;

View File

@ -63,22 +63,7 @@ class VCMReceiveCallback {
std::optional<double> corruption_score; std::optional<double> corruption_score;
}; };
// TODO: bugs.webrtc.org/358039777 - Delete this function. virtual int32_t OnFrameToRender(const FrameToRender& arguments) = 0;
virtual int32_t FrameToRender(VideoFrame& /* videoFrame */, // NOLINT
std::optional<uint8_t> /* qp */,
TimeDelta /* decode_time */,
VideoContentType /* content_type */,
VideoFrameType /* frame_type */) {
RTC_CHECK_NOTREACHED();
return 0;
}
// TODO: bugs.webrtc.org/358039777 - Make this pure virtual.
virtual int32_t OnFrameToRender(const struct FrameToRender& arguments) {
return FrameToRender(arguments.video_frame, arguments.qp,
arguments.decode_time, arguments.content_type,
arguments.frame_type);
}
virtual void OnDroppedFrames(uint32_t frames_dropped); virtual void OnDroppedFrames(uint32_t frames_dropped);

View File

@ -12,16 +12,11 @@
#include <cstdint> #include <cstdint>
#include <memory> #include <memory>
#include <optional>
#include <utility> #include <utility>
#include "api/test/mock_video_decoder.h" #include "api/test/mock_video_decoder.h"
#include "api/units/time_delta.h"
#include "api/units/timestamp.h" #include "api/units/timestamp.h"
#include "api/video/encoded_frame.h" #include "api/video/encoded_frame.h"
#include "api/video/video_content_type.h"
#include "api/video/video_frame.h"
#include "api/video/video_frame_type.h"
#include "common_video/test/utilities.h" #include "common_video/test/utilities.h"
#include "modules/video_coding/decoder_database.h" #include "modules/video_coding/decoder_database.h"
#include "modules/video_coding/timing/timing.h" #include "modules/video_coding/timing/timing.h"
@ -41,18 +36,7 @@ class MockVCMReceiveCallback : public VCMReceiveCallback {
public: public:
MockVCMReceiveCallback() = default; MockVCMReceiveCallback() = default;
MOCK_METHOD(int32_t, MOCK_METHOD(int32_t, OnFrameToRender, (const FrameToRender&), (override));
FrameToRender,
(VideoFrame&,
std::optional<uint8_t>,
TimeDelta,
VideoContentType,
VideoFrameType),
(override));
MOCK_METHOD(int32_t,
OnFrameToRender,
(const struct FrameToRender&),
(override));
MOCK_METHOD(void, OnIncomingPayloadType, (int), (override)); MOCK_METHOD(void, OnIncomingPayloadType, (int), (override));
MOCK_METHOD(void, MOCK_METHOD(void,
OnDecoderInfoChanged, OnDecoderInfoChanged,

View File

@ -9,12 +9,8 @@
*/ */
#include <cstdint> #include <cstdint>
#include <optional>
#include "api/test/mock_video_decoder.h" #include "api/test/mock_video_decoder.h"
#include "api/units/time_delta.h"
#include "api/video/video_content_type.h"
#include "api/video/video_frame.h"
#include "api/video/video_frame_type.h" #include "api/video/video_frame_type.h"
#include "api/video_codecs/video_decoder.h" #include "api/video_codecs/video_decoder.h"
#include "modules/video_coding/include/video_coding.h" #include "modules/video_coding/include/video_coding.h"
@ -46,18 +42,7 @@ class MockVCMReceiveCallback : public VCMReceiveCallback {
MockVCMReceiveCallback() {} MockVCMReceiveCallback() {}
virtual ~MockVCMReceiveCallback() {} virtual ~MockVCMReceiveCallback() {}
MOCK_METHOD(int32_t, MOCK_METHOD(int32_t, OnFrameToRender, (const FrameToRender&), (override));
FrameToRender,
(VideoFrame&,
std::optional<uint8_t>,
TimeDelta,
VideoContentType,
VideoFrameType),
(override));
MOCK_METHOD(int32_t,
OnFrameToRender,
(const struct FrameToRender&),
(override));
MOCK_METHOD(void, OnIncomingPayloadType, (int), (override)); MOCK_METHOD(void, OnIncomingPayloadType, (int), (override));
MOCK_METHOD(void, MOCK_METHOD(void,
OnDecoderInfoChanged, OnDecoderInfoChanged,

View File

@ -14,9 +14,7 @@
#include <optional> #include <optional>
#include "api/units/time_delta.h" #include "api/units/time_delta.h"
#include "api/video/video_content_type.h"
#include "api/video/video_frame.h" #include "api/video/video_frame.h"
#include "api/video/video_frame_type.h"
#include "api/video_codecs/video_decoder.h" #include "api/video_codecs/video_decoder.h"
#include "modules/video_coding/video_receiver2.h" #include "modules/video_coding/video_receiver2.h"
#include "rtc_base/checks.h" #include "rtc_base/checks.h"
@ -50,19 +48,7 @@ VideoStreamDecoder::~VideoStreamDecoder() {
// callback won't necessarily be called from the decoding thread. The decoding // callback won't necessarily be called from the decoding thread. The decoding
// thread may have held the lock when calling VideoDecoder::Decode, Reset, or // thread may have held the lock when calling VideoDecoder::Decode, Reset, or
// Release. Acquiring the same lock in the path of decode callback can deadlock. // Release. Acquiring the same lock in the path of decode callback can deadlock.
int32_t VideoStreamDecoder::FrameToRender(VideoFrame& video_frame, int32_t VideoStreamDecoder::OnFrameToRender(const FrameToRender& arguments) {
std::optional<uint8_t> qp,
TimeDelta decode_time,
VideoContentType content_type,
VideoFrameType frame_type) {
return OnFrameToRender({.video_frame = video_frame,
.qp = qp,
.decode_time = decode_time,
.content_type = content_type,
.frame_type = frame_type});
}
int32_t VideoStreamDecoder::OnFrameToRender(
const struct FrameToRender& arguments) {
receive_stats_callback_->OnDecodedFrame( receive_stats_callback_->OnDecodedFrame(
arguments.video_frame, arguments.qp, arguments.decode_time, arguments.video_frame, arguments.qp, arguments.decode_time,
arguments.content_type, arguments.frame_type); arguments.content_type, arguments.frame_type);

View File

@ -15,14 +15,10 @@
#include <list> #include <list>
#include <map> #include <map>
#include <memory> #include <memory>
#include <optional>
#include <vector> #include <vector>
#include "api/scoped_refptr.h" #include "api/scoped_refptr.h"
#include "api/units/time_delta.h"
#include "api/video/video_content_type.h"
#include "api/video/video_frame.h" #include "api/video/video_frame.h"
#include "api/video/video_frame_type.h"
#include "api/video/video_sink_interface.h" #include "api/video/video_sink_interface.h"
#include "api/video_codecs/video_decoder.h" #include "api/video_codecs/video_decoder.h"
#include "modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h" #include "modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
@ -46,12 +42,7 @@ class VideoStreamDecoder : public VCMReceiveCallback {
~VideoStreamDecoder() override; ~VideoStreamDecoder() override;
// Implements VCMReceiveCallback. // Implements VCMReceiveCallback.
int32_t FrameToRender(VideoFrame& video_frame, int32_t OnFrameToRender(const FrameToRender& arguments) override;
std::optional<uint8_t> qp,
TimeDelta decode_time,
VideoContentType content_type,
VideoFrameType frame_type) override;
int32_t OnFrameToRender(const struct FrameToRender& arguments) override;
void OnDroppedFrames(uint32_t frames_dropped) override; void OnDroppedFrames(uint32_t frames_dropped) override;
void OnIncomingPayloadType(int payload_type) override; void OnIncomingPayloadType(int payload_type) override;
void OnDecoderInfoChanged( void OnDecoderInfoChanged(