WebKit roll 138552:138617
[chromium-blink-merge.git] / media / mp4 / es_descriptor.h
blobdaddbc0f0d5563c59017b3fd84464a4f8c4cd554
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
3 // found in the LICENSE file.
5 #ifndef MEDIA_MP4_ES_DESCRIPTOR_H_
6 #define MEDIA_MP4_ES_DESCRIPTOR_H_
8 #include <vector>
10 #include "base/basictypes.h"
11 #include "media/base/media_export.h"
13 namespace media {
15 class BitReader;
17 namespace mp4 {
19 // The following values are extracted from ISO 14496 Part 1 Table 5 -
20 // objectTypeIndication Values. Only values currently in use are included.
21 enum ObjectType {
22 kForbidden = 0,
23 kISO_14496_3 = 0x40 // MPEG4 AAC
26 // This class parse object type and decoder specific information from an
27 // elementary stream descriptor, which is usually contained in an esds box.
28 // Please refer to ISO 14496 Part 1 7.2.6.5 for more details.
29 class MEDIA_EXPORT ESDescriptor {
30 public:
31 ESDescriptor();
32 ~ESDescriptor();
34 bool Parse(const std::vector<uint8>& data);
36 uint8 object_type() const;
37 const std::vector<uint8>& decoder_specific_info() const;
39 private:
40 enum Tag {
41 kESDescrTag = 0x03,
42 kDecoderConfigDescrTag = 0x04,
43 kDecoderSpecificInfoTag = 0x05
46 bool ParseDecoderConfigDescriptor(BitReader* reader);
47 bool ParseDecoderSpecificInfo(BitReader* reader);
49 uint8 object_type_;
50 std::vector<uint8> decoder_specific_info_;
53 } // namespace mp4
55 } // namespace media
57 #endif // MEDIA_MP4_ES_DESCRIPTOR_H_