Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Unified Diff: webrtc/api/peerconnection.cc

Issue 2505173002: Added a callback function OnAddTrack to PeerConnectionObserver (Closed)
Patch Set: CR comments. Remove unrelated file changes. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/api/peerconnection_unittest.cc » ('j') | webrtc/api/peerconnection_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | webrtc/api/peerconnection_unittest.cc » ('j') | webrtc/api/peerconnection_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698