[AUDIO_METHOD_UNWATCH_FOCUS] = {
.name = "UnwatchFocus",
},
+ [AUDIO_METHOD_SET_FILTER] = {
+ .name = "SetFilter",
+ },
+ [AUDIO_METHOD_UNSET_FILTER] = {
+ .name = "UnsetFilter",
+ },
+ [AUDIO_METHOD_CONTROL_FILTER] = {
+ .name = "ControlFilter",
+ },
};
const mm_sound_dbus_signal_info_t g_events[AUDIO_EVENT_MAX] = {
int mm_sound_volume_primary_type_get(volume_type_t *type);
/**
+ * This function is to set sound filter and apply to selected stream type.
+ *
+ * @param stream_type [in] stream type to apply
+ * @param filter_name [in] name of filter module to apply
+ * @param filter_parameters [in] extra filter parameters(optional)
+ * @param filter_group [in] extra filter group(optional)
+ *
+ * @return This function returns MM_ERROR_NONE on success, or negative value
+ * with error code.
+ * @remark None
+ * @pre None
+ * @post None
+ * @see None
+ */
+int mm_sound_set_filter(const char *stream_type, const char *filter_name, const char *filter_parameters, const char *filter_group);
+
+/**
+ * This function is to unset sound filter and remove from selected stream type.
+ *
+ * @param stream_type [in] stream type to remove
+ *
+ * @return This function returns MM_ERROR_NONE on success, or negative value
+ * with error code.
+ * @remark None
+ * @pre None
+ * @post None
+ * @see None
+ */
+int mm_sound_unset_filter(const char *stream_type);
+
+/**
+ * This function is to control filter configurations to selected stream type.
+ *
+ * @param stream_type [in] stream type to apply
+ * @param filter_name [in] specify filter module to apply
+ * @param filter_controls [in] filter control parameters(e.g, "0.0, 0.1, 3.0")
+ *
+ * @return This function returns MM_ERROR_NONE on success, or negative value
+ * with error code.
+ * @remark None
+ * @pre None
+ * @post None
+ * @see None
+ */
+int mm_sound_control_filter(const char *stream_type, const char *filter_name, const char *filter_controls);
+
+/**
* Terminate callback function type.
*
* @param data [in] Argument passed when callback was set
int mm_sound_client_set_volume_by_type(const int volume_type, const unsigned int volume_level);
int mm_sound_client_add_volume_changed_callback(mm_sound_volume_changed_cb func, void* user_data, unsigned int *subs_id);
int mm_sound_client_remove_volume_changed_callback(unsigned int subs_id);
+int mm_sound_client_set_filter_by_type(const char *stream_type, const char *filter_name, const char *filter_parameters, const char *filter_group);
+int mm_sound_client_unset_filter_by_type(const char *stream_type);
+int mm_sound_client_control_filter_by_type(const char *stream_type, const char *filter_name, const char *filter_controls);
int mm_sound_client_get_current_connected_device_list(int device_flgas, mm_sound_device_list_t *device_list);
int mm_sound_client_add_device_connected_callback(int device_flags, mm_sound_device_connected_cb func, void* user_data, unsigned int *subs_id);
int mm_sound_client_remove_device_connected_callback(unsigned int subs_id);
AUDIO_METHOD_WATCH_FOCUS,
AUDIO_METHOD_UNWATCH_FOCUS,
+ AUDIO_METHOD_SET_FILTER,
+ AUDIO_METHOD_UNSET_FILTER,
+ AUDIO_METHOD_CONTROL_FILTER,
+
AUDIO_METHOD_MAX
} audio_method_t;
int mm_sound_proxy_add_volume_changed_callback(mm_sound_volume_changed_wrapper_cb func, void* userdata, mm_sound_proxy_userdata_free freefunc, unsigned *subs_id);
int mm_sound_proxy_remove_volume_changed_callback(unsigned subs_id);
int mm_sound_proxy_emergent_exit(int exit_pid);
+int mm_sound_proxy_set_filter_by_type(const char *stream_type, const char *filter_name, const char *filter_parameters, const char *filter_group);
+int mm_sound_proxy_unset_filter_by_type(const char *stream_type);
+int mm_sound_proxy_control_filter_by_type(const char *stream_type, const char *filter_name, const char *filter_controls);
#ifdef USE_FOCUS
int mm_sound_proxy_get_unique_id(int *id);
return ret;
}
+EXPORT_API
+int mm_sound_set_filter(const char *stream_type, const char *filter_name, const char *filter_parameters, const char *filter_group)
+{
+ /* Check input param */
+ if (!stream_type || !filter_name) {
+ debug_error("invalid argument");
+ return MM_ERROR_INVALID_ARGUMENT;
+ }
+ if (!filter_parameters)
+ filter_parameters = "";
+ if (!filter_group)
+ filter_group = "default";
+
+ debug_msg("stream_type(%s), filter_name(%s), filter_parameters(%s), filter_group(%s)", stream_type, filter_name, filter_parameters, filter_group);
+
+ return mm_sound_client_set_filter_by_type(stream_type, filter_name, filter_parameters, filter_group);
+}
+
+EXPORT_API
+int mm_sound_unset_filter(const char *stream_type)
+{
+ /* Check input param */
+ if (!stream_type) {
+ debug_error("invalid argument");
+ return MM_ERROR_INVALID_ARGUMENT;
+ }
+
+ debug_msg("stream_type(%s)", stream_type);
+
+ return mm_sound_client_unset_filter_by_type(stream_type);
+}
+
+EXPORT_API
+int mm_sound_control_filter(const char *stream_type, const char *filter_name, const char *filter_controls)
+{
+ /* Check input param */
+ if (!stream_type || !filter_name || !filter_controls) {
+ debug_error("invalid argument");
+ return MM_ERROR_INVALID_ARGUMENT;
+ }
+
+ debug_msg("stream_type(%s), filter_name(%s), filter_controls(%s)", stream_type, filter_name, filter_controls);
+
+ return mm_sound_client_control_filter_by_type(stream_type, filter_name, filter_controls);
+}
+
///////////////////////////////////
//// MMSOUND PLAY APIs
///////////////////////////////////
return ret;
}
+int mm_sound_client_set_filter_by_type(const char *stream_type, const char *filter_name, const char *filter_parameters, const char *filter_group)
+{
+ int ret = MM_ERROR_NONE;
+ debug_fenter();
+
+ ret = mm_sound_proxy_set_filter_by_type(stream_type, filter_name, filter_parameters, filter_group);
+
+ debug_fleave();
+ return ret;
+}
+
+int mm_sound_client_unset_filter_by_type(const char *stream_type)
+{
+ int ret = MM_ERROR_NONE;
+ debug_fenter();
+
+ ret = mm_sound_proxy_unset_filter_by_type(stream_type);
+
+ debug_fleave();
+ return ret;
+}
+
+int mm_sound_client_control_filter_by_type(const char *stream_type, const char *filter_name, const char *filter_controls)
+{
+ int ret = MM_ERROR_NONE;
+ debug_fenter();
+
+ ret = mm_sound_proxy_control_filter_by_type(stream_type, filter_name, filter_controls);
+
+ debug_fleave();
+ return ret;
+}
+
#ifdef USE_FOCUS
int mm_sound_client_set_session_interrupt_callback(mm_sound_focus_session_interrupt_cb callback, void* user_data)
{
return ret;
}
+int mm_sound_proxy_set_filter_by_type(const char *stream_type, const char *filter_name, const char *filter_parameters, const char *filter_group)
+{
+ int ret = MM_ERROR_NONE;
+ char *reply = NULL;
+ GVariant *params = NULL, *result = NULL;
+
+ debug_fenter();
+
+ params = g_variant_new("(ssss)", filter_name, filter_parameters, filter_group, stream_type);
+ if (params) {
+ if ((ret = mm_sound_dbus_method_call_to(AUDIO_PROVIDER_STREAM_MANAGER, AUDIO_METHOD_SET_FILTER, params, &result)) != MM_ERROR_NONE) {
+ debug_error("dbus set filter by type failed");
+ goto cleanup;
+ }
+ } else {
+ debug_error("construct param for method call failed");
+ return MM_ERROR_SOUND_INTERNAL;
+ }
+
+ if (result) {
+ g_variant_get(result, "(&s)", &reply);
+ debug_log("reply : %s", reply);
+ if (!strcmp(reply, "STREAM_MANAGER_RETURN_ERROR"))
+ ret = MM_ERROR_SOUND_INTERNAL;
+ } else {
+ debug_error("reply null");
+ }
+
+cleanup:
+ if (result)
+ g_variant_unref(result);
+
+ debug_fleave();
+ return ret;
+}
+
+int mm_sound_proxy_unset_filter_by_type(const char *stream_type)
+{
+ int ret = MM_ERROR_NONE;
+ char *reply = NULL;
+ GVariant *params = NULL, *result = NULL;
+
+ debug_fenter();
+
+ params = g_variant_new("(s)", stream_type);
+ if (params) {
+ if ((ret = mm_sound_dbus_method_call_to(AUDIO_PROVIDER_STREAM_MANAGER, AUDIO_METHOD_UNSET_FILTER, params, &result)) != MM_ERROR_NONE) {
+ debug_error("dbus unset filter by type failed");
+ goto cleanup;
+ }
+ } else {
+ debug_error("construct param for method call failed");
+ return MM_ERROR_SOUND_INTERNAL;
+ }
+
+ if (result) {
+ g_variant_get(result, "(&s)", &reply);
+ debug_log("reply : %s", reply);
+ if (!strcmp(reply, "STREAM_MANAGER_RETURN_ERROR"))
+ ret = MM_ERROR_SOUND_INTERNAL;
+ } else {
+ debug_error("reply null");
+ }
+
+cleanup:
+ if (result)
+ g_variant_unref(result);
+
+ debug_fleave();
+ return ret;
+}
+
+int mm_sound_proxy_control_filter_by_type(const char *stream_type, const char *filter_name, const char *filter_controls)
+{
+ int ret = MM_ERROR_NONE;
+ char *reply = NULL;
+ GVariant *params = NULL, *result = NULL;
+
+ debug_fenter();
+
+ params = g_variant_new("(sss)", filter_name, filter_controls, stream_type);
+ if (params) {
+ if ((ret = mm_sound_dbus_method_call_to(AUDIO_PROVIDER_STREAM_MANAGER, AUDIO_METHOD_CONTROL_FILTER, params, &result)) != MM_ERROR_NONE) {
+ debug_error("dbus control filter by type failed");
+ goto cleanup;
+ }
+ } else {
+ debug_error("construct param for method call failed");
+ return MM_ERROR_SOUND_INTERNAL;
+ }
+
+ if (result) {
+ g_variant_get(result, "(&s)", &reply);
+ debug_log("reply : %s", reply);
+ if (!strcmp(reply, "STREAM_MANAGER_RETURN_ERROR"))
+ ret = MM_ERROR_SOUND_INTERNAL;
+ } else {
+ debug_error("reply null");
+ }
+
+cleanup:
+ if (result)
+ g_variant_unref(result);
+
+ debug_fleave();
+ return ret;
+}
+
int mm_sound_proxy_play_tone(int tone, int repeat, int volume, int volume_config,
int session_type, int session_options, int client_pid,
bool enable_session, int *codechandle, char *stream_type, int stream_index)
Name: libmm-sound
Summary: MMSound Package contains client lib and sound_server binary
-Version: 0.10.106
+Version: 0.10.107
Release: 0
Group: System/Libraries
License: Apache-2.0