7 #ifndef PACKAGER_MEDIA_BASE_AUDIO_STREAM_INFO_H_
8 #define PACKAGER_MEDIA_BASE_AUDIO_STREAM_INFO_H_
12 #include <packager/media/base/stream_info.h>
25 const std::string& codec_string,
26 const uint8_t* codec_config,
27 size_t codec_config_size,
30 uint32_t sampling_frequency,
31 uint64_t seek_preroll_ns,
32 uint64_t codec_delay_ns,
35 const std::string& language,
43 std::string
ToString()
const override;
44 std::unique_ptr<StreamInfo>
Clone()
const override;
47 uint8_t sample_bits()
const {
return sample_bits_; }
48 uint8_t sample_bytes()
const {
return sample_bits_ / 8; }
49 uint8_t num_channels()
const {
return num_channels_; }
50 uint32_t sampling_frequency()
const {
return sampling_frequency_; }
51 uint32_t bytes_per_frame()
const {
52 return static_cast<uint32_t
>(num_channels_) * sample_bits_ / 8;
54 uint64_t seek_preroll_ns()
const {
return seek_preroll_ns_; }
55 uint64_t codec_delay_ns()
const {
return codec_delay_ns_; }
56 uint32_t max_bitrate()
const {
return max_bitrate_; }
57 uint32_t avg_bitrate()
const {
return avg_bitrate_; }
59 void set_sampling_frequency(
const uint32_t sampling_frequency) {
60 sampling_frequency_ = sampling_frequency;
63 void set_max_bitrate(
const uint32_t max_bitrate) {
64 max_bitrate_ = max_bitrate;
69 static std::string
GetCodecString(Codec codec, uint8_t audio_object_type);
73 uint8_t num_channels_;
74 uint32_t sampling_frequency_;
75 uint64_t seek_preroll_ns_;
76 uint64_t codec_delay_ns_;
77 uint32_t max_bitrate_;
78 uint32_t avg_bitrate_;
All the methods that are virtual are virtual for mocking.