| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #ifndef TALK_SESSION_MEDIA_CHANNEL_H_ | 28 #ifndef TALK_SESSION_MEDIA_CHANNEL_H_ |
| 29 #define TALK_SESSION_MEDIA_CHANNEL_H_ | 29 #define TALK_SESSION_MEDIA_CHANNEL_H_ |
| 30 | 30 |
| 31 #include <string> | 31 #include <string> |
| 32 #include <vector> | 32 #include <vector> |
| 33 #include <map> |
| 34 #include <set> |
| 35 #include <utility> |
| 33 | 36 |
| 34 #include "talk/media/base/mediachannel.h" | 37 #include "talk/media/base/mediachannel.h" |
| 35 #include "talk/media/base/mediaengine.h" | 38 #include "talk/media/base/mediaengine.h" |
| 36 #include "talk/media/base/streamparams.h" | 39 #include "talk/media/base/streamparams.h" |
| 37 #include "talk/media/base/videocapturer.h" | 40 #include "talk/media/base/videocapturer.h" |
| 38 #include "webrtc/p2p/base/session.h" | 41 #include "webrtc/p2p/base/transportcontroller.h" |
| 39 #include "webrtc/p2p/client/socketmonitor.h" | 42 #include "webrtc/p2p/client/socketmonitor.h" |
| 40 #include "talk/session/media/audiomonitor.h" | 43 #include "talk/session/media/audiomonitor.h" |
| 41 #include "talk/session/media/bundlefilter.h" | 44 #include "talk/session/media/bundlefilter.h" |
| 42 #include "talk/session/media/mediamonitor.h" | 45 #include "talk/session/media/mediamonitor.h" |
| 43 #include "talk/session/media/mediasession.h" | 46 #include "talk/session/media/mediasession.h" |
| 44 #include "talk/session/media/rtcpmuxfilter.h" | 47 #include "talk/session/media/rtcpmuxfilter.h" |
| 45 #include "talk/session/media/srtpfilter.h" | 48 #include "talk/session/media/srtpfilter.h" |
| 46 #include "webrtc/base/asyncudpsocket.h" | 49 #include "webrtc/base/asyncudpsocket.h" |
| 47 #include "webrtc/base/criticalsection.h" | 50 #include "webrtc/base/criticalsection.h" |
| 48 #include "webrtc/base/network.h" | 51 #include "webrtc/base/network.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 67 // WARNING! SUBCLASSES MUST CALL Deinit() IN THEIR DESTRUCTORS! | 70 // WARNING! SUBCLASSES MUST CALL Deinit() IN THEIR DESTRUCTORS! |
| 68 // This is required to avoid a data race between the destructor modifying the | 71 // This is required to avoid a data race between the destructor modifying the |
| 69 // vtable, and the media channel's thread using BaseChannel as the | 72 // vtable, and the media channel's thread using BaseChannel as the |
| 70 // NetworkInterface. | 73 // NetworkInterface. |
| 71 | 74 |
| 72 class BaseChannel | 75 class BaseChannel |
| 73 : public rtc::MessageHandler, public sigslot::has_slots<>, | 76 : public rtc::MessageHandler, public sigslot::has_slots<>, |
| 74 public MediaChannel::NetworkInterface, | 77 public MediaChannel::NetworkInterface, |
| 75 public ConnectionStatsGetter { | 78 public ConnectionStatsGetter { |
| 76 public: | 79 public: |
| 77 BaseChannel(rtc::Thread* thread, MediaChannel* channel, BaseSession* session, | 80 BaseChannel(rtc::Thread* thread, |
| 78 const std::string& content_name, bool rtcp); | 81 MediaChannel* channel, |
| 82 TransportController* transport_controller, |
| 83 const std::string& content_name, |
| 84 bool rtcp); |
| 79 virtual ~BaseChannel(); | 85 virtual ~BaseChannel(); |
| 80 bool Init(); | 86 bool Init(); |
| 81 // Deinit may be called multiple times and is simply ignored if it's alreay | 87 // Deinit may be called multiple times and is simply ignored if it's alreay |
| 82 // done. | 88 // done. |
| 83 void Deinit(); | 89 void Deinit(); |
| 84 | 90 |
| 85 rtc::Thread* worker_thread() const { return worker_thread_; } | 91 rtc::Thread* worker_thread() const { return worker_thread_; } |
| 86 BaseSession* session() const { return session_; } | 92 const std::string& content_name() const { return content_name_; } |
| 87 const std::string& content_name() { return content_name_; } | 93 const std::string& transport_name() const { return transport_name_; } |
| 88 TransportChannel* transport_channel() const { | 94 TransportChannel* transport_channel() const { |
| 89 return transport_channel_; | 95 return transport_channel_; |
| 90 } | 96 } |
| 91 TransportChannel* rtcp_transport_channel() const { | 97 TransportChannel* rtcp_transport_channel() const { |
| 92 return rtcp_transport_channel_; | 98 return rtcp_transport_channel_; |
| 93 } | 99 } |
| 94 bool enabled() const { return enabled_; } | 100 bool enabled() const { return enabled_; } |
| 95 | 101 |
| 96 // This function returns true if we are using SRTP. | 102 // This function returns true if we are using SRTP. |
| 97 bool secure() const { return srtp_filter_.IsActive(); } | 103 bool secure() const { return srtp_filter_.IsActive(); } |
| 98 // The following function returns true if we are using | 104 // The following function returns true if we are using |
| 99 // DTLS-based keying. If you turned off SRTP later, however | 105 // DTLS-based keying. If you turned off SRTP later, however |
| 100 // you could have secure() == false and dtls_secure() == true. | 106 // you could have secure() == false and dtls_secure() == true. |
| 101 bool secure_dtls() const { return dtls_keyed_; } | 107 bool secure_dtls() const { return dtls_keyed_; } |
| 102 // This function returns true if we require secure channel for call setup. | 108 // This function returns true if we require secure channel for call setup. |
| 103 bool secure_required() const { return secure_required_; } | 109 bool secure_required() const { return secure_required_; } |
| 104 | 110 |
| 105 bool writable() const { return writable_; } | 111 bool writable() const { return writable_; } |
| 106 | 112 |
| 107 // Activate RTCP mux, regardless of the state so far. Once | 113 // Activate RTCP mux, regardless of the state so far. Once |
| 108 // activated, it can not be deactivated, and if the remote | 114 // activated, it can not be deactivated, and if the remote |
| 109 // description doesn't support RTCP mux, setting the remote | 115 // description doesn't support RTCP mux, setting the remote |
| 110 // description will fail. | 116 // description will fail. |
| 111 void ActivateRtcpMux(); | 117 void ActivateRtcpMux(); |
| 118 bool SetTransport(const std::string& transport_name); |
| 112 bool PushdownLocalDescription(const SessionDescription* local_desc, | 119 bool PushdownLocalDescription(const SessionDescription* local_desc, |
| 113 ContentAction action, | 120 ContentAction action, |
| 114 std::string* error_desc); | 121 std::string* error_desc); |
| 115 bool PushdownRemoteDescription(const SessionDescription* remote_desc, | 122 bool PushdownRemoteDescription(const SessionDescription* remote_desc, |
| 116 ContentAction action, | 123 ContentAction action, |
| 117 std::string* error_desc); | 124 std::string* error_desc); |
| 118 // Channel control | 125 // Channel control |
| 119 bool SetLocalContent(const MediaContentDescription* content, | 126 bool SetLocalContent(const MediaContentDescription* content, |
| 120 ContentAction action, | 127 ContentAction action, |
| 121 std::string* error_desc); | 128 std::string* error_desc); |
| 122 bool SetRemoteContent(const MediaContentDescription* content, | 129 bool SetRemoteContent(const MediaContentDescription* content, |
| 123 ContentAction action, | 130 ContentAction action, |
| 124 std::string* error_desc); | 131 std::string* error_desc); |
| 125 | 132 |
| 126 bool Enable(bool enable); | 133 bool Enable(bool enable); |
| 127 | 134 |
| 128 // Multiplexing | 135 // Multiplexing |
| 129 bool AddRecvStream(const StreamParams& sp); | 136 bool AddRecvStream(const StreamParams& sp); |
| 130 bool RemoveRecvStream(uint32 ssrc); | 137 bool RemoveRecvStream(uint32 ssrc); |
| 131 bool AddSendStream(const StreamParams& sp); | 138 bool AddSendStream(const StreamParams& sp); |
| 132 bool RemoveSendStream(uint32 ssrc); | 139 bool RemoveSendStream(uint32 ssrc); |
| 133 | 140 |
| 134 // Monitoring | 141 // Monitoring |
| 135 void StartConnectionMonitor(int cms); | 142 void StartConnectionMonitor(int cms); |
| 136 void StopConnectionMonitor(); | 143 void StopConnectionMonitor(); |
| 137 // For ConnectionStatsGetter, used by ConnectionMonitor | 144 // For ConnectionStatsGetter, used by ConnectionMonitor |
| 138 virtual bool GetConnectionStats(ConnectionInfos* infos) override; | 145 bool GetConnectionStats(ConnectionInfos* infos) override; |
| 139 | 146 |
| 140 void set_srtp_signal_silent_time(uint32 silent_time) { | 147 void set_srtp_signal_silent_time(uint32 silent_time) { |
| 141 srtp_filter_.set_signal_silent_time(silent_time); | 148 srtp_filter_.set_signal_silent_time(silent_time); |
| 142 } | 149 } |
| 143 | 150 |
| 144 BundleFilter* bundle_filter() { return &bundle_filter_; } | 151 BundleFilter* bundle_filter() { return &bundle_filter_; } |
| 145 | 152 |
| 146 const std::vector<StreamParams>& local_streams() const { | 153 const std::vector<StreamParams>& local_streams() const { |
| 147 return local_streams_; | 154 return local_streams_; |
| 148 } | 155 } |
| 149 const std::vector<StreamParams>& remote_streams() const { | 156 const std::vector<StreamParams>& remote_streams() const { |
| 150 return remote_streams_; | 157 return remote_streams_; |
| 151 } | 158 } |
| 152 | 159 |
| 153 sigslot::signal2<BaseChannel*, bool> SignalDtlsSetupFailure; | 160 sigslot::signal2<BaseChannel*, bool> SignalDtlsSetupFailure; |
| 154 void SignalDtlsSetupFailure_w(bool rtcp); | 161 void SignalDtlsSetupFailure_w(bool rtcp); |
| 155 void SignalDtlsSetupFailure_s(bool rtcp); | 162 void SignalDtlsSetupFailure_s(bool rtcp); |
| 156 | 163 |
| 157 // Used for latency measurements. | 164 // Used for latency measurements. |
| 158 sigslot::signal1<BaseChannel*> SignalFirstPacketReceived; | 165 sigslot::signal1<BaseChannel*> SignalFirstPacketReceived; |
| 159 | 166 |
| 160 // Made public for easier testing. | 167 // Made public for easier testing. |
| 161 void SetReadyToSend(TransportChannel* channel, bool ready); | 168 void SetReadyToSend(bool rtcp, bool ready); |
| 162 | 169 |
| 163 // Only public for unit tests. Otherwise, consider protected. | 170 // Only public for unit tests. Otherwise, consider protected. |
| 164 virtual int SetOption(SocketType type, rtc::Socket::Option o, int val); | 171 virtual int SetOption(SocketType type, rtc::Socket::Option o, int val); |
| 165 | 172 |
| 166 protected: | 173 protected: |
| 167 virtual MediaChannel* media_channel() const { return media_channel_; } | 174 virtual MediaChannel* media_channel() const { return media_channel_; } |
| 168 // Sets the transport_channel_ and rtcp_transport_channel_. If | 175 // Sets the |transport_channel_| (and |rtcp_transport_channel_|, if |rtcp_| is |
| 169 // |rtcp| is false, set rtcp_transport_channel_ is set to NULL. Get | 176 // true). Gets the transport channels from |transport_controller_|. |
| 170 // the transport channels from |session|. | 177 bool SetTransport_w(const std::string& transport_name); |
| 171 // TODO(pthatcher): Pass in a Transport instead of a BaseSession. | |
| 172 bool SetTransportChannels(BaseSession* session, bool rtcp); | |
| 173 bool SetTransportChannels_w(BaseSession* session, bool rtcp); | |
| 174 void set_transport_channel(TransportChannel* transport); | 178 void set_transport_channel(TransportChannel* transport); |
| 175 void set_rtcp_transport_channel(TransportChannel* transport); | 179 void set_rtcp_transport_channel(TransportChannel* transport); |
| 176 bool was_ever_writable() const { return was_ever_writable_; } | 180 bool was_ever_writable() const { return was_ever_writable_; } |
| 177 void set_local_content_direction(MediaContentDirection direction) { | 181 void set_local_content_direction(MediaContentDirection direction) { |
| 178 local_content_direction_ = direction; | 182 local_content_direction_ = direction; |
| 179 } | 183 } |
| 180 void set_remote_content_direction(MediaContentDirection direction) { | 184 void set_remote_content_direction(MediaContentDirection direction) { |
| 181 remote_content_direction_ = direction; | 185 remote_content_direction_ = direction; |
| 182 } | 186 } |
| 183 void set_secure_required(bool secure_required) { | 187 void set_secure_required(bool secure_required) { |
| 184 secure_required_ = secure_required; | 188 secure_required_ = secure_required; |
| 185 } | 189 } |
| 186 bool IsReadyToReceive() const; | 190 bool IsReadyToReceive() const; |
| 187 bool IsReadyToSend() const; | 191 bool IsReadyToSend() const; |
| 188 rtc::Thread* signaling_thread() { return session_->signaling_thread(); } | 192 rtc::Thread* signaling_thread() { |
| 193 return transport_controller_->signaling_thread(); |
| 194 } |
| 189 SrtpFilter* srtp_filter() { return &srtp_filter_; } | 195 SrtpFilter* srtp_filter() { return &srtp_filter_; } |
| 190 bool rtcp() const { return rtcp_; } | 196 bool rtcp_transport_enabled() const { return rtcp_transport_enabled_; } |
| 191 | 197 |
| 192 void ConnectToTransportChannel(TransportChannel* tc); | 198 void ConnectToTransportChannel(TransportChannel* tc); |
| 193 void DisconnectFromTransportChannel(TransportChannel* tc); | 199 void DisconnectFromTransportChannel(TransportChannel* tc); |
| 194 | 200 |
| 195 void FlushRtcpMessages(); | 201 void FlushRtcpMessages(); |
| 196 | 202 |
| 197 // NetworkInterface implementation, called by MediaEngine | 203 // NetworkInterface implementation, called by MediaEngine |
| 198 virtual bool SendPacket(rtc::Buffer* packet, | 204 virtual bool SendPacket(rtc::Buffer* packet, |
| 199 rtc::DiffServCodePoint dscp); | 205 rtc::DiffServCodePoint dscp); |
| 200 virtual bool SendRtcp(rtc::Buffer* packet, | 206 virtual bool SendRtcp(rtc::Buffer* packet, |
| 201 rtc::DiffServCodePoint dscp); | 207 rtc::DiffServCodePoint dscp); |
| 202 | 208 |
| 203 // From TransportChannel | 209 // From TransportChannel |
| 204 void OnWritableState(TransportChannel* channel); | 210 void OnWritableState(TransportChannel* channel); |
| 205 virtual void OnChannelRead(TransportChannel* channel, | 211 virtual void OnChannelRead(TransportChannel* channel, |
| 206 const char* data, | 212 const char* data, |
| 207 size_t len, | 213 size_t len, |
| 208 const rtc::PacketTime& packet_time, | 214 const rtc::PacketTime& packet_time, |
| 209 int flags); | 215 int flags); |
| 210 void OnReadyToSend(TransportChannel* channel); | 216 void OnReadyToSend(TransportChannel* channel); |
| 211 | 217 |
| 212 bool PacketIsRtcp(const TransportChannel* channel, const char* data, | 218 bool PacketIsRtcp(const TransportChannel* channel, const char* data, |
| 213 size_t len); | 219 size_t len); |
| 214 bool SendPacket(bool rtcp, rtc::Buffer* packet, | 220 bool SendPacket(bool rtcp, rtc::Buffer* packet, |
| 215 rtc::DiffServCodePoint dscp); | 221 rtc::DiffServCodePoint dscp); |
| 216 virtual bool WantsPacket(bool rtcp, rtc::Buffer* packet); | 222 virtual bool WantsPacket(bool rtcp, rtc::Buffer* packet); |
| 217 void HandlePacket(bool rtcp, rtc::Buffer* packet, | 223 void HandlePacket(bool rtcp, rtc::Buffer* packet, |
| 218 const rtc::PacketTime& packet_time); | 224 const rtc::PacketTime& packet_time); |
| 219 | 225 |
| 220 // Apply the new local/remote session description. | |
| 221 void OnNewLocalDescription(BaseSession* session, ContentAction action); | |
| 222 void OnNewRemoteDescription(BaseSession* session, ContentAction action); | |
| 223 | |
| 224 void EnableMedia_w(); | 226 void EnableMedia_w(); |
| 225 void DisableMedia_w(); | 227 void DisableMedia_w(); |
| 228 void UpdateWritableState_w(); |
| 226 void ChannelWritable_w(); | 229 void ChannelWritable_w(); |
| 227 void ChannelNotWritable_w(); | 230 void ChannelNotWritable_w(); |
| 228 bool AddRecvStream_w(const StreamParams& sp); | 231 bool AddRecvStream_w(const StreamParams& sp); |
| 229 bool RemoveRecvStream_w(uint32 ssrc); | 232 bool RemoveRecvStream_w(uint32 ssrc); |
| 230 bool AddSendStream_w(const StreamParams& sp); | 233 bool AddSendStream_w(const StreamParams& sp); |
| 231 bool RemoveSendStream_w(uint32 ssrc); | 234 bool RemoveSendStream_w(uint32 ssrc); |
| 232 virtual bool ShouldSetupDtlsSrtp() const; | 235 virtual bool ShouldSetupDtlsSrtp() const; |
| 233 // Do the DTLS key expansion and impose it on the SRTP/SRTCP filters. | 236 // Do the DTLS key expansion and impose it on the SRTP/SRTCP filters. |
| 234 // |rtcp_channel| indicates whether to set up the RTP or RTCP filter. | 237 // |rtcp_channel| indicates whether to set up the RTP or RTCP filter. |
| 235 bool SetupDtlsSrtp(bool rtcp_channel); | 238 bool SetupDtlsSrtp(bool rtcp_channel); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 const std::vector<ConnectionInfo>& infos) = 0; | 289 const std::vector<ConnectionInfo>& infos) = 0; |
| 287 | 290 |
| 288 // Helper function for invoking bool-returning methods on the worker thread. | 291 // Helper function for invoking bool-returning methods on the worker thread. |
| 289 template <class FunctorT> | 292 template <class FunctorT> |
| 290 bool InvokeOnWorker(const FunctorT& functor) { | 293 bool InvokeOnWorker(const FunctorT& functor) { |
| 291 return worker_thread_->Invoke<bool>(functor); | 294 return worker_thread_->Invoke<bool>(functor); |
| 292 } | 295 } |
| 293 | 296 |
| 294 private: | 297 private: |
| 295 rtc::Thread* worker_thread_; | 298 rtc::Thread* worker_thread_; |
| 296 BaseSession* session_; | 299 TransportController* transport_controller_; |
| 297 MediaChannel* media_channel_; | 300 MediaChannel* media_channel_; |
| 298 std::vector<StreamParams> local_streams_; | 301 std::vector<StreamParams> local_streams_; |
| 299 std::vector<StreamParams> remote_streams_; | 302 std::vector<StreamParams> remote_streams_; |
| 300 | 303 |
| 301 const std::string content_name_; | 304 const std::string content_name_; |
| 302 bool rtcp_; | 305 std::string transport_name_; |
| 306 bool rtcp_transport_enabled_; |
| 303 TransportChannel* transport_channel_; | 307 TransportChannel* transport_channel_; |
| 308 std::vector<std::pair<rtc::Socket::Option, int> > socket_options_; |
| 304 TransportChannel* rtcp_transport_channel_; | 309 TransportChannel* rtcp_transport_channel_; |
| 310 std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_; |
| 305 SrtpFilter srtp_filter_; | 311 SrtpFilter srtp_filter_; |
| 306 RtcpMuxFilter rtcp_mux_filter_; | 312 RtcpMuxFilter rtcp_mux_filter_; |
| 307 BundleFilter bundle_filter_; | 313 BundleFilter bundle_filter_; |
| 308 rtc::scoped_ptr<ConnectionMonitor> connection_monitor_; | 314 rtc::scoped_ptr<ConnectionMonitor> connection_monitor_; |
| 309 bool enabled_; | 315 bool enabled_; |
| 310 bool writable_; | 316 bool writable_; |
| 311 bool rtp_ready_to_send_; | 317 bool rtp_ready_to_send_; |
| 312 bool rtcp_ready_to_send_; | 318 bool rtcp_ready_to_send_; |
| 313 bool was_ever_writable_; | 319 bool was_ever_writable_; |
| 314 MediaContentDirection local_content_direction_; | 320 MediaContentDirection local_content_direction_; |
| 315 MediaContentDirection remote_content_direction_; | 321 MediaContentDirection remote_content_direction_; |
| 316 bool has_received_packet_; | 322 bool has_received_packet_; |
| 317 bool dtls_keyed_; | 323 bool dtls_keyed_; |
| 318 bool secure_required_; | 324 bool secure_required_; |
| 319 int rtp_abs_sendtime_extn_id_; | 325 int rtp_abs_sendtime_extn_id_; |
| 320 }; | 326 }; |
| 321 | 327 |
| 322 // VoiceChannel is a specialization that adds support for early media, DTMF, | 328 // VoiceChannel is a specialization that adds support for early media, DTMF, |
| 323 // and input/output level monitoring. | 329 // and input/output level monitoring. |
| 324 class VoiceChannel : public BaseChannel { | 330 class VoiceChannel : public BaseChannel { |
| 325 public: | 331 public: |
| 326 VoiceChannel(rtc::Thread* thread, MediaEngineInterface* media_engine, | 332 VoiceChannel(rtc::Thread* thread, |
| 327 VoiceMediaChannel* channel, BaseSession* session, | 333 MediaEngineInterface* media_engine, |
| 328 const std::string& content_name, bool rtcp); | 334 VoiceMediaChannel* channel, |
| 335 TransportController* transport_controller, |
| 336 const std::string& content_name, |
| 337 bool rtcp); |
| 329 ~VoiceChannel(); | 338 ~VoiceChannel(); |
| 330 bool Init(); | 339 bool Init(); |
| 331 bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer); | 340 bool SetRemoteRenderer(uint32 ssrc, AudioRenderer* renderer); |
| 332 | 341 |
| 333 // Configure sending media on the stream with SSRC |ssrc| | 342 // Configure sending media on the stream with SSRC |ssrc| |
| 334 // If there is only one sending stream SSRC 0 can be used. | 343 // If there is only one sending stream SSRC 0 can be used. |
| 335 bool SetAudioSend(uint32 ssrc, bool mute, const AudioOptions* options, | 344 bool SetAudioSend(uint32 ssrc, |
| 345 bool mute, |
| 346 const AudioOptions* options, |
| 336 AudioRenderer* renderer); | 347 AudioRenderer* renderer); |
| 337 | 348 |
| 338 // downcasts a MediaChannel | 349 // downcasts a MediaChannel |
| 339 virtual VoiceMediaChannel* media_channel() const { | 350 virtual VoiceMediaChannel* media_channel() const { |
| 340 return static_cast<VoiceMediaChannel*>(BaseChannel::media_channel()); | 351 return static_cast<VoiceMediaChannel*>(BaseChannel::media_channel()); |
| 341 } | 352 } |
| 342 | 353 |
| 343 bool SetRingbackTone(const void* buf, int len); | 354 bool SetRingbackTone(const void* buf, int len); |
| 344 void SetEarlyMedia(bool enable); | 355 void SetEarlyMedia(bool enable); |
| 345 // This signal is emitted when we have gone a period of time without | 356 // This signal is emitted when we have gone a period of time without |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 // SetSendParameters. | 437 // SetSendParameters. |
| 427 AudioSendParameters last_send_params_; | 438 AudioSendParameters last_send_params_; |
| 428 // Last AudioRecvParameters sent down to the media_channel() via | 439 // Last AudioRecvParameters sent down to the media_channel() via |
| 429 // SetRecvParameters. | 440 // SetRecvParameters. |
| 430 AudioRecvParameters last_recv_params_; | 441 AudioRecvParameters last_recv_params_; |
| 431 }; | 442 }; |
| 432 | 443 |
| 433 // VideoChannel is a specialization for video. | 444 // VideoChannel is a specialization for video. |
| 434 class VideoChannel : public BaseChannel { | 445 class VideoChannel : public BaseChannel { |
| 435 public: | 446 public: |
| 436 VideoChannel(rtc::Thread* thread, VideoMediaChannel* channel, | 447 VideoChannel(rtc::Thread* thread, |
| 437 BaseSession* session, const std::string& content_name, | 448 VideoMediaChannel* channel, |
| 449 TransportController* transport_controller, |
| 450 const std::string& content_name, |
| 438 bool rtcp); | 451 bool rtcp); |
| 439 ~VideoChannel(); | 452 ~VideoChannel(); |
| 440 bool Init(); | 453 bool Init(); |
| 441 | 454 |
| 442 // downcasts a MediaChannel | 455 // downcasts a MediaChannel |
| 443 virtual VideoMediaChannel* media_channel() const { | 456 virtual VideoMediaChannel* media_channel() const { |
| 444 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel()); | 457 return static_cast<VideoMediaChannel*>(BaseChannel::media_channel()); |
| 445 } | 458 } |
| 446 | 459 |
| 447 bool SetRenderer(uint32 ssrc, VideoRenderer* renderer); | 460 bool SetRenderer(uint32 ssrc, VideoRenderer* renderer); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 // Last VideoRecvParameters sent down to the media_channel() via | 539 // Last VideoRecvParameters sent down to the media_channel() via |
| 527 // SetRecvParameters. | 540 // SetRecvParameters. |
| 528 VideoRecvParameters last_recv_params_; | 541 VideoRecvParameters last_recv_params_; |
| 529 }; | 542 }; |
| 530 | 543 |
| 531 // DataChannel is a specialization for data. | 544 // DataChannel is a specialization for data. |
| 532 class DataChannel : public BaseChannel { | 545 class DataChannel : public BaseChannel { |
| 533 public: | 546 public: |
| 534 DataChannel(rtc::Thread* thread, | 547 DataChannel(rtc::Thread* thread, |
| 535 DataMediaChannel* media_channel, | 548 DataMediaChannel* media_channel, |
| 536 BaseSession* session, | 549 TransportController* transport_controller, |
| 537 const std::string& content_name, | 550 const std::string& content_name, |
| 538 bool rtcp); | 551 bool rtcp); |
| 539 ~DataChannel(); | 552 ~DataChannel(); |
| 540 bool Init(); | 553 bool Init(); |
| 541 | 554 |
| 542 virtual bool SendData(const SendDataParams& params, | 555 virtual bool SendData(const SendDataParams& params, |
| 543 const rtc::Buffer& payload, | 556 const rtc::Buffer& payload, |
| 544 SendDataResult* result); | 557 SendDataResult* result); |
| 545 | 558 |
| 546 void StartMediaMonitor(int cms); | 559 void StartMediaMonitor(int cms); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 // SetSendParameters. | 662 // SetSendParameters. |
| 650 DataSendParameters last_send_params_; | 663 DataSendParameters last_send_params_; |
| 651 // Last DataRecvParameters sent down to the media_channel() via | 664 // Last DataRecvParameters sent down to the media_channel() via |
| 652 // SetRecvParameters. | 665 // SetRecvParameters. |
| 653 DataRecvParameters last_recv_params_; | 666 DataRecvParameters last_recv_params_; |
| 654 }; | 667 }; |
| 655 | 668 |
| 656 } // namespace cricket | 669 } // namespace cricket |
| 657 | 670 |
| 658 #endif // TALK_SESSION_MEDIA_CHANNEL_H_ | 671 #endif // TALK_SESSION_MEDIA_CHANNEL_H_ |
| OLD | NEW |