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

Side by Side Diff: media/formats/mp3/mp3_stream_parser.cc

Issue 149153002: MSE: Add StreamParser buffer remuxing utility and tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments from PS4 Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/formats/mp2t/es_parser_h264.cc ('k') | media/formats/mp4/mp4_stream_parser.cc » ('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/mp3/mp3_stream_parser.h" 5 #include "media/formats/mp3/mp3_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/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "media/base/bit_reader.h" 10 #include "media/base/bit_reader.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 VideoDecoderConfig video_config; 411 VideoDecoderConfig video_config;
412 bool success = config_cb_.Run(config_, video_config, TextTrackConfigMap()); 412 bool success = config_cb_.Run(config_, video_config, TextTrackConfigMap());
413 413
414 if (!init_cb_.is_null()) 414 if (!init_cb_.is_null())
415 base::ResetAndReturn(&init_cb_).Run(success, kInfiniteDuration()); 415 base::ResetAndReturn(&init_cb_).Run(success, kInfiniteDuration());
416 416
417 if (!success) 417 if (!success)
418 return -1; 418 return -1;
419 } 419 }
420 420
421 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId
422 // type and allow multiple audio tracks, if applicable. See
423 // https://crbug.com/341581.
421 scoped_refptr<StreamParserBuffer> buffer = 424 scoped_refptr<StreamParserBuffer> buffer =
422 StreamParserBuffer::CopyFrom(data, frame_size, true); 425 StreamParserBuffer::CopyFrom(data, frame_size, true,
426 DemuxerStream::AUDIO, 0);
423 buffer->set_timestamp(timestamp_helper_->GetTimestamp()); 427 buffer->set_timestamp(timestamp_helper_->GetTimestamp());
424 buffer->set_duration(timestamp_helper_->GetFrameDuration(sample_count)); 428 buffer->set_duration(timestamp_helper_->GetFrameDuration(sample_count));
425 buffers->push_back(buffer); 429 buffers->push_back(buffer);
426 430
427 timestamp_helper_->AddFrames(sample_count); 431 timestamp_helper_->AddFrames(sample_count);
428 432
429 return frame_size; 433 return frame_size;
430 } 434 }
431 435
432 static int LocateEndOfHeaders(const uint8_t* buf, int buf_len, int i) { 436 static int LocateEndOfHeaders(const uint8_t* buf, int buf_len, int i) {
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 609
606 if (end_of_segment) { 610 if (end_of_segment) {
607 in_media_segment_ = false; 611 in_media_segment_ = false;
608 end_of_segment_cb_.Run(); 612 end_of_segment_cb_.Run();
609 } 613 }
610 614
611 return true; 615 return true;
612 } 616 }
613 617
614 } // namespace media 618 } // namespace media
OLDNEW
« no previous file with comments | « media/formats/mp2t/es_parser_h264.cc ('k') | media/formats/mp4/mp4_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698