diff --git a/api/BUILD.gn b/api/BUILD.gn index fff851bef1..1b47ee8954 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -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", ] diff --git a/api/video/BUILD.gn b/api/video/BUILD.gn index f30125f1b7..6057a7386d 100644 --- a/api/video/BUILD.gn +++ b/api/video/BUILD.gn @@ -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 diff --git a/api/video/DEPS b/api/video/DEPS index 1c9815c847..967b8e7f9d 100644 --- a/api/video/DEPS +++ b/api/video/DEPS @@ -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", ], diff --git a/modules/video_coding/frame_buffer3.cc b/api/video/frame_buffer.cc similarity index 99% rename from modules/video_coding/frame_buffer3.cc rename to api/video/frame_buffer.cc index 3c26380e45..67d5f6787f 100644 --- a/modules/video_coding/frame_buffer3.cc +++ b/api/video/frame_buffer.cc @@ -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 diff --git a/modules/video_coding/frame_buffer3.h b/api/video/frame_buffer.h similarity index 96% rename from modules/video_coding/frame_buffer3.h rename to api/video/frame_buffer.h index aef26d4f23..5ab88c50ee 100644 --- a/modules/video_coding/frame_buffer3.h +++ b/api/video/frame_buffer.h @@ -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 #include @@ -102,4 +102,4 @@ class FrameBuffer { } // namespace webrtc -#endif // MODULES_VIDEO_CODING_FRAME_BUFFER3_H_ +#endif // API_VIDEO_FRAME_BUFFER_H_ diff --git a/modules/video_coding/frame_buffer3_unittest.cc b/api/video/frame_buffer_unittest.cc similarity index 99% rename from modules/video_coding/frame_buffer3_unittest.cc rename to api/video/frame_buffer_unittest.cc index 305471ffc2..41a486f192 100644 --- a/modules/video_coding/frame_buffer3_unittest.cc +++ b/api/video/frame_buffer_unittest.cc @@ -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 diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index 88bd0799b2..cf2cb9f2d5 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -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", diff --git a/test/fuzzers/BUILD.gn b/test/fuzzers/BUILD.gn index a76b353c71..c2f21ecf3c 100644 --- a/test/fuzzers/BUILD.gn +++ b/test/fuzzers/BUILD.gn @@ -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" } diff --git a/test/fuzzers/frame_buffer3_fuzzer.cc b/test/fuzzers/frame_buffer_fuzzer.cc similarity index 98% rename from test/fuzzers/frame_buffer3_fuzzer.cc rename to test/fuzzers/frame_buffer_fuzzer.cc index b57be4af70..ea009938d0 100644 --- a/test/fuzzers/frame_buffer3_fuzzer.cc +++ b/test/fuzzers/frame_buffer_fuzzer.cc @@ -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" diff --git a/video/BUILD.gn b/video/BUILD.gn index 68dcfdd1ba..51e846c677 100644 --- a/video/BUILD.gn +++ b/video/BUILD.gn @@ -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", diff --git a/video/frame_buffer_proxy.cc b/video/frame_buffer_proxy.cc index 4091c1c384..79b8ff9826 100644 --- a/video/frame_buffer_proxy.cc +++ b/video/frame_buffer_proxy.cc @@ -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 { diff --git a/video/frame_buffer_proxy.h b/video/frame_buffer_proxy.h index e01b28cab8..1498d3e330 100644 --- a/video/frame_buffer_proxy.h +++ b/video/frame_buffer_proxy.h @@ -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 { diff --git a/video/video_receive_stream2.cc b/video/video_receive_stream2.cc index 873fa3d964..890edc621d 100644 --- a/video/video_receive_stream2.cc +++ b/video/video_receive_stream2.cc @@ -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"