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

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/peerconnectioninterface.h » ('j') | no next file with comments »
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));
+ observer_->OnAddTrack(receiver, streams);
}
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/peerconnectioninterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698