Shaka Packager SDK
Loading...
Searching...
No Matches
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
13#include <packager/macros/classes.h>
14#include <packager/media/base/fourccs.h>
15#include <packager/media/codecs/decoder_configuration_record.h>
16
17namespace shaka {
18namespace media {
19
22 public:
25
27 std::string GetCodecString(FourCC codec_fourcc) const;
28
29 uint8_t version() const { return version_; }
30 uint8_t profile_indication() const { return profile_indication_; }
31 uint8_t profile_compatibility() const { return profile_compatibility_; }
32 uint8_t avc_level() const { return avc_level_; }
33 uint32_t coded_width() const { return coded_width_; }
34 uint32_t coded_height() const { return coded_height_; }
35 uint32_t pixel_width() const { return pixel_width_; }
36 uint32_t pixel_height() const { return pixel_height_; }
37 uint8_t chroma_format() const { return chroma_format_; }
38 uint8_t bit_depth_luma_minus8() const { return bit_depth_luma_minus8_; }
39 uint8_t bit_depth_chroma_minus8() const { return bit_depth_chroma_minus8_; }
40
43 static std::string GetCodecString(FourCC codec_fourcc,
44 uint8_t profile_indication,
45 uint8_t profile_compatibility,
46 uint8_t avc_level);
47
48 private:
49 bool ParseInternal() override;
50
51 uint8_t version_ = 0;
52 uint8_t profile_indication_ = 0;
53 uint8_t profile_compatibility_ = 0;
54 uint8_t avc_level_ = 0;
55
56 // Extracted from SPS.
57 uint32_t coded_width_ = 0;
58 uint32_t coded_height_ = 0;
59 uint32_t pixel_width_ = 0;
60 uint32_t pixel_height_ = 0;
61
62 // Only should be present for special case profile values.
63 // Refer to ISO/IEC 14496-15 Section 5.3.3.1.1.
64 uint8_t chroma_format_ = 0;
65 uint8_t bit_depth_luma_minus8_ = 0;
66 uint8_t bit_depth_chroma_minus8_ = 0;
67
68 DISALLOW_COPY_AND_ASSIGN(AVCDecoderConfigurationRecord);
69};
70
71} // namespace media
72} // namespace shaka
73
74#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.