};
static const struct dbus_path g_paths[AUDIO_PROVIDER_MAX] = {
- [AUDIO_PROVIDER_SOUND_SERVER] = {
- .bus_name = "org.tizen.SoundServer",
- .object = "/org/tizen/SoundServer1",
- .interface = "org.tizen.SoundServer1"
- },
[AUDIO_PROVIDER_FOCUS_SERVER] = {
.bus_name = "org.tizen.FocusServer",
.object = "/org/tizen/FocusServer1",
if (serveropt.startserver) {
unlink(PA_READY); // remove pa_ready file after focus-server init.
-
/* FIXME : This code is moved from sound_server temporally for TV migration
As other modules which has dependancy on this file is cleared,
this code will be removed */
_generate_ready_file(SOUND_SERVER_READY);
#endif
_generate_ready_file(FOCUS_SERVER_READY);
-
_mainloop_run();
}
int mm_sound_client_add_ducking_state_changed_callback(mm_sound_ducking_state_changed_cb func, void* user_data, unsigned int *subs_id);
int mm_sound_client_remove_ducking_state_changed_callback(unsigned int subs_id);
-int mm_sound_client_add_test_callback(mm_sound_test_cb func, void* user_data, unsigned int *subs_id);
-int mm_sound_client_remove_test_callback(unsigned int subs_id);
-int mm_sound_client_test(int a, int b, int* get);
-
typedef void (*mm_sound_volume_changed_wrapper_cb)(const char *direction, const char *volume_type_str, int volume_level, void *userdata);
typedef void (*mm_sound_device_connected_wrapper_cb)(int device_id, const char *device_type, int io_direction, int state,
const char *name, int vendor_id, int product_id, bool is_running, int *stream_id, int stream_num, bool is_connected, void *userdata);
/* audio service(methods, signals) providers */
typedef enum audio_provider {
- AUDIO_PROVIDER_SOUND_SERVER,
AUDIO_PROVIDER_DEVICE_MANAGER,
AUDIO_PROVIDER_STREAM_MANAGER,
AUDIO_PROVIDER_FOCUS_SERVER,
int mm_sound_proxy_add_focus_watch_callback(int index, mm_sound_focus_type_e type);
int mm_sound_proxy_remove_focus_watch_callback(int index);
-int mm_sound_proxy_add_test_callback(mm_sound_test_cb func, void *userdata, mm_sound_proxy_userdata_free freefunc, unsigned *subs_id);
-int mm_sound_proxy_remove_test_callback(unsigned subs_id);
-int mm_sound_proxy_test(int a, int b, int* get);
-
int mm_sound_proxy_initialize(void);
int mm_sound_proxy_finalize(void);
///////////////////////////////////
EXPORT_API
-int mm_sound_test(int a, int b, int* getv)
-{
- int ret = MM_ERROR_NONE;
-
- debug_log("mm_sound_test enter");
- if (!getv) {
- debug_error("argu null");
- return MM_ERROR_INVALID_ARGUMENT;
- }
- ret = mm_sound_client_test(a, b, getv);
- if (ret < 0) {
- debug_error("Can not mm sound test, ret = %x", ret);
- }
- debug_log("mm_sound_test leave");
-
- return ret;
-}
-
-EXPORT_API
-int mm_sound_add_test_callback(mm_sound_test_cb func, void *user_data, unsigned int *subs_id)
-{
- int ret = MM_ERROR_NONE;
-
- debug_log("enter");
- if (!func || !subs_id) {
- debug_error("argument is not valid");
- return MM_ERROR_INVALID_ARGUMENT;
- }
-
- ret = mm_sound_client_add_test_callback(func, user_data, subs_id);
- if (ret < 0) {
- debug_error("Can not add test callback, ret = %x", ret);
- }
- debug_log("leave");
-
- return ret;
-}
-
-EXPORT_API
-int mm_sound_remove_test_callback(unsigned int subs_id)
-{
- int ret = MM_ERROR_NONE;
-
- debug_log("enter");
- ret = mm_sound_client_remove_test_callback(subs_id);
- if (ret < 0) {
- debug_error("Can not remove test callback, ret = %x", ret);
- }
- debug_log("leave");
-
- return ret;
-}
-
-EXPORT_API
int mm_sound_add_ducking_state_changed_callback(mm_sound_ducking_state_changed_cb func, void *user_data, unsigned int *subs_id)
{
int ret = MM_ERROR_NONE;
return ret;
}
-int mm_sound_client_add_test_callback(mm_sound_test_cb func, void* user_data, unsigned int *subs_id)
-{
- int ret = MM_ERROR_NONE;
-
- debug_fenter();
-
- ret = mm_sound_proxy_add_test_callback(func, user_data, g_free, subs_id);
-
- debug_fleave();
- return ret;
-}
-
-int mm_sound_client_remove_test_callback(unsigned int subs_id)
-{
- int ret = MM_ERROR_NONE;
- debug_fenter();
-
- ret = mm_sound_proxy_remove_test_callback(subs_id);
-
- debug_fleave();
- return ret;
-}
-
-int mm_sound_client_test(int a, int b, int* getv)
-{
- int ret = MM_ERROR_NONE;
-
- debug_fenter();
-
- ret = mm_sound_proxy_test(a, b, getv);
- debug_log("%d * %d -> result : %d", a, b, *getv);
-
- debug_fleave();
-
- return ret;
-}
}
}
-int mm_sound_proxy_add_test_callback(mm_sound_test_cb func, void *userdata, mm_sound_proxy_userdata_free freefunc, unsigned *subs_id)
-{
- int ret = MM_ERROR_NONE;
- struct callback_data *cb_data;
-
- debug_fenter();
-
- CB_DATA_NEW(cb_data, func, userdata, freefunc);
-
- if ((ret = mm_sound_dbus_signal_subscribe_to(AUDIO_PROVIDER_SOUND_SERVER, AUDIO_EVENT_TEST, dbus_callback, cb_data, simple_callback_data_free_func, &cb_data->subs_id)) != MM_ERROR_NONE)
- debug_error("add test callback failed");
- else
- *subs_id = cb_data->subs_id;
-
- debug_fleave();
- return ret;
-}
-
-int mm_sound_proxy_remove_test_callback(unsigned subs_id)
-{
- int ret = MM_ERROR_NONE;
- debug_fenter();
-
- if ((ret = mm_sound_dbus_signal_unsubscribe(subs_id)) != MM_ERROR_NONE)
- debug_error("remove test callback failed");
-
- debug_fleave();
- return ret;
-}
-
-int mm_sound_proxy_test(int a, int b, int *get)
-{
- int ret = MM_ERROR_NONE;
- int reply = 0;
- GVariant *params = NULL, *result = NULL;
-
- debug_fenter();
-
- if ((params = g_variant_new("(ii)", a, b)) == NULL) {
- debug_error("Construct Param for method call failed");
- return MM_ERROR_SOUND_INTERNAL;
- }
-
- if ((ret = mm_sound_dbus_method_call_to(AUDIO_PROVIDER_SOUND_SERVER, AUDIO_METHOD_TEST, params, &result)) != MM_ERROR_NONE) {
- debug_error("dbus test call failed");
- goto cleanup;
- }
-
- if (result) {
- g_variant_get(result, "(i)", &reply);
- debug_log("reply : %d", reply);
- *get = reply;
- } else {
- debug_error("reply null");
- ret = MM_ERROR_SOUND_INTERNAL;
- }
-
-cleanup:
- if (result)
- g_variant_unref(result);
-
- debug_fleave();
- return ret;
-}
-
int mm_sound_proxy_is_stream_on_device(int stream_id, int device_id, bool *is_on)
{
int ret = MM_ERROR_NONE;
+++ /dev/null
-/usr/bin/sound_server
Name: libmm-sound
-Summary: MMSound Package contains client lib and sound_server binary
-Version: 0.13.8
+Summary: MMSound Package contains client lib and focus server binary
+Version: 0.13.9
Release: 0
Group: System/Libraries
License: Apache-2.0
Source6: focus-server.conf
Requires: security-config
%if "%{tizen_profile_name}" == "tv"
-Source7: libmm-sound.notstrip
-Source8: focus-server-tv.service
+Source7: focus-server-tv.service
%endif
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
mkdir -p %{buildroot}/etc/dbus-1/system.d/
cp %{SOURCE6} %{buildroot}/etc/dbus-1/system.d/focus-server.conf
%if "%{tizen_profile_name}" == "tv"
-cp %{SOURCE8} %{SOURCE4}
+cp %{SOURCE7} %{SOURCE4}
%endif
%if "%{tizen_profile_name}" != "tv"
cp %{SOURCE1} %{buildroot}/etc/dbus-1/system.d/audio-aec.conf
mkdir -p %{buildroot}/usr/share/dbus-1/system-services/
%make_install
-%if "%{tizen_profile_name}" == "tv"
-mkdir -p %{buildroot}%{_sysconfdir}/notstrip
-install -m0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/notstrip/libmm-sound.notstrip
-%endif
install -d %{buildroot}%{_unitdir}/paths.target.wants
install -m0644 %{SOURCE4} %{buildroot}%{_unitdir}/
install -m0644 %{SOURCE5} %{buildroot}%{_unitdir}/
%{_libdir}/libmmfsoundcommon.so.*
%{_libdir}/libmmfkeysound.so.*
%{_libdir}/libmmfbootsound.so.*
-%if "%{tizen_profile_name}" == "tv"
-%{_sysconfdir}/notstrip/libmm-sound.notstrip
-%endif
%{_unitdir}/paths.target.wants/focus-server.path
%{_unitdir}/focus-server.service
%{_unitdir}/focus-server.path
ret = mm_sound_play_keysound(KEYTONE_FILE, 0);
if (ret < 0)
debug_error("keysound play failed with 0x%x", ret);
- } else if (strcmp(cmd, "dbus-m") == 0) {
- int ret = 0;
- int a = 3;
- int b = 4;
- int result_val = 0;
- g_print("dbus method test call\n");
- ret = mm_sound_test(a, b, &result_val);
- if (ret)
- g_print("failed to mm_sound_test(), ret[0x%x]\n", ret);
- else
- g_print("Got answer : %d\n", result_val);
-
- } else if (strcmp(cmd, "dbus-a") == 0) {
- int ret = 0;
- int user_data = 3;
- g_print("dbus method test add callback\n");
- g_print("my testsuite pid : %u tid : %ld\n", getpid(), pthread_self());
- ret = mm_sound_add_test_callback(mm_sound_test_cb1, (void *)user_data, &g_subs_id_test);
- if (ret)
- g_print("failed to mm_sound_add_test_callback(), ret[0x%x]\n", ret);
- else
- g_print("add test callback success\n");
-
- } else if (strcmp(cmd, "dbus-r") == 0) {
- int ret = 0;
- g_print("dbus method test remove callback\n");
- ret = mm_sound_remove_test_callback(g_subs_id_test);
- if (ret)
- g_print("failed to mm_sound_remove_test_callback(), ret[0x%x]\n", ret);
- else
- g_print("remove test callback success\n");
-
} else if (strncmp(cmd, "q", 1) == 0) {
unsigned int value = 100;
ret = mm_sound_volume_get_value(g_volume_type, &value);