OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/dolby_vision.h" | 5 #include "media/formats/mp4/dolby_vision.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/base/video_codecs.h" | 8 #include "media/base/video_codecs.h" |
9 #include "media/formats/mp4/box_definitions.h" | 9 #include "media/formats/mp4/box_definitions.h" |
10 #include "media/formats/mp4/box_reader.h" | 10 #include "media/formats/mp4/box_reader.h" |
(...skipping 16 matching lines...) Expand all Loading... | |
27 FourCC DolbyVisionConfiguration::BoxType() const { | 27 FourCC DolbyVisionConfiguration::BoxType() const { |
28 return FOURCC_DVCC; | 28 return FOURCC_DVCC; |
29 } | 29 } |
30 | 30 |
31 bool DolbyVisionConfiguration::Parse(BoxReader* reader) { | 31 bool DolbyVisionConfiguration::Parse(BoxReader* reader) { |
32 return ParseInternal(reader, reader->media_log()); | 32 return ParseInternal(reader, reader->media_log()); |
33 } | 33 } |
34 | 34 |
35 bool DolbyVisionConfiguration::Parse(const uint8_t* data, int data_size) { | 35 bool DolbyVisionConfiguration::Parse(const uint8_t* data, int data_size) { |
36 BufferReader reader(data, data_size); | 36 BufferReader reader(data, data_size); |
37 return ParseInternal(&reader, new MediaLog()); | 37 // TODO(wolenetz): Questionable MediaLog usage, http://crbug.com/712310 |
chcunningham
2017/04/18 23:29:12
This one should be easy to fix. We have the media
DaleCurtis
2017/04/18 23:55:45
Looking closer I think this is only used by the un
| |
38 MediaLog media_log; | |
39 return ParseInternal(&reader, &media_log); | |
38 } | 40 } |
39 | 41 |
40 bool DolbyVisionConfiguration::ParseInternal( | 42 bool DolbyVisionConfiguration::ParseInternal(BufferReader* reader, |
41 BufferReader* reader, | 43 MediaLog* media_log) { |
42 const scoped_refptr<MediaLog>& media_log) { | |
43 uint16_t profile_track_indication = 0; | 44 uint16_t profile_track_indication = 0; |
44 RCHECK(reader->Read1(&dv_version_major) && reader->Read1(&dv_version_minor) && | 45 RCHECK(reader->Read1(&dv_version_major) && reader->Read1(&dv_version_minor) && |
45 reader->Read2(&profile_track_indication)); | 46 reader->Read2(&profile_track_indication)); |
46 | 47 |
47 dv_profile = profile_track_indication >> 9; | 48 dv_profile = profile_track_indication >> 9; |
48 dv_level = (profile_track_indication >> 3) & 0x3F; | 49 dv_level = (profile_track_indication >> 3) & 0x3F; |
49 rpu_present_flag = (profile_track_indication >> 2) & 1; | 50 rpu_present_flag = (profile_track_indication >> 2) & 1; |
50 el_present_flag = (profile_track_indication >> 1) & 1; | 51 el_present_flag = (profile_track_indication >> 1) & 1; |
51 bl_present_flag = profile_track_indication & 1; | 52 bl_present_flag = profile_track_indication & 1; |
52 | 53 |
(...skipping 21 matching lines...) Expand all Loading... | |
74 << " has_bl:" << static_cast<int>(bl_present_flag) | 75 << " has_bl:" << static_cast<int>(bl_present_flag) |
75 << " has_el:" << static_cast<int>(el_present_flag) | 76 << " has_el:" << static_cast<int>(el_present_flag) |
76 << " has_rpu:" << static_cast<int>(rpu_present_flag) | 77 << " has_rpu:" << static_cast<int>(rpu_present_flag) |
77 << " profile type:" << codec_profile; | 78 << " profile type:" << codec_profile; |
78 | 79 |
79 return true; | 80 return true; |
80 } | 81 } |
81 | 82 |
82 } // namespace mp4 | 83 } // namespace mp4 |
83 } // namespace media | 84 } // namespace media |
OLD | NEW |