| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/mp4/es_descriptor.h" | 5 #include "media/mp4/es_descriptor.h" |
| 6 | 6 |
| 7 #include "media/base/bit_reader.h" | 7 #include "media/base/bit_reader.h" |
| 8 #include "media/mp4/rcheck.h" | 8 #include "media/mp4/rcheck.h" |
| 9 | 9 |
| 10 // The elementary stream size is specific by up to 4 bytes. | 10 // The elementary stream size is specific by up to 4 bytes. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 break; | 24 break; |
| 25 } | 25 } |
| 26 | 26 |
| 27 return true; | 27 return true; |
| 28 } | 28 } |
| 29 | 29 |
| 30 namespace media { | 30 namespace media { |
| 31 | 31 |
| 32 namespace mp4 { | 32 namespace mp4 { |
| 33 | 33 |
| 34 // static |
| 35 bool ESDescriptor::IsAAC(uint8 object_type) { |
| 36 return object_type == kISO_14496_3 || object_type == kISO_13818_7_AAC_LC; |
| 37 } |
| 38 |
| 34 ESDescriptor::ESDescriptor() | 39 ESDescriptor::ESDescriptor() |
| 35 : object_type_(kForbidden) { | 40 : object_type_(kForbidden) { |
| 36 } | 41 } |
| 37 | 42 |
| 38 ESDescriptor::~ESDescriptor() {} | 43 ESDescriptor::~ESDescriptor() {} |
| 39 | 44 |
| 40 bool ESDescriptor::Parse(const std::vector<uint8>& data) { | 45 bool ESDescriptor::Parse(const std::vector<uint8>& data) { |
| 41 BitReader reader(&data[0], data.size()); | 46 BitReader reader(&data[0], data.size()); |
| 42 uint8 tag; | 47 uint8 tag; |
| 43 uint32 size; | 48 uint32 size; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 decoder_specific_info_.resize(size); | 108 decoder_specific_info_.resize(size); |
| 104 for (uint32 i = 0; i < size; ++i) | 109 for (uint32 i = 0; i < size; ++i) |
| 105 RCHECK(reader->ReadBits(8, &decoder_specific_info_[i])); | 110 RCHECK(reader->ReadBits(8, &decoder_specific_info_[i])); |
| 106 | 111 |
| 107 return true; | 112 return true; |
| 108 } | 113 } |
| 109 | 114 |
| 110 } // namespace mp4 | 115 } // namespace mp4 |
| 111 | 116 |
| 112 } // namespace media | 117 } // namespace media |
| OLD | NEW |