Merge "hal: Add XML parser for platform info"
diff --git a/hal/voice_extn/compress_voip.c b/hal/voice_extn/compress_voip.c
index a89ec2d..5c87c9c 100644
--- a/hal/voice_extn/compress_voip.c
+++ b/hal/voice_extn/compress_voip.c
@@ -60,6 +60,7 @@
struct pcm *pcm_tx;
struct stream_out *out_stream;
int ref_count;
+ int out_stream_count;
};
#define MODE_IS127 0x2
@@ -76,12 +77,14 @@
#define AUDIO_PARAMETER_KEY_VOIP_DTX_MODE "dtx_on"
#define AUDIO_PARAMETER_VALUE_VOIP_TRUE "true"
#define AUDIO_PARAMETER_KEY_VOIP_CHECK "voip_flag"
+#define AUDIO_PARAMETER_KEY_VOIP_OUT_STREAM_COUNT "voip_out_stream_count"
static struct voip_data voip_data = {
.pcm_rx = NULL,
.pcm_tx = NULL,
.out_stream = NULL,
- .ref_count = 0
+ .ref_count = 0,
+ .out_stream_count = 0
};
static int voip_set_volume(struct audio_device *adev, int volume);
@@ -453,6 +456,22 @@
return ret;
}
+void voice_extn_compress_voip_get_parameters(const struct audio_device *adev,
+ struct str_parms *query,
+ struct str_parms *reply)
+{
+ int ret;
+ char value[32]={0};
+ char *str = NULL;
+
+ ret = str_parms_get_str(query, AUDIO_PARAMETER_KEY_VOIP_OUT_STREAM_COUNT,
+ value, sizeof(value));
+ if (ret >= 0) {
+ str_parms_add_int(reply, AUDIO_PARAMETER_KEY_VOIP_OUT_STREAM_COUNT,
+ voip_data.out_stream_count);
+ }
+}
+
void voice_extn_compress_voip_out_get_parameters(struct stream_out *out,
struct str_parms *query,
struct str_parms *reply)
@@ -554,6 +573,7 @@
ret = voip_stop_call(adev);
voip_data.out_stream = NULL;
+ voip_data.out_stream_count--;
ALOGV("%s: exit: status(%d)", __func__, ret);
return ret;
@@ -574,6 +594,7 @@
out->config = pcm_config_voip_nb;
voip_data.out_stream = out;
+ voip_data.out_stream_count++;
ret = voip_set_mode(out->dev, out->format);
diff --git a/hal/voice_extn/voice_extn.c b/hal/voice_extn/voice_extn.c
index bbf3325..b8bc2df 100644
--- a/hal/voice_extn/voice_extn.c
+++ b/hal/voice_extn/voice_extn.c
@@ -505,6 +505,8 @@
}
str_parms_add_str(reply, AUDIO_PARAMETER_KEY_ALL_CALL_STATES, value);
}
+ voice_extn_compress_voip_get_parameters(adev, query, reply);
+
ALOGV("%s: exit: returns \"%s\"", __func__, str_parms_to_str(reply));
}
diff --git a/hal/voice_extn/voice_extn.h b/hal/voice_extn/voice_extn.h
index 03118f7..f7d20e4 100644
--- a/hal/voice_extn/voice_extn.h
+++ b/hal/voice_extn/voice_extn.h
@@ -130,6 +130,9 @@
snd_device_t *in_snd_device);
int voice_extn_compress_voip_set_parameters(struct audio_device *adev,
struct str_parms *parms);
+void voice_extn_compress_voip_get_parameters(const struct audio_device *adev,
+ struct str_parms *query,
+ struct str_parms *reply);
void voice_extn_compress_voip_out_get_parameters(struct stream_out *out,
struct str_parms *query,
@@ -166,7 +169,7 @@
return -ENOSYS;
}
-static int voice_extn_compress_voip_out_get_buffer_size(struct audio_stream *stream)
+static int voice_extn_compress_voip_out_get_buffer_size(struct stream_out *stream)
{
ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
return -ENOSYS;
@@ -217,6 +220,13 @@
return -ENOSYS;
}
+static void voice_extn_compress_voip_get_parameters(const struct audio_device *adev,
+ struct str_parms *query,
+ struct str_parms *reply)
+{
+ ALOGE("%s: COMPRESS_VOIP_ENABLED is not defined", __func__);
+}
+
static void voice_extn_compress_voip_out_get_parameters(struct stream_out *out,
struct str_parms *query,
struct str_parms *reply)
diff --git a/hal_mpq/audio_stream_out.c b/hal_mpq/audio_stream_out.c
index c475a1e..e7f29de 100644
--- a/hal_mpq/audio_stream_out.c
+++ b/hal_mpq/audio_stream_out.c
@@ -1709,8 +1709,8 @@
uc_info->out_snd_device = SND_DEVICE_NONE;
/* This must be called before adding this usecase to the list */
- //if (out->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL)
- // check_and_set_hdmi_channels(adev, out->config.channels);
+ if (out->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL)
+ check_and_set_hdmi_channels(adev, handle->config.channels);
list_add_tail(&adev->usecase_list, &uc_info->list);