Index: webrtc/api/peerconnection.cc |
diff --git a/webrtc/api/peerconnection.cc b/webrtc/api/peerconnection.cc |
index 2f320d78edfd93f079bc41de6f53b2f3f13e7d59..0bdc30b7419f00bc1e6553cbb8db76fb190b67fd 100644 |
--- a/webrtc/api/peerconnection.cc |
+++ b/webrtc/api/peerconnection.cc |
@@ -1420,20 +1420,29 @@ void PeerConnection::OnMessage(rtc::Message* msg) { |
void PeerConnection::CreateAudioReceiver(MediaStreamInterface* stream, |
const std::string& track_id, |
uint32_t ssrc) { |
- receivers_.push_back( |
- RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create( |
+ rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> |
+ receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create( |
signaling_thread(), new AudioRtpReceiver(stream, track_id, ssrc, |
- session_->voice_channel()))); |
+ session_->voice_channel())); |
+ |
+ receivers_.push_back(receiver); |
+ std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams; |
+ streams.push_back(rtc::scoped_refptr<MediaStreamInterface>(stream)); |
honghaiz3
2016/11/17 01:19:02
Is there any reason to use a vector of streams her
Zhi Huang
2016/11/17 01:42:06
According to the spec: https://www.w3.org/TR/webrt
Taylor Brandstetter
2016/11/17 02:07:25
I agree about this. Even if we take a long time to
|
+ observer_->OnAddTrack(receiver, streams); |
honghaiz3
2016/11/17 01:52:31
Should we just get the track from the receiver and
|
} |
void PeerConnection::CreateVideoReceiver(MediaStreamInterface* stream, |
const std::string& track_id, |
uint32_t ssrc) { |
- receivers_.push_back( |
- RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create( |
+ rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> |
+ receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create( |
signaling_thread(), |
new VideoRtpReceiver(stream, track_id, factory_->worker_thread(), |
- ssrc, session_->video_channel()))); |
+ ssrc, session_->video_channel())); |
+ receivers_.push_back(receiver); |
+ std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams; |
+ streams.push_back(rtc::scoped_refptr<MediaStreamInterface>(stream)); |
+ observer_->OnAddTrack(receiver, streams); |
} |
// TODO(deadbeef): Keep RtpReceivers around even if track goes away in remote |