Shaka Packager SDK
avc_decoder_configuration_record.h
1 // Copyright 2015 Google LLC. All rights reserved.
2 //
3 // Use of this source code is governed by a BSD-style
4 // license that can be found in the LICENSE file or at
5 // https://developers.google.com/open-source/licenses/bsd
6 
7 #ifndef PACKAGER_MEDIA_CODECS_AVC_DECODER_CONFIGURATION_RECORD_H_
8 #define PACKAGER_MEDIA_CODECS_AVC_DECODER_CONFIGURATION_RECORD_H_
9 
10 #include <cstdint>
11 #include <string>
12 #include <vector>
13 
14 #include <packager/macros/classes.h>
15 #include <packager/media/base/fourccs.h>
16 #include <packager/media/codecs/decoder_configuration_record.h>
17 
18 namespace shaka {
19 namespace media {
20 
23  public:
26 
28  std::string GetCodecString(FourCC codec_fourcc) const;
29 
30  uint8_t version() const { return version_; }
31  uint8_t profile_indication() const { return profile_indication_; }
32  uint8_t profile_compatibility() const { return profile_compatibility_; }
33  uint8_t avc_level() const { return avc_level_; }
34  uint32_t coded_width() const { return coded_width_; }
35  uint32_t coded_height() const { return coded_height_; }
36  uint32_t pixel_width() const { return pixel_width_; }
37  uint32_t pixel_height() const { return pixel_height_; }
38  uint8_t chroma_format() const { return chroma_format_; }
39  uint8_t bit_depth_luma_minus8() const { return bit_depth_luma_minus8_; }
40  uint8_t bit_depth_chroma_minus8() const { return bit_depth_chroma_minus8_; }
41 
44  static std::string GetCodecString(FourCC codec_fourcc,
45  uint8_t profile_indication,
46  uint8_t profile_compatibility,
47  uint8_t avc_level);
48 
49  private:
50  bool ParseInternal() override;
51 
52  uint8_t version_ = 0;
53  uint8_t profile_indication_ = 0;
54  uint8_t profile_compatibility_ = 0;
55  uint8_t avc_level_ = 0;
56 
57  // Extracted from SPS.
58  uint32_t coded_width_ = 0;
59  uint32_t coded_height_ = 0;
60  uint32_t pixel_width_ = 0;
61  uint32_t pixel_height_ = 0;
62 
63  // Only should be present for special case profile values.
64  // Refer to ISO/IEC 14496-15 Section 5.3.3.1.1.
65  uint8_t chroma_format_ = 0;
66  uint8_t bit_depth_luma_minus8_ = 0;
67  uint8_t bit_depth_chroma_minus8_ = 0;
68 
69  DISALLOW_COPY_AND_ASSIGN(AVCDecoderConfigurationRecord);
70 };
71 
72 } // namespace media
73 } // namespace shaka
74 
75 #endif // PACKAGER_MEDIA_CODECS_AVC_DECODER_CONFIGURATION_RECORD_H_
Class for parsing AVC decoder configuration record.
All the methods that are virtual are virtual for mocking.
Definition: crypto_flags.cc:66