| OLD | NEW |
| 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 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 if (!decrypt_config) { | 637 if (!decrypt_config) { |
| 638 *err = true; | 638 *err = true; |
| 639 return false; | 639 return false; |
| 640 } | 640 } |
| 641 subsamples = decrypt_config->subsamples(); | 641 subsamples = decrypt_config->subsamples(); |
| 642 } | 642 } |
| 643 | 643 |
| 644 std::vector<uint8_t> frame_buf(buf, buf + runs_->sample_size()); | 644 std::vector<uint8_t> frame_buf(buf, buf + runs_->sample_size()); |
| 645 if (video) { | 645 if (video) { |
| 646 if (runs_->video_description().video_codec == kCodecH264 || | 646 if (runs_->video_description().video_codec == kCodecH264 || |
| 647 runs_->video_description().video_codec == kCodecHEVC) { | 647 runs_->video_description().video_codec == kCodecHEVC || |
| 648 runs_->video_description().video_codec == kCodecDolbyVision) { |
| 648 DCHECK(runs_->video_description().frame_bitstream_converter); | 649 DCHECK(runs_->video_description().frame_bitstream_converter); |
| 649 if (!runs_->video_description().frame_bitstream_converter->ConvertFrame( | 650 if (!runs_->video_description().frame_bitstream_converter->ConvertFrame( |
| 650 &frame_buf, runs_->is_keyframe(), &subsamples)) { | 651 &frame_buf, runs_->is_keyframe(), &subsamples)) { |
| 651 MEDIA_LOG(ERROR, media_log_) | 652 MEDIA_LOG(ERROR, media_log_) |
| 652 << "Failed to prepare video sample for decode"; | 653 << "Failed to prepare video sample for decode"; |
| 653 *err = true; | 654 *err = true; |
| 654 return false; | 655 return false; |
| 655 } | 656 } |
| 656 } | 657 } |
| 657 } | 658 } |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 runs.AdvanceSample(); | 777 runs.AdvanceSample(); |
| 777 } | 778 } |
| 778 runs.AdvanceRun(); | 779 runs.AdvanceRun(); |
| 779 } | 780 } |
| 780 | 781 |
| 781 return true; | 782 return true; |
| 782 } | 783 } |
| 783 | 784 |
| 784 } // namespace mp4 | 785 } // namespace mp4 |
| 785 } // namespace media | 786 } // namespace media |
| OLD | NEW |