mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 13:50:40 +01:00
Remove VideoCodingModule dependency on the global field trial string
Environment provides non-null interface for FieldTrialsView and thus VideoCodingModule no longer need to rely on FieldTrialBasedConfig class to provide field_trials when not passed at construction. Bug: webrtc:10335 Change-Id: Iedfb29e8b29056618a85f2e7a1528da29e3be5c1 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347701 Auto-Submit: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Philip Eliasson <philipel@webrtc.org> Commit-Queue: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42163}
This commit is contained in:
parent
af3dfd8c35
commit
e92b143eea
3 changed files with 7 additions and 32 deletions
|
@ -334,7 +334,6 @@ rtc_library("video_coding_legacy") {
|
||||||
"../../api:rtp_packet_info",
|
"../../api:rtp_packet_info",
|
||||||
"../../api:sequence_checker",
|
"../../api:sequence_checker",
|
||||||
"../../api/environment",
|
"../../api/environment",
|
||||||
"../../api/transport:field_trial_based_config",
|
|
||||||
"../../api/units:timestamp",
|
"../../api/units:timestamp",
|
||||||
"../../api/video:encoded_image",
|
"../../api/video:encoded_image",
|
||||||
"../../api/video:video_frame",
|
"../../api/video:video_frame",
|
||||||
|
@ -350,7 +349,6 @@ rtc_library("video_coding_legacy") {
|
||||||
"../../rtc_base:one_time_event",
|
"../../rtc_base:one_time_event",
|
||||||
"../../rtc_base:rtc_event",
|
"../../rtc_base:rtc_event",
|
||||||
"../../rtc_base:safe_conversions",
|
"../../rtc_base:safe_conversions",
|
||||||
"../../rtc_base/memory:always_valid_pointer",
|
|
||||||
"../../rtc_base/synchronization:mutex",
|
"../../rtc_base/synchronization:mutex",
|
||||||
"../../system_wrappers",
|
"../../system_wrappers",
|
||||||
"../rtp_rtcp:rtp_rtcp_format",
|
"../rtp_rtcp:rtp_rtcp_format",
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "api/environment/environment.h"
|
#include "api/environment/environment.h"
|
||||||
#include "api/field_trials_view.h"
|
|
||||||
#include "api/video/video_frame.h"
|
#include "api/video/video_frame.h"
|
||||||
#include "api/video_codecs/video_decoder.h"
|
#include "api/video_codecs/video_decoder.h"
|
||||||
#include "modules/rtp_rtcp/source/rtp_video_header.h"
|
#include "modules/rtp_rtcp/source/rtp_video_header.h"
|
||||||
|
@ -22,17 +21,8 @@
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
class Clock;
|
|
||||||
class EncodedImageCallback;
|
|
||||||
class VideoDecoder;
|
|
||||||
class VideoEncoder;
|
|
||||||
struct CodecSpecificInfo;
|
|
||||||
|
|
||||||
class VideoCodingModule {
|
class VideoCodingModule {
|
||||||
public:
|
public:
|
||||||
[[deprecated]] static VideoCodingModule* Create(
|
|
||||||
Clock* clock,
|
|
||||||
const FieldTrialsView* field_trials = nullptr);
|
|
||||||
[[deprecated]] static std::unique_ptr<VideoCodingModule> CreateDeprecated(
|
[[deprecated]] static std::unique_ptr<VideoCodingModule> CreateDeprecated(
|
||||||
const Environment& env);
|
const Environment& env);
|
||||||
|
|
||||||
|
|
|
@ -15,12 +15,10 @@
|
||||||
|
|
||||||
#include "api/field_trials_view.h"
|
#include "api/field_trials_view.h"
|
||||||
#include "api/sequence_checker.h"
|
#include "api/sequence_checker.h"
|
||||||
#include "api/transport/field_trial_based_config.h"
|
|
||||||
#include "api/video/encoded_image.h"
|
#include "api/video/encoded_image.h"
|
||||||
#include "modules/video_coding/include/video_codec_interface.h"
|
#include "modules/video_coding/include/video_codec_interface.h"
|
||||||
#include "modules/video_coding/timing/timing.h"
|
#include "modules/video_coding/timing/timing.h"
|
||||||
#include "rtc_base/logging.h"
|
#include "rtc_base/logging.h"
|
||||||
#include "rtc_base/memory/always_valid_pointer.h"
|
|
||||||
#include "system_wrappers/include/clock.h"
|
#include "system_wrappers/include/clock.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
@ -175,12 +173,10 @@ namespace {
|
||||||
|
|
||||||
class VideoCodingModuleImpl : public VideoCodingModule {
|
class VideoCodingModuleImpl : public VideoCodingModule {
|
||||||
public:
|
public:
|
||||||
explicit VideoCodingModuleImpl(Clock* clock,
|
explicit VideoCodingModuleImpl(const Environment& env)
|
||||||
const FieldTrialsView* field_trials)
|
: env_(env),
|
||||||
: VideoCodingModule(),
|
timing_(&env_.clock(), env_.field_trials()),
|
||||||
field_trials_(field_trials),
|
receiver_(&env_.clock(), &timing_, env_.field_trials()) {}
|
||||||
timing_(new VCMTiming(clock, *field_trials_)),
|
|
||||||
receiver_(clock, timing_.get(), *field_trials_) {}
|
|
||||||
|
|
||||||
~VideoCodingModuleImpl() override = default;
|
~VideoCodingModuleImpl() override = default;
|
||||||
|
|
||||||
|
@ -234,27 +230,18 @@ class VideoCodingModuleImpl : public VideoCodingModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AlwaysValidPointer<const FieldTrialsView, FieldTrialBasedConfig>
|
const Environment env_;
|
||||||
field_trials_;
|
|
||||||
SequenceChecker construction_thread_;
|
SequenceChecker construction_thread_;
|
||||||
const std::unique_ptr<VCMTiming> timing_;
|
VCMTiming timing_;
|
||||||
vcm::VideoReceiver receiver_;
|
vcm::VideoReceiver receiver_;
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
// DEPRECATED. Create method for current interface, will be removed when the
|
// DEPRECATED. Create method for current interface, will be removed when the
|
||||||
// new jitter buffer is in place.
|
// new jitter buffer is in place.
|
||||||
VideoCodingModule* VideoCodingModule::Create(
|
|
||||||
Clock* clock,
|
|
||||||
const FieldTrialsView* field_trials) {
|
|
||||||
RTC_DCHECK(clock);
|
|
||||||
return new VideoCodingModuleImpl(clock, field_trials);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::unique_ptr<VideoCodingModule> VideoCodingModule::CreateDeprecated(
|
std::unique_ptr<VideoCodingModule> VideoCodingModule::CreateDeprecated(
|
||||||
const Environment& env) {
|
const Environment& env) {
|
||||||
return std::make_unique<VideoCodingModuleImpl>(&env.clock(),
|
return std::make_unique<VideoCodingModuleImpl>(env);
|
||||||
&env.field_trials());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace webrtc
|
} // namespace webrtc
|
||||||
|
|
Loading…
Reference in a new issue