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

Unified Diff: talk/app/webrtc/peerconnection.cc

Issue 1403173002: Don't create remote streams if m-line direction doesn't include "send". (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | talk/app/webrtc/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/peerconnection.cc
diff --git a/talk/app/webrtc/peerconnection.cc b/talk/app/webrtc/peerconnection.cc
index e7b33c43acdbd917ad549aac93df2611fd818475..1e225334705698ca07f67cc73e943ee48e08d354 100644
--- a/talk/app/webrtc/peerconnection.cc
+++ b/talk/app/webrtc/peerconnection.cc
@@ -1029,7 +1029,13 @@ void PeerConnection::SetRemoteDescription(
const cricket::AudioContentDescription* desc =
static_cast<const cricket::AudioContentDescription*>(
audio_content->description);
- UpdateRemoteStreamsList(desc->streams(), desc->type(), new_streams);
+ // If the direction is "recvonly" or "inactive", treat the description
+ // as containing no streams.
+ // See: https://code.google.com/p/webrtc/issues/detail?id=5054
+ UpdateRemoteStreamsList(MediaContentDirectionHasSend(desc->direction())
+ ? desc->streams()
+ : std::vector<cricket::StreamParams>(),
pthatcher1 2015/10/15 05:46:49 Can you put this logic in a method called "GetActi
Taylor Brandstetter 2015/10/15 17:32:24 Done.
+ desc->type(), new_streams);
remote_info_.default_audio_track_needed =
MediaContentDirectionHasSend(desc->direction()) &&
desc->streams().empty();
@@ -1042,7 +1048,10 @@ void PeerConnection::SetRemoteDescription(
const cricket::VideoContentDescription* desc =
static_cast<const cricket::VideoContentDescription*>(
video_content->description);
- UpdateRemoteStreamsList(desc->streams(), desc->type(), new_streams);
+ UpdateRemoteStreamsList(MediaContentDirectionHasSend(desc->direction())
+ ? desc->streams()
+ : std::vector<cricket::StreamParams>(),
+ desc->type(), new_streams);
remote_info_.default_video_track_needed =
MediaContentDirectionHasSend(desc->direction()) &&
desc->streams().empty();
@@ -1051,12 +1060,15 @@ void PeerConnection::SetRemoteDescription(
// Update the DataChannels with the information from the remote peer.
const cricket::ContentInfo* data_content = GetFirstDataContent(remote_desc);
if (data_content) {
- const cricket::DataContentDescription* data_desc =
+ const cricket::DataContentDescription* desc =
static_cast<const cricket::DataContentDescription*>(
data_content->description);
- if (rtc::starts_with(data_desc->protocol().data(),
+ if (rtc::starts_with(desc->protocol().data(),
cricket::kMediaProtocolRtpPrefix)) {
- UpdateRemoteRtpDataChannels(data_desc->streams());
+ UpdateRemoteRtpDataChannels(
+ MediaContentDirectionHasSend(desc->direction())
+ ? desc->streams()
+ : std::vector<cricket::StreamParams>());
}
}
« no previous file with comments | « no previous file | talk/app/webrtc/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698