2013-07-10 00:45:36 +00:00
|
|
|
/*
|
2016-02-12 00:05:01 -08:00
|
|
|
* Copyright 2004 The WebRTC project authors. All Rights Reserved.
|
2013-07-10 00:45:36 +00:00
|
|
|
*
|
2016-02-12 00:05:01 -08:00
|
|
|
* 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.
|
2013-07-10 00:45:36 +00:00
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef PC_CHANNEL_H_
|
|
|
|
|
#define PC_CHANNEL_H_
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2015-09-23 11:50:27 -07:00
|
|
|
#include <map>
|
2016-03-11 14:18:21 -08:00
|
|
|
#include <memory>
|
2015-09-23 11:50:27 -07:00
|
|
|
#include <set>
|
Move talk/media to webrtc/media
I removed the 'libjingle' target in talk/libjingle.gyp and replaced
all users of it with base/base.gyp:rtc_base. It seems the jsoncpp
and expat dependencies were not used by it's previous references.
The files in talk/media/testdata were uploaded to Google Storage and
added .sha1 files in resources/media instead of simply moving them.
The previously disabled warnings that were inherited from
talk/build/common.gypi are now replaced by target-specific disabling
of only the failing warnings. Additional disabling was needed since the stricter
compilation warnings that applies to code in webrtc/.
License headers will be updated in a follow-up CL in order to not
break Git history.
Other modifications:
* Updated the header guards.
* Sorted the includes using chromium/src/tools/sort-headers.py
except for these files:
talk/app/webrtc/peerconnectionendtoend_unittest.cc
talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
talk/app/webrtc/java/jni/androidmediaencoder_jni.cc
webrtc/media/devices/win32devicemanager.cc.
* Unused GYP reference to libjingle_tests_additional_deps was removed.
* Removed duplicated GYP entries of
webrtc/base/testutils.cc
webrtc/base/testutils.h
The HAVE_WEBRTC_VIDEO and HAVE_WEBRTC_VOICE defines were used by only talk/media,
so they were moved to the media.gyp.
I also checked that none of
EXPAT_RELATIVE_PATH,
FEATURE_ENABLE_VOICEMAIL,
GTEST_RELATIVE_PATH,
JSONCPP_RELATIVE_PATH,
LOGGING=1,
SRTP_RELATIVE_PATH,
FEATURE_ENABLE_SSL,
FEATURE_ENABLE_VOICEMAIL,
FEATURE_ENABLE_PSTN,
HAVE_SCTP,
HAVE_SRTP,
are used by the talk/media code.
For Chromium, the following changes will need to be applied to the roll CL that updates the
DEPS for WebRTC and libjingle: https://codereview.chromium.org/1604303002/
BUG=webrtc:5420
NOPRESUBMIT=True
TBR=tommi@webrtc.org
Review URL: https://codereview.webrtc.org/1587193006
Cr-Commit-Position: refs/heads/master@{#11495}
2016-02-04 23:52:28 -08:00
|
|
|
#include <string>
|
2015-09-23 11:50:27 -07:00
|
|
|
#include <utility>
|
Move talk/media to webrtc/media
I removed the 'libjingle' target in talk/libjingle.gyp and replaced
all users of it with base/base.gyp:rtc_base. It seems the jsoncpp
and expat dependencies were not used by it's previous references.
The files in talk/media/testdata were uploaded to Google Storage and
added .sha1 files in resources/media instead of simply moving them.
The previously disabled warnings that were inherited from
talk/build/common.gypi are now replaced by target-specific disabling
of only the failing warnings. Additional disabling was needed since the stricter
compilation warnings that applies to code in webrtc/.
License headers will be updated in a follow-up CL in order to not
break Git history.
Other modifications:
* Updated the header guards.
* Sorted the includes using chromium/src/tools/sort-headers.py
except for these files:
talk/app/webrtc/peerconnectionendtoend_unittest.cc
talk/app/webrtc/java/jni/androidmediadecoder_jni.cc
talk/app/webrtc/java/jni/androidmediaencoder_jni.cc
webrtc/media/devices/win32devicemanager.cc.
* Unused GYP reference to libjingle_tests_additional_deps was removed.
* Removed duplicated GYP entries of
webrtc/base/testutils.cc
webrtc/base/testutils.h
The HAVE_WEBRTC_VIDEO and HAVE_WEBRTC_VOICE defines were used by only talk/media,
so they were moved to the media.gyp.
I also checked that none of
EXPAT_RELATIVE_PATH,
FEATURE_ENABLE_VOICEMAIL,
GTEST_RELATIVE_PATH,
JSONCPP_RELATIVE_PATH,
LOGGING=1,
SRTP_RELATIVE_PATH,
FEATURE_ENABLE_SSL,
FEATURE_ENABLE_VOICEMAIL,
FEATURE_ENABLE_PSTN,
HAVE_SCTP,
HAVE_SRTP,
are used by the talk/media code.
For Chromium, the following changes will need to be applied to the roll CL that updates the
DEPS for WebRTC and libjingle: https://codereview.chromium.org/1604303002/
BUG=webrtc:5420
NOPRESUBMIT=True
TBR=tommi@webrtc.org
Review URL: https://codereview.webrtc.org/1587193006
Cr-Commit-Position: refs/heads/master@{#11495}
2016-02-04 23:52:28 -08:00
|
|
|
#include <vector>
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "api/call/audio_sink.h"
|
|
|
|
|
#include "api/rtpreceiverinterface.h"
|
|
|
|
|
#include "media/base/mediachannel.h"
|
|
|
|
|
#include "media/base/mediaengine.h"
|
|
|
|
|
#include "media/base/streamparams.h"
|
|
|
|
|
#include "media/base/videosinkinterface.h"
|
|
|
|
|
#include "media/base/videosourceinterface.h"
|
|
|
|
|
#include "p2p/base/dtlstransportinternal.h"
|
|
|
|
|
#include "p2p/base/packettransportinternal.h"
|
|
|
|
|
#include "p2p/client/socketmonitor.h"
|
|
|
|
|
#include "pc/audiomonitor.h"
|
|
|
|
|
#include "pc/mediamonitor.h"
|
|
|
|
|
#include "pc/mediasession.h"
|
|
|
|
|
#include "pc/rtcpmuxfilter.h"
|
|
|
|
|
#include "pc/srtpfilter.h"
|
2017-09-29 10:51:43 -07:00
|
|
|
#include "pc/transportcontroller.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "rtc_base/asyncinvoker.h"
|
|
|
|
|
#include "rtc_base/asyncudpsocket.h"
|
|
|
|
|
#include "rtc_base/criticalsection.h"
|
|
|
|
|
#include "rtc_base/network.h"
|
|
|
|
|
#include "rtc_base/sigslot.h"
|
|
|
|
|
#include "rtc_base/window.h"
|
2015-12-12 01:37:01 +01:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
class AudioSinkInterface;
|
2017-09-22 12:12:30 -07:00
|
|
|
class RtpTransportInternal;
|
|
|
|
|
class SrtpTransport;
|
2015-12-12 01:37:01 +01:00
|
|
|
} // namespace webrtc
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
namespace cricket {
|
|
|
|
|
|
|
|
|
|
struct CryptoParams;
|
|
|
|
|
class MediaContentDescription;
|
|
|
|
|
|
2016-08-26 21:42:15 -07:00
|
|
|
// BaseChannel contains logic common to voice and video, including enable,
|
|
|
|
|
// marshaling calls to a worker and network threads, and connection and media
|
|
|
|
|
// monitors.
|
|
|
|
|
//
|
2016-05-11 19:55:27 +02:00
|
|
|
// BaseChannel assumes signaling and other threads are allowed to make
|
|
|
|
|
// synchronous calls to the worker thread, the worker thread makes synchronous
|
|
|
|
|
// calls only to the network thread, and the network thread can't be blocked by
|
|
|
|
|
// other threads.
|
|
|
|
|
// All methods with _n suffix must be called on network thread,
|
2016-08-26 21:42:15 -07:00
|
|
|
// methods with _w suffix on worker thread
|
2016-05-11 19:55:27 +02:00
|
|
|
// and methods with _s suffix on signaling thread.
|
|
|
|
|
// Network and worker threads may be the same thread.
|
2013-10-07 23:32:02 +00:00
|
|
|
//
|
|
|
|
|
// WARNING! SUBCLASSES MUST CALL Deinit() IN THEIR DESTRUCTORS!
|
|
|
|
|
// This is required to avoid a data race between the destructor modifying the
|
|
|
|
|
// vtable, and the media channel's thread using BaseChannel as the
|
|
|
|
|
// NetworkInterface.
|
|
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
class BaseChannel
|
2014-07-29 17:36:52 +00:00
|
|
|
: public rtc::MessageHandler, public sigslot::has_slots<>,
|
2015-03-13 18:25:21 +00:00
|
|
|
public MediaChannel::NetworkInterface,
|
|
|
|
|
public ConnectionStatsGetter {
|
2013-07-10 00:45:36 +00:00
|
|
|
public:
|
2016-12-13 11:29:11 -08:00
|
|
|
// If |srtp_required| is true, the channel will not send or receive any
|
|
|
|
|
// RTP/RTCP packets without using SRTP (either using SDES or DTLS-SRTP).
|
2016-05-11 19:55:27 +02:00
|
|
|
BaseChannel(rtc::Thread* worker_thread,
|
|
|
|
|
rtc::Thread* network_thread,
|
2017-01-12 19:37:48 -08:00
|
|
|
rtc::Thread* signaling_thread,
|
2017-11-06 15:53:33 -08:00
|
|
|
std::unique_ptr<MediaChannel> media_channel,
|
2015-09-23 11:50:27 -07:00
|
|
|
const std::string& content_name,
|
2017-01-12 21:59:29 -08:00
|
|
|
bool rtcp_mux_required,
|
2016-12-13 11:29:11 -08:00
|
|
|
bool srtp_required);
|
2013-07-10 00:45:36 +00:00
|
|
|
virtual ~BaseChannel();
|
2017-11-06 15:53:33 -08:00
|
|
|
void Init_w(DtlsTransportInternal* rtp_dtls_transport,
|
2017-01-24 21:51:21 -08:00
|
|
|
DtlsTransportInternal* rtcp_dtls_transport,
|
2017-02-10 11:31:50 -08:00
|
|
|
rtc::PacketTransportInternal* rtp_packet_transport,
|
|
|
|
|
rtc::PacketTransportInternal* rtcp_packet_transport);
|
2016-05-11 19:55:27 +02:00
|
|
|
// Deinit may be called multiple times and is simply ignored if it's already
|
2013-10-07 23:32:02 +00:00
|
|
|
// done.
|
|
|
|
|
void Deinit();
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2014-07-29 17:36:52 +00:00
|
|
|
rtc::Thread* worker_thread() const { return worker_thread_; }
|
2016-05-11 19:55:27 +02:00
|
|
|
rtc::Thread* network_thread() const { return network_thread_; }
|
2015-09-23 11:50:27 -07:00
|
|
|
const std::string& content_name() const { return content_name_; }
|
2017-01-24 21:51:21 -08:00
|
|
|
// TODO(deadbeef): This is redundant; remove this.
|
2015-09-23 11:50:27 -07:00
|
|
|
const std::string& transport_name() const { return transport_name_; }
|
2013-07-10 00:45:36 +00:00
|
|
|
bool enabled() const { return enabled_; }
|
|
|
|
|
|
2017-09-22 12:12:30 -07:00
|
|
|
// This function returns true if we are using SDES.
|
|
|
|
|
bool sdes_active() const { return sdes_negotiator_.IsActive(); }
|
|
|
|
|
// The following function returns true if we are using DTLS-based keying.
|
|
|
|
|
bool dtls_active() const { return dtls_active_; }
|
|
|
|
|
// This function returns true if using SRTP (DTLS-based keying or SDES).
|
|
|
|
|
bool srtp_active() const { return sdes_active() || dtls_active(); }
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
bool writable() const { return writable_; }
|
|
|
|
|
|
2017-01-17 18:32:35 -08:00
|
|
|
// Set the transport(s), and update writability and "ready-to-send" state.
|
|
|
|
|
// |rtp_transport| must be non-null.
|
|
|
|
|
// |rtcp_transport| must be supplied if NeedsRtcpTransport() is true (meaning
|
|
|
|
|
// RTCP muxing is not fully active yet).
|
|
|
|
|
// |rtp_transport| and |rtcp_transport| must share the same transport name as
|
|
|
|
|
// well.
|
2017-02-10 11:31:50 -08:00
|
|
|
// Can not start with "rtc::PacketTransportInternal" and switch to
|
2017-01-24 21:51:21 -08:00
|
|
|
// "DtlsTransportInternal", or vice-versa.
|
2017-01-19 16:54:25 -08:00
|
|
|
void SetTransports(DtlsTransportInternal* rtp_dtls_transport,
|
|
|
|
|
DtlsTransportInternal* rtcp_dtls_transport);
|
2017-02-10 11:31:50 -08:00
|
|
|
void SetTransports(rtc::PacketTransportInternal* rtp_packet_transport,
|
|
|
|
|
rtc::PacketTransportInternal* rtcp_packet_transport);
|
2013-07-10 00:45:36 +00:00
|
|
|
// Channel control
|
|
|
|
|
bool SetLocalContent(const MediaContentDescription* content,
|
2014-01-15 23:15:54 +00:00
|
|
|
ContentAction action,
|
|
|
|
|
std::string* error_desc);
|
2013-07-10 00:45:36 +00:00
|
|
|
bool SetRemoteContent(const MediaContentDescription* content,
|
2014-01-15 23:15:54 +00:00
|
|
|
ContentAction action,
|
|
|
|
|
std::string* error_desc);
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
bool Enable(bool enable);
|
|
|
|
|
|
|
|
|
|
// Multiplexing
|
|
|
|
|
bool AddRecvStream(const StreamParams& sp);
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
bool RemoveRecvStream(uint32_t ssrc);
|
2013-08-30 21:24:16 +00:00
|
|
|
bool AddSendStream(const StreamParams& sp);
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
bool RemoveSendStream(uint32_t ssrc);
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
// Monitoring
|
|
|
|
|
void StartConnectionMonitor(int cms);
|
|
|
|
|
void StopConnectionMonitor();
|
2015-03-13 18:25:21 +00:00
|
|
|
// For ConnectionStatsGetter, used by ConnectionMonitor
|
2015-09-23 11:50:27 -07:00
|
|
|
bool GetConnectionStats(ConnectionInfos* infos) override;
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
const std::vector<StreamParams>& local_streams() const {
|
|
|
|
|
return local_streams_;
|
|
|
|
|
}
|
|
|
|
|
const std::vector<StreamParams>& remote_streams() const {
|
|
|
|
|
return remote_streams_;
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-09 14:53:41 -08:00
|
|
|
sigslot::signal2<BaseChannel*, bool> SignalDtlsSrtpSetupFailure;
|
|
|
|
|
void SignalDtlsSrtpSetupFailure_n(bool rtcp);
|
|
|
|
|
void SignalDtlsSrtpSetupFailure_s(bool rtcp);
|
2015-03-16 19:34:23 +00:00
|
|
|
|
2014-05-15 16:15:59 +00:00
|
|
|
// Used for latency measurements.
|
2013-07-10 00:45:36 +00:00
|
|
|
sigslot::signal1<BaseChannel*> SignalFirstPacketReceived;
|
|
|
|
|
|
2017-01-19 16:54:25 -08:00
|
|
|
// Forward SignalSentPacket to worker thread.
|
2016-05-11 19:55:27 +02:00
|
|
|
sigslot::signal1<const rtc::SentPacket&> SignalSentPacket;
|
|
|
|
|
|
2017-01-12 21:59:29 -08:00
|
|
|
// Emitted whenever rtcp-mux is fully negotiated and the rtcp-transport can
|
|
|
|
|
// be destroyed.
|
|
|
|
|
// Fired on the network thread.
|
|
|
|
|
sigslot::signal1<const std::string&> SignalRtcpMuxFullyActive;
|
2017-01-12 19:37:48 -08:00
|
|
|
|
2017-01-19 16:54:25 -08:00
|
|
|
// Only public for unit tests. Otherwise, consider private.
|
|
|
|
|
DtlsTransportInternal* rtp_dtls_transport() const {
|
|
|
|
|
return rtp_dtls_transport_;
|
|
|
|
|
}
|
|
|
|
|
DtlsTransportInternal* rtcp_dtls_transport() const {
|
|
|
|
|
return rtcp_dtls_transport_;
|
|
|
|
|
}
|
2017-01-12 19:37:48 -08:00
|
|
|
|
|
|
|
|
bool NeedsRtcpTransport();
|
2016-05-11 19:55:27 +02:00
|
|
|
|
2017-04-24 16:54:35 -07:00
|
|
|
// From RtpTransport - public for testing only
|
|
|
|
|
void OnTransportReadyToSend(bool ready);
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2015-03-12 20:09:44 +00:00
|
|
|
// Only public for unit tests. Otherwise, consider protected.
|
2015-10-27 14:22:16 -07:00
|
|
|
int SetOption(SocketType type, rtc::Socket::Option o, int val)
|
|
|
|
|
override;
|
2016-05-11 19:55:27 +02:00
|
|
|
int SetOption_n(SocketType type, rtc::Socket::Option o, int val);
|
2015-03-12 20:09:44 +00:00
|
|
|
|
2016-06-14 11:47:14 -07:00
|
|
|
virtual cricket::MediaType media_type() = 0;
|
|
|
|
|
|
2017-06-01 13:22:42 -07:00
|
|
|
// Public for testing.
|
|
|
|
|
// TODO(zstein): Remove this once channels register themselves with
|
|
|
|
|
// an RtpTransport in a more explicit way.
|
|
|
|
|
bool HandlesPayloadType(int payload_type) const;
|
|
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
protected:
|
2017-11-06 15:53:33 -08:00
|
|
|
virtual MediaChannel* media_channel() const { return media_channel_.get(); }
|
2016-08-25 13:31:14 -07:00
|
|
|
|
2017-01-19 16:54:25 -08:00
|
|
|
void SetTransports_n(DtlsTransportInternal* rtp_dtls_transport,
|
2017-01-24 21:51:21 -08:00
|
|
|
DtlsTransportInternal* rtcp_dtls_transport,
|
2017-02-10 11:31:50 -08:00
|
|
|
rtc::PacketTransportInternal* rtp_packet_transport,
|
|
|
|
|
rtc::PacketTransportInternal* rtcp_packet_transport);
|
2015-12-17 16:45:59 -08:00
|
|
|
|
2016-08-26 21:42:15 -07:00
|
|
|
// This does not update writability or "ready-to-send" state; it just
|
|
|
|
|
// disconnects from the old channel and connects to the new one.
|
2017-01-24 21:51:21 -08:00
|
|
|
void SetTransport_n(bool rtcp,
|
|
|
|
|
DtlsTransportInternal* new_dtls_transport,
|
2017-02-10 11:31:50 -08:00
|
|
|
rtc::PacketTransportInternal* new_packet_transport);
|
2015-12-17 16:45:59 -08:00
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
bool was_ever_writable() const { return was_ever_writable_; }
|
2017-11-28 14:57:10 -08:00
|
|
|
void set_local_content_direction(webrtc::RtpTransceiverDirection direction) {
|
2013-07-10 00:45:36 +00:00
|
|
|
local_content_direction_ = direction;
|
|
|
|
|
}
|
2017-11-28 14:57:10 -08:00
|
|
|
void set_remote_content_direction(webrtc::RtpTransceiverDirection direction) {
|
2013-07-10 00:45:36 +00:00
|
|
|
remote_content_direction_ = direction;
|
|
|
|
|
}
|
2016-08-25 13:31:14 -07:00
|
|
|
// These methods verify that:
|
|
|
|
|
// * The required content description directions have been set.
|
|
|
|
|
// * The channel is enabled.
|
|
|
|
|
// * And for sending:
|
|
|
|
|
// - The SRTP filter is active if it's needed.
|
|
|
|
|
// - The transport has been writable before, meaning it should be at least
|
|
|
|
|
// possible to succeed in sending a packet.
|
|
|
|
|
//
|
|
|
|
|
// When any of these properties change, UpdateMediaSendRecvState_w should be
|
|
|
|
|
// called.
|
|
|
|
|
bool IsReadyToReceiveMedia_w() const;
|
|
|
|
|
bool IsReadyToSendMedia_w() const;
|
2017-01-12 19:37:48 -08:00
|
|
|
rtc::Thread* signaling_thread() { return signaling_thread_; }
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2017-01-24 21:51:21 -08:00
|
|
|
void ConnectToDtlsTransport(DtlsTransportInternal* transport);
|
|
|
|
|
void DisconnectFromDtlsTransport(DtlsTransportInternal* transport);
|
2017-02-10 11:31:50 -08:00
|
|
|
void ConnectToPacketTransport(rtc::PacketTransportInternal* transport);
|
|
|
|
|
void DisconnectFromPacketTransport(rtc::PacketTransportInternal* transport);
|
2015-03-16 20:19:12 +00:00
|
|
|
|
2016-05-11 19:55:27 +02:00
|
|
|
void FlushRtcpMessages_n();
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
// NetworkInterface implementation, called by MediaEngine
|
2016-03-20 06:15:43 -07:00
|
|
|
bool SendPacket(rtc::CopyOnWriteBuffer* packet,
|
|
|
|
|
const rtc::PacketOptions& options) override;
|
|
|
|
|
bool SendRtcp(rtc::CopyOnWriteBuffer* packet,
|
|
|
|
|
const rtc::PacketOptions& options) override;
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
// From TransportChannel
|
2017-02-10 11:31:50 -08:00
|
|
|
void OnWritableState(rtc::PacketTransportInternal* transport);
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2017-01-19 16:54:25 -08:00
|
|
|
void OnDtlsState(DtlsTransportInternal* transport, DtlsTransportState state);
|
2015-12-05 09:59:56 -08:00
|
|
|
|
2017-11-13 13:26:07 -08:00
|
|
|
void OnNetworkRouteChanged(rtc::Optional<rtc::NetworkRoute> network_route);
|
2016-03-29 17:27:21 -07:00
|
|
|
|
2017-02-10 11:31:50 -08:00
|
|
|
bool PacketIsRtcp(const rtc::PacketTransportInternal* transport,
|
2016-10-25 10:50:32 -07:00
|
|
|
const char* data,
|
2013-07-10 00:45:36 +00:00
|
|
|
size_t len);
|
2015-10-15 07:26:07 -07:00
|
|
|
bool SendPacket(bool rtcp,
|
2016-03-20 06:15:43 -07:00
|
|
|
rtc::CopyOnWriteBuffer* packet,
|
2015-10-15 07:26:07 -07:00
|
|
|
const rtc::PacketOptions& options);
|
2016-05-11 19:55:27 +02:00
|
|
|
|
2017-01-09 14:53:41 -08:00
|
|
|
bool WantsPacket(bool rtcp, const rtc::CopyOnWriteBuffer* packet);
|
2016-03-20 06:15:43 -07:00
|
|
|
void HandlePacket(bool rtcp, rtc::CopyOnWriteBuffer* packet,
|
2014-07-29 17:36:52 +00:00
|
|
|
const rtc::PacketTime& packet_time);
|
2017-06-01 13:22:42 -07:00
|
|
|
// TODO(zstein): packet can be const once the RtpTransport handles protection.
|
|
|
|
|
virtual void OnPacketReceived(bool rtcp,
|
2017-07-14 12:30:04 -07:00
|
|
|
rtc::CopyOnWriteBuffer* packet,
|
2017-06-01 13:22:42 -07:00
|
|
|
const rtc::PacketTime& packet_time);
|
|
|
|
|
void ProcessPacket(bool rtcp,
|
|
|
|
|
const rtc::CopyOnWriteBuffer& packet,
|
|
|
|
|
const rtc::PacketTime& packet_time);
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
void EnableMedia_w();
|
|
|
|
|
void DisableMedia_w();
|
2016-08-25 13:31:14 -07:00
|
|
|
|
|
|
|
|
// Performs actions if the RTP/RTCP writable state changed. This should
|
|
|
|
|
// be called whenever a channel's writable state changes or when RTCP muxing
|
|
|
|
|
// becomes active/inactive.
|
2016-05-11 19:55:27 +02:00
|
|
|
void UpdateWritableState_n();
|
|
|
|
|
void ChannelWritable_n();
|
|
|
|
|
void ChannelNotWritable_n();
|
2016-08-25 13:31:14 -07:00
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
bool AddRecvStream_w(const StreamParams& sp);
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
bool RemoveRecvStream_w(uint32_t ssrc);
|
2013-08-30 21:24:16 +00:00
|
|
|
bool AddSendStream_w(const StreamParams& sp);
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
bool RemoveSendStream_w(uint32_t ssrc);
|
2017-01-09 14:53:41 -08:00
|
|
|
bool ShouldSetupDtlsSrtp_n() const;
|
2013-07-10 00:45:36 +00:00
|
|
|
// Do the DTLS key expansion and impose it on the SRTP/SRTCP filters.
|
|
|
|
|
// |rtcp_channel| indicates whether to set up the RTP or RTCP filter.
|
2017-01-19 16:54:25 -08:00
|
|
|
bool SetupDtlsSrtp_n(bool rtcp);
|
2016-05-11 19:55:27 +02:00
|
|
|
void MaybeSetupDtlsSrtp_n();
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2016-08-25 13:31:14 -07:00
|
|
|
// Should be called whenever the conditions for
|
|
|
|
|
// IsReadyToReceiveMedia/IsReadyToSendMedia are satisfied (or unsatisfied).
|
|
|
|
|
// Updates the send/recv state of the media channel.
|
|
|
|
|
void UpdateMediaSendRecvState();
|
|
|
|
|
virtual void UpdateMediaSendRecvState_w() = 0;
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
bool UpdateLocalStreams_w(const std::vector<StreamParams>& streams,
|
2014-01-15 23:15:54 +00:00
|
|
|
ContentAction action,
|
|
|
|
|
std::string* error_desc);
|
2013-07-10 00:45:36 +00:00
|
|
|
bool UpdateRemoteStreams_w(const std::vector<StreamParams>& streams,
|
2014-01-15 23:15:54 +00:00
|
|
|
ContentAction action,
|
|
|
|
|
std::string* error_desc);
|
2013-07-10 00:45:36 +00:00
|
|
|
virtual bool SetLocalContent_w(const MediaContentDescription* content,
|
2014-01-15 23:15:54 +00:00
|
|
|
ContentAction action,
|
|
|
|
|
std::string* error_desc) = 0;
|
2013-07-10 00:45:36 +00:00
|
|
|
virtual bool SetRemoteContent_w(const MediaContentDescription* content,
|
2014-01-15 23:15:54 +00:00
|
|
|
ContentAction action,
|
|
|
|
|
std::string* error_desc) = 0;
|
2016-05-11 19:55:27 +02:00
|
|
|
bool SetRtpTransportParameters(const MediaContentDescription* content,
|
2017-06-29 12:31:36 -07:00
|
|
|
ContentAction action, ContentSource src,
|
|
|
|
|
const RtpHeaderExtensions& extensions, std::string* error_desc);
|
2016-05-11 19:55:27 +02:00
|
|
|
bool SetRtpTransportParameters_n(const MediaContentDescription* content,
|
2017-06-29 12:31:36 -07:00
|
|
|
ContentAction action, ContentSource src,
|
|
|
|
|
const std::vector<int>& encrypted_extension_ids,
|
|
|
|
|
std::string* error_desc);
|
|
|
|
|
|
|
|
|
|
// Return a list of RTP header extensions with the non-encrypted extensions
|
|
|
|
|
// removed depending on the current crypto_options_ and only if both the
|
|
|
|
|
// non-encrypted and encrypted extension is present for the same URI.
|
|
|
|
|
RtpHeaderExtensions GetFilteredRtpHeaderExtensions(
|
|
|
|
|
const RtpHeaderExtensions& extensions);
|
2014-01-15 23:15:54 +00:00
|
|
|
|
2014-02-21 23:43:24 +00:00
|
|
|
// Helper method to get RTP Absoulute SendTime extension header id if
|
|
|
|
|
// present in remote supported extensions list.
|
2016-05-11 19:55:27 +02:00
|
|
|
void MaybeCacheRtpAbsSendTimeHeaderExtension_w(
|
2016-05-26 11:24:55 -07:00
|
|
|
const std::vector<webrtc::RtpExtension>& extensions);
|
2014-02-21 23:43:24 +00:00
|
|
|
|
2016-05-11 19:55:27 +02:00
|
|
|
bool CheckSrtpConfig_n(const std::vector<CryptoParams>& cryptos,
|
|
|
|
|
bool* dtls,
|
|
|
|
|
std::string* error_desc);
|
|
|
|
|
bool SetSrtp_n(const std::vector<CryptoParams>& params,
|
2014-01-15 23:15:54 +00:00
|
|
|
ContentAction action,
|
|
|
|
|
ContentSource src,
|
2017-06-29 12:31:36 -07:00
|
|
|
const std::vector<int>& encrypted_extension_ids,
|
2014-01-15 23:15:54 +00:00
|
|
|
std::string* error_desc);
|
2016-05-11 19:55:27 +02:00
|
|
|
bool SetRtcpMux_n(bool enable,
|
2014-01-15 23:15:54 +00:00
|
|
|
ContentAction action,
|
|
|
|
|
ContentSource src,
|
|
|
|
|
std::string* error_desc);
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
// From MessageHandler
|
2015-10-27 14:22:16 -07:00
|
|
|
void OnMessage(rtc::Message* pmsg) override;
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
// Handled in derived classes
|
2015-03-13 18:25:21 +00:00
|
|
|
virtual void OnConnectionMonitorUpdate(ConnectionMonitor* monitor,
|
2013-07-10 00:45:36 +00:00
|
|
|
const std::vector<ConnectionInfo>& infos) = 0;
|
|
|
|
|
|
2017-06-02 06:44:03 -07:00
|
|
|
// Helper function template for invoking methods on the worker thread.
|
|
|
|
|
template <class T, class FunctorT>
|
|
|
|
|
T InvokeOnWorker(const rtc::Location& posted_from, const FunctorT& functor) {
|
|
|
|
|
return worker_thread_->Invoke<T>(posted_from, functor);
|
2014-02-07 19:03:26 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-01 13:22:42 -07:00
|
|
|
void AddHandledPayloadType(int payload_type);
|
|
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
private:
|
2017-11-06 15:53:33 -08:00
|
|
|
void InitNetwork_n(DtlsTransportInternal* rtp_dtls_transport,
|
2017-01-24 21:51:21 -08:00
|
|
|
DtlsTransportInternal* rtcp_dtls_transport,
|
2017-02-10 11:31:50 -08:00
|
|
|
rtc::PacketTransportInternal* rtp_packet_transport,
|
|
|
|
|
rtc::PacketTransportInternal* rtcp_packet_transport);
|
2016-05-14 01:43:50 +02:00
|
|
|
void DisconnectTransportChannels_n();
|
2017-02-10 11:31:50 -08:00
|
|
|
void SignalSentPacket_n(rtc::PacketTransportInternal* transport,
|
2016-05-11 19:55:27 +02:00
|
|
|
const rtc::SentPacket& sent_packet);
|
|
|
|
|
void SignalSentPacket_w(const rtc::SentPacket& sent_packet);
|
2016-08-25 13:31:14 -07:00
|
|
|
bool IsReadyToSendMedia_n() const;
|
2016-05-11 19:55:27 +02:00
|
|
|
void CacheRtpAbsSendTimeHeaderExtension_n(int rtp_abs_sendtime_extn_id);
|
2017-09-22 12:12:30 -07:00
|
|
|
// Wraps the existing RtpTransport in an SrtpTransport.
|
|
|
|
|
void EnableSrtpTransport_n();
|
2016-05-11 19:55:27 +02:00
|
|
|
|
2017-11-10 16:44:46 -08:00
|
|
|
// Cache the encrypted header extension IDs when setting the local/remote
|
|
|
|
|
// description and use them later together with other crypto parameters from
|
|
|
|
|
// DtlsTransport.
|
|
|
|
|
void CacheEncryptedHeaderExtensionIds(cricket::ContentSource source,
|
|
|
|
|
const std::vector<int>& extension_ids);
|
|
|
|
|
|
|
|
|
|
// Return true if the new header extension IDs are different from the existing
|
|
|
|
|
// ones.
|
|
|
|
|
bool EncryptedHeaderExtensionIdsChanged(
|
|
|
|
|
cricket::ContentSource source,
|
|
|
|
|
const std::vector<int>& new_extension_ids);
|
|
|
|
|
|
2016-05-11 19:55:27 +02:00
|
|
|
rtc::Thread* const worker_thread_;
|
|
|
|
|
rtc::Thread* const network_thread_;
|
2017-01-12 19:37:48 -08:00
|
|
|
rtc::Thread* const signaling_thread_;
|
2016-05-11 19:55:27 +02:00
|
|
|
rtc::AsyncInvoker invoker_;
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2015-03-13 18:20:33 +00:00
|
|
|
const std::string content_name_;
|
2016-05-11 19:55:27 +02:00
|
|
|
std::unique_ptr<ConnectionMonitor> connection_monitor_;
|
|
|
|
|
|
2017-01-24 21:51:21 -08:00
|
|
|
// Won't be set when using raw packet transports. SDP-specific thing.
|
2015-09-23 11:50:27 -07:00
|
|
|
std::string transport_name_;
|
2017-01-19 16:54:25 -08:00
|
|
|
|
2017-04-24 16:54:35 -07:00
|
|
|
const bool rtcp_mux_required_;
|
|
|
|
|
|
2017-01-24 21:51:21 -08:00
|
|
|
// Separate DTLS/non-DTLS pointers to support using BaseChannel without DTLS.
|
|
|
|
|
// Temporary measure until more refactoring is done.
|
|
|
|
|
// If non-null, "X_dtls_transport_" will always equal "X_packet_transport_".
|
2017-01-19 16:54:25 -08:00
|
|
|
DtlsTransportInternal* rtp_dtls_transport_ = nullptr;
|
|
|
|
|
DtlsTransportInternal* rtcp_dtls_transport_ = nullptr;
|
2017-07-19 13:38:02 -07:00
|
|
|
std::unique_ptr<webrtc::RtpTransportInternal> rtp_transport_;
|
2017-09-22 12:12:30 -07:00
|
|
|
webrtc::SrtpTransport* srtp_transport_ = nullptr;
|
2017-01-24 21:51:21 -08:00
|
|
|
std::vector<std::pair<rtc::Socket::Option, int> > socket_options_;
|
2015-09-23 11:50:27 -07:00
|
|
|
std::vector<std::pair<rtc::Socket::Option, int> > rtcp_socket_options_;
|
2017-09-22 12:12:30 -07:00
|
|
|
SrtpFilter sdes_negotiator_;
|
2013-07-10 00:45:36 +00:00
|
|
|
RtcpMuxFilter rtcp_mux_filter_;
|
2016-08-22 16:00:30 -07:00
|
|
|
bool writable_ = false;
|
|
|
|
|
bool was_ever_writable_ = false;
|
|
|
|
|
bool has_received_packet_ = false;
|
2017-09-22 12:12:30 -07:00
|
|
|
bool dtls_active_ = false;
|
2016-12-13 11:29:11 -08:00
|
|
|
const bool srtp_required_ = true;
|
2016-05-11 19:55:27 +02:00
|
|
|
|
2016-08-25 13:31:14 -07:00
|
|
|
// MediaChannel related members that should be accessed from the worker
|
|
|
|
|
// thread.
|
2017-11-06 15:53:33 -08:00
|
|
|
std::unique_ptr<MediaChannel> media_channel_;
|
2016-08-25 13:31:14 -07:00
|
|
|
// Currently the |enabled_| flag is accessed from the signaling thread as
|
|
|
|
|
// well, but it can be changed only when signaling thread does a synchronous
|
|
|
|
|
// call to the worker thread, so it should be safe.
|
2016-08-22 16:00:30 -07:00
|
|
|
bool enabled_ = false;
|
2016-05-11 19:55:27 +02:00
|
|
|
std::vector<StreamParams> local_streams_;
|
|
|
|
|
std::vector<StreamParams> remote_streams_;
|
2017-11-28 14:57:10 -08:00
|
|
|
webrtc::RtpTransceiverDirection local_content_direction_ =
|
|
|
|
|
webrtc::RtpTransceiverDirection::kInactive;
|
|
|
|
|
webrtc::RtpTransceiverDirection remote_content_direction_ =
|
|
|
|
|
webrtc::RtpTransceiverDirection::kInactive;
|
2017-11-10 16:44:46 -08:00
|
|
|
|
|
|
|
|
// The cached encrypted header extension IDs.
|
|
|
|
|
rtc::Optional<std::vector<int>> catched_send_extension_ids_;
|
|
|
|
|
rtc::Optional<std::vector<int>> catched_recv_extension_ids_;
|
2013-07-10 00:45:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// VoiceChannel is a specialization that adds support for early media, DTMF,
|
|
|
|
|
// and input/output level monitoring.
|
|
|
|
|
class VoiceChannel : public BaseChannel {
|
|
|
|
|
public:
|
2016-05-11 19:55:27 +02:00
|
|
|
VoiceChannel(rtc::Thread* worker_thread,
|
|
|
|
|
rtc::Thread* network_thread,
|
2017-01-12 19:37:48 -08:00
|
|
|
rtc::Thread* signaling_thread,
|
2015-09-23 11:50:27 -07:00
|
|
|
MediaEngineInterface* media_engine,
|
2017-11-06 15:53:33 -08:00
|
|
|
std::unique_ptr<VoiceMediaChannel> channel,
|
2015-09-23 11:50:27 -07:00
|
|
|
const std::string& content_name,
|
2017-01-12 21:59:29 -08:00
|
|
|
bool rtcp_mux_required,
|
2016-12-13 11:29:11 -08:00
|
|
|
bool srtp_required);
|
2013-07-10 00:45:36 +00:00
|
|
|
~VoiceChannel();
|
2015-09-10 01:57:14 -07:00
|
|
|
|
|
|
|
|
// Configure sending media on the stream with SSRC |ssrc|
|
|
|
|
|
// If there is only one sending stream SSRC 0 can be used.
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
bool SetAudioSend(uint32_t ssrc,
|
2015-10-01 02:31:10 -07:00
|
|
|
bool enable,
|
2015-09-23 11:50:27 -07:00
|
|
|
const AudioOptions* options,
|
2016-03-08 12:37:39 -08:00
|
|
|
AudioSource* source);
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
// downcasts a MediaChannel
|
2016-05-11 19:55:27 +02:00
|
|
|
VoiceMediaChannel* media_channel() const override {
|
2013-07-10 00:45:36 +00:00
|
|
|
return static_cast<VoiceMediaChannel*>(BaseChannel::media_channel());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SetEarlyMedia(bool enable);
|
|
|
|
|
// This signal is emitted when we have gone a period of time without
|
|
|
|
|
// receiving early media. When received, a UI should start playing its
|
|
|
|
|
// own ringing sound
|
|
|
|
|
sigslot::signal1<VoiceChannel*> SignalEarlyMediaTimeout;
|
|
|
|
|
|
|
|
|
|
// Returns if the telephone-event has been negotiated.
|
|
|
|
|
bool CanInsertDtmf();
|
|
|
|
|
// Send and/or play a DTMF |event| according to the |flags|.
|
|
|
|
|
// The DTMF out-of-band signal will be used on sending.
|
|
|
|
|
// The |ssrc| should be either 0 or a valid send stream ssrc.
|
2013-07-17 14:42:53 +00:00
|
|
|
// The valid value for the |event| are 0 which corresponding to DTMF
|
|
|
|
|
// event 0-9, *, #, A-D.
|
2015-12-02 12:35:09 -08:00
|
|
|
bool InsertDtmf(uint32_t ssrc, int event_code, int duration);
|
2015-10-09 02:32:53 -07:00
|
|
|
bool SetOutputVolume(uint32_t ssrc, double volume);
|
2016-01-13 12:00:26 -08:00
|
|
|
void SetRawAudioSink(uint32_t ssrc,
|
2016-03-11 14:18:21 -08:00
|
|
|
std::unique_ptr<webrtc::AudioSinkInterface> sink);
|
2016-05-16 11:40:30 -07:00
|
|
|
webrtc::RtpParameters GetRtpSendParameters(uint32_t ssrc) const;
|
|
|
|
|
bool SetRtpSendParameters(uint32_t ssrc,
|
|
|
|
|
const webrtc::RtpParameters& parameters);
|
|
|
|
|
webrtc::RtpParameters GetRtpReceiveParameters(uint32_t ssrc) const;
|
|
|
|
|
bool SetRtpReceiveParameters(uint32_t ssrc,
|
|
|
|
|
const webrtc::RtpParameters& parameters);
|
2015-12-12 01:37:01 +01:00
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
// Get statistics about the current media session.
|
|
|
|
|
bool GetStats(VoiceMediaInfo* stats);
|
|
|
|
|
|
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ )
Reason for revert:
Re-land, reverting did not fix bug.
https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
Original issue's description:
> Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ )
>
> Reason for revert:
> Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see
>
> https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
>
> Original issue's description:
> > Added the GetSources() to the RtpReceiverInterface and implemented
> > it for the AudioRtpReceiver.
> >
> > This method returns a vector of RtpSource(both CSRC source and SSRC
> > source) which contains the ID of a source, the timestamp, the source
> > type (SSRC or CSRC) and the audio level.
> >
> > The RtpSource objects are buffered and maintained by the
> > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called,
> > the info of the contributing source will be pulled along the object
> > chain:
> > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel ->
> > AudioReceiveStream -> voe::Channel -> RtpRtcp module
> >
> > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource
> >
> > BUG=chromium:703122
> > TBR=stefan@webrtc.org, danilchap@webrtc.org
> >
> > Review-Url: https://codereview.webrtc.org/2770233003
> > Cr-Commit-Position: refs/heads/master@{#17591}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053
>
> TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=chromium:703122
>
> Review-Url: https://codereview.webrtc.org/2809613002
> Cr-Commit-Position: refs/heads/master@{#17616}
> Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675
TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:703122
Review-Url: https://codereview.webrtc.org/2810623003
Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
|
|
|
std::vector<webrtc::RtpSource> GetSources(uint32_t ssrc) const;
|
2017-06-15 12:52:32 -07:00
|
|
|
std::vector<webrtc::RtpSource> GetSources_w(uint32_t ssrc) const;
|
Reland of Implemented the GetSources() in native code. (patchset #1 id:1 of https://codereview.webrtc.org/2809613002/ )
Reason for revert:
Re-land, reverting did not fix bug.
https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
Original issue's description:
> Revert of Implemented the GetSources() in native code. (patchset #11 id:510001 of https://codereview.webrtc.org/2770233003/ )
>
> Reason for revert:
> Suspected of WebRtcApprtcBrowserTest.MANUAL_WorksOnApprtc breakage, see
>
> https://bugs.chromium.org/p/webrtc/issues/detail?id=7465
>
> Original issue's description:
> > Added the GetSources() to the RtpReceiverInterface and implemented
> > it for the AudioRtpReceiver.
> >
> > This method returns a vector of RtpSource(both CSRC source and SSRC
> > source) which contains the ID of a source, the timestamp, the source
> > type (SSRC or CSRC) and the audio level.
> >
> > The RtpSource objects are buffered and maintained by the
> > RtpReceiver in webrtc/modules/rtp_rtcp/. When the method is called,
> > the info of the contributing source will be pulled along the object
> > chain:
> > AudioRtpReceiver -> VoiceChannel -> WebRtcVoiceMediaChannel ->
> > AudioReceiveStream -> voe::Channel -> RtpRtcp module
> >
> > Spec:https://w3c.github.io/webrtc-pc/archives/20151006/webrtc.html#widl-RTCRtpReceiver-getContributingSources-sequence-RTCRtpContributingSource
> >
> > BUG=chromium:703122
> > TBR=stefan@webrtc.org, danilchap@webrtc.org
> >
> > Review-Url: https://codereview.webrtc.org/2770233003
> > Cr-Commit-Position: refs/heads/master@{#17591}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/292084c3765d9f3ee406ca2ec86eae206b540053
>
> TBR=deadbeef@webrtc.org,solenberg@webrtc.org,hbos@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=chromium:703122
>
> Review-Url: https://codereview.webrtc.org/2809613002
> Cr-Commit-Position: refs/heads/master@{#17616}
> Committed: https://chromium.googlesource.com/external/webrtc/+/fbcc5cb3869d1370008e40f24fc03ac8fb69c675
TBR=deadbeef@webrtc.org,solenberg@webrtc.org,philipel@webrtc.org,stefan@webrtc.org,danilchap@webrtc.org,zhihuang@webrtc.org,olka@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:703122
Review-Url: https://codereview.webrtc.org/2810623003
Cr-Commit-Position: refs/heads/master@{#17621}
2017-04-10 07:39:05 -07:00
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
// Monitoring functions
|
|
|
|
|
sigslot::signal2<VoiceChannel*, const std::vector<ConnectionInfo>&>
|
|
|
|
|
SignalConnectionMonitor;
|
|
|
|
|
|
|
|
|
|
void StartMediaMonitor(int cms);
|
|
|
|
|
void StopMediaMonitor();
|
|
|
|
|
sigslot::signal2<VoiceChannel*, const VoiceMediaInfo&> SignalMediaMonitor;
|
|
|
|
|
|
|
|
|
|
void StartAudioMonitor(int cms);
|
|
|
|
|
void StopAudioMonitor();
|
|
|
|
|
bool IsAudioMonitorRunning() const;
|
|
|
|
|
sigslot::signal2<VoiceChannel*, const AudioInfo&> SignalAudioMonitor;
|
|
|
|
|
|
|
|
|
|
int GetInputLevel_w();
|
|
|
|
|
int GetOutputLevel_w();
|
|
|
|
|
void GetActiveStreams_w(AudioInfo::StreamList* actives);
|
2016-05-16 11:40:30 -07:00
|
|
|
webrtc::RtpParameters GetRtpSendParameters_w(uint32_t ssrc) const;
|
|
|
|
|
bool SetRtpSendParameters_w(uint32_t ssrc, webrtc::RtpParameters parameters);
|
|
|
|
|
webrtc::RtpParameters GetRtpReceiveParameters_w(uint32_t ssrc) const;
|
|
|
|
|
bool SetRtpReceiveParameters_w(uint32_t ssrc,
|
|
|
|
|
webrtc::RtpParameters parameters);
|
2016-06-14 11:47:14 -07:00
|
|
|
cricket::MediaType media_type() override { return cricket::MEDIA_TYPE_AUDIO; }
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
// overrides from BaseChannel
|
2017-06-01 13:22:42 -07:00
|
|
|
void OnPacketReceived(bool rtcp,
|
2017-07-14 12:30:04 -07:00
|
|
|
rtc::CopyOnWriteBuffer* packet,
|
2017-06-01 13:22:42 -07:00
|
|
|
const rtc::PacketTime& packet_time) override;
|
2016-08-25 13:31:14 -07:00
|
|
|
void UpdateMediaSendRecvState_w() override;
|
2016-05-11 19:55:27 +02:00
|
|
|
bool SetLocalContent_w(const MediaContentDescription* content,
|
|
|
|
|
ContentAction action,
|
|
|
|
|
std::string* error_desc) override;
|
|
|
|
|
bool SetRemoteContent_w(const MediaContentDescription* content,
|
|
|
|
|
ContentAction action,
|
|
|
|
|
std::string* error_desc) override;
|
2013-07-10 00:45:36 +00:00
|
|
|
void HandleEarlyMediaTimeout();
|
2015-12-02 12:35:09 -08:00
|
|
|
bool InsertDtmf_w(uint32_t ssrc, int event, int duration);
|
2015-10-09 02:32:53 -07:00
|
|
|
bool SetOutputVolume_w(uint32_t ssrc, double volume);
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2016-05-11 19:55:27 +02:00
|
|
|
void OnMessage(rtc::Message* pmsg) override;
|
|
|
|
|
void OnConnectionMonitorUpdate(
|
|
|
|
|
ConnectionMonitor* monitor,
|
|
|
|
|
const std::vector<ConnectionInfo>& infos) override;
|
|
|
|
|
void OnMediaMonitorUpdate(VoiceMediaChannel* media_channel,
|
|
|
|
|
const VoiceMediaInfo& info);
|
2013-07-10 00:45:36 +00:00
|
|
|
void OnAudioMonitorUpdate(AudioMonitor* monitor, const AudioInfo& info);
|
|
|
|
|
|
|
|
|
|
static const int kEarlyMediaTimeout = 1000;
|
2015-08-05 12:25:22 +02:00
|
|
|
MediaEngineInterface* media_engine_;
|
2017-11-06 15:53:33 -08:00
|
|
|
bool received_media_ = false;
|
2016-03-11 14:18:21 -08:00
|
|
|
std::unique_ptr<VoiceMediaMonitor> media_monitor_;
|
|
|
|
|
std::unique_ptr<AudioMonitor> audio_monitor_;
|
2015-08-07 16:05:34 -07:00
|
|
|
|
|
|
|
|
// Last AudioSendParameters sent down to the media_channel() via
|
|
|
|
|
// SetSendParameters.
|
|
|
|
|
AudioSendParameters last_send_params_;
|
|
|
|
|
// Last AudioRecvParameters sent down to the media_channel() via
|
|
|
|
|
// SetRecvParameters.
|
|
|
|
|
AudioRecvParameters last_recv_params_;
|
2013-07-10 00:45:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// VideoChannel is a specialization for video.
|
|
|
|
|
class VideoChannel : public BaseChannel {
|
|
|
|
|
public:
|
2016-05-11 19:55:27 +02:00
|
|
|
VideoChannel(rtc::Thread* worker_thread,
|
2017-01-12 19:37:48 -08:00
|
|
|
rtc::Thread* network_thread,
|
|
|
|
|
rtc::Thread* signaling_thread,
|
2017-11-06 15:53:33 -08:00
|
|
|
std::unique_ptr<VideoMediaChannel> media_channel,
|
2015-09-23 11:50:27 -07:00
|
|
|
const std::string& content_name,
|
2017-01-12 21:59:29 -08:00
|
|
|
bool rtcp_mux_required,
|
2016-12-13 11:29:11 -08:00
|
|
|
bool srtp_required);
|
2013-07-10 00:45:36 +00:00
|
|
|
~VideoChannel();
|
|
|
|
|
|
2015-05-07 14:07:48 +02:00
|
|
|
// downcasts a MediaChannel
|
2016-05-11 19:55:27 +02:00
|
|
|
VideoMediaChannel* media_channel() const override {
|
2015-05-07 14:07:48 +02:00
|
|
|
return static_cast<VideoMediaChannel*>(BaseChannel::media_channel());
|
|
|
|
|
}
|
|
|
|
|
|
Reland of Delete all use of cricket::VideoFrame and cricket::WebRtcVideoFrame. (patchset #1 id:1 of https://codereview.webrtc.org/2471783002/ )
Reason for revert:
Relanding after known downstream breakages have been fixed.
Original issue's description:
> Revert of Delete all use of cricket::VideoFrame and cricket::WebRtcVideoFrame. (patchset #7 id:120001 of https://codereview.webrtc.org/2383093002/ )
>
> Reason for revert:
> Breaks chrome, see https://build.chromium.org/p/chromium.webrtc.fyi/builders/Mac%20Builder/builds/19019/steps/compile/logs/stdio
>
> Analysis: Chrome uses cricket::VideoFrame, without explicitly including webrtc/media/base/videoframe.h, and breaks when that file is no longer included by any other webrtc headers. Will reland after updating Chrome.
>
> Original issue's description:
> > Delete all use of cricket::VideoFrame and cricket::WebRtcVideoFrame.
> >
> > Replaced with webrtc::VideoFrame.
> >
> > TBR=mflodman@webrtc.org
> > BUG=webrtc:5682
> >
> > Committed: https://crrev.com/45c8b8940042bd2574c39920804ade8343cefdba
> > Cr-Commit-Position: refs/heads/master@{#14885}
>
> TBR=perkj@webrtc.org,pthatcher@webrtc.org,tkchin@webrtc.org,mflodman@webrtc.org,stefan@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:5682
>
> Committed: https://crrev.com/7341ab8e2505c9763d208e069bda269018357e7d
> Cr-Commit-Position: refs/heads/master@{#14886}
TBR=perkj@webrtc.org,pthatcher@webrtc.org,tkchin@webrtc.org,mflodman@webrtc.org,stefan@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:5682
Review-Url: https://codereview.webrtc.org/2487633002
Cr-Commit-Position: refs/heads/master@{#15039}
2016-11-11 03:55:13 -08:00
|
|
|
bool SetSink(uint32_t ssrc,
|
|
|
|
|
rtc::VideoSinkInterface<webrtc::VideoFrame>* sink);
|
2017-06-02 06:44:03 -07:00
|
|
|
void FillBitrateInfo(BandwidthEstimationInfo* bwe_info);
|
2013-07-10 00:45:36 +00:00
|
|
|
// Get statistics about the current media session.
|
2015-03-04 08:54:32 +00:00
|
|
|
bool GetStats(VideoMediaInfo* stats);
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
sigslot::signal2<VideoChannel*, const std::vector<ConnectionInfo>&>
|
|
|
|
|
SignalConnectionMonitor;
|
|
|
|
|
|
|
|
|
|
void StartMediaMonitor(int cms);
|
|
|
|
|
void StopMediaMonitor();
|
|
|
|
|
sigslot::signal2<VideoChannel*, const VideoMediaInfo&> SignalMediaMonitor;
|
|
|
|
|
|
2016-06-02 16:23:38 -07:00
|
|
|
// Register a source and set options.
|
|
|
|
|
// The |ssrc| must correspond to a registered send stream.
|
|
|
|
|
bool SetVideoSend(uint32_t ssrc,
|
|
|
|
|
bool enable,
|
|
|
|
|
const VideoOptions* options,
|
Reland of Delete all use of cricket::VideoFrame and cricket::WebRtcVideoFrame. (patchset #1 id:1 of https://codereview.webrtc.org/2471783002/ )
Reason for revert:
Relanding after known downstream breakages have been fixed.
Original issue's description:
> Revert of Delete all use of cricket::VideoFrame and cricket::WebRtcVideoFrame. (patchset #7 id:120001 of https://codereview.webrtc.org/2383093002/ )
>
> Reason for revert:
> Breaks chrome, see https://build.chromium.org/p/chromium.webrtc.fyi/builders/Mac%20Builder/builds/19019/steps/compile/logs/stdio
>
> Analysis: Chrome uses cricket::VideoFrame, without explicitly including webrtc/media/base/videoframe.h, and breaks when that file is no longer included by any other webrtc headers. Will reland after updating Chrome.
>
> Original issue's description:
> > Delete all use of cricket::VideoFrame and cricket::WebRtcVideoFrame.
> >
> > Replaced with webrtc::VideoFrame.
> >
> > TBR=mflodman@webrtc.org
> > BUG=webrtc:5682
> >
> > Committed: https://crrev.com/45c8b8940042bd2574c39920804ade8343cefdba
> > Cr-Commit-Position: refs/heads/master@{#14885}
>
> TBR=perkj@webrtc.org,pthatcher@webrtc.org,tkchin@webrtc.org,mflodman@webrtc.org,stefan@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:5682
>
> Committed: https://crrev.com/7341ab8e2505c9763d208e069bda269018357e7d
> Cr-Commit-Position: refs/heads/master@{#14886}
TBR=perkj@webrtc.org,pthatcher@webrtc.org,tkchin@webrtc.org,mflodman@webrtc.org,stefan@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:5682
Review-Url: https://codereview.webrtc.org/2487633002
Cr-Commit-Position: refs/heads/master@{#15039}
2016-11-11 03:55:13 -08:00
|
|
|
rtc::VideoSourceInterface<webrtc::VideoFrame>* source);
|
2016-05-16 11:40:30 -07:00
|
|
|
webrtc::RtpParameters GetRtpSendParameters(uint32_t ssrc) const;
|
|
|
|
|
bool SetRtpSendParameters(uint32_t ssrc,
|
|
|
|
|
const webrtc::RtpParameters& parameters);
|
|
|
|
|
webrtc::RtpParameters GetRtpReceiveParameters(uint32_t ssrc) const;
|
|
|
|
|
bool SetRtpReceiveParameters(uint32_t ssrc,
|
|
|
|
|
const webrtc::RtpParameters& parameters);
|
2016-06-14 11:47:14 -07:00
|
|
|
cricket::MediaType media_type() override { return cricket::MEDIA_TYPE_VIDEO; }
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
// overrides from BaseChannel
|
2016-08-25 13:31:14 -07:00
|
|
|
void UpdateMediaSendRecvState_w() override;
|
2016-05-11 19:55:27 +02:00
|
|
|
bool SetLocalContent_w(const MediaContentDescription* content,
|
|
|
|
|
ContentAction action,
|
|
|
|
|
std::string* error_desc) override;
|
|
|
|
|
bool SetRemoteContent_w(const MediaContentDescription* content,
|
|
|
|
|
ContentAction action,
|
|
|
|
|
std::string* error_desc) override;
|
2013-07-10 00:45:36 +00:00
|
|
|
bool GetStats_w(VideoMediaInfo* stats);
|
2016-05-16 11:40:30 -07:00
|
|
|
webrtc::RtpParameters GetRtpSendParameters_w(uint32_t ssrc) const;
|
|
|
|
|
bool SetRtpSendParameters_w(uint32_t ssrc, webrtc::RtpParameters parameters);
|
|
|
|
|
webrtc::RtpParameters GetRtpReceiveParameters_w(uint32_t ssrc) const;
|
|
|
|
|
bool SetRtpReceiveParameters_w(uint32_t ssrc,
|
|
|
|
|
webrtc::RtpParameters parameters);
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2016-05-11 19:55:27 +02:00
|
|
|
void OnMessage(rtc::Message* pmsg) override;
|
|
|
|
|
void OnConnectionMonitorUpdate(
|
|
|
|
|
ConnectionMonitor* monitor,
|
|
|
|
|
const std::vector<ConnectionInfo>& infos) override;
|
|
|
|
|
void OnMediaMonitorUpdate(VideoMediaChannel* media_channel,
|
|
|
|
|
const VideoMediaInfo& info);
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2016-03-11 14:18:21 -08:00
|
|
|
std::unique_ptr<VideoMediaMonitor> media_monitor_;
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2015-08-07 16:05:34 -07:00
|
|
|
// Last VideoSendParameters sent down to the media_channel() via
|
|
|
|
|
// SetSendParameters.
|
|
|
|
|
VideoSendParameters last_send_params_;
|
|
|
|
|
// Last VideoRecvParameters sent down to the media_channel() via
|
|
|
|
|
// SetRecvParameters.
|
|
|
|
|
VideoRecvParameters last_recv_params_;
|
2013-07-10 00:45:36 +00:00
|
|
|
};
|
|
|
|
|
|
2017-01-09 14:53:41 -08:00
|
|
|
// RtpDataChannel is a specialization for data.
|
|
|
|
|
class RtpDataChannel : public BaseChannel {
|
2013-07-10 00:45:36 +00:00
|
|
|
public:
|
2017-01-09 14:53:41 -08:00
|
|
|
RtpDataChannel(rtc::Thread* worker_thread,
|
|
|
|
|
rtc::Thread* network_thread,
|
2017-01-12 19:37:48 -08:00
|
|
|
rtc::Thread* signaling_thread,
|
2017-11-06 15:53:33 -08:00
|
|
|
std::unique_ptr<DataMediaChannel> channel,
|
2017-01-09 14:53:41 -08:00
|
|
|
const std::string& content_name,
|
2017-01-12 21:59:29 -08:00
|
|
|
bool rtcp_mux_required,
|
2017-01-09 14:53:41 -08:00
|
|
|
bool srtp_required);
|
|
|
|
|
~RtpDataChannel();
|
2017-11-06 15:53:33 -08:00
|
|
|
void Init_w(DtlsTransportInternal* rtp_dtls_transport,
|
2017-01-24 21:51:21 -08:00
|
|
|
DtlsTransportInternal* rtcp_dtls_transport,
|
2017-02-10 11:31:50 -08:00
|
|
|
rtc::PacketTransportInternal* rtp_packet_transport,
|
|
|
|
|
rtc::PacketTransportInternal* rtcp_packet_transport);
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2013-08-01 00:00:07 +00:00
|
|
|
virtual bool SendData(const SendDataParams& params,
|
2016-03-20 06:15:43 -07:00
|
|
|
const rtc::CopyOnWriteBuffer& payload,
|
2013-08-01 00:00:07 +00:00
|
|
|
SendDataResult* result);
|
2013-07-10 00:45:36 +00:00
|
|
|
|
|
|
|
|
void StartMediaMonitor(int cms);
|
|
|
|
|
void StopMediaMonitor();
|
|
|
|
|
|
2013-11-04 18:41:34 +00:00
|
|
|
// Should be called on the signaling thread only.
|
|
|
|
|
bool ready_to_send_data() const {
|
|
|
|
|
return ready_to_send_data_;
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-09 14:53:41 -08:00
|
|
|
sigslot::signal2<RtpDataChannel*, const DataMediaInfo&> SignalMediaMonitor;
|
|
|
|
|
sigslot::signal2<RtpDataChannel*, const std::vector<ConnectionInfo>&>
|
2013-07-10 00:45:36 +00:00
|
|
|
SignalConnectionMonitor;
|
2017-01-09 14:53:41 -08:00
|
|
|
|
|
|
|
|
sigslot::signal2<const ReceiveDataParams&, const rtc::CopyOnWriteBuffer&>
|
|
|
|
|
SignalDataReceived;
|
2013-07-10 00:45:36 +00:00
|
|
|
// Signal for notifying when the channel becomes ready to send data.
|
2013-08-01 00:00:07 +00:00
|
|
|
// That occurs when the channel is enabled, the transport is writable,
|
|
|
|
|
// both local and remote descriptions are set, and the channel is unblocked.
|
2013-07-10 00:45:36 +00:00
|
|
|
sigslot::signal1<bool> SignalReadyToSendData;
|
2016-06-14 11:47:14 -07:00
|
|
|
cricket::MediaType media_type() override { return cricket::MEDIA_TYPE_DATA; }
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2013-08-30 21:24:16 +00:00
|
|
|
protected:
|
|
|
|
|
// downcasts a MediaChannel.
|
2016-05-11 19:55:27 +02:00
|
|
|
DataMediaChannel* media_channel() const override {
|
2013-08-30 21:24:16 +00:00
|
|
|
return static_cast<DataMediaChannel*>(BaseChannel::media_channel());
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
private:
|
2014-07-29 17:36:52 +00:00
|
|
|
struct SendDataMessageData : public rtc::MessageData {
|
2013-07-10 00:45:36 +00:00
|
|
|
SendDataMessageData(const SendDataParams& params,
|
2016-03-20 06:15:43 -07:00
|
|
|
const rtc::CopyOnWriteBuffer* payload,
|
2013-07-10 00:45:36 +00:00
|
|
|
SendDataResult* result)
|
|
|
|
|
: params(params),
|
|
|
|
|
payload(payload),
|
|
|
|
|
result(result),
|
|
|
|
|
succeeded(false) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const SendDataParams& params;
|
2016-03-20 06:15:43 -07:00
|
|
|
const rtc::CopyOnWriteBuffer* payload;
|
2013-07-10 00:45:36 +00:00
|
|
|
SendDataResult* result;
|
|
|
|
|
bool succeeded;
|
|
|
|
|
};
|
|
|
|
|
|
2014-07-29 17:36:52 +00:00
|
|
|
struct DataReceivedMessageData : public rtc::MessageData {
|
2013-07-10 00:45:36 +00:00
|
|
|
// We copy the data because the data will become invalid after we
|
|
|
|
|
// handle DataMediaChannel::SignalDataReceived but before we fire
|
|
|
|
|
// SignalDataReceived.
|
|
|
|
|
DataReceivedMessageData(
|
|
|
|
|
const ReceiveDataParams& params, const char* data, size_t len)
|
|
|
|
|
: params(params),
|
|
|
|
|
payload(data, len) {
|
|
|
|
|
}
|
|
|
|
|
const ReceiveDataParams params;
|
2016-03-20 06:15:43 -07:00
|
|
|
const rtc::CopyOnWriteBuffer payload;
|
2013-07-10 00:45:36 +00:00
|
|
|
};
|
|
|
|
|
|
2014-07-29 17:36:52 +00:00
|
|
|
typedef rtc::TypedMessageData<bool> DataChannelReadyToSendMessageData;
|
2013-08-01 00:00:07 +00:00
|
|
|
|
2013-07-10 00:45:36 +00:00
|
|
|
// overrides from BaseChannel
|
2017-01-09 14:53:41 -08:00
|
|
|
// Checks that data channel type is RTP.
|
|
|
|
|
bool CheckDataChannelTypeFromContent(const DataContentDescription* content,
|
|
|
|
|
std::string* error_desc);
|
2016-05-11 19:55:27 +02:00
|
|
|
bool SetLocalContent_w(const MediaContentDescription* content,
|
|
|
|
|
ContentAction action,
|
|
|
|
|
std::string* error_desc) override;
|
|
|
|
|
bool SetRemoteContent_w(const MediaContentDescription* content,
|
|
|
|
|
ContentAction action,
|
|
|
|
|
std::string* error_desc) override;
|
2016-08-25 13:31:14 -07:00
|
|
|
void UpdateMediaSendRecvState_w() override;
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2016-05-11 19:55:27 +02:00
|
|
|
void OnMessage(rtc::Message* pmsg) override;
|
|
|
|
|
void OnConnectionMonitorUpdate(
|
|
|
|
|
ConnectionMonitor* monitor,
|
|
|
|
|
const std::vector<ConnectionInfo>& infos) override;
|
|
|
|
|
void OnMediaMonitorUpdate(DataMediaChannel* media_channel,
|
|
|
|
|
const DataMediaInfo& info);
|
2013-07-10 00:45:36 +00:00
|
|
|
void OnDataReceived(
|
|
|
|
|
const ReceiveDataParams& params, const char* data, size_t len);
|
Use suffixed {uint,int}{8,16,32,64}_t types.
Removes the use of uint8, etc. in favor of uint8_t.
BUG=webrtc:5024
R=henrik.lundin@webrtc.org, henrikg@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1362503003 .
Cr-Commit-Position: refs/heads/master@{#10196}
2015-10-07 12:23:21 +02:00
|
|
|
void OnDataChannelError(uint32_t ssrc, DataMediaChannel::Error error);
|
2013-08-01 00:00:07 +00:00
|
|
|
void OnDataChannelReadyToSend(bool writable);
|
2013-07-10 00:45:36 +00:00
|
|
|
|
2016-03-11 14:18:21 -08:00
|
|
|
std::unique_ptr<DataMediaMonitor> media_monitor_;
|
2017-01-09 14:53:41 -08:00
|
|
|
bool ready_to_send_data_ = false;
|
2015-08-07 16:05:34 -07:00
|
|
|
|
|
|
|
|
// Last DataSendParameters sent down to the media_channel() via
|
|
|
|
|
// SetSendParameters.
|
|
|
|
|
DataSendParameters last_send_params_;
|
|
|
|
|
// Last DataRecvParameters sent down to the media_channel() via
|
|
|
|
|
// SetRecvParameters.
|
|
|
|
|
DataRecvParameters last_recv_params_;
|
2013-07-10 00:45:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace cricket
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // PC_CHANNEL_H_
|