7 #ifndef MEDIA_BASE_AUDIO_STREAM_INFO_H_
8 #define MEDIA_BASE_AUDIO_STREAM_INFO_H_
12 #include "packager/media/base/stream_info.h"
22 Codec codec,
const std::string& codec_string,
23 const uint8_t* codec_config,
size_t codec_config_size,
24 uint8_t sample_bits, uint8_t num_channels,
25 uint32_t sampling_frequency, uint64_t seek_preroll_ns,
26 uint64_t codec_delay_ns, uint32_t max_bitrate,
27 uint32_t avg_bitrate,
const std::string& language,
35 std::string
ToString()
const override;
38 uint8_t sample_bits()
const {
return sample_bits_; }
39 uint8_t sample_bytes()
const {
return sample_bits_ / 8; }
40 uint8_t num_channels()
const {
return num_channels_; }
41 uint32_t sampling_frequency()
const {
return sampling_frequency_; }
42 uint32_t bytes_per_frame()
const {
43 return static_cast<uint32_t
>(num_channels_) * sample_bits_ / 8;
45 uint64_t seek_preroll_ns()
const {
return seek_preroll_ns_; }
46 uint64_t codec_delay_ns()
const {
return codec_delay_ns_; }
47 uint32_t max_bitrate()
const {
return max_bitrate_; }
48 uint32_t avg_bitrate()
const {
return avg_bitrate_; }
50 void set_sampling_frequency(
const uint32_t sampling_frequency) {
51 sampling_frequency_ = sampling_frequency;
56 static std::string
GetCodecString(Codec codec, uint8_t audio_object_type);
60 uint8_t num_channels_;
61 uint32_t sampling_frequency_;
62 uint64_t seek_preroll_ns_;
63 uint64_t codec_delay_ns_;
64 uint32_t max_bitrate_;
65 uint32_t avg_bitrate_;
75 #endif // MEDIA_BASE_AUDIO_STREAM_INFO_H_