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}
This commit is contained in:
perkj
2016-03-24 03:16:19 -07:00
committed by Commit bot
parent e29f0e2515
commit d61bf803d2
14 changed files with 122 additions and 165 deletions

View File

@ -11,22 +11,28 @@
#include "webrtc/api/rtpreceiver.h"
#include "webrtc/api/mediastreamtrackproxy.h"
#include "webrtc/api/audiotrack.h"
#include "webrtc/api/videotrack.h"
namespace webrtc {
AudioRtpReceiver::AudioRtpReceiver(AudioTrackInterface* track,
AudioRtpReceiver::AudioRtpReceiver(MediaStreamInterface* stream,
const std::string& track_id,
uint32_t ssrc,
AudioProviderInterface* provider)
: id_(track->id()),
track_(track),
: id_(track_id),
ssrc_(ssrc),
provider_(provider),
cached_track_enabled_(track->enabled()) {
track_(AudioTrackProxy::Create(
rtc::Thread::Current(),
AudioTrack::Create(track_id,
RemoteAudioSource::Create(ssrc, provider)))),
cached_track_enabled_(track_->enabled()) {
RTC_DCHECK(track_->GetSource()->remote());
track_->RegisterObserver(this);
track_->GetSource()->RegisterAudioObserver(this);
Reconfigure();
stream->AddTrack(track_);
}
AudioRtpReceiver::~AudioRtpReceiver() {