Move ownership of the Channel class to RTCRtpTransceiver

This makes the channel manager object into a factory, not a manager.

Bug: webrtc:13931
Change-Id: I59f7d818a739797a7c0a7a32e6583450834df122
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/260467
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36718}
This commit is contained in:
Harald Alvestrand
2022-04-29 15:04:58 +00:00
committed by WebRTC LUCI CQ
parent 249382e79d
commit 3af79d1768
11 changed files with 135 additions and 190 deletions

View File

@ -11,6 +11,7 @@
#ifndef PC_CHANNEL_INTERFACE_H_
#define PC_CHANNEL_INTERFACE_H_
#include <memory>
#include <string>
#include <vector>
@ -42,8 +43,10 @@ struct MediaConfig;
// ChannelInterface contains methods common to voice and video channels.
// As more methods are added to BaseChannel, they should be included in the
// interface as well.
// TODO(bugs.webrtc.org/13931): Merge this class into RtpTransceiver.
class ChannelInterface {
public:
virtual ~ChannelInterface() = default;
virtual cricket::MediaType media_type() const = 0;
virtual MediaChannel* media_channel() const = 0;
@ -83,14 +86,11 @@ class ChannelInterface {
// * An SrtpTransport for SDES.
// * A DtlsSrtpTransport for DTLS-SRTP.
virtual bool SetRtpTransport(webrtc::RtpTransportInternal* rtp_transport) = 0;
protected:
virtual ~ChannelInterface() = default;
};
class ChannelFactoryInterface {
public:
virtual VideoChannel* CreateVideoChannel(
virtual std::unique_ptr<VideoChannel> CreateVideoChannel(
webrtc::Call* call,
const MediaConfig& media_config,
const std::string& mid,
@ -100,7 +100,7 @@ class ChannelFactoryInterface {
webrtc::VideoBitrateAllocatorFactory*
video_bitrate_allocator_factory) = 0;
virtual VoiceChannel* CreateVoiceChannel(
virtual std::unique_ptr<VoiceChannel> CreateVoiceChannel(
webrtc::Call* call,
const MediaConfig& media_config,
const std::string& mid,
@ -108,8 +108,6 @@ class ChannelFactoryInterface {
const webrtc::CryptoOptions& crypto_options,
const AudioOptions& options) = 0;
virtual void DestroyChannel(ChannelInterface* channel) = 0;
protected:
virtual ~ChannelFactoryInterface() = default;
};