Delete deprecated cricket::CreateMediaEngine

Bug: webrtc:15574
Change-Id: I98ec7130585b002e64d8eac4b6d75113e96252d2
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/329780
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41317}
This commit is contained in:
Danil Chapovalov 2023-12-04 12:30:15 +01:00 committed by WebRTC LUCI CQ
parent e79e722834
commit 61c5e86dca
2 changed files with 0 additions and 79 deletions

View file

@ -12,53 +12,16 @@
#include <algorithm>
#include <map>
#include <memory>
#include <string>
#include <utility>
#include "absl/algorithm/container.h"
#include "absl/strings/match.h"
#include "api/transport/field_trial_based_config.h"
#include "media/base/media_constants.h"
#include "media/engine/webrtc_voice_engine.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
#ifdef HAVE_WEBRTC_VIDEO
#include "media/engine/webrtc_video_engine.h"
#else
#include "media/engine/null_webrtc_video_engine.h"
#endif
namespace cricket {
std::unique_ptr<MediaEngineInterface> CreateMediaEngine(
MediaEngineDependencies dependencies) {
// TODO(sprang): Make populating `dependencies.trials` mandatory and remove
// these fallbacks.
std::unique_ptr<webrtc::FieldTrialsView> fallback_trials(
dependencies.trials ? nullptr : new webrtc::FieldTrialBasedConfig());
const webrtc::FieldTrialsView& trials =
dependencies.trials ? *dependencies.trials : *fallback_trials;
auto audio_engine = std::make_unique<WebRtcVoiceEngine>(
dependencies.task_queue_factory, dependencies.adm.get(),
std::move(dependencies.audio_encoder_factory),
std::move(dependencies.audio_decoder_factory),
std::move(dependencies.audio_mixer),
std::move(dependencies.audio_processing),
std::move(dependencies.owned_audio_frame_processor), trials);
#ifdef HAVE_WEBRTC_VIDEO
auto video_engine = std::make_unique<WebRtcVideoEngine>(
std::move(dependencies.video_encoder_factory),
std::move(dependencies.video_decoder_factory), trials);
#else
auto video_engine = std::make_unique<NullWebRtcVideoEngine>();
#endif
return std::make_unique<CompositeMediaEngine>(std::move(fallback_trials),
std::move(audio_engine),
std::move(video_engine));
}
namespace {
// Remove mutually exclusive extensions with lower priority.
void DiscardRedundantExtensions(

View file

@ -11,59 +11,17 @@
#ifndef MEDIA_ENGINE_WEBRTC_MEDIA_ENGINE_H_
#define MEDIA_ENGINE_WEBRTC_MEDIA_ENGINE_H_
#include <memory>
#include <vector>
#include "absl/strings/string_view.h"
#include "api/array_view.h"
#include "api/audio/audio_frame_processor.h"
#include "api/audio/audio_mixer.h"
#include "api/audio_codecs/audio_decoder_factory.h"
#include "api/audio_codecs/audio_encoder_factory.h"
#include "api/field_trials_view.h"
#include "api/rtp_parameters.h"
#include "api/scoped_refptr.h"
#include "api/task_queue/task_queue_factory.h"
#include "api/transport/bitrate_settings.h"
#include "api/video_codecs/video_decoder_factory.h"
#include "api/video_codecs/video_encoder_factory.h"
#include "media/base/codec.h"
#include "media/base/media_engine.h"
#include "modules/audio_device/include/audio_device.h"
#include "modules/audio_processing/include/audio_processing.h"
#include "rtc_base/system/rtc_export.h"
namespace cricket {
struct MediaEngineDependencies {
MediaEngineDependencies() = default;
MediaEngineDependencies(const MediaEngineDependencies&) = delete;
MediaEngineDependencies(MediaEngineDependencies&&) = default;
MediaEngineDependencies& operator=(const MediaEngineDependencies&) = delete;
MediaEngineDependencies& operator=(MediaEngineDependencies&&) = default;
~MediaEngineDependencies() = default;
webrtc::TaskQueueFactory* task_queue_factory = nullptr;
rtc::scoped_refptr<webrtc::AudioDeviceModule> adm;
rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory;
rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory;
rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer;
rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing;
std::unique_ptr<webrtc::AudioFrameProcessor> owned_audio_frame_processor;
std::unique_ptr<webrtc::VideoEncoderFactory> video_encoder_factory;
std::unique_ptr<webrtc::VideoDecoderFactory> video_decoder_factory;
const webrtc::FieldTrialsView* trials = nullptr;
};
// CreateMediaEngine may be called on any thread, though the engine is
// only expected to be used on one thread, internally called the "worker
// thread". This is the thread Init must be called on.
[[deprecated("bugs.webrtc.org/15574")]] //
RTC_EXPORT std::unique_ptr<MediaEngineInterface>
CreateMediaEngine(MediaEngineDependencies dependencies);
// Verify that extension IDs are within 1-byte extension range and are not
// overlapping, and that they form a legal change from previously registerd
// extensions (if any).