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

Unified Diff: content/renderer/media/peer_connection_handler.cc

Issue 9543001: Support for multiple PeerConnections (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 months 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
Index: content/renderer/media/peer_connection_handler.cc
diff --git a/content/renderer/media/peer_connection_handler.cc b/content/renderer/media/peer_connection_handler.cc
index 10afa7ad8d4f5ebc12fd95a219974e558f670ab9..a8aaa32b36567e0038738bee9d534773445760fd 100644
--- a/content/renderer/media/peer_connection_handler.cc
+++ b/content/renderer/media/peer_connection_handler.cc
@@ -31,6 +31,12 @@ PeerConnectionHandler::PeerConnectionHandler(
PeerConnectionHandler::~PeerConnectionHandler() {
}
+bool PeerConnectionHandler::HasStream(const std::string& stream_label) {
+ webrtc::MediaStreamInterface* stream =
+ native_peer_connection_->remote_streams()->find(stream_label);
+ return stream != NULL;
+}
+
void PeerConnectionHandler::SetVideoRenderer(
const std::string& stream_label,
webrtc::VideoRendererWrapperInterface* renderer) {
@@ -38,7 +44,7 @@ void PeerConnectionHandler::SetVideoRenderer(
native_peer_connection_->remote_streams()->find(stream_label);
webrtc::VideoTracks* video_tracks = stream->video_tracks();
// We assume there is only one enabled video track.
- for(size_t i = 0; i < video_tracks->count(); ++i) {
+ for (size_t i = 0; i < video_tracks->count(); ++i) {
webrtc::VideoTrackInterface* video_track = video_tracks->at(i);
if (video_track->enabled()) {
video_track->SetRenderer(renderer);
@@ -94,7 +100,7 @@ void PeerConnectionHandler::stop() {
// close. We need to investigate further. Not calling Close() on native
// PeerConnection is OK for now.
native_peer_connection_ = NULL;
- media_stream_impl_->ClosePeerConnection();
+ media_stream_impl_->ClosePeerConnection(this);
}
void PeerConnectionHandler::OnError() {

Powered by Google App Engine
This is Rietveld 408576698