Removed MediaStreamTrackInterface::set_state
The track state should be implicitly set by the underlying source.
This removes the public method and cleans up how AudioRtpReceiver is created. Further more it cleans up how the RtpReceivers are destroyed.
Note that this cl depend on https://codereview.webrtc.org/1790633002.
BUG=webrtc:5426
Review URL: https://codereview.webrtc.org/1816143002
Cr-Commit-Position: refs/heads/master@{#12115}
diff --git a/webrtc/api/rtpreceiver.h b/webrtc/api/rtpreceiver.h
index a62ed19..b581857 100644
--- a/webrtc/api/rtpreceiver.h
+++ b/webrtc/api/rtpreceiver.h
@@ -19,6 +19,7 @@
#include "webrtc/api/mediastreamprovider.h"
#include "webrtc/api/rtpreceiverinterface.h"
+#include "webrtc/api/remoteaudiosource.h"
#include "webrtc/api/videotracksource.h"
#include "webrtc/base/basictypes.h"
#include "webrtc/media/base/videobroadcaster.h"
@@ -29,7 +30,8 @@
public AudioSourceInterface::AudioObserver,
public rtc::RefCountedObject<RtpReceiverInterface> {
public:
- AudioRtpReceiver(AudioTrackInterface* track,
+ AudioRtpReceiver(MediaStreamInterface* stream,
+ const std::string& track_id,
uint32_t ssrc,
AudioProviderInterface* provider);
@@ -41,6 +43,10 @@
// AudioSourceInterface::AudioObserver implementation
void OnSetVolume(double volume) override;
+ rtc::scoped_refptr<AudioTrackInterface> audio_track() const {
+ return track_.get();
+ }
+
// RtpReceiverInterface implementation
rtc::scoped_refptr<MediaStreamTrackInterface> track() const override {
return track_.get();
@@ -54,9 +60,9 @@
void Reconfigure();
const std::string id_;
- const rtc::scoped_refptr<AudioTrackInterface> track_;
const uint32_t ssrc_;
AudioProviderInterface* provider_; // Set to null in Stop().
+ const rtc::scoped_refptr<AudioTrackInterface> track_;
bool cached_track_enabled_;
};