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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 1935873002: Implement disabling and enabling media tracks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-control2
Patch Set: rebase Created 4 years, 6 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 | « media/blink/webmediaplayer_impl.h ('k') | media/filters/chunk_demuxer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index 6da13ceed5a23238ff79a76c82de83de1cb63b8d..c0cdfcc5c25245dd8da65c0ec0c301947fcd5b88 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -567,6 +567,37 @@ bool WebMediaPlayerImpl::hasAudio() const {
return pipeline_metadata_.has_audio;
}
+void WebMediaPlayerImpl::enabledAudioTracksChanged(
+ const blink::WebVector<blink::WebMediaPlayer::TrackId>& enabledTrackIds) {
+ DCHECK(main_task_runner_->BelongsToCurrentThread());
+
+ std::ostringstream logstr;
+ std::vector<MediaTrack::Id> enabledMediaTrackIds;
+ for (const auto& blinkTrackId : enabledTrackIds) {
+ MediaTrack::Id track_id = blinkTrackId.utf8().data();
+ logstr << track_id << " ";
+ enabledMediaTrackIds.push_back(track_id);
+ }
+ MEDIA_LOG(INFO, media_log_) << "Enabled audio tracks: [" << logstr.str()
+ << "]";
+ pipeline_.OnEnabledAudioTracksChanged(enabledMediaTrackIds);
+}
+
+void WebMediaPlayerImpl::selectedVideoTrackChanged(
+ blink::WebMediaPlayer::TrackId* selectedTrackId) {
+ DCHECK(main_task_runner_->BelongsToCurrentThread());
+
+ std::ostringstream logstr;
+ std::vector<MediaTrack::Id> selectedVideoMediaTrackId;
+ if (selectedTrackId) {
+ selectedVideoMediaTrackId.push_back(selectedTrackId->utf8().data());
+ logstr << selectedVideoMediaTrackId[0];
+ }
+ MEDIA_LOG(INFO, media_log_) << "Selected video track: [" << logstr.str()
+ << "]";
+ pipeline_.OnSelectedVideoTrackChanged(selectedVideoMediaTrackId);
+}
+
blink::WebSize WebMediaPlayerImpl::naturalSize() const {
DCHECK(main_task_runner_->BelongsToCurrentThread());
« no previous file with comments | « media/blink/webmediaplayer_impl.h ('k') | media/filters/chunk_demuxer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698