Delete ChannelManager class
Bug: webrtc:13931 Change-Id: I331aed0e304f89a0c53d8db20ab2c9733ebbb34c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/263120 Reviewed-by: Florent Castelli <orphis@webrtc.org> Reviewed-by: Henrik Boström <hbos@webrtc.org> Commit-Queue: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#36970}
This commit is contained in:
parent
353d5b243a
commit
485457f050
@ -30,13 +30,6 @@ class VideoMediaChannel;
|
||||
// CompositeMediaEngine.
|
||||
class NullWebRtcVideoEngine : public VideoEngineInterface {
|
||||
public:
|
||||
std::vector<VideoCodec> send_codecs() const override {
|
||||
return std::vector<VideoCodec>();
|
||||
}
|
||||
|
||||
std::vector<VideoCodec> recv_codecs() const override {
|
||||
return std::vector<VideoCodec>();
|
||||
}
|
||||
std::vector<VideoCodec> send_codecs(bool) const override {
|
||||
return std::vector<VideoCodec>();
|
||||
}
|
||||
@ -44,6 +37,13 @@ class NullWebRtcVideoEngine : public VideoEngineInterface {
|
||||
std::vector<VideoCodec> recv_codecs(bool) const override {
|
||||
return std::vector<VideoCodec>();
|
||||
}
|
||||
std::vector<VideoCodec> send_codecs() const override {
|
||||
return std::vector<VideoCodec>();
|
||||
}
|
||||
|
||||
std::vector<VideoCodec> recv_codecs() const override {
|
||||
return std::vector<VideoCodec>();
|
||||
}
|
||||
|
||||
std::vector<webrtc::RtpHeaderExtensionCapability> GetRtpHeaderExtensions()
|
||||
const override {
|
||||
|
||||
@ -1389,6 +1389,8 @@ TEST_F(WebRtcVideoEngineTest, SetVideoRtxEnabled) {
|
||||
std::vector<VideoCodec> send_codecs;
|
||||
std::vector<VideoCodec> recv_codecs;
|
||||
|
||||
webrtc::test::ScopedKeyValueConfig field_trials;
|
||||
|
||||
// Don't want RTX
|
||||
send_codecs = engine_.send_codecs(false);
|
||||
EXPECT_FALSE(HasAnyRtxCodec(send_codecs));
|
||||
|
||||
59
pc/BUILD.gn
59
pc/BUILD.gn
@ -118,53 +118,6 @@ rtc_source_set("channel_interface") {
|
||||
absl_deps = [ "//third_party/abseil-cpp/absl/strings" ]
|
||||
}
|
||||
|
||||
rtc_source_set("channel_factory_interface") {
|
||||
visibility = [ ":*" ]
|
||||
sources = [ "channel_factory_interface.h" ]
|
||||
deps = [
|
||||
"../api:audio_options_api",
|
||||
"../api/crypto:options",
|
||||
"../api/video:video_bitrate_allocator_factory",
|
||||
"../call:call_interfaces",
|
||||
"../media:rtc_media_base",
|
||||
"../media:rtc_media_config",
|
||||
]
|
||||
}
|
||||
|
||||
rtc_source_set("channel_manager") {
|
||||
visibility = [ ":*" ]
|
||||
sources = [
|
||||
"channel_manager.cc",
|
||||
"channel_manager.h",
|
||||
]
|
||||
deps = [
|
||||
":channel",
|
||||
":channel_factory_interface",
|
||||
":channel_interface",
|
||||
":session_description",
|
||||
"../api:audio_options_api",
|
||||
"../api:rtp_parameters",
|
||||
"../api:sequence_checker",
|
||||
"../api/crypto:options",
|
||||
"../api/video:video_bitrate_allocator_factory",
|
||||
"../call:call_interfaces",
|
||||
"../media:rtc_media_base",
|
||||
"../media:rtc_media_config",
|
||||
"../rtc_base",
|
||||
"../rtc_base:checks",
|
||||
"../rtc_base:event_tracer",
|
||||
"../rtc_base:location",
|
||||
"../rtc_base:macromagic",
|
||||
"../rtc_base:threading",
|
||||
"../rtc_base/system:file_wrapper",
|
||||
]
|
||||
absl_deps = [
|
||||
"//third_party/abseil-cpp/absl/algorithm:container",
|
||||
"//third_party/abseil-cpp/absl/memory",
|
||||
"//third_party/abseil-cpp/absl/strings",
|
||||
]
|
||||
}
|
||||
|
||||
rtc_source_set("dtls_srtp_transport") {
|
||||
visibility = [ ":*" ]
|
||||
sources = [
|
||||
@ -357,7 +310,6 @@ rtc_source_set("media_session") {
|
||||
"media_session.h",
|
||||
]
|
||||
deps = [
|
||||
":channel_manager",
|
||||
":jsep_transport",
|
||||
":media_protocol_names",
|
||||
":rtp_media_utils",
|
||||
@ -949,7 +901,6 @@ rtc_library("connection_context") {
|
||||
"connection_context.h",
|
||||
]
|
||||
deps = [
|
||||
":channel_manager",
|
||||
"../api:callfactory_api",
|
||||
"../api:field_trials_view",
|
||||
"../api:libjingle_peerconnection_api",
|
||||
@ -1120,7 +1071,6 @@ rtc_source_set("sdp_offer_answer") {
|
||||
deps = [
|
||||
":channel",
|
||||
":channel_interface",
|
||||
":channel_manager",
|
||||
":connection_context",
|
||||
":data_channel_controller",
|
||||
":dtls_transport",
|
||||
@ -1210,7 +1160,6 @@ rtc_source_set("peer_connection") {
|
||||
deps = [
|
||||
":channel",
|
||||
":channel_interface",
|
||||
":channel_manager",
|
||||
":connection_context",
|
||||
":data_channel_controller",
|
||||
":data_channel_utils",
|
||||
@ -1437,7 +1386,6 @@ rtc_source_set("webrtc_session_description_factory") {
|
||||
"webrtc_session_description_factory.h",
|
||||
]
|
||||
deps = [
|
||||
":channel_manager",
|
||||
":connection_context",
|
||||
":media_session",
|
||||
":sdp_state_provider",
|
||||
@ -1503,7 +1451,6 @@ rtc_source_set("peer_connection_factory") {
|
||||
"peer_connection_factory.h",
|
||||
]
|
||||
deps = [
|
||||
":channel_manager",
|
||||
":local_audio_source",
|
||||
":media_stream_proxy",
|
||||
":media_stream_track_proxy",
|
||||
@ -1597,7 +1544,6 @@ rtc_library("rtp_transceiver") {
|
||||
deps = [
|
||||
":channel",
|
||||
":channel_interface",
|
||||
":channel_manager",
|
||||
":connection_context",
|
||||
":peer_connection_sdp_methods",
|
||||
":proxy",
|
||||
@ -1647,7 +1593,6 @@ rtc_library("rtp_transmission_manager") {
|
||||
":audio_rtp_receiver",
|
||||
":channel",
|
||||
":channel_interface",
|
||||
":channel_manager",
|
||||
":rtp_receiver",
|
||||
":rtp_receiver_proxy",
|
||||
":rtp_sender",
|
||||
@ -2079,7 +2024,6 @@ if (rtc_include_tests && !build_with_chromium) {
|
||||
|
||||
sources = [
|
||||
"audio_rtp_receiver_unittest.cc",
|
||||
"channel_manager_unittest.cc",
|
||||
"channel_unittest.cc",
|
||||
"dtls_srtp_transport_unittest.cc",
|
||||
"dtls_transport_unittest.cc",
|
||||
@ -2109,7 +2053,6 @@ if (rtc_include_tests && !build_with_chromium) {
|
||||
deps = [
|
||||
":audio_rtp_receiver",
|
||||
":channel",
|
||||
":channel_manager",
|
||||
":dtls_srtp_transport",
|
||||
":dtls_transport",
|
||||
":ice_transport",
|
||||
@ -2348,7 +2291,6 @@ if (rtc_include_tests && !build_with_chromium) {
|
||||
":audio_track",
|
||||
":channel",
|
||||
":channel_interface",
|
||||
":channel_manager",
|
||||
":data_channel_controller_unittest",
|
||||
":dtls_srtp_transport",
|
||||
":dtls_transport",
|
||||
@ -2698,7 +2640,6 @@ if (rtc_include_tests && !build_with_chromium) {
|
||||
deps = [
|
||||
":channel",
|
||||
":channel_interface",
|
||||
":channel_manager",
|
||||
":jitter_buffer_delay",
|
||||
":libjingle_peerconnection",
|
||||
":peer_connection_internal",
|
||||
|
||||
@ -1,142 +0,0 @@
|
||||
/*
|
||||
* Copyright 2004 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "pc/channel_manager.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "absl/algorithm/container.h"
|
||||
#include "absl/memory/memory.h"
|
||||
#include "absl/strings/match.h"
|
||||
#include "api/media_types.h"
|
||||
#include "api/sequence_checker.h"
|
||||
#include "media/base/media_constants.h"
|
||||
#include "pc/channel.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/location.h"
|
||||
#include "rtc_base/trace_event.h"
|
||||
|
||||
namespace cricket {
|
||||
|
||||
// static
|
||||
std::unique_ptr<ChannelManager> ChannelManager::Create(
|
||||
MediaEngineInterface* media_engine,
|
||||
rtc::UniqueRandomIdGenerator* ssrc_generator,
|
||||
bool enable_rtx,
|
||||
rtc::Thread* worker_thread,
|
||||
rtc::Thread* network_thread) {
|
||||
RTC_DCHECK(network_thread);
|
||||
RTC_DCHECK(worker_thread);
|
||||
|
||||
return absl::WrapUnique(new ChannelManager(
|
||||
media_engine, ssrc_generator, enable_rtx, worker_thread, network_thread));
|
||||
}
|
||||
|
||||
ChannelManager::ChannelManager(MediaEngineInterface* media_engine,
|
||||
rtc::UniqueRandomIdGenerator* ssrc_generator,
|
||||
bool enable_rtx,
|
||||
rtc::Thread* worker_thread,
|
||||
rtc::Thread* network_thread)
|
||||
: media_engine_(media_engine),
|
||||
ssrc_generator_(ssrc_generator),
|
||||
signaling_thread_(rtc::Thread::Current()),
|
||||
worker_thread_(worker_thread),
|
||||
network_thread_(network_thread) {
|
||||
RTC_DCHECK_RUN_ON(signaling_thread_);
|
||||
RTC_DCHECK(worker_thread_);
|
||||
RTC_DCHECK(network_thread_);
|
||||
|
||||
if (media_engine_) {
|
||||
// TODO(tommi): Change VoiceEngine to do ctor time initialization so that
|
||||
// this isn't necessary.
|
||||
worker_thread_->Invoke<void>(RTC_FROM_HERE, [&] { media_engine_->Init(); });
|
||||
}
|
||||
}
|
||||
|
||||
ChannelManager::~ChannelManager() {
|
||||
RTC_DCHECK_RUN_ON(signaling_thread_);
|
||||
}
|
||||
|
||||
std::unique_ptr<VoiceChannel> ChannelManager::CreateVoiceChannel(
|
||||
webrtc::Call* call,
|
||||
const MediaConfig& media_config,
|
||||
absl::string_view mid,
|
||||
bool srtp_required,
|
||||
const webrtc::CryptoOptions& crypto_options,
|
||||
const AudioOptions& options) {
|
||||
RTC_DCHECK(call);
|
||||
RTC_DCHECK(media_engine_);
|
||||
// TODO(bugs.webrtc.org/11992): Remove this workaround after updates in
|
||||
// PeerConnection and add the expectation that we're already on the right
|
||||
// thread.
|
||||
if (!worker_thread_->IsCurrent()) {
|
||||
return worker_thread_->Invoke<std::unique_ptr<VoiceChannel>>(
|
||||
RTC_FROM_HERE, [&] {
|
||||
return CreateVoiceChannel(call, media_config, mid, srtp_required,
|
||||
crypto_options, options);
|
||||
});
|
||||
}
|
||||
|
||||
RTC_DCHECK_RUN_ON(worker_thread_);
|
||||
|
||||
VoiceMediaChannel* media_channel = media_engine_->voice().CreateMediaChannel(
|
||||
call, media_config, options, crypto_options);
|
||||
if (!media_channel) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto voice_channel = std::make_unique<VoiceChannel>(
|
||||
worker_thread_, network_thread_, signaling_thread_,
|
||||
absl::WrapUnique(media_channel), mid, srtp_required, crypto_options,
|
||||
ssrc_generator_);
|
||||
|
||||
return voice_channel;
|
||||
}
|
||||
|
||||
std::unique_ptr<VideoChannel> ChannelManager::CreateVideoChannel(
|
||||
webrtc::Call* call,
|
||||
const MediaConfig& media_config,
|
||||
absl::string_view mid,
|
||||
bool srtp_required,
|
||||
const webrtc::CryptoOptions& crypto_options,
|
||||
const VideoOptions& options,
|
||||
webrtc::VideoBitrateAllocatorFactory* video_bitrate_allocator_factory) {
|
||||
RTC_DCHECK(call);
|
||||
RTC_DCHECK(media_engine_);
|
||||
// TODO(bugs.webrtc.org/11992): Remove this workaround after updates in
|
||||
// PeerConnection and add the expectation that we're already on the right
|
||||
// thread.
|
||||
if (!worker_thread_->IsCurrent()) {
|
||||
return worker_thread_->Invoke<std::unique_ptr<VideoChannel>>(
|
||||
RTC_FROM_HERE, [&] {
|
||||
return CreateVideoChannel(call, media_config, mid, srtp_required,
|
||||
crypto_options, options,
|
||||
video_bitrate_allocator_factory);
|
||||
});
|
||||
}
|
||||
|
||||
RTC_DCHECK_RUN_ON(worker_thread_);
|
||||
|
||||
VideoMediaChannel* media_channel = media_engine_->video().CreateMediaChannel(
|
||||
call, media_config, options, crypto_options,
|
||||
video_bitrate_allocator_factory);
|
||||
if (!media_channel) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto video_channel = std::make_unique<VideoChannel>(
|
||||
worker_thread_, network_thread_, signaling_thread_,
|
||||
absl::WrapUnique(media_channel), mid, srtp_required, crypto_options,
|
||||
ssrc_generator_);
|
||||
|
||||
return video_channel;
|
||||
}
|
||||
|
||||
} // namespace cricket
|
||||
@ -1,105 +0,0 @@
|
||||
/*
|
||||
* Copyright 2004 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#ifndef PC_CHANNEL_MANAGER_H_
|
||||
#define PC_CHANNEL_MANAGER_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "api/audio_options.h"
|
||||
#include "api/crypto/crypto_options.h"
|
||||
#include "api/rtp_parameters.h"
|
||||
#include "api/video/video_bitrate_allocator_factory.h"
|
||||
#include "call/call.h"
|
||||
#include "media/base/codec.h"
|
||||
#include "media/base/media_channel.h"
|
||||
#include "media/base/media_config.h"
|
||||
#include "media/base/media_engine.h"
|
||||
#include "pc/channel_factory_interface.h"
|
||||
#include "pc/channel_interface.h"
|
||||
#include "pc/session_description.h"
|
||||
#include "rtc_base/system/file_wrapper.h"
|
||||
#include "rtc_base/thread.h"
|
||||
#include "rtc_base/thread_annotations.h"
|
||||
#include "rtc_base/unique_id_generator.h"
|
||||
|
||||
namespace cricket {
|
||||
|
||||
// ChannelManager allows the MediaEngine to run on a separate thread, and takes
|
||||
// care of marshalling calls between threads. It also creates and keeps track of
|
||||
// voice and video channels; by doing so, it can temporarily pause all the
|
||||
// channels when a new audio or video device is chosen. The voice and video
|
||||
// channels are stored in separate vectors, to easily allow operations on just
|
||||
// voice or just video channels.
|
||||
// ChannelManager also allows the application to discover what devices it has
|
||||
// using device manager.
|
||||
class ChannelManager : public ChannelFactoryInterface {
|
||||
public:
|
||||
// Returns an initialized instance of ChannelManager.
|
||||
// If media_engine is non-nullptr, then the returned ChannelManager instance
|
||||
// will own that reference and media engine initialization
|
||||
static std::unique_ptr<ChannelManager> Create(
|
||||
MediaEngineInterface* media_engine,
|
||||
rtc::UniqueRandomIdGenerator* ssrc_generator,
|
||||
bool enable_rtx,
|
||||
rtc::Thread* worker_thread,
|
||||
rtc::Thread* network_thread);
|
||||
|
||||
ChannelManager() = delete;
|
||||
~ChannelManager() override;
|
||||
|
||||
// The operations below all occur on the worker thread.
|
||||
// The caller is responsible for ensuring that destruction happens
|
||||
// on the worker thread.
|
||||
|
||||
// Creates a voice channel, to be associated with the specified session.
|
||||
std::unique_ptr<VoiceChannel> CreateVoiceChannel(
|
||||
webrtc::Call* call,
|
||||
const MediaConfig& media_config,
|
||||
absl::string_view mid,
|
||||
bool srtp_required,
|
||||
const webrtc::CryptoOptions& crypto_options,
|
||||
const AudioOptions& options) override;
|
||||
|
||||
// Creates a video channel, synced with the specified voice channel, and
|
||||
// associated with the specified session.
|
||||
// Version of the above that takes PacketTransportInternal.
|
||||
std::unique_ptr<VideoChannel> CreateVideoChannel(
|
||||
webrtc::Call* call,
|
||||
const MediaConfig& media_config,
|
||||
absl::string_view mid,
|
||||
bool srtp_required,
|
||||
const webrtc::CryptoOptions& crypto_options,
|
||||
const VideoOptions& options,
|
||||
webrtc::VideoBitrateAllocatorFactory* video_bitrate_allocator_factory)
|
||||
override;
|
||||
|
||||
protected:
|
||||
ChannelManager(MediaEngineInterface* media_engine,
|
||||
rtc::UniqueRandomIdGenerator* ssrc_generator_,
|
||||
bool enable_rtx,
|
||||
rtc::Thread* worker_thread,
|
||||
rtc::Thread* network_thread);
|
||||
|
||||
private:
|
||||
MediaEngineInterface* media_engine_; // Nullable.
|
||||
rtc::UniqueRandomIdGenerator* ssrc_generator_;
|
||||
rtc::Thread* const signaling_thread_;
|
||||
rtc::Thread* const worker_thread_;
|
||||
rtc::Thread* const network_thread_;
|
||||
};
|
||||
|
||||
} // namespace cricket
|
||||
|
||||
#endif // PC_CHANNEL_MANAGER_H_
|
||||
@ -1,116 +0,0 @@
|
||||
/*
|
||||
* Copyright 2008 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#include "pc/channel_manager.h"
|
||||
|
||||
#include "api/sequence_checker.h"
|
||||
#include "api/video/builtin_video_bitrate_allocator_factory.h"
|
||||
#include "media/base/fake_media_engine.h"
|
||||
#include "media/base/test_utils.h"
|
||||
#include "media/engine/fake_webrtc_call.h"
|
||||
#include "p2p/base/fake_dtls_transport.h"
|
||||
#include "p2p/base/p2p_constants.h"
|
||||
#include "pc/channel.h"
|
||||
#include "pc/dtls_srtp_transport.h"
|
||||
#include "pc/rtp_transport_internal.h"
|
||||
#include "rtc_base/arraysize.h"
|
||||
#include "rtc_base/checks.h"
|
||||
#include "rtc_base/location.h"
|
||||
#include "rtc_base/thread.h"
|
||||
#include "test/gtest.h"
|
||||
#include "test/scoped_key_value_config.h"
|
||||
|
||||
namespace cricket {
|
||||
namespace {
|
||||
const bool kDefaultSrtpRequired = true;
|
||||
|
||||
static const AudioCodec kAudioCodecs[] = {
|
||||
AudioCodec(97, "voice", 1, 2, 3),
|
||||
AudioCodec(111, "OPUS", 48000, 32000, 2),
|
||||
};
|
||||
|
||||
static const VideoCodec kVideoCodecs[] = {
|
||||
VideoCodec(99, "H264"),
|
||||
VideoCodec(100, "VP8"),
|
||||
VideoCodec(96, "rtx"),
|
||||
};
|
||||
|
||||
std::unique_ptr<MediaEngineInterface> CreateFakeMediaEngine() {
|
||||
auto fme = std::make_unique<FakeMediaEngine>();
|
||||
fme->SetAudioCodecs(MAKE_VECTOR(kAudioCodecs));
|
||||
fme->SetVideoCodecs(MAKE_VECTOR(kVideoCodecs));
|
||||
return fme;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
class ChannelManagerTest : public ::testing::Test {
|
||||
protected:
|
||||
ChannelManagerTest()
|
||||
: network_(rtc::Thread::CreateWithSocketServer()),
|
||||
worker_(rtc::Thread::Current()),
|
||||
video_bitrate_allocator_factory_(
|
||||
webrtc::CreateBuiltinVideoBitrateAllocatorFactory()),
|
||||
media_engine_(CreateFakeMediaEngine()),
|
||||
cm_(cricket::ChannelManager::Create(media_engine_.get(),
|
||||
&ssrc_generator_,
|
||||
false,
|
||||
worker_,
|
||||
network_.get())),
|
||||
fake_call_(worker_, network_.get()) {
|
||||
network_->SetName("Network", this);
|
||||
network_->Start();
|
||||
}
|
||||
|
||||
void TestCreateDestroyChannels(webrtc::RtpTransportInternal* rtp_transport) {
|
||||
RTC_DCHECK_RUN_ON(worker_);
|
||||
std::unique_ptr<cricket::VoiceChannel> voice_channel =
|
||||
cm_->CreateVoiceChannel(&fake_call_, cricket::MediaConfig(),
|
||||
cricket::CN_AUDIO, kDefaultSrtpRequired,
|
||||
webrtc::CryptoOptions(), AudioOptions());
|
||||
ASSERT_TRUE(voice_channel != nullptr);
|
||||
std::unique_ptr<cricket::VideoChannel> video_channel =
|
||||
cm_->CreateVideoChannel(&fake_call_, cricket::MediaConfig(),
|
||||
cricket::CN_VIDEO, kDefaultSrtpRequired,
|
||||
webrtc::CryptoOptions(), VideoOptions(),
|
||||
video_bitrate_allocator_factory_.get());
|
||||
ASSERT_TRUE(video_channel != nullptr);
|
||||
// Destruction is tested by having the owning pointers
|
||||
// go out of scope.
|
||||
}
|
||||
|
||||
rtc::AutoThread main_thread_;
|
||||
std::unique_ptr<rtc::Thread> network_;
|
||||
rtc::Thread* const worker_;
|
||||
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>
|
||||
video_bitrate_allocator_factory_;
|
||||
std::unique_ptr<cricket::MediaEngineInterface> media_engine_;
|
||||
rtc::UniqueRandomIdGenerator ssrc_generator_;
|
||||
std::unique_ptr<cricket::ChannelManager> cm_;
|
||||
cricket::FakeCall fake_call_;
|
||||
webrtc::test::ScopedKeyValueConfig field_trials_;
|
||||
};
|
||||
|
||||
TEST_F(ChannelManagerTest, CreateDestroyChannels) {
|
||||
auto rtp_dtls_transport = std::make_unique<FakeDtlsTransport>(
|
||||
"fake_dtls_transport", cricket::ICE_CANDIDATE_COMPONENT_RTP,
|
||||
network_.get());
|
||||
auto dtls_srtp_transport = std::make_unique<webrtc::DtlsSrtpTransport>(
|
||||
/*rtcp_mux_required=*/true, field_trials_);
|
||||
|
||||
network_->Invoke<void>(
|
||||
RTC_FROM_HERE, [&rtp_dtls_transport, &dtls_srtp_transport] {
|
||||
dtls_srtp_transport->SetDtlsTransports(rtp_dtls_transport.get(),
|
||||
/*rtcp_dtls_transport=*/nullptr);
|
||||
});
|
||||
TestCreateDestroyChannels(dtls_srtp_transport.get());
|
||||
}
|
||||
|
||||
} // namespace cricket
|
||||
@ -16,7 +16,6 @@
|
||||
#include "api/transport/field_trial_based_config.h"
|
||||
#include "media/base/media_engine.h"
|
||||
#include "media/sctp/sctp_transport_factory.h"
|
||||
#include "pc/channel_manager.h"
|
||||
#include "rtc_base/helpers.h"
|
||||
#include "rtc_base/internal/default_socket_server.h"
|
||||
#include "rtc_base/socket_server.h"
|
||||
@ -145,11 +144,6 @@ ConnectionContext::ConnectionContext(
|
||||
default_socket_factory_ =
|
||||
std::make_unique<rtc::BasicPacketSocketFactory>(socket_factory);
|
||||
|
||||
// TODO(bugs.webrtc.org/13931): Delete ChannelManager when functions gone.
|
||||
channel_manager_ = cricket::ChannelManager::Create(
|
||||
media_engine_.get(), &ssrc_generator_,
|
||||
/*enable_rtx=*/true, worker_thread(), network_thread());
|
||||
|
||||
// Set warning levels on the threads, to give warnings when response
|
||||
// may be slower than is expected of the thread.
|
||||
// Since some of the threads may be the same, start with the least
|
||||
@ -158,17 +152,22 @@ ConnectionContext::ConnectionContext(
|
||||
signaling_thread_->SetDispatchWarningMs(100);
|
||||
worker_thread_->SetDispatchWarningMs(30);
|
||||
network_thread_->SetDispatchWarningMs(10);
|
||||
|
||||
if (media_engine_) {
|
||||
// TODO(tommi): Change VoiceEngine to do ctor time initialization so that
|
||||
// this isn't necessary.
|
||||
worker_thread_->Invoke<void>(RTC_FROM_HERE, [&] { media_engine_->Init(); });
|
||||
}
|
||||
}
|
||||
|
||||
ConnectionContext::~ConnectionContext() {
|
||||
RTC_DCHECK_RUN_ON(signaling_thread_);
|
||||
channel_manager_.reset(nullptr);
|
||||
worker_thread_->Invoke<void>(RTC_FROM_HERE, [&] {
|
||||
RTC_DCHECK_RUN_ON(worker_thread());
|
||||
// While `media_engine_` is const throughout the ChannelManager's lifetime,
|
||||
// it requires destruction to happen on the worker thread. Instead of
|
||||
// marking the pointer as non-const, we live with this const_cast<> in the
|
||||
// destructor.
|
||||
// While `media_engine_` is const throughout the ConnectionContext's
|
||||
// lifetime, it requires destruction to happen on the worker thread. Instead
|
||||
// of marking the pointer as non-const, we live with this const_cast<> in
|
||||
// the destructor.
|
||||
const_cast<std::unique_ptr<cricket::MediaEngineInterface>&>(media_engine_)
|
||||
.reset();
|
||||
});
|
||||
@ -182,8 +181,4 @@ ConnectionContext::~ConnectionContext() {
|
||||
rtc::ThreadManager::Instance()->UnwrapCurrentThread();
|
||||
}
|
||||
|
||||
cricket::ChannelManager* ConnectionContext::channel_manager() const {
|
||||
return channel_manager_.get();
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
@ -70,7 +70,6 @@ class ConnectionContext final
|
||||
return sctp_factory_.get();
|
||||
}
|
||||
|
||||
cricket::ChannelManager* channel_manager() const;
|
||||
cricket::MediaEngineInterface* media_engine() const {
|
||||
return media_engine_.get();
|
||||
}
|
||||
@ -128,9 +127,6 @@ class ConnectionContext final
|
||||
// Accessed both on signaling thread and worker thread.
|
||||
std::unique_ptr<FieldTrialsView> const trials_;
|
||||
|
||||
// channel_manager is accessed both on signaling thread and worker thread.
|
||||
// Const after construction, explicitly cleared in destructor.
|
||||
std::unique_ptr<cricket::ChannelManager> channel_manager_;
|
||||
const std::unique_ptr<cricket::MediaEngineInterface> media_engine_;
|
||||
|
||||
// This object should be used to generate any SSRC that is not explicitly
|
||||
|
||||
@ -29,7 +29,6 @@
|
||||
#include "media/base/sdp_video_format_utils.h"
|
||||
#include "media/sctp/sctp_transport_internal.h"
|
||||
#include "p2p/base/p2p_constants.h"
|
||||
#include "pc/channel_manager.h"
|
||||
#include "pc/media_protocol_names.h"
|
||||
#include "pc/rtp_media_utils.h"
|
||||
#include "pc/used_ids.h"
|
||||
|
||||
@ -42,7 +42,6 @@
|
||||
#include "p2p/base/p2p_constants.h"
|
||||
#include "p2p/base/p2p_transport_channel.h"
|
||||
#include "p2p/base/transport_info.h"
|
||||
#include "pc/channel_manager.h"
|
||||
#include "pc/ice_server_parsing.h"
|
||||
#include "pc/rtp_receiver.h"
|
||||
#include "pc/rtp_receiver_proxy.h"
|
||||
|
||||
@ -593,10 +593,6 @@ class PeerConnection : public PeerConnectionInternal,
|
||||
int64_t packet_time_us)>
|
||||
InitializeRtcpCallback();
|
||||
|
||||
cricket::ChannelManager* channel_manager() {
|
||||
return context_->channel_manager();
|
||||
}
|
||||
|
||||
const rtc::scoped_refptr<ConnectionContext> context_;
|
||||
// Field trials active for this PeerConnection is the first of:
|
||||
// a) Specified in PeerConnectionDependencies (owned).
|
||||
|
||||
@ -33,7 +33,6 @@
|
||||
#include "p2p/base/port_allocator.h"
|
||||
#include "p2p/client/basic_port_allocator.h"
|
||||
#include "pc/audio_track.h"
|
||||
#include "pc/channel_manager.h"
|
||||
#include "pc/local_audio_source.h"
|
||||
#include "pc/media_stream.h"
|
||||
#include "pc/media_stream_proxy.h"
|
||||
@ -198,7 +197,6 @@ void PeerConnectionFactory::StopAecDump() {
|
||||
|
||||
cricket::MediaEngineInterface* PeerConnectionFactory::media_engine() const {
|
||||
RTC_DCHECK(context_);
|
||||
RTC_DCHECK(context_->channel_manager());
|
||||
return context_->media_engine();
|
||||
}
|
||||
|
||||
|
||||
@ -139,13 +139,6 @@ class PeerConnectionFactory : public PeerConnectionFactoryInterface {
|
||||
|
||||
bool IsTrialEnabled(absl::string_view key) const;
|
||||
|
||||
cricket::ChannelManager* channel_manager() {
|
||||
return context_->channel_manager();
|
||||
}
|
||||
const cricket::ChannelManager* channel_manager() const {
|
||||
return context_->channel_manager();
|
||||
}
|
||||
|
||||
std::unique_ptr<RtcEventLog> CreateRtcEventLog_w();
|
||||
std::unique_ptr<Call> CreateCall_w(RtcEventLog* event_log,
|
||||
const FieldTrialsView& field_trials);
|
||||
|
||||
@ -52,7 +52,6 @@
|
||||
#include "pc/audio_rtp_receiver.h"
|
||||
#include "pc/audio_track.h"
|
||||
#include "pc/channel.h"
|
||||
#include "pc/channel_manager.h"
|
||||
#include "pc/dtls_srtp_transport.h"
|
||||
#include "pc/local_audio_source.h"
|
||||
#include "pc/media_stream.h"
|
||||
@ -117,36 +116,24 @@ class RtpSenderReceiverTest
|
||||
media_engine_(std::make_unique<cricket::FakeMediaEngine>()),
|
||||
fake_call_(worker_thread_, network_thread_),
|
||||
local_stream_(MediaStream::Create(kStreamId1)) {
|
||||
worker_thread_->Invoke<void>(RTC_FROM_HERE, [&]() {
|
||||
channel_manager_ = cricket::ChannelManager::Create(
|
||||
media_engine_.get(), &ssrc_generator_, false, worker_thread_,
|
||||
network_thread_);
|
||||
});
|
||||
|
||||
bool srtp_required = true;
|
||||
rtp_dtls_transport_ = std::make_unique<cricket::FakeDtlsTransport>(
|
||||
"fake_dtls_transport", cricket::ICE_CANDIDATE_COMPONENT_RTP);
|
||||
rtp_transport_ = CreateDtlsSrtpTransport();
|
||||
|
||||
voice_channel_ = channel_manager_->CreateVoiceChannel(
|
||||
&fake_call_, cricket::MediaConfig(), cricket::CN_AUDIO, srtp_required,
|
||||
webrtc::CryptoOptions(), cricket::AudioOptions());
|
||||
video_channel_ = channel_manager_->CreateVideoChannel(
|
||||
&fake_call_, cricket::MediaConfig(), cricket::CN_VIDEO, srtp_required,
|
||||
webrtc::CryptoOptions(), cricket::VideoOptions(),
|
||||
video_bitrate_allocator_factory_.get());
|
||||
// Create the channels, discard the result; we get them later.
|
||||
// Fake media channels are owned by the media engine.
|
||||
media_engine_->voice().CreateMediaChannel(
|
||||
&fake_call_, cricket::MediaConfig(), cricket::AudioOptions(),
|
||||
webrtc::CryptoOptions());
|
||||
media_engine_->video().CreateMediaChannel(
|
||||
&fake_call_, cricket::MediaConfig(), cricket::VideoOptions(),
|
||||
webrtc::CryptoOptions(), video_bitrate_allocator_factory_.get());
|
||||
|
||||
voice_channel_->SetRtpTransport(rtp_transport_.get());
|
||||
video_channel_->SetRtpTransport(rtp_transport_.get());
|
||||
voice_media_channel_ = absl::WrapUnique(media_engine_->GetVoiceChannel(0));
|
||||
video_media_channel_ = absl::WrapUnique(media_engine_->GetVideoChannel(0));
|
||||
|
||||
voice_channel_->Enable(true);
|
||||
video_channel_->Enable(true);
|
||||
voice_media_channel_ = media_engine_->GetVoiceChannel(0);
|
||||
video_media_channel_ = media_engine_->GetVideoChannel(0);
|
||||
RTC_CHECK(voice_channel_);
|
||||
RTC_CHECK(video_channel_);
|
||||
RTC_CHECK(voice_media_channel_);
|
||||
RTC_CHECK(video_media_channel_);
|
||||
RTC_CHECK(voice_media_channel());
|
||||
RTC_CHECK(video_media_channel());
|
||||
|
||||
// Create streams for predefined SSRCs. Streams need to exist in order
|
||||
// for the senders and receievers to apply parameters to them.
|
||||
@ -178,9 +165,6 @@ class RtpSenderReceiverTest
|
||||
local_stream_ = nullptr;
|
||||
video_track_ = nullptr;
|
||||
audio_track_ = nullptr;
|
||||
|
||||
voice_channel_->SetRtpTransport(nullptr);
|
||||
video_channel_->SetRtpTransport(nullptr);
|
||||
}
|
||||
|
||||
std::unique_ptr<webrtc::RtpTransportInternal> CreateDtlsSrtpTransport() {
|
||||
@ -197,7 +181,7 @@ class RtpSenderReceiverTest
|
||||
const cricket::AudioCodec kTelephoneEventCodec(106, "telephone-event", 8000,
|
||||
0, 1);
|
||||
params.codecs.push_back(kTelephoneEventCodec);
|
||||
voice_media_channel_->SetSendParameters(params);
|
||||
voice_media_channel()->SetSendParameters(params);
|
||||
}
|
||||
|
||||
void AddVideoTrack() { AddVideoTrack(false); }
|
||||
@ -224,7 +208,7 @@ class RtpSenderReceiverTest
|
||||
ASSERT_TRUE(audio_rtp_sender_->SetTrack(audio_track_.get()));
|
||||
EXPECT_CALL(*set_streams_observer, OnSetStreams());
|
||||
audio_rtp_sender_->SetStreams({local_stream_->id()});
|
||||
audio_rtp_sender_->SetMediaChannel(voice_media_channel_);
|
||||
audio_rtp_sender_->SetMediaChannel(voice_media_channel());
|
||||
audio_rtp_sender_->SetSsrc(kAudioSsrc);
|
||||
audio_rtp_sender_->GetOnDestroyedSignal()->connect(
|
||||
this, &RtpSenderReceiverTest::OnAudioSenderDestroyed);
|
||||
@ -234,7 +218,7 @@ class RtpSenderReceiverTest
|
||||
void CreateAudioRtpSenderWithNoTrack() {
|
||||
audio_rtp_sender_ =
|
||||
AudioRtpSender::Create(worker_thread_, /*id=*/"", nullptr, nullptr);
|
||||
audio_rtp_sender_->SetMediaChannel(voice_media_channel_);
|
||||
audio_rtp_sender_->SetMediaChannel(voice_media_channel());
|
||||
}
|
||||
|
||||
void OnAudioSenderDestroyed() { audio_sender_destroyed_signal_fired_ = true; }
|
||||
@ -288,14 +272,14 @@ class RtpSenderReceiverTest
|
||||
ASSERT_TRUE(video_rtp_sender_->SetTrack(video_track_.get()));
|
||||
EXPECT_CALL(*set_streams_observer, OnSetStreams());
|
||||
video_rtp_sender_->SetStreams({local_stream_->id()});
|
||||
video_rtp_sender_->SetMediaChannel(video_media_channel_);
|
||||
video_rtp_sender_->SetMediaChannel(video_media_channel());
|
||||
video_rtp_sender_->SetSsrc(ssrc);
|
||||
VerifyVideoChannelInput(ssrc);
|
||||
}
|
||||
void CreateVideoRtpSenderWithNoTrack() {
|
||||
video_rtp_sender_ =
|
||||
VideoRtpSender::Create(worker_thread_, /*id=*/"", nullptr);
|
||||
video_rtp_sender_->SetMediaChannel(video_media_channel_);
|
||||
video_rtp_sender_->SetMediaChannel(video_media_channel());
|
||||
}
|
||||
|
||||
void DestroyAudioRtpSender() {
|
||||
@ -313,7 +297,7 @@ class RtpSenderReceiverTest
|
||||
audio_rtp_receiver_ = rtc::make_ref_counted<AudioRtpReceiver>(
|
||||
rtc::Thread::Current(), kAudioTrackId, streams,
|
||||
/*is_unified_plan=*/true);
|
||||
audio_rtp_receiver_->SetMediaChannel(voice_media_channel_);
|
||||
audio_rtp_receiver_->SetMediaChannel(voice_media_channel());
|
||||
audio_rtp_receiver_->SetupMediaChannel(kAudioSsrc);
|
||||
audio_track_ = audio_rtp_receiver_->audio_track();
|
||||
VerifyVoiceChannelOutput();
|
||||
@ -323,7 +307,7 @@ class RtpSenderReceiverTest
|
||||
std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams = {}) {
|
||||
video_rtp_receiver_ = rtc::make_ref_counted<VideoRtpReceiver>(
|
||||
rtc::Thread::Current(), kVideoTrackId, streams);
|
||||
video_rtp_receiver_->SetMediaChannel(video_media_channel_);
|
||||
video_rtp_receiver_->SetMediaChannel(video_media_channel());
|
||||
video_rtp_receiver_->SetupMediaChannel(kVideoSsrc);
|
||||
video_track_ = video_rtp_receiver_->video_track();
|
||||
VerifyVideoChannelOutput();
|
||||
@ -343,7 +327,7 @@ class RtpSenderReceiverTest
|
||||
|
||||
video_rtp_receiver_ = rtc::make_ref_counted<VideoRtpReceiver>(
|
||||
rtc::Thread::Current(), kVideoTrackId, streams);
|
||||
video_rtp_receiver_->SetMediaChannel(video_media_channel_);
|
||||
video_rtp_receiver_->SetMediaChannel(video_media_channel());
|
||||
video_rtp_receiver_->SetupMediaChannel(primary_ssrc);
|
||||
video_track_ = video_rtp_receiver_->video_track();
|
||||
}
|
||||
@ -370,8 +354,8 @@ class RtpSenderReceiverTest
|
||||
void VerifyVoiceChannelInput(uint32_t ssrc) {
|
||||
// Verify that the media channel has an audio source, and the stream isn't
|
||||
// muted.
|
||||
EXPECT_TRUE(voice_media_channel_->HasSource(ssrc));
|
||||
EXPECT_FALSE(voice_media_channel_->IsStreamMuted(ssrc));
|
||||
EXPECT_TRUE(voice_media_channel()->HasSource(ssrc));
|
||||
EXPECT_FALSE(voice_media_channel()->IsStreamMuted(ssrc));
|
||||
}
|
||||
|
||||
void VerifyVideoChannelInput() { VerifyVideoChannelInput(kVideoSsrc); }
|
||||
@ -385,7 +369,7 @@ class RtpSenderReceiverTest
|
||||
|
||||
void VerifyVoiceChannelNoInput(uint32_t ssrc) {
|
||||
// Verify that the media channel's source is reset.
|
||||
EXPECT_FALSE(voice_media_channel_->HasSource(ssrc));
|
||||
EXPECT_FALSE(voice_media_channel()->HasSource(ssrc));
|
||||
}
|
||||
|
||||
void VerifyVideoChannelNoInput() { VerifyVideoChannelNoInput(kVideoSsrc); }
|
||||
@ -398,7 +382,7 @@ class RtpSenderReceiverTest
|
||||
void VerifyVoiceChannelOutput() {
|
||||
// Verify that the volume is initialized to 1.
|
||||
double volume;
|
||||
EXPECT_TRUE(voice_media_channel_->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_TRUE(voice_media_channel()->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_EQ(1, volume);
|
||||
}
|
||||
|
||||
@ -410,7 +394,7 @@ class RtpSenderReceiverTest
|
||||
void VerifyVoiceChannelNoOutput() {
|
||||
// Verify that the volume is reset to 0.
|
||||
double volume;
|
||||
EXPECT_TRUE(voice_media_channel_->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_TRUE(voice_media_channel()->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_EQ(0, volume);
|
||||
}
|
||||
|
||||
@ -516,6 +500,13 @@ class RtpSenderReceiverTest
|
||||
}
|
||||
|
||||
protected:
|
||||
cricket::FakeVideoMediaChannel* video_media_channel() {
|
||||
return video_media_channel_.get();
|
||||
}
|
||||
cricket::FakeVoiceMediaChannel* voice_media_channel() {
|
||||
return voice_media_channel_.get();
|
||||
}
|
||||
|
||||
test::RunLoop run_loop_;
|
||||
rtc::Thread* const network_thread_;
|
||||
rtc::Thread* const worker_thread_;
|
||||
@ -528,12 +519,9 @@ class RtpSenderReceiverTest
|
||||
video_bitrate_allocator_factory_;
|
||||
std::unique_ptr<cricket::FakeMediaEngine> media_engine_;
|
||||
rtc::UniqueRandomIdGenerator ssrc_generator_;
|
||||
std::unique_ptr<cricket::ChannelManager> channel_manager_;
|
||||
cricket::FakeCall fake_call_;
|
||||
std::unique_ptr<cricket::VoiceChannel> voice_channel_;
|
||||
std::unique_ptr<cricket::VideoChannel> video_channel_;
|
||||
cricket::FakeVoiceMediaChannel* voice_media_channel_;
|
||||
cricket::FakeVideoMediaChannel* video_media_channel_;
|
||||
std::unique_ptr<cricket::FakeVoiceMediaChannel> voice_media_channel_;
|
||||
std::unique_ptr<cricket::FakeVideoMediaChannel> video_media_channel_;
|
||||
rtc::scoped_refptr<AudioRtpSender> audio_rtp_sender_;
|
||||
rtc::scoped_refptr<VideoRtpSender> video_rtp_sender_;
|
||||
rtc::scoped_refptr<AudioRtpReceiver> audio_rtp_receiver_;
|
||||
@ -590,7 +578,7 @@ TEST_F(RtpSenderReceiverTest, LocalAudioSourceOptionsApplied) {
|
||||
auto source = LocalAudioSource::Create(&options);
|
||||
CreateAudioRtpSender(source);
|
||||
|
||||
EXPECT_EQ(true, voice_media_channel_->options().echo_cancellation);
|
||||
EXPECT_EQ(true, voice_media_channel()->options().echo_cancellation);
|
||||
|
||||
DestroyAudioRtpSender();
|
||||
}
|
||||
@ -601,10 +589,10 @@ TEST_F(RtpSenderReceiverTest, LocalAudioTrackDisable) {
|
||||
CreateAudioRtpSender();
|
||||
|
||||
audio_track_->set_enabled(false);
|
||||
EXPECT_TRUE(voice_media_channel_->IsStreamMuted(kAudioSsrc));
|
||||
EXPECT_TRUE(voice_media_channel()->IsStreamMuted(kAudioSsrc));
|
||||
|
||||
audio_track_->set_enabled(true);
|
||||
EXPECT_FALSE(voice_media_channel_->IsStreamMuted(kAudioSsrc));
|
||||
EXPECT_FALSE(voice_media_channel()->IsStreamMuted(kAudioSsrc));
|
||||
|
||||
DestroyAudioRtpSender();
|
||||
}
|
||||
@ -615,19 +603,19 @@ TEST_F(RtpSenderReceiverTest, RemoteAudioTrackDisable) {
|
||||
CreateAudioRtpReceiver();
|
||||
|
||||
double volume;
|
||||
EXPECT_TRUE(voice_media_channel_->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_TRUE(voice_media_channel()->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_EQ(1, volume);
|
||||
|
||||
// Handling of enable/disable is applied asynchronously.
|
||||
audio_track_->set_enabled(false);
|
||||
run_loop_.Flush();
|
||||
|
||||
EXPECT_TRUE(voice_media_channel_->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_TRUE(voice_media_channel()->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_EQ(0, volume);
|
||||
|
||||
audio_track_->set_enabled(true);
|
||||
run_loop_.Flush();
|
||||
EXPECT_TRUE(voice_media_channel_->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_TRUE(voice_media_channel()->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_EQ(1, volume);
|
||||
|
||||
DestroyAudioRtpReceiver();
|
||||
@ -682,7 +670,7 @@ TEST_F(RtpSenderReceiverTest, RemoteAudioTrackSetVolume) {
|
||||
double volume;
|
||||
audio_track_->GetSource()->SetVolume(0.5);
|
||||
run_loop_.Flush();
|
||||
EXPECT_TRUE(voice_media_channel_->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_TRUE(voice_media_channel()->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_EQ(0.5, volume);
|
||||
|
||||
// Disable the audio track, this should prevent setting the volume.
|
||||
@ -690,19 +678,19 @@ TEST_F(RtpSenderReceiverTest, RemoteAudioTrackSetVolume) {
|
||||
RTC_DCHECK_EQ(worker_thread_, run_loop_.task_queue());
|
||||
run_loop_.Flush();
|
||||
audio_track_->GetSource()->SetVolume(0.8);
|
||||
EXPECT_TRUE(voice_media_channel_->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_TRUE(voice_media_channel()->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_EQ(0, volume);
|
||||
|
||||
// When the track is enabled, the previously set volume should take effect.
|
||||
audio_track_->set_enabled(true);
|
||||
run_loop_.Flush();
|
||||
EXPECT_TRUE(voice_media_channel_->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_TRUE(voice_media_channel()->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_EQ(0.8, volume);
|
||||
|
||||
// Try changing volume one more time.
|
||||
audio_track_->GetSource()->SetVolume(0.9);
|
||||
run_loop_.Flush();
|
||||
EXPECT_TRUE(voice_media_channel_->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_TRUE(voice_media_channel()->GetOutputVolume(kAudioSsrc, &volume));
|
||||
EXPECT_EQ(0.9, volume);
|
||||
|
||||
DestroyAudioRtpReceiver();
|
||||
@ -710,14 +698,14 @@ TEST_F(RtpSenderReceiverTest, RemoteAudioTrackSetVolume) {
|
||||
|
||||
TEST_F(RtpSenderReceiverTest, AudioRtpReceiverDelay) {
|
||||
CreateAudioRtpReceiver();
|
||||
VerifyRtpReceiverDelayBehaviour(voice_media_channel_,
|
||||
VerifyRtpReceiverDelayBehaviour(voice_media_channel(),
|
||||
audio_rtp_receiver_.get(), kAudioSsrc);
|
||||
DestroyAudioRtpReceiver();
|
||||
}
|
||||
|
||||
TEST_F(RtpSenderReceiverTest, VideoRtpReceiverDelay) {
|
||||
CreateVideoRtpReceiver();
|
||||
VerifyRtpReceiverDelayBehaviour(video_media_channel_,
|
||||
VerifyRtpReceiverDelayBehaviour(video_media_channel(),
|
||||
video_rtp_receiver_.get(), kVideoSsrc);
|
||||
DestroyVideoRtpReceiver();
|
||||
}
|
||||
@ -916,8 +904,8 @@ TEST_F(RtpSenderReceiverTest, AudioSenderInitParametersMovedAfterNegotiation) {
|
||||
std::vector<uint32_t> ssrcs(1, 1);
|
||||
cricket::StreamParams stream_params =
|
||||
cricket::CreateSimStreamParams("cname", ssrcs);
|
||||
voice_media_channel_->AddSendStream(stream_params);
|
||||
audio_rtp_sender_->SetMediaChannel(voice_media_channel_);
|
||||
voice_media_channel()->AddSendStream(stream_params);
|
||||
audio_rtp_sender_->SetMediaChannel(voice_media_channel());
|
||||
audio_rtp_sender_->SetSsrc(1);
|
||||
|
||||
params = audio_rtp_sender_->GetParameters();
|
||||
@ -1013,7 +1001,7 @@ TEST_F(RtpSenderReceiverTest, AudioSenderCantSetUnimplementedRtpParameters) {
|
||||
TEST_F(RtpSenderReceiverTest, SetAudioMaxSendBitrate) {
|
||||
CreateAudioRtpSender();
|
||||
|
||||
EXPECT_EQ(-1, voice_media_channel_->max_bps());
|
||||
EXPECT_EQ(-1, voice_media_channel()->max_bps());
|
||||
webrtc::RtpParameters params = audio_rtp_sender_->GetParameters();
|
||||
EXPECT_EQ(1U, params.encodings.size());
|
||||
EXPECT_FALSE(params.encodings[0].max_bitrate_bps);
|
||||
@ -1026,12 +1014,12 @@ TEST_F(RtpSenderReceiverTest, SetAudioMaxSendBitrate) {
|
||||
EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps);
|
||||
|
||||
// Verify that the audio channel received the new parameters.
|
||||
params = voice_media_channel_->GetRtpSendParameters(kAudioSsrc);
|
||||
params = voice_media_channel()->GetRtpSendParameters(kAudioSsrc);
|
||||
EXPECT_EQ(1U, params.encodings.size());
|
||||
EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps);
|
||||
|
||||
// Verify that the global bitrate limit has not been changed.
|
||||
EXPECT_EQ(-1, voice_media_channel_->max_bps());
|
||||
EXPECT_EQ(-1, voice_media_channel()->max_bps());
|
||||
|
||||
DestroyAudioRtpSender();
|
||||
}
|
||||
@ -1051,7 +1039,7 @@ TEST_F(RtpSenderReceiverTest, SetAudioBitratePriority) {
|
||||
EXPECT_EQ(1U, params.encodings.size());
|
||||
EXPECT_EQ(new_bitrate_priority, params.encodings[0].bitrate_priority);
|
||||
|
||||
params = voice_media_channel_->GetRtpSendParameters(kAudioSsrc);
|
||||
params = voice_media_channel()->GetRtpSendParameters(kAudioSsrc);
|
||||
EXPECT_EQ(1U, params.encodings.size());
|
||||
EXPECT_EQ(new_bitrate_priority, params.encodings[0].bitrate_priority);
|
||||
|
||||
@ -1112,8 +1100,8 @@ TEST_F(RtpSenderReceiverTest, VideoSenderInitParametersMovedAfterNegotiation) {
|
||||
ssrcs.push_back(kVideoSsrcSimulcast + i);
|
||||
cricket::StreamParams stream_params =
|
||||
cricket::CreateSimStreamParams("cname", ssrcs);
|
||||
video_media_channel_->AddSendStream(stream_params);
|
||||
video_rtp_sender_->SetMediaChannel(video_media_channel_);
|
||||
video_media_channel()->AddSendStream(stream_params);
|
||||
video_rtp_sender_->SetMediaChannel(video_media_channel());
|
||||
video_rtp_sender_->SetSsrc(kVideoSsrcSimulcast);
|
||||
|
||||
params = video_rtp_sender_->GetParameters();
|
||||
@ -1152,8 +1140,8 @@ TEST_F(RtpSenderReceiverTest,
|
||||
ssrcs.push_back(kVideoSsrcSimulcast + i);
|
||||
cricket::StreamParams stream_params =
|
||||
cricket::CreateSimStreamParams("cname", ssrcs);
|
||||
video_media_channel_->AddSendStream(stream_params);
|
||||
video_rtp_sender_->SetMediaChannel(video_media_channel_);
|
||||
video_media_channel()->AddSendStream(stream_params);
|
||||
video_rtp_sender_->SetMediaChannel(video_media_channel());
|
||||
video_rtp_sender_->SetSsrc(kVideoSsrcSimulcast);
|
||||
|
||||
params = video_rtp_sender_->GetParameters();
|
||||
@ -1370,7 +1358,7 @@ TEST_F(RtpSenderReceiverTest, VideoSenderCantSetReadOnlyEncodingParameters) {
|
||||
TEST_F(RtpSenderReceiverTest, SetVideoMinMaxSendBitrate) {
|
||||
CreateVideoRtpSender();
|
||||
|
||||
EXPECT_EQ(-1, video_media_channel_->max_bps());
|
||||
EXPECT_EQ(-1, video_media_channel()->max_bps());
|
||||
webrtc::RtpParameters params = video_rtp_sender_->GetParameters();
|
||||
EXPECT_EQ(1U, params.encodings.size());
|
||||
EXPECT_FALSE(params.encodings[0].min_bitrate_bps);
|
||||
@ -1386,13 +1374,13 @@ TEST_F(RtpSenderReceiverTest, SetVideoMinMaxSendBitrate) {
|
||||
EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps);
|
||||
|
||||
// Verify that the video channel received the new parameters.
|
||||
params = video_media_channel_->GetRtpSendParameters(kVideoSsrc);
|
||||
params = video_media_channel()->GetRtpSendParameters(kVideoSsrc);
|
||||
EXPECT_EQ(1U, params.encodings.size());
|
||||
EXPECT_EQ(100, params.encodings[0].min_bitrate_bps);
|
||||
EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps);
|
||||
|
||||
// Verify that the global bitrate limit has not been changed.
|
||||
EXPECT_EQ(-1, video_media_channel_->max_bps());
|
||||
EXPECT_EQ(-1, video_media_channel()->max_bps());
|
||||
|
||||
DestroyVideoRtpSender();
|
||||
}
|
||||
@ -1410,7 +1398,7 @@ TEST_F(RtpSenderReceiverTest, SetVideoMinMaxSendBitrateSimulcast) {
|
||||
EXPECT_TRUE(video_rtp_sender_->SetParameters(params).ok());
|
||||
|
||||
// Verify that the video channel received the new parameters.
|
||||
params = video_media_channel_->GetRtpSendParameters(kVideoSsrcSimulcast);
|
||||
params = video_media_channel()->GetRtpSendParameters(kVideoSsrcSimulcast);
|
||||
EXPECT_EQ(kVideoSimulcastLayerCount, params.encodings.size());
|
||||
EXPECT_EQ(100, params.encodings[0].min_bitrate_bps);
|
||||
EXPECT_EQ(1000, params.encodings[0].max_bitrate_bps);
|
||||
@ -1435,7 +1423,7 @@ TEST_F(RtpSenderReceiverTest, SetVideoBitratePriority) {
|
||||
EXPECT_EQ(1U, params.encodings.size());
|
||||
EXPECT_EQ(new_bitrate_priority, params.encodings[0].bitrate_priority);
|
||||
|
||||
params = video_media_channel_->GetRtpSendParameters(kVideoSsrc);
|
||||
params = video_media_channel()->GetRtpSendParameters(kVideoSsrc);
|
||||
EXPECT_EQ(1U, params.encodings.size());
|
||||
EXPECT_EQ(new_bitrate_priority, params.encodings[0].bitrate_priority);
|
||||
|
||||
@ -1459,23 +1447,23 @@ TEST_F(RtpSenderReceiverTest, PropagatesVideoTrackContentHint) {
|
||||
video_track_->set_enabled(true);
|
||||
|
||||
// `video_track_` is not screencast by default.
|
||||
EXPECT_EQ(false, video_media_channel_->options().is_screencast);
|
||||
EXPECT_EQ(false, video_media_channel()->options().is_screencast);
|
||||
// No content hint should be set by default.
|
||||
EXPECT_EQ(VideoTrackInterface::ContentHint::kNone,
|
||||
video_track_->content_hint());
|
||||
// Setting detailed should turn a non-screencast source into screencast mode.
|
||||
video_track_->set_content_hint(VideoTrackInterface::ContentHint::kDetailed);
|
||||
EXPECT_EQ(true, video_media_channel_->options().is_screencast);
|
||||
EXPECT_EQ(true, video_media_channel()->options().is_screencast);
|
||||
// Removing the content hint should turn the track back into non-screencast
|
||||
// mode.
|
||||
video_track_->set_content_hint(VideoTrackInterface::ContentHint::kNone);
|
||||
EXPECT_EQ(false, video_media_channel_->options().is_screencast);
|
||||
EXPECT_EQ(false, video_media_channel()->options().is_screencast);
|
||||
// Setting fluid should remain in non-screencast mode (its default).
|
||||
video_track_->set_content_hint(VideoTrackInterface::ContentHint::kFluid);
|
||||
EXPECT_EQ(false, video_media_channel_->options().is_screencast);
|
||||
EXPECT_EQ(false, video_media_channel()->options().is_screencast);
|
||||
// Setting text should have the same effect as Detailed
|
||||
video_track_->set_content_hint(VideoTrackInterface::ContentHint::kText);
|
||||
EXPECT_EQ(true, video_media_channel_->options().is_screencast);
|
||||
EXPECT_EQ(true, video_media_channel()->options().is_screencast);
|
||||
|
||||
DestroyVideoRtpSender();
|
||||
}
|
||||
@ -1489,22 +1477,22 @@ TEST_F(RtpSenderReceiverTest,
|
||||
video_track_->set_enabled(true);
|
||||
|
||||
// `video_track_` with a screencast source should be screencast by default.
|
||||
EXPECT_EQ(true, video_media_channel_->options().is_screencast);
|
||||
EXPECT_EQ(true, video_media_channel()->options().is_screencast);
|
||||
// No content hint should be set by default.
|
||||
EXPECT_EQ(VideoTrackInterface::ContentHint::kNone,
|
||||
video_track_->content_hint());
|
||||
// Setting fluid should turn a screencast source into non-screencast mode.
|
||||
video_track_->set_content_hint(VideoTrackInterface::ContentHint::kFluid);
|
||||
EXPECT_EQ(false, video_media_channel_->options().is_screencast);
|
||||
EXPECT_EQ(false, video_media_channel()->options().is_screencast);
|
||||
// Removing the content hint should turn the track back into screencast mode.
|
||||
video_track_->set_content_hint(VideoTrackInterface::ContentHint::kNone);
|
||||
EXPECT_EQ(true, video_media_channel_->options().is_screencast);
|
||||
EXPECT_EQ(true, video_media_channel()->options().is_screencast);
|
||||
// Setting detailed should still remain in screencast mode (its default).
|
||||
video_track_->set_content_hint(VideoTrackInterface::ContentHint::kDetailed);
|
||||
EXPECT_EQ(true, video_media_channel_->options().is_screencast);
|
||||
EXPECT_EQ(true, video_media_channel()->options().is_screencast);
|
||||
// Setting text should have the same effect as Detailed
|
||||
video_track_->set_content_hint(VideoTrackInterface::ContentHint::kText);
|
||||
EXPECT_EQ(true, video_media_channel_->options().is_screencast);
|
||||
EXPECT_EQ(true, video_media_channel()->options().is_screencast);
|
||||
|
||||
DestroyVideoRtpSender();
|
||||
}
|
||||
@ -1524,21 +1512,21 @@ TEST_F(RtpSenderReceiverTest,
|
||||
ASSERT_TRUE(video_rtp_sender_->SetTrack(video_track_.get()));
|
||||
EXPECT_CALL(*set_streams_observer, OnSetStreams());
|
||||
video_rtp_sender_->SetStreams({local_stream_->id()});
|
||||
video_rtp_sender_->SetMediaChannel(video_media_channel_);
|
||||
video_rtp_sender_->SetMediaChannel(video_media_channel());
|
||||
video_track_->set_enabled(true);
|
||||
|
||||
// Sender is not ready to send (no SSRC) so no option should have been set.
|
||||
EXPECT_EQ(absl::nullopt, video_media_channel_->options().is_screencast);
|
||||
EXPECT_EQ(absl::nullopt, video_media_channel()->options().is_screencast);
|
||||
|
||||
// Verify that the content hint is accounted for when video_rtp_sender_ does
|
||||
// get enabled.
|
||||
video_rtp_sender_->SetSsrc(kVideoSsrc);
|
||||
EXPECT_EQ(true, video_media_channel_->options().is_screencast);
|
||||
EXPECT_EQ(true, video_media_channel()->options().is_screencast);
|
||||
|
||||
// And removing the hint should go back to false (to verify that false was
|
||||
// default correctly).
|
||||
video_track_->set_content_hint(VideoTrackInterface::ContentHint::kNone);
|
||||
EXPECT_EQ(false, video_media_channel_->options().is_screencast);
|
||||
EXPECT_EQ(false, video_media_channel()->options().is_screencast);
|
||||
|
||||
DestroyVideoRtpSender();
|
||||
}
|
||||
@ -1577,22 +1565,22 @@ TEST_F(RtpSenderReceiverTest, InsertDtmf) {
|
||||
auto dtmf_sender = audio_rtp_sender_->GetDtmfSender();
|
||||
ASSERT_NE(nullptr, dtmf_sender);
|
||||
|
||||
EXPECT_EQ(0U, voice_media_channel_->dtmf_info_queue().size());
|
||||
EXPECT_EQ(0U, voice_media_channel()->dtmf_info_queue().size());
|
||||
|
||||
// Insert DTMF
|
||||
const int expected_duration = 90;
|
||||
dtmf_sender->InsertDtmf("012", expected_duration, 100);
|
||||
|
||||
// Verify
|
||||
ASSERT_EQ_WAIT(3U, voice_media_channel_->dtmf_info_queue().size(),
|
||||
ASSERT_EQ_WAIT(3U, voice_media_channel()->dtmf_info_queue().size(),
|
||||
kDefaultTimeout);
|
||||
const uint32_t send_ssrc =
|
||||
voice_media_channel_->send_streams()[0].first_ssrc();
|
||||
EXPECT_TRUE(CompareDtmfInfo(voice_media_channel_->dtmf_info_queue()[0],
|
||||
voice_media_channel()->send_streams()[0].first_ssrc();
|
||||
EXPECT_TRUE(CompareDtmfInfo(voice_media_channel()->dtmf_info_queue()[0],
|
||||
send_ssrc, 0, expected_duration));
|
||||
EXPECT_TRUE(CompareDtmfInfo(voice_media_channel_->dtmf_info_queue()[1],
|
||||
EXPECT_TRUE(CompareDtmfInfo(voice_media_channel()->dtmf_info_queue()[1],
|
||||
send_ssrc, 1, expected_duration));
|
||||
EXPECT_TRUE(CompareDtmfInfo(voice_media_channel_->dtmf_info_queue()[2],
|
||||
EXPECT_TRUE(CompareDtmfInfo(voice_media_channel()->dtmf_info_queue()[2],
|
||||
send_ssrc, 2, expected_duration));
|
||||
}
|
||||
|
||||
|
||||
@ -17,13 +17,13 @@
|
||||
#include <vector>
|
||||
|
||||
#include "absl/algorithm/container.h"
|
||||
#include "absl/memory/memory.h"
|
||||
#include "api/peer_connection_interface.h"
|
||||
#include "api/rtp_parameters.h"
|
||||
#include "api/sequence_checker.h"
|
||||
#include "media/base/codec.h"
|
||||
#include "media/base/media_constants.h"
|
||||
#include "pc/channel.h"
|
||||
#include "pc/channel_manager.h"
|
||||
#include "pc/rtp_media_utils.h"
|
||||
#include "pc/session_description.h"
|
||||
#include "rtc_base/checks.h"
|
||||
@ -125,7 +125,6 @@ RtpTransceiver::RtpTransceiver(cricket::MediaType media_type,
|
||||
context_(context) {
|
||||
RTC_DCHECK(media_type == cricket::MEDIA_TYPE_AUDIO ||
|
||||
media_type == cricket::MEDIA_TYPE_VIDEO);
|
||||
RTC_DCHECK(context_->channel_manager());
|
||||
}
|
||||
|
||||
RtpTransceiver::RtpTransceiver(
|
||||
@ -144,7 +143,6 @@ RtpTransceiver::RtpTransceiver(
|
||||
RTC_DCHECK(media_type_ == cricket::MEDIA_TYPE_AUDIO ||
|
||||
media_type_ == cricket::MEDIA_TYPE_VIDEO);
|
||||
RTC_DCHECK_EQ(sender->media_type(), receiver->media_type());
|
||||
RTC_DCHECK(context_->channel_manager());
|
||||
senders_.push_back(sender);
|
||||
receivers_.push_back(receiver);
|
||||
}
|
||||
@ -182,19 +180,62 @@ RTCError RtpTransceiver::CreateChannel(
|
||||
// TODO(bugs.webrtc.org/11992): CreateVideoChannel internally switches to
|
||||
// the worker thread. We shouldn't be using the `call_ptr_` hack here but
|
||||
// simply be on the worker thread and use `call_` (update upstream code).
|
||||
new_channel = channel_manager()->CreateVoiceChannel(
|
||||
call_ptr, media_config, mid, srtp_required, crypto_options,
|
||||
audio_options);
|
||||
RTC_DCHECK(call_ptr);
|
||||
RTC_DCHECK(media_engine());
|
||||
// TODO(bugs.webrtc.org/11992): Remove this workaround after updates in
|
||||
// PeerConnection and add the expectation that we're already on the right
|
||||
// thread.
|
||||
new_channel =
|
||||
context()
|
||||
->worker_thread()
|
||||
->Invoke<std::unique_ptr<cricket::VoiceChannel>>(
|
||||
RTC_FROM_HERE, [&]() -> std::unique_ptr<cricket::VoiceChannel> {
|
||||
RTC_DCHECK_RUN_ON(context()->worker_thread());
|
||||
|
||||
cricket::VoiceMediaChannel* media_channel =
|
||||
media_engine()->voice().CreateMediaChannel(
|
||||
call_ptr, media_config, audio_options,
|
||||
crypto_options);
|
||||
if (!media_channel) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto voice_channel = std::make_unique<cricket::VoiceChannel>(
|
||||
context()->worker_thread(), context()->network_thread(),
|
||||
context()->signaling_thread(),
|
||||
absl::WrapUnique(media_channel), mid, srtp_required,
|
||||
crypto_options, context()->ssrc_generator());
|
||||
|
||||
return voice_channel;
|
||||
});
|
||||
} else {
|
||||
RTC_DCHECK_EQ(cricket::MEDIA_TYPE_VIDEO, media_type());
|
||||
|
||||
// TODO(bugs.webrtc.org/11992): CreateVideoChannel internally switches to
|
||||
// the worker thread. We shouldn't be using the `call_ptr_` hack here but
|
||||
// simply be on the worker thread and use `call_` (update upstream code).
|
||||
new_channel = channel_manager()->CreateVideoChannel(
|
||||
call_ptr, media_config, mid, srtp_required, crypto_options,
|
||||
video_options, video_bitrate_allocator_factory);
|
||||
new_channel =
|
||||
context()
|
||||
->worker_thread()
|
||||
->Invoke<std::unique_ptr<cricket::VideoChannel>>(
|
||||
RTC_FROM_HERE, [&]() -> std::unique_ptr<cricket::VideoChannel> {
|
||||
RTC_DCHECK_RUN_ON(context()->worker_thread());
|
||||
cricket::VideoMediaChannel* media_channel =
|
||||
media_engine()->video().CreateMediaChannel(
|
||||
call_ptr, media_config, video_options, crypto_options,
|
||||
video_bitrate_allocator_factory);
|
||||
if (!media_channel) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto video_channel = std::make_unique<cricket::VideoChannel>(
|
||||
context()->worker_thread(), context()->network_thread(),
|
||||
context()->signaling_thread(),
|
||||
absl::WrapUnique(media_channel), mid, srtp_required,
|
||||
crypto_options, context()->ssrc_generator());
|
||||
|
||||
return video_channel;
|
||||
});
|
||||
}
|
||||
if (!new_channel) {
|
||||
// TODO(hta): Must be a better way
|
||||
|
||||
@ -303,9 +303,6 @@ class RtpTransceiver : public RtpTransceiverInterface,
|
||||
cricket::MediaEngineInterface* media_engine() const {
|
||||
return context_->media_engine();
|
||||
}
|
||||
cricket::ChannelManager* channel_manager() const {
|
||||
return context_->channel_manager();
|
||||
}
|
||||
ConnectionContext* context() const { return context_; }
|
||||
void OnFirstPacketReceived();
|
||||
void StopSendingAndReceiving();
|
||||
|
||||
@ -18,7 +18,6 @@
|
||||
#include "api/rtp_transceiver_direction.h"
|
||||
#include "pc/audio_rtp_receiver.h"
|
||||
#include "pc/channel_interface.h"
|
||||
#include "pc/channel_manager.h"
|
||||
#include "pc/stats_collector_interface.h"
|
||||
#include "pc/video_rtp_receiver.h"
|
||||
#include "rtc_base/checks.h"
|
||||
|
||||
@ -41,7 +41,6 @@
|
||||
#include "p2p/base/transport_description_factory.h"
|
||||
#include "p2p/base/transport_info.h"
|
||||
#include "pc/channel_interface.h"
|
||||
#include "pc/channel_manager.h"
|
||||
#include "pc/dtls_transport.h"
|
||||
#include "pc/media_stream.h"
|
||||
#include "pc/media_stream_proxy.h"
|
||||
@ -1249,10 +1248,6 @@ void SdpOfferAnswerHandler::Initialize(
|
||||
|
||||
// ==================================================================
|
||||
// Access to pc_ variables
|
||||
cricket::ChannelManager* SdpOfferAnswerHandler::channel_manager() const {
|
||||
return context_->channel_manager();
|
||||
}
|
||||
|
||||
cricket::MediaEngineInterface* SdpOfferAnswerHandler::media_engine() const {
|
||||
RTC_DCHECK(context_);
|
||||
return context_->media_engine();
|
||||
|
||||
@ -20,7 +20,6 @@
|
||||
|
||||
#include "media/base/fake_media_engine.h"
|
||||
#include "pc/channel.h"
|
||||
#include "pc/channel_manager.h"
|
||||
#include "pc/stream_collection.h"
|
||||
#include "pc/test/fake_data_channel_controller.h"
|
||||
#include "pc/test/fake_peer_connection_base.h"
|
||||
@ -421,20 +420,6 @@ class FakePeerConnectionForStats : public FakePeerConnectionBase {
|
||||
return transceiver;
|
||||
}
|
||||
|
||||
class TestChannelManager : public cricket::ChannelManager {
|
||||
public:
|
||||
TestChannelManager(rtc::Thread* worker, rtc::Thread* network)
|
||||
: cricket::ChannelManager(nullptr,
|
||||
&ssrc_generator_,
|
||||
true,
|
||||
worker,
|
||||
network) {}
|
||||
rtc::UniqueRandomIdGenerator* ssrc_generator() { return &ssrc_generator_; }
|
||||
|
||||
private:
|
||||
rtc::UniqueRandomIdGenerator ssrc_generator_;
|
||||
};
|
||||
|
||||
rtc::Thread* const network_thread_;
|
||||
rtc::Thread* const worker_thread_;
|
||||
rtc::Thread* const signaling_thread_;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user