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) {
47 NOTIMPLEMENTED() <<
"Unknown Audio Codec: " << audio_codec;
48 return "UnknownAudioCodec";
57 const std::string& codec_string,
58 const std::string& language,
61 uint32_t sampling_frequency,
62 const uint8_t* extra_data,
63 size_t extra_data_size,
75 sample_bits_(sample_bits),
76 num_channels_(num_channels),
77 sampling_frequency_(sampling_frequency) {
80 AudioStreamInfo::~AudioStreamInfo() {}
83 return codec_ != kUnknownAudioCodec && num_channels_ != 0 &&
84 num_channels_ <= limits::kMaxChannels && sample_bits_ > 0 &&
85 sample_bits_ <= limits::kMaxBitsPerSample &&
86 sampling_frequency_ > 0 &&
87 sampling_frequency_ <= limits::kMaxSampleRate;
91 return base::StringPrintf(
92 "%s codec: %s\n sample_bits: %d\n num_channels: %d\n "
93 "sampling_frequency: %d\n language: %s\n",
95 sample_bits_, num_channels_, sampling_frequency_, language().c_str());
99 uint8_t audio_object_type) {
106 return "mp4a.40." + base::UintToString(audio_object_type);
108 NOTIMPLEMENTED() <<
"Codec: " << codec;