Loading hal/audio_hw.c +55 −1 Original line number Original line Diff line number Diff line Loading @@ -285,7 +285,9 @@ static bool is_supported_format(audio_format_t format) format == AUDIO_FORMAT_AAC_HE_V2 || format == AUDIO_FORMAT_AAC_HE_V2 || format == AUDIO_FORMAT_PCM_16_BIT_OFFLOAD || format == AUDIO_FORMAT_PCM_16_BIT_OFFLOAD || format == AUDIO_FORMAT_PCM_24_BIT_OFFLOAD || format == AUDIO_FORMAT_PCM_24_BIT_OFFLOAD || format == AUDIO_FORMAT_FLAC) format == AUDIO_FORMAT_FLAC || format == AUDIO_FORMAT_WMA || format == AUDIO_FORMAT_WMA_PRO) return true; return true; return false; return false; Loading @@ -308,6 +310,12 @@ static int get_snd_codec_id(audio_format_t format) case AUDIO_FORMAT_FLAC: case AUDIO_FORMAT_FLAC: id = SND_AUDIOCODEC_FLAC; id = SND_AUDIOCODEC_FLAC; break; break; case AUDIO_FORMAT_WMA: id = SND_AUDIOCODEC_WMA; break; case AUDIO_FORMAT_WMA_PRO: id = SND_AUDIOCODEC_WMA_PRO; break; default: default: ALOGE("%s: Unsupported audio format :%x", __func__, format); ALOGE("%s: Unsupported audio format :%x", __func__, format); } } Loading Loading @@ -1797,6 +1805,52 @@ static int parse_compress_metadata(struct stream_out *out, struct str_parms *par } } } } if (out->format == AUDIO_FORMAT_WMA || out->format == AUDIO_FORMAT_WMA_PRO) { ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_WMA_FORMAT_TAG, value, sizeof(value)); if (ret >= 0) { out->compr_config.codec->format = atoi(value); out->send_new_metadata = 1; } ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_WMA_BLOCK_ALIGN, value, sizeof(value)); if (ret >= 0) { out->compr_config.codec->options.wma.super_block_align = atoi(value); out->send_new_metadata = 1; } ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_WMA_BIT_PER_SAMPLE, value, sizeof(value)); if (ret >= 0) { out->compr_config.codec->options.wma.bits_per_sample = atoi(value); out->send_new_metadata = 1; } ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_WMA_CHANNEL_MASK, value, sizeof(value)); if (ret >= 0) { out->compr_config.codec->options.wma.channelmask = atoi(value); out->send_new_metadata = 1; } ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_WMA_ENCODE_OPTION, value, sizeof(value)); if (ret >= 0) { out->compr_config.codec->options.wma.encodeopt = atoi(value); out->send_new_metadata = 1; } ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_WMA_ENCODE_OPTION1, value, sizeof(value)); if (ret >= 0) { out->compr_config.codec->options.wma.encodeopt1 = atoi(value); out->send_new_metadata = 1; } ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_WMA_ENCODE_OPTION2, value, sizeof(value)); if (ret >= 0) { out->compr_config.codec->options.wma.encodeopt2 = atoi(value); out->send_new_metadata = 1; } ALOGV("WMA params: fmt %x, balgn %x, sr %d, chmsk %x, encop %x, op1 %x, op2 %x", out->compr_config.codec->format, out->compr_config.codec->options.wma.super_block_align, out->compr_config.codec->options.wma.bits_per_sample, out->compr_config.codec->options.wma.channelmask, out->compr_config.codec->options.wma.encodeopt, out->compr_config.codec->options.wma.encodeopt1, out->compr_config.codec->options.wma.encodeopt2); } ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_SAMPLE_RATE, value, sizeof(value)); ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_SAMPLE_RATE, value, sizeof(value)); if(ret >= 0) if(ret >= 0) is_meta_data_params = true; is_meta_data_params = true; Loading Loading
hal/audio_hw.c +55 −1 Original line number Original line Diff line number Diff line Loading @@ -285,7 +285,9 @@ static bool is_supported_format(audio_format_t format) format == AUDIO_FORMAT_AAC_HE_V2 || format == AUDIO_FORMAT_AAC_HE_V2 || format == AUDIO_FORMAT_PCM_16_BIT_OFFLOAD || format == AUDIO_FORMAT_PCM_16_BIT_OFFLOAD || format == AUDIO_FORMAT_PCM_24_BIT_OFFLOAD || format == AUDIO_FORMAT_PCM_24_BIT_OFFLOAD || format == AUDIO_FORMAT_FLAC) format == AUDIO_FORMAT_FLAC || format == AUDIO_FORMAT_WMA || format == AUDIO_FORMAT_WMA_PRO) return true; return true; return false; return false; Loading @@ -308,6 +310,12 @@ static int get_snd_codec_id(audio_format_t format) case AUDIO_FORMAT_FLAC: case AUDIO_FORMAT_FLAC: id = SND_AUDIOCODEC_FLAC; id = SND_AUDIOCODEC_FLAC; break; break; case AUDIO_FORMAT_WMA: id = SND_AUDIOCODEC_WMA; break; case AUDIO_FORMAT_WMA_PRO: id = SND_AUDIOCODEC_WMA_PRO; break; default: default: ALOGE("%s: Unsupported audio format :%x", __func__, format); ALOGE("%s: Unsupported audio format :%x", __func__, format); } } Loading Loading @@ -1797,6 +1805,52 @@ static int parse_compress_metadata(struct stream_out *out, struct str_parms *par } } } } if (out->format == AUDIO_FORMAT_WMA || out->format == AUDIO_FORMAT_WMA_PRO) { ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_WMA_FORMAT_TAG, value, sizeof(value)); if (ret >= 0) { out->compr_config.codec->format = atoi(value); out->send_new_metadata = 1; } ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_WMA_BLOCK_ALIGN, value, sizeof(value)); if (ret >= 0) { out->compr_config.codec->options.wma.super_block_align = atoi(value); out->send_new_metadata = 1; } ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_WMA_BIT_PER_SAMPLE, value, sizeof(value)); if (ret >= 0) { out->compr_config.codec->options.wma.bits_per_sample = atoi(value); out->send_new_metadata = 1; } ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_WMA_CHANNEL_MASK, value, sizeof(value)); if (ret >= 0) { out->compr_config.codec->options.wma.channelmask = atoi(value); out->send_new_metadata = 1; } ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_WMA_ENCODE_OPTION, value, sizeof(value)); if (ret >= 0) { out->compr_config.codec->options.wma.encodeopt = atoi(value); out->send_new_metadata = 1; } ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_WMA_ENCODE_OPTION1, value, sizeof(value)); if (ret >= 0) { out->compr_config.codec->options.wma.encodeopt1 = atoi(value); out->send_new_metadata = 1; } ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_WMA_ENCODE_OPTION2, value, sizeof(value)); if (ret >= 0) { out->compr_config.codec->options.wma.encodeopt2 = atoi(value); out->send_new_metadata = 1; } ALOGV("WMA params: fmt %x, balgn %x, sr %d, chmsk %x, encop %x, op1 %x, op2 %x", out->compr_config.codec->format, out->compr_config.codec->options.wma.super_block_align, out->compr_config.codec->options.wma.bits_per_sample, out->compr_config.codec->options.wma.channelmask, out->compr_config.codec->options.wma.encodeopt, out->compr_config.codec->options.wma.encodeopt1, out->compr_config.codec->options.wma.encodeopt2); } ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_SAMPLE_RATE, value, sizeof(value)); ret = str_parms_get_str(parms, AUDIO_OFFLOAD_CODEC_SAMPLE_RATE, value, sizeof(value)); if(ret >= 0) if(ret >= 0) is_meta_data_params = true; is_meta_data_params = true; Loading