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