7 #include "packager/media/base/audio_stream_info.h"
9 #include "packager/base/logging.h"
10 #include "packager/base/strings/string_number_conversions.h"
11 #include "packager/base/strings/stringprintf.h"
12 #include "packager/media/base/limits.h"
14 namespace edash_packager {
18 std::string AudioCodecToString(AudioCodec audio_codec) {
19 switch (audio_codec) {
59 NOTIMPLEMENTED() <<
"Unknown Audio Codec: " << audio_codec;
60 return "UnknownAudioCodec";
69 const std::string& codec_string,
70 const std::string& language,
73 uint32_t sampling_frequency,
76 const uint8_t* extra_data,
77 size_t extra_data_size,
89 sample_bits_(sample_bits),
90 num_channels_(num_channels),
91 sampling_frequency_(sampling_frequency),
92 max_bitrate_(max_bitrate),
93 avg_bitrate_(avg_bitrate) {}
95 AudioStreamInfo::~AudioStreamInfo() {}
98 return codec_ != kUnknownAudioCodec && num_channels_ != 0 &&
99 num_channels_ <= limits::kMaxChannels && sample_bits_ > 0 &&
100 sample_bits_ <= limits::kMaxBitsPerSample &&
101 sampling_frequency_ > 0 &&
102 sampling_frequency_ <= limits::kMaxSampleRate;
106 return base::StringPrintf(
107 "%s codec: %s\n sample_bits: %d\n num_channels: %d\n "
108 "sampling_frequency: %d\n language: %s\n",
110 sample_bits_, num_channels_, sampling_frequency_, language().c_str());
114 uint8_t audio_object_type) {
121 return "mp4a.40." + base::UintToString(audio_object_type);
135 NOTIMPLEMENTED() <<
"Codec: " << codec;