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,
74 const uint8_t* extra_data,
75 size_t extra_data_size,
87 sample_bits_(sample_bits),
88 num_channels_(num_channels),
89 sampling_frequency_(sampling_frequency) {
92 AudioStreamInfo::~AudioStreamInfo() {}
95 return codec_ != kUnknownAudioCodec && num_channels_ != 0 &&
96 num_channels_ <= limits::kMaxChannels && sample_bits_ > 0 &&
97 sample_bits_ <= limits::kMaxBitsPerSample &&
98 sampling_frequency_ > 0 &&
99 sampling_frequency_ <= limits::kMaxSampleRate;
103 return base::StringPrintf(
104 "%s codec: %s\n sample_bits: %d\n num_channels: %d\n "
105 "sampling_frequency: %d\n language: %s\n",
107 sample_bits_, num_channels_, sampling_frequency_, language().c_str());
111 uint8_t audio_object_type) {
118 return "mp4a.40." + base::UintToString(audio_object_type);
132 NOTIMPLEMENTED() <<
"Codec: " << codec;