Shaka Packager SDK
audio_header.h
1 // Copyright 2017 Google Inc. 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_FORMATS_MP2T_AUDIO_HEADER_H_
8 #define PACKAGER_MEDIA_FORMATS_MP2T_AUDIO_HEADER_H_
9 
10 #include <stddef.h>
11 #include <stdint.h>
12 
13 #include <vector>
14 
15 namespace shaka {
16 namespace media {
17 namespace mp2t {
18 
19 class AudioHeader {
20  public:
21  AudioHeader() = default;
22  virtual ~AudioHeader() = default;
23 
27  virtual bool IsSyncWord(const uint8_t* buf) const = 0;
28 
30  virtual size_t GetMinFrameSize() const = 0;
31 
33  virtual size_t GetSamplesPerFrame() const = 0;
34 
43  virtual bool Parse(const uint8_t* audio_frame, size_t audio_frame_size) = 0;
44 
47  virtual size_t GetHeaderSize() const = 0;
48 
51  virtual size_t GetFrameSize() const = 0;
52 
59  virtual void GetAudioSpecificConfig(std::vector<uint8_t>* buffer) const = 0;
60 
63  virtual uint8_t GetObjectType() const = 0;
64 
67  virtual uint32_t GetSamplingFrequency() const = 0;
68 
71  virtual uint8_t GetNumChannels() const = 0;
72 
73  private:
74  AudioHeader(const AudioHeader&) = delete;
75  AudioHeader& operator=(const AudioHeader&) = delete;
76 };
77 
78 } // namespace mp2t
79 } // namespace media
80 } // namespace shaka
81 
82 #endif // PACKAGER_MEDIA_FORMATS_MP2T_AUDIO_HEADER_H_
virtual void GetAudioSpecificConfig(std::vector< uint8_t > *buffer) const =0
virtual bool Parse(const uint8_t *audio_frame, size_t audio_frame_size)=0
All the methods that are virtual are virtual for mocking.
virtual uint32_t GetSamplingFrequency() const =0
virtual size_t GetHeaderSize() const =0
virtual uint8_t GetObjectType() const =0
virtual uint8_t GetNumChannels() const =0
virtual bool IsSyncWord(const uint8_t *buf) const =0
virtual size_t GetSamplesPerFrame() const =0
virtual size_t GetFrameSize() const =0
virtual size_t GetMinFrameSize() const =0