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

Unified Diff: media/base/media_tracks.cc

Issue 1812543003: Allow muting/unmuting audio through media track API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blink-sb-tracks6
Patch Set: rebase Created 4 years, 9 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: media/base/media_tracks.cc
diff --git a/media/base/media_tracks.cc b/media/base/media_tracks.cc
index 832e5a822b12a497f43d01aabc9ef898c55fb7d0..984ca1881baae653eeb6ca8c51f883413d8737e9 100644
--- a/media/base/media_tracks.cc
+++ b/media/base/media_tracks.cc
@@ -14,30 +14,32 @@ MediaTracks::MediaTracks() {}
MediaTracks::~MediaTracks() {}
-void MediaTracks::AddAudioTrack(const AudioDecoderConfig& config,
- const std::string& id,
- const std::string& kind,
- const std::string& label,
- const std::string& language) {
+const MediaTrack* MediaTracks::AddAudioTrack(const AudioDecoderConfig& config,
+ const std::string& id,
+ const std::string& kind,
+ const std::string& label,
+ const std::string& language) {
DCHECK(config.IsValidConfig());
CHECK(audio_configs_.find(id) == audio_configs_.end());
scoped_ptr<MediaTrack> track = make_scoped_ptr(
new MediaTrack(MediaTrack::Audio, id, kind, label, language));
tracks_.push_back(std::move(track));
audio_configs_[id] = config;
+ return tracks_.back().get();
}
-void MediaTracks::AddVideoTrack(const VideoDecoderConfig& config,
- const std::string& id,
- const std::string& kind,
- const std::string& label,
- const std::string& language) {
+const MediaTrack* MediaTracks::AddVideoTrack(const VideoDecoderConfig& config,
+ const std::string& id,
+ const std::string& kind,
+ const std::string& label,
+ const std::string& language) {
DCHECK(config.IsValidConfig());
CHECK(video_configs_.find(id) == video_configs_.end());
scoped_ptr<MediaTrack> track = make_scoped_ptr(
new MediaTrack(MediaTrack::Video, id, kind, label, language));
tracks_.push_back(std::move(track));
video_configs_[id] = config;
+ return tracks_.back().get();
}
const AudioDecoderConfig& MediaTracks::getAudioConfig(

Powered by Google App Engine
This is Rietveld 408576698