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

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

Issue 1624703002: Implement support for vp9 in ISO-BMFF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
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 <stddef.h> 7 #include <stddef.h>
8 #include <limits> 8 #include <limits>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 decrypt_config = runs_->GetDecryptConfig(); 503 decrypt_config = runs_->GetDecryptConfig();
504 if (!decrypt_config) { 504 if (!decrypt_config) {
505 *err = true; 505 *err = true;
506 return false; 506 return false;
507 } 507 }
508 subsamples = decrypt_config->subsamples(); 508 subsamples = decrypt_config->subsamples();
509 } 509 }
510 510
511 std::vector<uint8_t> frame_buf(buf, buf + runs_->sample_size()); 511 std::vector<uint8_t> frame_buf(buf, buf + runs_->sample_size());
512 if (video) { 512 if (video) {
513 DCHECK(runs_->video_description().frame_bitstream_converter); 513 if (runs_->video_description().video_codec == kCodecH264 ||
514 if (!runs_->video_description().frame_bitstream_converter->ConvertFrame( 514 runs_->video_description().video_codec == kCodecHEVC) {
515 &frame_buf, runs_->is_keyframe(), &subsamples)) { 515 DCHECK(runs_->video_description().frame_bitstream_converter);
516 MEDIA_LOG(ERROR, media_log_) 516 if (!runs_->video_description().frame_bitstream_converter->ConvertFrame(
517 << "Failed to prepare video sample for decode"; 517 &frame_buf, runs_->is_keyframe(), &subsamples)) {
518 *err = true; 518 MEDIA_LOG(ERROR, media_log_)
519 return false; 519 << "Failed to prepare video sample for decode";
520 *err = true;
521 return false;
522 }
520 } 523 }
521 } 524 }
522 525
523 if (audio) { 526 if (audio) {
524 if (ESDescriptor::IsAAC(runs_->audio_description().esds.object_type) && 527 if (ESDescriptor::IsAAC(runs_->audio_description().esds.object_type) &&
525 !PrepareAACBuffer(runs_->audio_description().esds.aac, 528 !PrepareAACBuffer(runs_->audio_description().esds.aac,
526 &frame_buf, &subsamples)) { 529 &frame_buf, &subsamples)) {
527 MEDIA_LOG(ERROR, media_log_) << "Failed to prepare AAC sample for decode"; 530 MEDIA_LOG(ERROR, media_log_) << "Failed to prepare AAC sample for decode";
528 *err = true; 531 *err = true;
529 return false; 532 return false;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 runs.AdvanceSample(); 659 runs.AdvanceSample();
657 } 660 }
658 runs.AdvanceRun(); 661 runs.AdvanceRun();
659 } 662 }
660 663
661 return true; 664 return true;
662 } 665 }
663 666
664 } // namespace mp4 667 } // namespace mp4
665 } // namespace media 668 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698