Index: webrtc/api/rtpsender.h |
diff --git a/webrtc/api/rtpsender.h b/webrtc/api/rtpsender.h |
index a0bcc9407abf10bba024cf625f880a6bf8ee5885..067ae5e5b8720219c268b182292f287e5f0ecd3d 100644 |
--- a/webrtc/api/rtpsender.h |
+++ b/webrtc/api/rtpsender.h |
@@ -18,12 +18,13 @@ |
#include <memory> |
#include <string> |
-#include "webrtc/api/mediastreamprovider.h" |
+#include "webrtc/api/mediastreaminterface.h" |
#include "webrtc/api/rtpsenderinterface.h" |
#include "webrtc/api/statscollector.h" |
#include "webrtc/base/basictypes.h" |
#include "webrtc/base/criticalsection.h" |
#include "webrtc/media/base/audiosource.h" |
+#include "webrtc/pc/channel.h" |
namespace webrtc { |
@@ -72,18 +73,21 @@ class AudioRtpSender : public ObserverInterface, |
public: |
// StatsCollector provided so that Add/RemoveLocalAudioTrack can be called |
// at the appropriate times. |
+ // |channel| can be null if one does not exist yet. |
AudioRtpSender(AudioTrackInterface* track, |
const std::string& stream_id, |
- AudioProviderInterface* provider, |
+ cricket::VoiceChannel* channel, |
StatsCollector* stats); |
// Randomly generates stream_id. |
+ // |channel| can be null if one does not exist yet. |
AudioRtpSender(AudioTrackInterface* track, |
- AudioProviderInterface* provider, |
+ cricket::VoiceChannel* channel, |
StatsCollector* stats); |
// Randomly generates id and stream_id. |
- AudioRtpSender(AudioProviderInterface* provider, StatsCollector* stats); |
+ // |channel| can be null if one does not exist yet. |
+ AudioRtpSender(cricket::VoiceChannel* channel, StatsCollector* stats); |
virtual ~AudioRtpSender(); |
@@ -122,6 +126,10 @@ class AudioRtpSender : public ObserverInterface, |
void Stop() override; |
+ // Does not take ownership. |
+ // Should call SetChannel(nullptr) before |channel| is destroyed. |
+ void SetChannel(cricket::VoiceChannel* channel) { channel_ = channel; } |
+ |
private: |
// TODO(nisse): Since SSRC == 0 is technically valid, figure out |
// some other way to test if we have a valid SSRC. |
@@ -129,10 +137,12 @@ class AudioRtpSender : public ObserverInterface, |
// Helper function to construct options for |
// AudioProviderInterface::SetAudioSend. |
void SetAudioSend(); |
+ // Helper function to call SetAudioSend with "stop sending" parameters. |
+ void ClearAudioSend(); |
std::string id_; |
std::string stream_id_; |
- AudioProviderInterface* provider_; |
+ cricket::VoiceChannel* channel_ = nullptr; |
StatsCollector* stats_; |
rtc::scoped_refptr<AudioTrackInterface> track_; |
uint32_t ssrc_ = 0; |
@@ -147,15 +157,18 @@ class AudioRtpSender : public ObserverInterface, |
class VideoRtpSender : public ObserverInterface, |
public rtc::RefCountedObject<RtpSenderInternal> { |
public: |
+ // |channel| can be null if one does not exist yet. |
VideoRtpSender(VideoTrackInterface* track, |
const std::string& stream_id, |
- VideoProviderInterface* provider); |
+ cricket::VideoChannel* channel); |
// Randomly generates stream_id. |
- VideoRtpSender(VideoTrackInterface* track, VideoProviderInterface* provider); |
+ // |channel| can be null if one does not exist yet. |
+ VideoRtpSender(VideoTrackInterface* track, cricket::VideoChannel* channel); |
// Randomly generates id and stream_id. |
- explicit VideoRtpSender(VideoProviderInterface* provider); |
+ // |channel| can be null if one does not exist yet. |
+ explicit VideoRtpSender(cricket::VideoChannel* channel); |
virtual ~VideoRtpSender(); |
@@ -194,6 +207,10 @@ class VideoRtpSender : public ObserverInterface, |
void Stop() override; |
+ // Does not take ownership. |
+ // Should call SetChannel(nullptr) before |channel| is destroyed. |
+ void SetChannel(cricket::VideoChannel* channel) { channel_ = channel; } |
+ |
private: |
bool can_send_track() const { return track_ && ssrc_; } |
// Helper function to construct options for |
@@ -204,7 +221,7 @@ class VideoRtpSender : public ObserverInterface, |
std::string id_; |
std::string stream_id_; |
- VideoProviderInterface* provider_; |
+ cricket::VideoChannel* channel_ = nullptr; |
rtc::scoped_refptr<VideoTrackInterface> track_; |
uint32_t ssrc_ = 0; |
bool cached_track_enabled_ = false; |