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

Unified Diff: media/base/media_tracks.cc

Issue 2050043002: Generate and assign media track ids in demuxers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use-streamparser-trackid
Patch Set: rebase to ToT 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/base/media_tracks.h ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/media_tracks.cc
diff --git a/media/base/media_tracks.cc b/media/base/media_tracks.cc
index 6f3d2c53b6442b6ff0d9d2ee146cfc30a1a039ef..9cfbfbe0bd9fcddc30d0c9ee57d71b717004c3a8 100644
--- a/media/base/media_tracks.cc
+++ b/media/base/media_tracks.cc
@@ -15,30 +15,36 @@ MediaTracks::MediaTracks() {}
MediaTracks::~MediaTracks() {}
-void MediaTracks::AddAudioTrack(const AudioDecoderConfig& config,
- StreamParser::TrackId bytestream_track_id,
- const std::string& kind,
- const std::string& label,
- const std::string& language) {
+MediaTrack* MediaTracks::AddAudioTrack(
+ const AudioDecoderConfig& config,
+ StreamParser::TrackId bytestream_track_id,
+ const std::string& kind,
+ const std::string& label,
+ const std::string& language) {
DCHECK(config.IsValidConfig());
CHECK(audio_configs_.find(bytestream_track_id) == audio_configs_.end());
std::unique_ptr<MediaTrack> track = base::WrapUnique(new MediaTrack(
MediaTrack::Audio, bytestream_track_id, kind, label, language));
+ MediaTrack* track_ptr = track.get();
tracks_.push_back(std::move(track));
audio_configs_[bytestream_track_id] = config;
+ return track_ptr;
}
-void MediaTracks::AddVideoTrack(const VideoDecoderConfig& config,
- StreamParser::TrackId bytestream_track_id,
- const std::string& kind,
- const std::string& label,
- const std::string& language) {
+MediaTrack* MediaTracks::AddVideoTrack(
+ const VideoDecoderConfig& config,
+ StreamParser::TrackId bytestream_track_id,
+ const std::string& kind,
+ const std::string& label,
+ const std::string& language) {
DCHECK(config.IsValidConfig());
CHECK(video_configs_.find(bytestream_track_id) == video_configs_.end());
std::unique_ptr<MediaTrack> track = base::WrapUnique(new MediaTrack(
MediaTrack::Video, bytestream_track_id, kind, label, language));
+ MediaTrack* track_ptr = track.get();
tracks_.push_back(std::move(track));
video_configs_[bytestream_track_id] = config;
+ return track_ptr;
}
const AudioDecoderConfig& MediaTracks::getAudioConfig(
« no previous file with comments | « media/base/media_tracks.h ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698