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

Side by Side Diff: media/formats/mp2t/mp2t_stream_parser.cc

Issue 506943003: Support MPEG1 audio in the MPEG2-TS stream parser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address CR comments from patch set #5. Created 6 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/formats/mp2t/es_parser_test_base.cc ('k') | media/formats/mpeg/mp3_stream_parser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/formats/mp2t/mp2t_stream_parser.h" 5 #include "media/formats/mp2t/mp2t_stream_parser.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
11 #include "media/base/audio_decoder_config.h" 11 #include "media/base/audio_decoder_config.h"
12 #include "media/base/buffers.h" 12 #include "media/base/buffers.h"
13 #include "media/base/stream_parser_buffer.h" 13 #include "media/base/stream_parser_buffer.h"
14 #include "media/base/text_track_config.h" 14 #include "media/base/text_track_config.h"
15 #include "media/base/video_decoder_config.h" 15 #include "media/base/video_decoder_config.h"
16 #include "media/formats/mp2t/es_parser.h" 16 #include "media/formats/mp2t/es_parser.h"
17 #include "media/formats/mp2t/es_parser_adts.h" 17 #include "media/formats/mp2t/es_parser_adts.h"
18 #include "media/formats/mp2t/es_parser_h264.h" 18 #include "media/formats/mp2t/es_parser_h264.h"
19 #include "media/formats/mp2t/es_parser_mpeg1audio.h"
19 #include "media/formats/mp2t/mp2t_common.h" 20 #include "media/formats/mp2t/mp2t_common.h"
20 #include "media/formats/mp2t/ts_packet.h" 21 #include "media/formats/mp2t/ts_packet.h"
21 #include "media/formats/mp2t/ts_section.h" 22 #include "media/formats/mp2t/ts_section.h"
22 #include "media/formats/mp2t/ts_section_pat.h" 23 #include "media/formats/mp2t/ts_section_pat.h"
23 #include "media/formats/mp2t/ts_section_pes.h" 24 #include "media/formats/mp2t/ts_section_pes.h"
24 #include "media/formats/mp2t/ts_section_pmt.h" 25 #include "media/formats/mp2t/ts_section_pmt.h"
25 26
26 namespace media { 27 namespace media {
27 namespace mp2t { 28 namespace mp2t {
28 29
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 es_parser.reset( 343 es_parser.reset(
343 new EsParserAdts( 344 new EsParserAdts(
344 base::Bind(&Mp2tStreamParser::OnAudioConfigChanged, 345 base::Bind(&Mp2tStreamParser::OnAudioConfigChanged,
345 base::Unretained(this), 346 base::Unretained(this),
346 pes_pid), 347 pes_pid),
347 base::Bind(&Mp2tStreamParser::OnEmitAudioBuffer, 348 base::Bind(&Mp2tStreamParser::OnEmitAudioBuffer,
348 base::Unretained(this), 349 base::Unretained(this),
349 pes_pid), 350 pes_pid),
350 sbr_in_mimetype_)); 351 sbr_in_mimetype_));
351 is_audio = true; 352 is_audio = true;
353 } else if (stream_type == kStreamTypeMpeg1Audio) {
354 es_parser.reset(
355 new EsParserMpeg1Audio(
356 base::Bind(&Mp2tStreamParser::OnAudioConfigChanged,
357 base::Unretained(this),
358 pes_pid),
359 base::Bind(&Mp2tStreamParser::OnEmitAudioBuffer,
360 base::Unretained(this),
361 pes_pid),
362 log_cb_));
363 is_audio = true;
352 } else { 364 } else {
353 return; 365 return;
354 } 366 }
355 367
356 // Create the PES state here. 368 // Create the PES state here.
357 DVLOG(1) << "Create a new PES state"; 369 DVLOG(1) << "Create a new PES state";
358 scoped_ptr<TsSection> pes_section_parser( 370 scoped_ptr<TsSection> pes_section_parser(
359 new TsSectionPes(es_parser.Pass())); 371 new TsSectionPes(es_parser.Pass()));
360 PidState::PidType pid_type = 372 PidState::PidType pid_type =
361 is_audio ? PidState::kPidAudioPes : PidState::kPidVideoPes; 373 is_audio ? PidState::kPidAudioPes : PidState::kPidVideoPes;
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 // so that buffers with the same config can be added later on. 635 // so that buffers with the same config can be added later on.
624 BufferQueueWithConfig queue_with_config( 636 BufferQueueWithConfig queue_with_config(
625 true, last_audio_config, last_video_config); 637 true, last_audio_config, last_video_config);
626 buffer_queue_chain_.push_back(queue_with_config); 638 buffer_queue_chain_.push_back(queue_with_config);
627 639
628 return true; 640 return true;
629 } 641 }
630 642
631 } // namespace mp2t 643 } // namespace mp2t
632 } // namespace media 644 } // namespace media
OLDNEW
« no previous file with comments | « media/formats/mp2t/es_parser_test_base.cc ('k') | media/formats/mpeg/mp3_stream_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698