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

Unified Diff: media/formats/mp4/mp4_stream_parser.cc

Issue 1735003004: Implement reading of media track info from WebM and MP4 containers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@demuxer-tracks2
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
« no previous file with comments | « media/formats/mp4/box_definitions.cc ('k') | media/formats/mp4/mp4_stream_parser_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mp4/mp4_stream_parser.cc
diff --git a/media/formats/mp4/mp4_stream_parser.cc b/media/formats/mp4/mp4_stream_parser.cc
index 95abf83d78655790c714181d7de00aca6886b0a4..37b53968109623ac703939a813872343beaa6da1 100644
--- a/media/formats/mp4/mp4_stream_parser.cc
+++ b/media/formats/mp4/mp4_stream_parser.cc
@@ -11,6 +11,7 @@
#include "base/callback_helpers.h"
#include "base/logging.h"
+#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "media/base/audio_decoder_config.h"
@@ -187,6 +188,7 @@ bool MP4StreamParser::ParseMoov(BoxReader* reader) {
has_audio_ = false;
has_video_ = false;
+ scoped_ptr<MediaTracks> media_tracks(new MediaTracks());
AudioDecoderConfig audio_config;
VideoDecoderConfig video_config;
@@ -307,6 +309,9 @@ bool MP4StreamParser::ParseMoov(BoxReader* reader) {
is_audio_track_encrypted_, base::TimeDelta(), 0);
has_audio_ = true;
audio_track_id_ = track->header.track_id;
+ media_tracks->AddAudioTrack(
+ audio_config, base::UintToString(audio_track_id_), "main",
+ track->media.handler.name, track->media.header.language());
}
if (track->media.handler.type == kVideo && !video_config.IsValidConfig()) {
RCHECK(!samp_descr.video_entries.empty());
@@ -348,21 +353,15 @@ bool MP4StreamParser::ParseMoov(BoxReader* reader) {
std::vector<uint8_t>(), is_video_track_encrypted_);
has_video_ = true;
video_track_id_ = track->header.track_id;
+ media_tracks->AddVideoTrack(
+ video_config, base::UintToString(video_track_id_), "main",
+ track->media.handler.name, track->media.header.language());
}
}
if (!moov_->pssh.empty())
OnEncryptedMediaInitData(moov_->pssh);
- scoped_ptr<MediaTracks> media_tracks(new MediaTracks());
- // TODO(servolk): Implement proper sourcing of media track info as described
- // in crbug.com/590085
- if (audio_config.IsValidConfig()) {
- media_tracks->AddAudioTrack(audio_config, "audio", "", "", "");
- }
- if (video_config.IsValidConfig()) {
- media_tracks->AddVideoTrack(video_config, "video", "", "", "");
- }
RCHECK(config_cb_.Run(std::move(media_tracks), TextTrackConfigMap()));
StreamParser::InitParameters params(kInfiniteDuration());
« no previous file with comments | « media/formats/mp4/box_definitions.cc ('k') | media/formats/mp4/mp4_stream_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698