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

Side by Side Diff: media/formats/mp4/mp4_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/mp3/mp3_stream_parser.cc ('k') | media/formats/webm/webm_cluster_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/mp4/mp4_stream_parser.h" 5 #include "media/formats/mp4/mp4_stream_parser.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 } 490 }
491 // else, use the existing config. 491 // else, use the existing config.
492 } else if ((audio && is_audio_track_encrypted_) || 492 } else if ((audio && is_audio_track_encrypted_) ||
493 (video && is_video_track_encrypted_)) { 493 (video && is_video_track_encrypted_)) {
494 // The media pipeline requires a DecryptConfig with an empty |iv|. 494 // The media pipeline requires a DecryptConfig with an empty |iv|.
495 // TODO(ddorwin): Refactor so we do not need a fake key ID ("1"); 495 // TODO(ddorwin): Refactor so we do not need a fake key ID ("1");
496 decrypt_config.reset( 496 decrypt_config.reset(
497 new DecryptConfig("1", "", std::vector<SubsampleEntry>())); 497 new DecryptConfig("1", "", std::vector<SubsampleEntry>()));
498 } 498 }
499 499
500 StreamParserBuffer::Type buffer_type = audio ? DemuxerStream::AUDIO :
501 DemuxerStream::VIDEO;
502
503 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId
504 // type and allow multiple tracks for same media type, if applicable. See
505 // https://crbug.com/341581.
500 scoped_refptr<StreamParserBuffer> stream_buf = 506 scoped_refptr<StreamParserBuffer> stream_buf =
501 StreamParserBuffer::CopyFrom(&frame_buf[0], frame_buf.size(), 507 StreamParserBuffer::CopyFrom(&frame_buf[0], frame_buf.size(),
502 runs_->is_keyframe()); 508 runs_->is_keyframe(), buffer_type, 0);
503 509
504 if (decrypt_config) 510 if (decrypt_config)
505 stream_buf->set_decrypt_config(decrypt_config.Pass()); 511 stream_buf->set_decrypt_config(decrypt_config.Pass());
506 512
507 stream_buf->set_duration(runs_->duration()); 513 stream_buf->set_duration(runs_->duration());
508 stream_buf->set_timestamp(runs_->cts()); 514 stream_buf->set_timestamp(runs_->cts());
509 stream_buf->SetDecodeTimestamp(runs_->dts()); 515 stream_buf->SetDecodeTimestamp(runs_->dts());
510 516
511 DVLOG(3) << "Pushing frame: aud=" << audio 517 DVLOG(3) << "Pushing frame: aud=" << audio
512 << ", key=" << runs_->is_keyframe() 518 << ", key=" << runs_->is_keyframe()
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 return !err; 568 return !err;
563 } 569 }
564 570
565 void MP4StreamParser::ChangeState(State new_state) { 571 void MP4StreamParser::ChangeState(State new_state) {
566 DVLOG(2) << "Changing state: " << new_state; 572 DVLOG(2) << "Changing state: " << new_state;
567 state_ = new_state; 573 state_ = new_state;
568 } 574 }
569 575
570 } // namespace mp4 576 } // namespace mp4
571 } // namespace media 577 } // namespace media
OLDNEW
« no previous file with comments | « media/formats/mp3/mp3_stream_parser.cc ('k') | media/formats/webm/webm_cluster_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698