Implement FrameBuffer3Proxy
This emulates behaviour from frame buffer 2, but does not handle stats. In contrast to frame buffer 2, all work happens on the same task queue. FrameBuffer3Proxy encapsulates FrameBuffer3 and scheduler behind a field trial WebRTC-FrameBuffer3. This separates frame scheduling behaviour into a few components, VideoReceiveStreamTimeoutTracker * Handles the stream timeouts. FrameDecodeScheduler * Manages the scheduling and cancelling of frames being sent to the decoder. FrameDecodeTiming * Handles the timing and ordering of frames to be decoded. Other changes * Adds CurrentSize() method to FrameBuffer3 * Move timing to a separate library * Does a thread check for Receive statistics as this is now on the worker thread. * Adds `FlushImmediate` method to RunLoop so that video_receive_stream2_unittest can pass when scheduling is happening on the worker thread. Change-Id: Ia8d2e5650d1708cdc1be3631a5214134583a0721 Bug: webrtc:13343 Tested: Ran webrtc_perf_tests, video_engine_tests, rtc_unittests forcing frame buffer3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/241603 Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> Reviewed-by: Markus Handell <handellm@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Philip Eliasson <philipel@webrtc.org> Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Evan Shrubsole <eshr@webrtc.org> Cr-Commit-Position: refs/heads/main@{#35847}
This commit is contained in:
committed by
WebRTC LUCI CQ
parent
538b76a2f1
commit
9a99905301
@ -180,11 +180,30 @@ rtc_library("frame_buffer") {
|
||||
]
|
||||
}
|
||||
|
||||
rtc_library("video_coding") {
|
||||
visibility = [ "*" ]
|
||||
rtc_library("timing") {
|
||||
sources = [
|
||||
"codec_timer.cc",
|
||||
"codec_timer.h",
|
||||
"timing.cc",
|
||||
"timing.h",
|
||||
]
|
||||
deps = [
|
||||
"../../api/units:time_delta",
|
||||
"../../api/video:video_rtp_headers",
|
||||
"../../rtc_base:macromagic",
|
||||
"../../rtc_base:rtc_numerics",
|
||||
"../../rtc_base/experiments:field_trial_parser",
|
||||
"../../rtc_base/synchronization:mutex",
|
||||
"../../rtc_base/time:timestamp_extrapolator",
|
||||
"../../system_wrappers",
|
||||
"../../system_wrappers:field_trial",
|
||||
]
|
||||
absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
|
||||
}
|
||||
|
||||
rtc_library("video_coding") {
|
||||
visibility = [ "*" ]
|
||||
sources = [
|
||||
"decoder_database.cc",
|
||||
"decoder_database.h",
|
||||
"fec_controller_default.cc",
|
||||
@ -226,8 +245,6 @@ rtc_library("video_coding") {
|
||||
"rtt_filter.h",
|
||||
"timestamp_map.cc",
|
||||
"timestamp_map.h",
|
||||
"timing.cc",
|
||||
"timing.h",
|
||||
"unique_timestamp_counter.cc",
|
||||
"unique_timestamp_counter.h",
|
||||
"video_codec_initializer.cc",
|
||||
@ -241,6 +258,7 @@ rtc_library("video_coding") {
|
||||
":frame_buffer",
|
||||
":frame_helpers",
|
||||
":packet_buffer",
|
||||
":timing",
|
||||
":video_codec_interface",
|
||||
":video_coding_utility",
|
||||
":webrtc_vp9_helpers",
|
||||
@ -351,6 +369,7 @@ rtc_library("video_coding_legacy") {
|
||||
deps = [
|
||||
":codec_globals_headers",
|
||||
":encoded_frame",
|
||||
":timing",
|
||||
":video_codec_interface",
|
||||
":video_coding",
|
||||
"..:module_api",
|
||||
@ -1100,6 +1119,7 @@ if (rtc_include_tests) {
|
||||
":nack_requester",
|
||||
":packet_buffer",
|
||||
":simulcast_test_fixture_impl",
|
||||
":timing",
|
||||
":video_codec_interface",
|
||||
":video_codecs_test_framework",
|
||||
":video_coding",
|
||||
@ -1124,6 +1144,7 @@ if (rtc_include_tests) {
|
||||
"../../api:videocodec_test_fixture_api",
|
||||
"../../api/task_queue:default_task_queue_factory",
|
||||
"../../api/test/video:function_video_factory",
|
||||
"../../api/units:time_delta",
|
||||
"../../api/video:builtin_video_bitrate_allocator_factory",
|
||||
"../../api/video:encoded_frame",
|
||||
"../../api/video:render_resolution",
|
||||
|
||||
@ -177,6 +177,10 @@ int FrameBuffer::GetTotalNumberOfDroppedFrames() const {
|
||||
return num_dropped_frames_;
|
||||
}
|
||||
|
||||
size_t FrameBuffer::CurrentSize() const {
|
||||
return frames_.size();
|
||||
}
|
||||
|
||||
bool FrameBuffer::IsContinuous(const FrameIterator& it) const {
|
||||
for (int64_t reference : GetReferences(it)) {
|
||||
if (decoded_frame_history_.WasDecoded(reference)) {
|
||||
|
||||
@ -57,6 +57,7 @@ class FrameBuffer {
|
||||
|
||||
int GetTotalNumberOfContinuousTemporalUnits() const;
|
||||
int GetTotalNumberOfDroppedFrames() const;
|
||||
size_t CurrentSize() const;
|
||||
|
||||
private:
|
||||
struct FrameInfo {
|
||||
|
||||
Reference in New Issue
Block a user