mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +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:sequence_checker",
|
||||
"../../api/environment",
|
||||
"../../api/transport:field_trial_based_config",
|
||||
"../../api/units:timestamp",
|
||||
"../../api/video:encoded_image",
|
||||
"../../api/video:video_frame",
|
||||
|
@ -350,7 +349,6 @@ rtc_library("video_coding_legacy") {
|
|||
"../../rtc_base:one_time_event",
|
||||
"../../rtc_base:rtc_event",
|
||||
"../../rtc_base:safe_conversions",
|
||||
"../../rtc_base/memory:always_valid_pointer",
|
||||
"../../rtc_base/synchronization:mutex",
|
||||
"../../system_wrappers",
|
||||
"../rtp_rtcp:rtp_rtcp_format",
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include <memory>
|
||||
|
||||
#include "api/environment/environment.h"
|
||||
#include "api/field_trials_view.h"
|
||||
#include "api/video/video_frame.h"
|
||||
#include "api/video_codecs/video_decoder.h"
|
||||
#include "modules/rtp_rtcp/source/rtp_video_header.h"
|
||||
|
@ -22,17 +21,8 @@
|
|||
|
||||
namespace webrtc {
|
||||
|
||||
class Clock;
|
||||
class EncodedImageCallback;
|
||||
class VideoDecoder;
|
||||
class VideoEncoder;
|
||||
struct CodecSpecificInfo;
|
||||
|
||||
class VideoCodingModule {
|
||||
public:
|
||||
[[deprecated]] static VideoCodingModule* Create(
|
||||
Clock* clock,
|
||||
const FieldTrialsView* field_trials = nullptr);
|
||||
[[deprecated]] static std::unique_ptr<VideoCodingModule> CreateDeprecated(
|
||||
const Environment& env);
|
||||
|
||||
|
|
|
@ -15,12 +15,10 @@
|
|||
|
||||
#include "api/field_trials_view.h"
|
||||
#include "api/sequence_checker.h"
|
||||
#include "api/transport/field_trial_based_config.h"
|
||||
#include "api/video/encoded_image.h"
|
||||
#include "modules/video_coding/include/video_codec_interface.h"
|
||||
#include "modules/video_coding/timing/timing.h"
|
||||
#include "rtc_base/logging.h"
|
||||
#include "rtc_base/memory/always_valid_pointer.h"
|
||||
#include "system_wrappers/include/clock.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -175,12 +173,10 @@ namespace {
|
|||
|
||||
class VideoCodingModuleImpl : public VideoCodingModule {
|
||||
public:
|
||||
explicit VideoCodingModuleImpl(Clock* clock,
|
||||
const FieldTrialsView* field_trials)
|
||||
: VideoCodingModule(),
|
||||
field_trials_(field_trials),
|
||||
timing_(new VCMTiming(clock, *field_trials_)),
|
||||
receiver_(clock, timing_.get(), *field_trials_) {}
|
||||
explicit VideoCodingModuleImpl(const Environment& env)
|
||||
: env_(env),
|
||||
timing_(&env_.clock(), env_.field_trials()),
|
||||
receiver_(&env_.clock(), &timing_, env_.field_trials()) {}
|
||||
|
||||
~VideoCodingModuleImpl() override = default;
|
||||
|
||||
|
@ -234,27 +230,18 @@ class VideoCodingModuleImpl : public VideoCodingModule {
|
|||
}
|
||||
|
||||
private:
|
||||
AlwaysValidPointer<const FieldTrialsView, FieldTrialBasedConfig>
|
||||
field_trials_;
|
||||
const Environment env_;
|
||||
SequenceChecker construction_thread_;
|
||||
const std::unique_ptr<VCMTiming> timing_;
|
||||
VCMTiming timing_;
|
||||
vcm::VideoReceiver receiver_;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
// DEPRECATED. Create method for current interface, will be removed when the
|
||||
// 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(
|
||||
const Environment& env) {
|
||||
return std::make_unique<VideoCodingModuleImpl>(&env.clock(),
|
||||
&env.field_trials());
|
||||
return std::make_unique<VideoCodingModuleImpl>(env);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
|
Loading…
Reference in a new issue