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

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

Issue 1247443005: Revert of Fixing scenario where track is rejected and later un-rejected. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 5 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 | « talk/app/webrtc/mediastreamsignaling.h ('k') | talk/app/webrtc/peerconnection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/mediastreamsignaling.cc
diff --git a/talk/app/webrtc/mediastreamsignaling.cc b/talk/app/webrtc/mediastreamsignaling.cc
index d126ac5967c0e35d37a6391ca1ccea5eb5fd7aef..1f5f14fd7b55a3e6641349058f03ed1c38bfdb4a 100644
--- a/talk/app/webrtc/mediastreamsignaling.cc
+++ b/talk/app/webrtc/mediastreamsignaling.cc
@@ -525,13 +525,7 @@
GetFirstAudioContent(desc->description());
if (audio_content) {
if (audio_content->rejected) {
- SetRemoteTracksState(cricket::MEDIA_TYPE_AUDIO,
- MediaStreamTrackInterface::kEnded);
- } else {
- // This is needed in case the local description caused the track to be
- // rejected, then later accepted, without being destroyed.
- SetRemoteTracksState(cricket::MEDIA_TYPE_AUDIO,
- MediaStreamTrackInterface::kLive);
+ RejectRemoteTracks(cricket::MEDIA_TYPE_AUDIO);
}
const cricket::AudioContentDescription* audio_desc =
static_cast<const cricket::AudioContentDescription*>(
@@ -543,13 +537,7 @@
GetFirstVideoContent(desc->description());
if (video_content) {
if (video_content->rejected) {
- SetRemoteTracksState(cricket::MEDIA_TYPE_VIDEO,
- MediaStreamTrackInterface::kEnded);
- } else {
- // This is needed in case the local description caused the track to be
- // rejected, then later accepted, without being destroyed.
- SetRemoteTracksState(cricket::MEDIA_TYPE_VIDEO,
- MediaStreamTrackInterface::kLive);
+ RejectRemoteTracks(cricket::MEDIA_TYPE_VIDEO);
}
const cricket::VideoContentDescription* video_desc =
static_cast<const cricket::VideoContentDescription*>(
@@ -571,13 +559,11 @@
}
void MediaStreamSignaling::OnAudioChannelClose() {
- SetRemoteTracksState(cricket::MEDIA_TYPE_AUDIO,
- MediaStreamTrackInterface::kEnded);
+ RejectRemoteTracks(cricket::MEDIA_TYPE_AUDIO);
}
void MediaStreamSignaling::OnVideoChannelClose() {
- SetRemoteTracksState(cricket::MEDIA_TYPE_VIDEO,
- MediaStreamTrackInterface::kEnded);
+ RejectRemoteTracks(cricket::MEDIA_TYPE_VIDEO);
}
void MediaStreamSignaling::OnDataChannelClose() {
@@ -692,9 +678,7 @@
}
}
-void MediaStreamSignaling::SetRemoteTracksState(
- cricket::MediaType media_type,
- MediaStreamTrackInterface::TrackState state) {
+void MediaStreamSignaling::RejectRemoteTracks(cricket::MediaType media_type) {
TrackInfos* current_tracks = GetRemoteTracks(media_type);
for (TrackInfos::iterator track_it = current_tracks->begin();
track_it != current_tracks->end(); ++track_it) {
@@ -705,7 +689,7 @@
// There's no guarantee the track is still available, e.g. the track may
// have been removed from the stream by javascript.
if (track) {
- track->set_state(state);
+ track->set_state(webrtc::MediaStreamTrackInterface::kEnded);
}
}
if (media_type == cricket::MEDIA_TYPE_VIDEO) {
@@ -713,7 +697,7 @@
// There's no guarantee the track is still available, e.g. the track may
// have been removed from the stream by javascript.
if (track) {
- track->set_state(state);
+ track->set_state(webrtc::MediaStreamTrackInterface::kEnded);
}
}
}
« no previous file with comments | « talk/app/webrtc/mediastreamsignaling.h ('k') | talk/app/webrtc/peerconnection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698