Rename and move VCMReceiveStatisticsCallback closer to its users.
The VCMReceiveStatisticsCallback interface is both implemented (by ReceiveStatisticsProxy) and called (by VideoStreamBufferController) in `video/`, so there's no reason it should be declared in `modules/video_coding`. I also took the opportunity to update the name. No functional changes are intended by this change, but following CLs will make some changes. Bug: webrtc:15085 Change-Id: Ib8da30ca56675e4f638d0b9778c329b9c1138acf Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/304662 Reviewed-by: Åsa Persson <asapersson@webrtc.org> Commit-Queue: Rasmus Brandt <brandtr@webrtc.org> Cr-Commit-Position: refs/heads/main@{#40034}
This commit is contained in:
parent
6456952c94
commit
39250a4e68
@ -66,29 +66,6 @@ class VCMReceiveCallback {
|
||||
virtual ~VCMReceiveCallback() {}
|
||||
};
|
||||
|
||||
// Callback class used for informing the user of the incoming bit rate and frame
|
||||
// rate.
|
||||
class VCMReceiveStatisticsCallback {
|
||||
public:
|
||||
virtual void OnCompleteFrame(bool is_keyframe,
|
||||
size_t size_bytes,
|
||||
VideoContentType content_type) = 0;
|
||||
|
||||
virtual void OnDroppedFrames(uint32_t frames_dropped) = 0;
|
||||
|
||||
virtual void OnFrameBufferTimingsUpdated(int estimated_max_decode_time_ms,
|
||||
int current_delay_ms,
|
||||
int target_delay_ms,
|
||||
int jitter_buffer_ms,
|
||||
int min_playout_delay_ms,
|
||||
int render_delay_ms) = 0;
|
||||
|
||||
virtual void OnTimingFrameInfoUpdated(const TimingFrameInfo& info) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~VCMReceiveStatisticsCallback() {}
|
||||
};
|
||||
|
||||
// Callback class used for telling the user about what frame type needed to
|
||||
// continue decoding.
|
||||
// Typically a key frame when the stream has been corrupted in some way.
|
||||
|
||||
@ -252,7 +252,6 @@ rtc_library("video_stream_buffer_controller") {
|
||||
"../api/video:video_rtp_headers",
|
||||
"../modules/video_coding",
|
||||
"../modules/video_coding:frame_helpers",
|
||||
"../modules/video_coding:video_codec_interface",
|
||||
"../modules/video_coding/timing:inter_frame_delay_variation_calculator",
|
||||
"../modules/video_coding/timing:jitter_estimator",
|
||||
"../modules/video_coding/timing:timing_module",
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
#include "api/video_codecs/video_decoder.h"
|
||||
#include "call/video_receive_stream.h"
|
||||
#include "modules/include/module_common_types.h"
|
||||
#include "modules/video_coding/include/video_coding_defines.h"
|
||||
#include "rtc_base/numerics/histogram_percentile_counter.h"
|
||||
#include "rtc_base/numerics/moving_max_counter.h"
|
||||
#include "rtc_base/numerics/sample_counter.h"
|
||||
@ -35,6 +34,7 @@
|
||||
#include "video/quality_threshold.h"
|
||||
#include "video/stats_counter.h"
|
||||
#include "video/video_quality_observer2.h"
|
||||
#include "video/video_stream_buffer_controller.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -45,7 +45,7 @@ namespace internal {
|
||||
// Declared in video_receive_stream2.h.
|
||||
struct VideoFrameMetaData;
|
||||
|
||||
class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback,
|
||||
class ReceiveStatisticsProxy : public VideoStreamBufferControllerStatsObserver,
|
||||
public RtcpCnameCallback,
|
||||
public RtcpPacketTypeCounterObserver {
|
||||
public:
|
||||
@ -85,7 +85,7 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback,
|
||||
// Indicates video stream has been paused (no incoming packets).
|
||||
void OnStreamInactive();
|
||||
|
||||
// Overrides VCMReceiveStatisticsCallback.
|
||||
// Implements VideoStreamBufferControllerStatsObserver.
|
||||
void OnCompleteFrame(bool is_keyframe,
|
||||
size_t size_bytes,
|
||||
VideoContentType content_type) override;
|
||||
@ -99,10 +99,10 @@ class ReceiveStatisticsProxy : public VCMReceiveStatisticsCallback,
|
||||
|
||||
void OnTimingFrameInfoUpdated(const TimingFrameInfo& info) override;
|
||||
|
||||
// Overrides RtcpCnameCallback.
|
||||
// Implements RtcpCnameCallback.
|
||||
void OnCname(uint32_t ssrc, absl::string_view cname) override;
|
||||
|
||||
// Overrides RtcpPacketTypeCounterObserver.
|
||||
// Implements RtcpPacketTypeCounterObserver.
|
||||
void RtcpPacketTypesCounterUpdated(
|
||||
uint32_t ssrc,
|
||||
const RtcpPacketTypeCounter& packet_counter) override;
|
||||
|
||||
@ -79,7 +79,7 @@ VideoStreamBufferController::VideoStreamBufferController(
|
||||
Clock* clock,
|
||||
TaskQueueBase* worker_queue,
|
||||
VCMTiming* timing,
|
||||
VCMReceiveStatisticsCallback* stats_proxy,
|
||||
VideoStreamBufferControllerStatsObserver* stats_proxy,
|
||||
FrameSchedulingReceiver* receiver,
|
||||
TimeDelta max_wait_for_keyframe,
|
||||
TimeDelta max_wait_for_frame,
|
||||
|
||||
@ -17,7 +17,6 @@
|
||||
#include "api/task_queue/task_queue_base.h"
|
||||
#include "api/video/encoded_frame.h"
|
||||
#include "api/video/frame_buffer.h"
|
||||
#include "modules/video_coding/include/video_coding_defines.h"
|
||||
#include "modules/video_coding/timing/inter_frame_delay_variation_calculator.h"
|
||||
#include "modules/video_coding/timing/jitter_estimator.h"
|
||||
#include "modules/video_coding/timing/timing.h"
|
||||
@ -36,13 +35,33 @@ class FrameSchedulingReceiver {
|
||||
virtual void OnDecodableFrameTimeout(TimeDelta wait_time) = 0;
|
||||
};
|
||||
|
||||
class VideoStreamBufferControllerStatsObserver {
|
||||
public:
|
||||
virtual ~VideoStreamBufferControllerStatsObserver() = default;
|
||||
|
||||
virtual void OnCompleteFrame(bool is_keyframe,
|
||||
size_t size_bytes,
|
||||
VideoContentType content_type) = 0;
|
||||
|
||||
virtual void OnDroppedFrames(uint32_t frames_dropped) = 0;
|
||||
|
||||
virtual void OnFrameBufferTimingsUpdated(int estimated_max_decode_time_ms,
|
||||
int current_delay_ms,
|
||||
int target_delay_ms,
|
||||
int jitter_buffer_ms,
|
||||
int min_playout_delay_ms,
|
||||
int render_delay_ms) = 0;
|
||||
|
||||
virtual void OnTimingFrameInfoUpdated(const TimingFrameInfo& info) = 0;
|
||||
};
|
||||
|
||||
class VideoStreamBufferController {
|
||||
public:
|
||||
VideoStreamBufferController(
|
||||
Clock* clock,
|
||||
TaskQueueBase* worker_queue,
|
||||
VCMTiming* timing,
|
||||
VCMReceiveStatisticsCallback* stats_proxy,
|
||||
VideoStreamBufferControllerStatsObserver* stats_proxy,
|
||||
FrameSchedulingReceiver* receiver,
|
||||
TimeDelta max_wait_for_keyframe,
|
||||
TimeDelta max_wait_for_frame,
|
||||
@ -78,7 +97,7 @@ class VideoStreamBufferController {
|
||||
const absl::optional<RttMultExperiment::Settings> rtt_mult_settings_ =
|
||||
RttMultExperiment::GetRttMultValue();
|
||||
Clock* const clock_;
|
||||
VCMReceiveStatisticsCallback* const stats_proxy_;
|
||||
VideoStreamBufferControllerStatsObserver* const stats_proxy_;
|
||||
FrameSchedulingReceiver* const receiver_;
|
||||
VCMTiming* const timing_;
|
||||
const std::unique_ptr<FrameDecodeScheduler> frame_decode_scheduler_
|
||||
|
||||
@ -95,7 +95,8 @@ class VCMTimingTest : public VCMTiming {
|
||||
());
|
||||
};
|
||||
|
||||
class VCMReceiveStatisticsCallbackMock : public VCMReceiveStatisticsCallback {
|
||||
class VideoStreamBufferControllerStatsObserverMock
|
||||
: public VideoStreamBufferControllerStatsObserver {
|
||||
public:
|
||||
MOCK_METHOD(void,
|
||||
OnCompleteFrame,
|
||||
@ -225,7 +226,8 @@ class VideoStreamBufferControllerFixture
|
||||
DecodeSynchronizer decode_sync_;
|
||||
|
||||
::testing::NiceMock<VCMTimingTest> timing_;
|
||||
::testing::NiceMock<VCMReceiveStatisticsCallbackMock> stats_callback_;
|
||||
::testing::NiceMock<VideoStreamBufferControllerStatsObserverMock>
|
||||
stats_callback_;
|
||||
std::unique_ptr<VideoStreamBufferController> buffer_;
|
||||
|
||||
private:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user