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

Side by Side Diff: media/formats/mp4/mp4_stream_parser.cc

Issue 296983006: Disable AnnexB validation for encrypted content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | 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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 (*subsamples)[i].clear_bytes += nalu_size_diff; 359 (*subsamples)[i].clear_bytes += nalu_size_diff;
360 } 360 }
361 361
362 if (runs_->is_keyframe()) { 362 if (runs_->is_keyframe()) {
363 // If this is a keyframe, we (re-)inject SPS and PPS headers at the start of 363 // If this is a keyframe, we (re-)inject SPS and PPS headers at the start of
364 // a frame. If subsample info is present, we also update the clear byte 364 // a frame. If subsample info is present, we also update the clear byte
365 // count for that first subsample. 365 // count for that first subsample.
366 RCHECK(AVC::InsertParamSetsAnnexB(avc_config, frame_buf, subsamples)); 366 RCHECK(AVC::InsertParamSetsAnnexB(avc_config, frame_buf, subsamples));
367 } 367 }
368 368
369 DCHECK(AVC::IsValidAnnexB(*frame_buf)); 369 // TODO(acolwell): Improve IsValidAnnexB() so it can handle encrypted content.
370 DCHECK(runs_->is_encrypted() || AVC::IsValidAnnexB(*frame_buf));
370 return true; 371 return true;
371 } 372 }
372 373
373 bool MP4StreamParser::PrepareAACBuffer( 374 bool MP4StreamParser::PrepareAACBuffer(
374 const AAC& aac_config, std::vector<uint8>* frame_buf, 375 const AAC& aac_config, std::vector<uint8>* frame_buf,
375 std::vector<SubsampleEntry>* subsamples) const { 376 std::vector<SubsampleEntry>* subsamples) const {
376 // Append an ADTS header to every audio sample. 377 // Append an ADTS header to every audio sample.
377 RCHECK(aac_config.ConvertEsdsToADTS(frame_buf)); 378 RCHECK(aac_config.ConvertEsdsToADTS(frame_buf));
378 379
379 // As above, adjust subsample information to account for the headers. AAC is 380 // As above, adjust subsample information to account for the headers. AAC is
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 return !err; 570 return !err;
570 } 571 }
571 572
572 void MP4StreamParser::ChangeState(State new_state) { 573 void MP4StreamParser::ChangeState(State new_state) {
573 DVLOG(2) << "Changing state: " << new_state; 574 DVLOG(2) << "Changing state: " << new_state;
574 state_ = new_state; 575 state_ = new_state;
575 } 576 }
576 577
577 } // namespace mp4 578 } // namespace mp4
578 } // namespace media 579 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698