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

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: Added DISALLOW_COPY_AND_ASSIGN in MediaTracks 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
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()) {
wolenetz 2016/02/26 00:06:21 Hmm. Do we instead want to preserve the potential
servolk 2016/02/26 01:56:33 I think it's better to just pass an empty MediaTra
wolenetz 2016/02/26 19:29:27 Ack. If we need more info on why a particular expe
+ media_tracks->AddAudioTrack(config_, "audio", "", "", "");
+ }
+ if (!config_cb_.Run(std::move(media_tracks), TextTrackConfigMap()))
return -1;
if (!init_cb_.is_null()) {

Powered by Google App Engine
This is Rietveld 408576698