Shaka Packager SDK
webm_audio_client.h
1 // Copyright 2014 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.
4 
5 #ifndef PACKAGER_MEDIA_FORMATS_WEBM_WEBM_AUDIO_CLIENT_H_
6 #define PACKAGER_MEDIA_FORMATS_WEBM_WEBM_AUDIO_CLIENT_H_
7 
8 #include <memory>
9 #include <string>
10 #include <vector>
11 
12 #include "packager/media/base/audio_stream_info.h"
13 #include "packager/media/formats/webm/webm_parser.h"
14 
15 namespace shaka {
16 namespace media {
17 class AudioDecoderConfig;
18 
21  public:
23  ~WebMAudioClient() override;
24 
26  void Reset();
27 
43  std::shared_ptr<AudioStreamInfo> GetAudioStreamInfo(
44  int64_t track_num,
45  const std::string& codec_id,
46  const std::vector<uint8_t>& codec_private,
47  int64_t seek_preroll,
48  int64_t codec_delay,
49  const std::string& language,
50  bool is_encrypted);
51 
52  private:
53  // WebMParserClient implementation.
54  bool OnUInt(int id, int64_t val) override;
55  bool OnFloat(int id, double val) override;
56 
57  int channels_;
58  double samples_per_second_;
59  double output_samples_per_second_;
60 
61  DISALLOW_COPY_AND_ASSIGN(WebMAudioClient);
62 };
63 
64 } // namespace media
65 } // namespace shaka
66 
67 #endif // PACKAGER_MEDIA_FORMATS_WEBM_WEBM_AUDIO_CLIENT_H_
shaka::media::WebMAudioClient
Helper class used to parse an Audio element inside a TrackEntry element.
Definition: webm_audio_client.h:20
shaka
All the methods that are virtual are virtual for mocking.
Definition: gflags_hex_bytes.cc:11
shaka::media::WebMParserClient
Definition: webm_parser.h:30
shaka::media::WebMAudioClient::Reset
void Reset()
Reset this object's state so it can process a new audio track element.
Definition: webm_audio_client.cc:25
shaka::media::WebMAudioClient::GetAudioStreamInfo
std::shared_ptr< AudioStreamInfo > GetAudioStreamInfo(int64_t track_num, const std::string &codec_id, const std::vector< uint8_t > &codec_private, int64_t seek_preroll, int64_t codec_delay, const std::string &language, bool is_encrypted)
Definition: webm_audio_client.cc:31