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

Unified Diff: media/formats/mpeg/mpeg_audio_stream_parser_base.cc

Issue 1716503002: Basic media tracks implementation for media stream parsers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 10 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/mp4_stream_parser_unittest.cc ('k') | media/formats/webm/webm_stream_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mpeg/mpeg_audio_stream_parser_base.cc
diff --git a/media/formats/mpeg/mpeg_audio_stream_parser_base.cc b/media/formats/mpeg/mpeg_audio_stream_parser_base.cc
index ea2261fad7965e572c61b9acfcf94ac28745431c..202849527de0b103fbde90942ce626de3f68d404 100644
--- a/media/formats/mpeg/mpeg_audio_stream_parser_base.cc
+++ b/media/formats/mpeg/mpeg_audio_stream_parser_base.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/message_loop/message_loop.h"
+#include "media/base/media_tracks.h"
#include "media/base/stream_parser_buffer.h"
#include "media/base/text_track_config.h"
#include "media/base/timestamp_constants.h"
@@ -220,8 +221,11 @@ int MPEGAudioStreamParserBase::ParseFrame(const uint8_t* data,
timestamp_helper_.reset(new AudioTimestampHelper(sample_rate));
timestamp_helper_->SetBaseTimestamp(base_timestamp);
- VideoDecoderConfig video_config;
- if (!config_cb_.Run(config_, video_config, TextTrackConfigMap()))
+ scoped_ptr<MediaTracks> media_tracks(new MediaTracks());
+ if (config_.IsValidConfig()) {
+ media_tracks->AddAudioTrack(config_, "audio", "", "", "");
+ }
+ if (!config_cb_.Run(std::move(media_tracks), TextTrackConfigMap()))
return -1;
if (!init_cb_.is_null()) {
« no previous file with comments | « media/formats/mp4/mp4_stream_parser_unittest.cc ('k') | media/formats/webm/webm_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698