Move code related to VideoCodingModule to its own build target
The new target, modules/video_coding:video_coding_legacy, is not depended upon by any webrtc non-test code. Bug: webrtc:7408 Change-Id: I94127e2b8b3b8f15917bfa38e602f8face91fcdb Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/152163 Reviewed-by: Philip Eliasson <philipel@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29133}
This commit is contained in:
parent
01b7e929e2
commit
fe407b7a1d
@ -91,13 +91,9 @@ rtc_static_library("video_coding") {
|
||||
"codec_timer.h",
|
||||
"decoder_database.cc",
|
||||
"decoder_database.h",
|
||||
"decoding_state.cc",
|
||||
"decoding_state.h",
|
||||
"fec_controller_default.cc",
|
||||
"fec_controller_default.h",
|
||||
"fec_rate_table.h",
|
||||
"frame_buffer.cc",
|
||||
"frame_buffer.h",
|
||||
"frame_buffer2.cc",
|
||||
"frame_buffer2.h",
|
||||
"frame_object.cc",
|
||||
@ -109,12 +105,9 @@ rtc_static_library("video_coding") {
|
||||
"h264_sps_pps_tracker.cc",
|
||||
"h264_sps_pps_tracker.h",
|
||||
"include/video_codec_initializer.h",
|
||||
"include/video_coding.h",
|
||||
"inter_frame_delay.cc",
|
||||
"inter_frame_delay.h",
|
||||
"internal_defines.h",
|
||||
"jitter_buffer.cc",
|
||||
"jitter_buffer.h",
|
||||
"jitter_buffer_common.h",
|
||||
"jitter_estimator.cc",
|
||||
"jitter_estimator.h",
|
||||
@ -124,22 +117,15 @@ rtc_static_library("video_coding") {
|
||||
"media_opt_util.h",
|
||||
"packet_buffer.cc",
|
||||
"packet_buffer.h",
|
||||
"receiver.cc",
|
||||
"receiver.h",
|
||||
"rtp_frame_reference_finder.cc",
|
||||
"rtp_frame_reference_finder.h",
|
||||
"rtt_filter.cc",
|
||||
"rtt_filter.h",
|
||||
"session_info.cc",
|
||||
"session_info.h",
|
||||
"timestamp_map.cc",
|
||||
"timestamp_map.h",
|
||||
"timing.cc",
|
||||
"timing.h",
|
||||
"video_codec_initializer.cc",
|
||||
"video_coding_impl.cc",
|
||||
"video_coding_impl.h",
|
||||
"video_receiver.cc",
|
||||
"video_receiver2.cc",
|
||||
"video_receiver2.h",
|
||||
]
|
||||
@ -179,7 +165,6 @@ rtc_static_library("video_coding") {
|
||||
"../../rtc_base/third_party/base64",
|
||||
"../../rtc_base/time:timestamp_extrapolator",
|
||||
"../../system_wrappers",
|
||||
"../../system_wrappers:event_wrapper",
|
||||
"../rtp_rtcp:rtp_rtcp_format",
|
||||
"../utility",
|
||||
"//third_party/abseil-cpp/absl/container:inlined_vector",
|
||||
@ -211,6 +196,52 @@ rtc_source_set("video_codec_interface") {
|
||||
|
||||
rtc_source_set("video_coding_legacy") {
|
||||
visibility = [ ":video_coding_unittests" ]
|
||||
sources = [
|
||||
"decoding_state.cc",
|
||||
"decoding_state.h",
|
||||
"frame_buffer.cc",
|
||||
"frame_buffer.h",
|
||||
"include/video_coding.h",
|
||||
"jitter_buffer.cc",
|
||||
"jitter_buffer.h",
|
||||
"receiver.cc",
|
||||
"receiver.h",
|
||||
"session_info.cc",
|
||||
"session_info.h",
|
||||
"video_coding_impl.cc",
|
||||
"video_coding_impl.h",
|
||||
"video_receiver.cc",
|
||||
]
|
||||
deps = [
|
||||
":codec_globals_headers",
|
||||
":encoded_frame",
|
||||
":packet",
|
||||
":video_codec_interface",
|
||||
":video_coding",
|
||||
"..:module_api",
|
||||
"..:module_api_public",
|
||||
"../../api:fec_controller_api",
|
||||
"../../api:rtp_headers",
|
||||
"../../api/video:encoded_image",
|
||||
"../../api/video:video_frame",
|
||||
"../../api/video:video_rtp_headers",
|
||||
"../../api/video_codecs:video_codecs_api",
|
||||
"../../common_video",
|
||||
"../../rtc_base:checks",
|
||||
"../../rtc_base:deprecation",
|
||||
"../../rtc_base:logging",
|
||||
"../../rtc_base:rtc_base_approved",
|
||||
"../../rtc_base/synchronization:sequence_checker",
|
||||
"../../rtc_base/system:fallthrough",
|
||||
"../../system_wrappers",
|
||||
"../../system_wrappers:event_wrapper",
|
||||
"../rtp_rtcp:rtp_rtcp_format",
|
||||
"../rtp_rtcp:rtp_video_header",
|
||||
"../utility",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/types:optional",
|
||||
"//third_party/abseil-cpp/absl/types:variant",
|
||||
]
|
||||
}
|
||||
|
||||
rtc_source_set("codec_globals_headers") {
|
||||
@ -846,6 +877,7 @@ if (rtc_include_tests) {
|
||||
":video_codec_interface",
|
||||
":video_codecs_test_framework",
|
||||
":video_coding",
|
||||
":video_coding_legacy",
|
||||
":video_coding_utility",
|
||||
":videocodec_test_impl",
|
||||
":videocodec_test_stats_impl",
|
||||
|
||||
@ -27,7 +27,6 @@
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/system/fallthrough.h"
|
||||
#include "system_wrappers/include/clock.h"
|
||||
#include "system_wrappers/include/field_trial.h"
|
||||
|
||||
namespace webrtc {
|
||||
// Use this rtt if no value has been reported.
|
||||
|
||||
@ -110,7 +110,7 @@ rtc_source_set("field_trial") {
|
||||
|
||||
rtc_source_set("event_wrapper") {
|
||||
visibility = [
|
||||
"../modules/video_coding",
|
||||
"../modules/video_coding:video_coding_legacy",
|
||||
"../modules/video_coding:video_coding_unittests",
|
||||
]
|
||||
sources = [
|
||||
|
||||
@ -223,6 +223,7 @@ rtc_source_set("video_stream_encoder_impl") {
|
||||
"../rtc_base/synchronization:sequence_checker",
|
||||
"../rtc_base/system:fallthrough",
|
||||
"../rtc_base/task_utils:repeating_task",
|
||||
"../system_wrappers",
|
||||
"../system_wrappers:field_trial",
|
||||
"//third_party/abseil-cpp/absl/algorithm:container",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
|
||||
@ -27,12 +27,12 @@
|
||||
#include "modules/rtp_rtcp/source/rtp_header_extensions.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_packet_received.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_rtcp_config.h"
|
||||
#include "modules/utility/include/process_thread.h"
|
||||
#include "modules/video_coding/frame_object.h"
|
||||
#include "modules/video_coding/h264_sprop_parameter_sets.h"
|
||||
#include "modules/video_coding/h264_sps_pps_tracker.h"
|
||||
#include "modules/video_coding/nack_module.h"
|
||||
#include "modules/video_coding/packet_buffer.h"
|
||||
#include "modules/video_coding/video_coding_impl.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/location.h"
|
||||
#include "rtc_base/logging.h"
|
||||
|
||||
@ -25,7 +25,6 @@
|
||||
#include "api/video_codecs/video_encoder.h"
|
||||
#include "modules/video_coding/codecs/vp9/svc_rate_allocator.h"
|
||||
#include "modules/video_coding/include/video_codec_initializer.h"
|
||||
#include "modules/video_coding/include/video_coding.h"
|
||||
#include "modules/video_coding/utility/default_video_bitrate_allocator.h"
|
||||
#include "rtc_base/arraysize.h"
|
||||
#include "rtc_base/checks.h"
|
||||
@ -67,6 +66,8 @@ const int64_t kFrameRateAvergingWindowSizeMs = (1000 / 30) * 90;
|
||||
|
||||
const size_t kDefaultPayloadSize = 1440;
|
||||
|
||||
const int64_t kParameterUpdateIntervalMs = 1000;
|
||||
|
||||
uint32_t abs_diff(uint32_t a, uint32_t b) {
|
||||
return (a < b) ? b - a : a - b;
|
||||
}
|
||||
@ -1258,7 +1259,7 @@ void VideoStreamEncoder::MaybeEncodeVideoFrame(const VideoFrame& video_frame,
|
||||
last_parameters_update_ms_.emplace(now_ms);
|
||||
} else if (!last_parameters_update_ms_ ||
|
||||
now_ms - *last_parameters_update_ms_ >=
|
||||
vcm::VCMProcessTimer::kDefaultProcessIntervalMs) {
|
||||
kParameterUpdateIntervalMs) {
|
||||
if (last_encoder_rate_settings_) {
|
||||
// Clone rate settings before update, so that SetEncoderRates() will
|
||||
// actually detect the change between the input and
|
||||
|
||||
@ -27,7 +27,6 @@
|
||||
#include "api/video_codecs/video_encoder.h"
|
||||
#include "modules/video_coding/utility/frame_dropper.h"
|
||||
#include "modules/video_coding/utility/quality_scaler.h"
|
||||
#include "modules/video_coding/video_coding_impl.h"
|
||||
#include "rtc_base/critical_section.h"
|
||||
#include "rtc_base/event.h"
|
||||
#include "rtc_base/experiments/balanced_degradation_settings.h"
|
||||
@ -37,6 +36,7 @@
|
||||
#include "rtc_base/rate_statistics.h"
|
||||
#include "rtc_base/synchronization/sequence_checker.h"
|
||||
#include "rtc_base/task_queue.h"
|
||||
#include "system_wrappers/include/clock.h"
|
||||
#include "video/encoder_bitrate_adjuster.h"
|
||||
#include "video/frame_encode_metadata_writer.h"
|
||||
#include "video/overuse_frame_detector.h"
|
||||
|
||||
@ -63,6 +63,7 @@ const uint32_t kLowTargetBitrateBps = kTargetBitrateBps / 10;
|
||||
const int kMaxInitialFramedrop = 4;
|
||||
const int kDefaultFramerate = 30;
|
||||
const int64_t kFrameIntervalMs = rtc::kNumMillisecsPerSec / kDefaultFramerate;
|
||||
const int64_t kProcessIntervalMs = 1000;
|
||||
|
||||
uint8_t optimal_sps[] = {0, 0, 0, 1, H264::NaluType::kSps,
|
||||
0x00, 0x00, 0x03, 0x03, 0xF4,
|
||||
@ -3126,8 +3127,6 @@ TEST_F(VideoStreamEncoderTest, CallsBitrateObserver) {
|
||||
fake_clock_.AdvanceTime(TimeDelta::ms(1) / kDefaultFps);
|
||||
|
||||
// Called after a process interval.
|
||||
const int64_t kProcessIntervalMs =
|
||||
vcm::VCMProcessTimer::kDefaultProcessIntervalMs;
|
||||
EXPECT_CALL(bitrate_observer, OnBitrateAllocationUpdated(expected_bitrate))
|
||||
.Times(1);
|
||||
const int64_t start_time_ms = rtc::TimeMillis();
|
||||
@ -4259,8 +4258,7 @@ TEST_F(VideoStreamEncoderTest, PeriodicallyUpdatesChannelParameters) {
|
||||
EXPECT_EQ(kLowFps, fake_encoder_.GetConfiguredInputFramerate());
|
||||
|
||||
// Insert 30fps frames for just a little more than the forced update period.
|
||||
const int kVcmTimerIntervalFrames =
|
||||
(vcm::VCMProcessTimer::kDefaultProcessIntervalMs * kHighFps) / 1000;
|
||||
const int kVcmTimerIntervalFrames = (kProcessIntervalMs * kHighFps) / 1000;
|
||||
const int kFrameIntervalMs = 1000 / kHighFps;
|
||||
max_framerate_ = kHighFps;
|
||||
for (int i = 0; i < kVcmTimerIntervalFrames + 2; ++i) {
|
||||
@ -4305,9 +4303,8 @@ TEST_F(VideoStreamEncoderTest, DoesNotUpdateBitrateAllocationWhenSuspended) {
|
||||
DataRate::bps(0), 0, 1);
|
||||
|
||||
// Skip ahead until a new periodic parameter update should have occured.
|
||||
timestamp_ms += vcm::VCMProcessTimer::kDefaultProcessIntervalMs;
|
||||
fake_clock_.AdvanceTime(
|
||||
TimeDelta::ms(vcm::VCMProcessTimer::kDefaultProcessIntervalMs));
|
||||
timestamp_ms += kProcessIntervalMs;
|
||||
fake_clock_.AdvanceTime(TimeDelta::ms(kProcessIntervalMs));
|
||||
|
||||
// Bitrate observer should not be called.
|
||||
EXPECT_CALL(bitrate_observer, OnBitrateAllocationUpdated(_)).Times(0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user