Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(264)

Unified Diff: talk/session/media/channel.h

Issue 1246913005: TransportController refactoring (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: minor cleanup Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: talk/session/media/channel.h
diff --git a/talk/session/media/channel.h b/talk/session/media/channel.h
index 420141c0003a32133d2e504bc32905542dfc1588..6dd4decdda5b3dc3db736b7e49be666bb098be25 100644
--- a/talk/session/media/channel.h
+++ b/talk/session/media/channel.h
@@ -30,12 +30,15 @@
#include <string>
#include <vector>
+#include <map>
+#include <set>
+#include <utility>
#include "talk/media/base/mediachannel.h"
#include "talk/media/base/mediaengine.h"
#include "talk/media/base/streamparams.h"
#include "talk/media/base/videocapturer.h"
-#include "webrtc/p2p/base/session.h"
+#include "webrtc/p2p/base/transportcontroller.h"
#include "webrtc/p2p/client/socketmonitor.h"
#include "talk/session/media/audiomonitor.h"
#include "talk/session/media/bundlefilter.h"
@@ -76,8 +79,11 @@ class BaseChannel
public MediaChannel::NetworkInterface,
public ConnectionStatsGetter {
public:
- BaseChannel(rtc::Thread* thread, MediaChannel* channel, BaseSession* session,
- const std::string& content_name, bool rtcp);
+ BaseChannel(rtc::Thread* thread,
+ MediaChannel* channel,
+ TransportController* transport_controller,
+ const std::string& content_name,
+ bool rtcp);
virtual ~BaseChannel();
bool Init();
// Deinit may be called multiple times and is simply ignored if it's alreay
@@ -85,8 +91,8 @@ class BaseChannel
void Deinit();
rtc::Thread* worker_thread() const { return worker_thread_; }
- BaseSession* session() const { return session_; }
- const std::string& content_name() { return content_name_; }
+ const std::string& content_name() const { return content_name_; }
+ const std::string& transport_name() const { return transport_name_; }
TransportChannel* transport_channel() const {
return transport_channel_;
}
@@ -112,6 +118,7 @@ class BaseChannel
// description doesn't support RTCP mux, setting the remote
// description will fail.
void ActivateRtcpMux();
+ bool SetTransport(const std::string& transport_name);
bool PushdownLocalDescription(const SessionDescription* local_desc,
ContentAction action,
std::string* error_desc);
@@ -141,7 +148,7 @@ class BaseChannel
void StartConnectionMonitor(int cms);
void StopConnectionMonitor();
// For ConnectionStatsGetter, used by ConnectionMonitor
- virtual bool GetConnectionStats(ConnectionInfos* infos) override;
+ bool GetConnectionStats(ConnectionInfos* infos) override;
void set_srtp_signal_silent_time(uint32 silent_time) {
srtp_filter_.set_signal_silent_time(silent_time);
@@ -178,8 +185,8 @@ class BaseChannel
// |rtcp| is false, set rtcp_transport_channel_ is set to NULL. Get
// the transport channels from |session|.
// TODO(pthatcher): Pass in a Transport instead of a BaseSession.
- bool SetTransportChannels(BaseSession* session, bool rtcp);
- bool SetTransportChannels_w(BaseSession* session, bool rtcp);
+ bool SetTransportChannels(const std::string& transport_name, bool rtcp);
+ bool SetTransportChannels_w(const std::string& transport_name, bool rtcp);
void set_transport_channel(TransportChannel* transport);
void set_rtcp_transport_channel(TransportChannel* transport);
bool was_ever_writable() const { return was_ever_writable_; }
@@ -191,7 +198,9 @@ class BaseChannel
}
bool IsReadyToReceive() const;
bool IsReadyToSend() const;
- rtc::Thread* signaling_thread() { return session_->signaling_thread(); }
+ rtc::Thread* signaling_thread() {
+ return transport_controller_->signaling_thread();
+ }
SrtpFilter* srtp_filter() { return &srtp_filter_; }
bool rtcp() const { return rtcp_; }
@@ -223,10 +232,6 @@ class BaseChannel
void HandlePacket(bool rtcp, rtc::Buffer* packet,
const rtc::PacketTime& packet_time);
- // Apply the new local/remote session description.
- void OnNewLocalDescription(BaseSession* session, ContentAction action);
- void OnNewRemoteDescription(BaseSession* session, ContentAction action);
-
void EnableMedia_w();
void DisableMedia_w();
virtual bool MuteStream_w(uint32 ssrc, bool mute);
@@ -310,15 +315,18 @@ class BaseChannel
private:
rtc::Thread* worker_thread_;
- BaseSession* session_;
+ TransportController* transport_controller_;
MediaChannel* media_channel_;
std::vector<StreamParams> local_streams_;
std::vector<StreamParams> remote_streams_;
const std::string content_name_;
+ std::string transport_name_;
bool rtcp_;
TransportChannel* transport_channel_;
+ std::vector<std::pair<rtc::Socket::Option, int> > socket_options_;
TransportChannel* rtcp_transport_channel_;
+ std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_;
SrtpFilter srtp_filter_;
RtcpMuxFilter rtcp_mux_filter_;
BundleFilter bundle_filter_;
@@ -341,9 +349,12 @@ class BaseChannel
// and input/output level monitoring.
class VoiceChannel : public BaseChannel {
public:
- VoiceChannel(rtc::Thread* thread, MediaEngineInterface* media_engine,
- VoiceMediaChannel* channel, BaseSession* session,
- const std::string& content_name, bool rtcp);
+ VoiceChannel(rtc::Thread* thread,
+ MediaEngineInterface* media_engine,
+ VoiceMediaChannel* channel,
+ TransportController* transport_controller,
+ const std::string& content_name,
+ bool rtcp);
~VoiceChannel();
bool Init();
bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer);
@@ -451,8 +462,10 @@ class VoiceChannel : public BaseChannel {
// VideoChannel is a specialization for video.
class VideoChannel : public BaseChannel {
public:
- VideoChannel(rtc::Thread* thread, VideoMediaChannel* channel,
- BaseSession* session, const std::string& content_name,
+ VideoChannel(rtc::Thread* thread,
+ VideoMediaChannel* channel,
+ TransportController* transport_controller,
+ const std::string& content_name,
bool rtcp);
~VideoChannel();
bool Init();
@@ -543,7 +556,7 @@ class DataChannel : public BaseChannel {
public:
DataChannel(rtc::Thread* thread,
DataMediaChannel* media_channel,
- BaseSession* session,
+ TransportController* transport_controller,
const std::string& content_name,
bool rtcp);
~DataChannel();

Powered by Google App Engine
This is Rietveld 408576698