Move FrameBuffer3 to api/

The webrtc::VideoStreamDecoderInterface was basically created as a public version of FrameBuffer2, but to hide the complexity of FrameBuffer2 it was also combined with decoding so that the public API could be reasonably simple to use. FrameBuffer3 has a simple API with a clear purpose, so its API can be exposed directly.

Bug: webrtc:14026
Change-Id: I81dc84b869e4d16c5e02feb5c876fbcede3d4a25
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261181
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36781}
This commit is contained in:
philipel 2022-05-05 15:12:13 +02:00 committed by WebRTC LUCI CQ
parent d4d97eb04d
commit 8615bf0582
13 changed files with 58 additions and 48 deletions

View File

@ -1209,6 +1209,7 @@ if (rtc_include_tests) {
"units:time_delta",
"units:timestamp",
"units:units_unittests",
"video:frame_buffer_unittest",
"video:rtp_video_frame_assembler_unittests",
"video:video_unittests",
]

View File

@ -357,6 +357,40 @@ rtc_library("builtin_video_bitrate_allocator_factory") {
absl_deps = [ "//third_party/abseil-cpp/absl/base:core_headers" ]
}
rtc_library("frame_buffer") {
sources = [
"frame_buffer.cc",
"frame_buffer.h",
]
deps = [
"../../api:field_trials_view",
"../../api/units:timestamp",
"../../api/video:encoded_frame",
"../../modules/video_coding:video_coding_utility",
"../../rtc_base:logging",
"../../rtc_base:rtc_numerics",
]
absl_deps = [
"//third_party/abseil-cpp/absl/algorithm:container",
"//third_party/abseil-cpp/absl/container:inlined_vector",
"//third_party/abseil-cpp/absl/types:optional",
]
}
rtc_library("frame_buffer_unittest") {
testonly = true
sources = [ "frame_buffer_unittest.cc" ]
deps = [
":frame_buffer",
"../../api/video:encoded_frame",
"../../test:fake_encoded_frame",
"../../test:field_trial",
"../../test:scoped_key_value_config",
"../../test:test_support",
]
}
if (rtc_include_tests) {
rtc_library("video_unittests") {
testonly = true

View File

@ -53,6 +53,10 @@ specific_include_rules = {
"+modules/rtp_rtcp/source/rtp_packet_received.h",
],
"frame_buffer.h": [
"+modules/video_coding/utility/decoded_frames_history.h",
],
"video_frame_matchers\.h": [
"+test/gmock.h",
],

View File

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/video_coding/frame_buffer3.h"
#include "api/video/frame_buffer.h"
#include <algorithm>

View File

@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef MODULES_VIDEO_CODING_FRAME_BUFFER3_H_
#define MODULES_VIDEO_CODING_FRAME_BUFFER3_H_
#ifndef API_VIDEO_FRAME_BUFFER_H_
#define API_VIDEO_FRAME_BUFFER_H_
#include <map>
#include <memory>
@ -102,4 +102,4 @@ class FrameBuffer {
} // namespace webrtc
#endif // MODULES_VIDEO_CODING_FRAME_BUFFER3_H_
#endif // API_VIDEO_FRAME_BUFFER_H_

View File

@ -7,7 +7,7 @@
* 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/frame_buffer3.h"
#include "api/video/frame_buffer.h"
#include <vector>

View File

@ -162,26 +162,6 @@ rtc_library("frame_helpers") {
absl_deps = [ "//third_party/abseil-cpp/absl/container:inlined_vector" ]
}
rtc_library("frame_buffer") {
sources = [
"frame_buffer3.cc",
"frame_buffer3.h",
]
deps = [
":video_coding_utility",
"../../api:field_trials_view",
"../../api/units:timestamp",
"../../api/video:encoded_frame",
"../../rtc_base:logging",
"../../rtc_base:rtc_numerics",
]
absl_deps = [
"//third_party/abseil-cpp/absl/algorithm:container",
"//third_party/abseil-cpp/absl/container:inlined_vector",
"//third_party/abseil-cpp/absl/types:optional",
]
}
rtc_library("timing") {
sources = [
"codec_timer.cc",
@ -298,7 +278,6 @@ rtc_library("video_coding") {
deps = [
":codec_globals_headers",
":encoded_frame",
":frame_buffer",
":frame_helpers",
":inter_frame_delay",
":jitter_estimator",
@ -1156,7 +1135,6 @@ if (rtc_include_tests) {
"decoding_state_unittest.cc",
"fec_controller_unittest.cc",
"frame_buffer2_unittest.cc",
"frame_buffer3_unittest.cc",
"frame_dependencies_calculator_unittest.cc",
"generic_decoder_unittest.cc",
"h264_packet_buffer_unittest.cc",
@ -1205,7 +1183,6 @@ if (rtc_include_tests) {
":chain_diff_calculator",
":codec_globals_headers",
":encoded_frame",
":frame_buffer",
":frame_dependencies_calculator",
":h264_packet_buffer",
":inter_frame_delay",

View File

@ -612,13 +612,13 @@ webrtc_fuzzer_test("frame_buffer2_fuzzer") {
]
}
webrtc_fuzzer_test("frame_buffer3_fuzzer") {
sources = [ "frame_buffer3_fuzzer.cc" ]
webrtc_fuzzer_test("frame_buffer_fuzzer") {
sources = [ "frame_buffer_fuzzer.cc" ]
deps = [
":fuzz_data_helper",
"../../api:array_view",
"../../api/video:encoded_frame",
"../../modules/video_coding:frame_buffer",
"../../api/video:frame_buffer",
"../../rtc_base:rtc_numerics",
"../../test:scoped_key_value_config",
]
@ -632,9 +632,7 @@ webrtc_fuzzer_test("field_trial_fuzzer") {
webrtc_fuzzer_test("string_to_number_fuzzer") {
sources = [ "string_to_number_fuzzer.cc" ]
deps = [
"../../rtc_base:stringutils",
]
deps = [ "../../rtc_base:stringutils" ]
seed_corpus = "corpora/string_to_number-corpus"
}
@ -670,9 +668,7 @@ webrtc_fuzzer_test("ssl_certificate_fuzzer") {
webrtc_fuzzer_test("vp8_replay_fuzzer") {
sources = [ "vp8_replay_fuzzer.cc" ]
deps = [
"utils:rtp_replayer",
]
deps = [ "utils:rtp_replayer" ]
seed_corpus = "corpora/rtpdump-corpus/vp8"
}
@ -703,8 +699,6 @@ if (rtc_build_libvpx) {
webrtc_fuzzer_test("vp9_replay_fuzzer") {
sources = [ "vp9_replay_fuzzer.cc" ]
deps = [
"utils:rtp_replayer",
]
deps = [ "utils:rtp_replayer" ]
seed_corpus = "corpora/rtpdump-corpus/vp9"
}

View File

@ -10,7 +10,7 @@
#include "api/array_view.h"
#include "api/video/encoded_frame.h"
#include "modules/video_coding/frame_buffer3.h"
#include "api/video/frame_buffer.h"
#include "rtc_base/numerics/sequence_number_util.h"
#include "test/fuzzers/fuzz_data_helper.h"
#include "test/scoped_key_value_config.h"

View File

@ -76,6 +76,7 @@ rtc_library("video") {
"../api/units:time_delta",
"../api/units:timestamp",
"../api/video:encoded_image",
"../api/video:frame_buffer",
"../api/video:recordable_encoded_frame",
"../api/video:video_bitrate_allocation",
"../api/video:video_bitrate_allocator",
@ -100,7 +101,6 @@ rtc_library("video") {
"../modules/rtp_rtcp:rtp_video_header",
"../modules/video_coding",
"../modules/video_coding:codec_globals_headers",
"../modules/video_coding:frame_buffer",
"../modules/video_coding:frame_helpers",
"../modules/video_coding:inter_frame_delay",
"../modules/video_coding:jitter_estimator",
@ -342,9 +342,9 @@ rtc_library("frame_buffer_proxy") {
"../api/task_queue",
"../api/units:data_size",
"../api/video:encoded_frame",
"../api/video:frame_buffer",
"../api/video:video_rtp_headers",
"../modules/video_coding",
"../modules/video_coding:frame_buffer",
"../modules/video_coding:frame_helpers",
"../modules/video_coding:timing",
"../modules/video_coding:video_codec_interface",

View File

@ -19,9 +19,9 @@
#include "api/sequence_checker.h"
#include "api/units/data_size.h"
#include "api/video/encoded_frame.h"
#include "api/video/frame_buffer.h"
#include "api/video/video_content_type.h"
#include "modules/video_coding/frame_buffer2.h"
#include "modules/video_coding/frame_buffer3.h"
#include "modules/video_coding/frame_helpers.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
@ -167,7 +167,7 @@ Timestamp ReceiveTime(const EncodedFrame& frame) {
}
// Encapsulates use of the new frame buffer for use in VideoReceiveStream. This
// behaves the same as the FrameBuffer2Proxy but uses frame_buffer3 instead.
// behaves the same as the FrameBuffer2Proxy but uses frame_buffer instead.
// Responsibilities from frame_buffer2, like stats, jitter and frame timing
// accounting are moved into this pro
class FrameBuffer3Proxy : public FrameBufferProxy {

View File

@ -33,8 +33,8 @@ class FrameSchedulingReceiver {
virtual void OnDecodableFrameTimeout(TimeDelta wait_time) = 0;
};
// Temporary class to enable replacement of frame_buffer2 with frame_buffer3.
// Once frame_buffer3 has shown to work with a field trial, frame_buffer2 will
// Temporary class to enable replacement of frame_buffer2 with frame_buffer.
// Once frame_buffer has shown to work with a field trial, frame_buffer2 will
// be removed and this class should be directly integrated into
// video_receive_stream2. bugs.webrtc.org/13343 tracks this integration.
class FrameBufferProxy {

View File

@ -32,6 +32,7 @@
#include "api/units/time_delta.h"
#include "api/units/timestamp.h"
#include "api/video/encoded_image.h"
#include "api/video/frame_buffer.h"
#include "api/video_codecs/h264_profile_level_id.h"
#include "api/video_codecs/sdp_video_format.h"
#include "api/video_codecs/video_codec.h"
@ -41,7 +42,6 @@
#include "call/rtx_receive_stream.h"
#include "common_video/include/incoming_video_stream.h"
#include "modules/video_coding/frame_buffer2.h"
#include "modules/video_coding/frame_buffer3.h"
#include "modules/video_coding/frame_helpers.h"
#include "modules/video_coding/include/video_codec_interface.h"
#include "modules/video_coding/include/video_coding_defines.h"