diff options
author | Gilbok Lee <gilbok.lee@samsung.com> | 2017-09-18 11:44:47 +0900 |
---|---|---|
committer | Gilbok Lee <gilbok.lee@samsung.com> | 2017-09-18 11:44:55 +0900 |
commit | 0e4654c3b6f635665b776df27714e3c3d336a3dc (patch) | |
tree | bd5b12aeb9d0b1a79f36dc8345fa4736bc624af9 | |
parent | 9089a193386f93193f4641790d02cd7c335864bb (diff) | |
parent | e3b8a7868a514d2dcf94cb6fe6d5162e03989e2e (diff) | |
download | libmm-radio-submit/tizen_4.0/20170918.031048.tar.gz libmm-radio-submit/tizen_4.0/20170918.031048.tar.bz2 libmm-radio-submit/tizen_4.0/20170918.031048.zip |
Merge branch 'tizen' into tizen_4.0submit/tizen_4.0/20170918.031048accepted/tizen/4.0/unified/20170920.081335
Change-Id: I1fc4fe63f4dab82c5404cc1c4ee9f85a6b26e66a
-rwxr-xr-x | configure.ac | 4 | ||||
-rwxr-xr-x | packaging/libmm-radio.spec | 6 | ||||
-rwxr-xr-x | src/Makefile.am | 5 | ||||
-rw-r--r-- | src/include/mm_radio_utils.h | 32 | ||||
-rw-r--r-- | src/mm_radio.c | 57 | ||||
-rw-r--r-- | src/mm_radio_priv_emulator.c | 14 | ||||
-rw-r--r-- | src/mm_radio_priv_hal.c | 28 | ||||
-rw-r--r-- | src/mm_radio_sound_focus.c | 1 |
8 files changed, 78 insertions, 69 deletions
diff --git a/configure.ac b/configure.ac index d61edb8..ab1c1e1 100755 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,10 @@ PKG_CHECK_MODULES(MURPHY_GLIB, murphy-glib) AC_SUBST(MURPHY_GLIB_CFLAGS) AC_SUBST(MURPHY_GLIB_LIBS) +PKG_CHECK_MODULES(DLOG, dlog) +AC_SUBST(DLOG_CFLAGS) +AC_SUBST(DLOG_LIBS) + AC_ARG_ENABLE(emulator, AC_HELP_STRING([--enable-emulator], [using emulator interface]), [ case "${enableval}" in diff --git a/packaging/libmm-radio.spec b/packaging/libmm-radio.spec index e1ce8d6..d44a5dc 100755 --- a/packaging/libmm-radio.spec +++ b/packaging/libmm-radio.spec @@ -1,15 +1,13 @@ Name: libmm-radio Summary: Multimedia Framework Radio Library -Version: 0.2.28 +Version: 0.2.31 Release: 0 Group: System/Libraries License: Apache-2.0 Source0: %{name}-%{version}.tar.gz Source1001: libmm-radio.manifest -#Requires(post): /sbin/ldconfig -#Requires(postun): /sbin/ldconfig BuildRequires: pkgconfig(mm-common) -BuildRequires: pkgconfig(mm-log) +BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(mm-session) BuildRequires: pkgconfig(mm-sound) BuildRequires: pkgconfig(capi-media-sound-manager) diff --git a/src/Makefile.am b/src/Makefile.am index 18ce7ce..8118ed2 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -11,12 +11,13 @@ libmmfradio_la_CFLAGS = -I. -I./include \ $(MMCOMMON_CFLAGS) \ $(MURPHY_RESOURCE_CFLAGS) \ $(MURPHY_GLIB_CFLAGS) \ - -DMMF_LOG_OWNER=0x200000 -DMMF_DEBUG_PREFIX=\"MM-RADIO\" + $(DLOG_CFLAGS) libmmfradio_la_LIBADD = $(GTHREAD_LIBS) \ $(MMCOMMON_LIBS) \ $(MURPHY_RESOURCE_LIBS) \ - $(MURPHY_GLIB_LIBS) + $(MURPHY_GLIB_LIBS) \ + $(DLOG_LIBS) if ENABLE_EMULATOR diff --git a/src/include/mm_radio_utils.h b/src/include/mm_radio_utils.h index 32bc957..bcc5959 100644 --- a/src/include/mm_radio_utils.h +++ b/src/include/mm_radio_utils.h @@ -23,18 +23,23 @@ #include <assert.h> #include <mm_types.h> #include <mm_error.h> -#include <mm_debug.h> +#include <dlog.h> #include <mm_message.h> +#ifdef LOG_TAG +#undef LOG_TAG +#endif +#define LOG_TAG "MM_RADIO" + /* radio log */ -#define MMRADIO_LOG_FENTER debug_fenter -#define MMRADIO_LOG_FLEAVE debug_fleave -#define MMRADIO_LOG_INFO debug_msg -#define MMRADIO_LOG_DEBUG debug_log -#define MMRADIO_LOG_ERROR debug_error -#define MMRADIO_LOG_WARNING debug_warning -#define MMRADIO_LOG_CRITICAL debug_critical -#define MMRADIO_SLOG_DEBUG debug_log /* secure_debug_log */ +#define MMRADIO_LOG_FENTER(); LOGD("<Enter>"); +#define MMRADIO_LOG_FLEAVE(); LOGD("<Leave>"); +#define MMRADIO_LOG_INFO LOGI +#define MMRADIO_LOG_DEBUG LOGD +#define MMRADIO_LOG_ERROR LOGE +#define MMRADIO_LOG_WARNING LOGW +#define MMRADIO_LOG_CRITICAL LOGF +#define MMRADIO_SLOG_DEBUG SECURE_LOGD /* secure_debug_log */ /* general */ #ifndef ARRAY_SIZE @@ -91,6 +96,15 @@ do { \ } \ } while (0) +#define MMRADIO_RETURN_VAL_IF_FAIL(expr, val) \ +do { \ + if (!(expr)) { \ + MMRADIO_LOG_WARNING("failed [%s]\n", #expr); \ + return val; \ + } \ +} while (0) + + /* command locking for multithreading */ #define MMRADIO_CMD_LOCK(x_radio) pthread_mutex_lock(&((mm_radio_t *)x_radio)->cmd_lock) #define MMRADIO_CMD_UNLOCK(x_radio) pthread_mutex_unlock(&((mm_radio_t *)x_radio)->cmd_lock) diff --git a/src/mm_radio.c b/src/mm_radio.c index b1e17b0..ca47130 100644 --- a/src/mm_radio.c +++ b/src/mm_radio.c @@ -90,7 +90,7 @@ int mm_radio_create(MMHandleType *hradio) MMRADIO_LOG_FENTER(); - return_val_if_fail(hradio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(hradio, MM_ERROR_RADIO_NOT_INITIALIZED); /* alloc radio structure */ new_radio = (mm_radio_t *)malloc(sizeof(mm_radio_t)); @@ -134,7 +134,7 @@ int mm_radio_destroy(MMHandleType hradio) MMRADIO_LOG_FENTER(); - return_val_if_fail(radio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(radio, MM_ERROR_RADIO_NOT_INITIALIZED); result = _mmradio_destroy(radio); @@ -156,7 +156,7 @@ int mm_radio_realize(MMHandleType hradio) MMRADIO_LOG_FENTER(); - return_val_if_fail(radio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(radio, MM_ERROR_RADIO_NOT_INITIALIZED); MMRADIO_CMD_LOCK(radio); @@ -177,7 +177,7 @@ int mm_radio_unrealize(MMHandleType hradio) MMRADIO_LOG_FENTER(); - return_val_if_fail(radio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(radio, MM_ERROR_RADIO_NOT_INITIALIZED); mm_radio_get_state((hradio), &state); MMRADIO_LOG_DEBUG("mm_radio_unrealize state: %d\n", state); @@ -203,7 +203,7 @@ int mm_radio_set_message_callback(MMHandleType hradio, MMMessageCallback callbac MMRADIO_LOG_FENTER(); - return_val_if_fail(radio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(radio, MM_ERROR_RADIO_NOT_INITIALIZED); MMRADIO_CMD_LOCK(radio); @@ -224,8 +224,8 @@ int mm_radio_get_state(MMHandleType hradio, MMRadioStateType *pState) MMRADIO_LOG_FENTER(); - return_val_if_fail(radio, MM_ERROR_RADIO_NOT_INITIALIZED); - return_val_if_fail(pState, MM_ERROR_COMMON_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(radio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(pState, MM_ERROR_COMMON_INVALID_ARGUMENT); MMRADIO_CMD_LOCK(radio); @@ -247,7 +247,7 @@ int mm_radio_start(MMHandleType hradio) MMRADIO_LOG_FENTER(); - return_val_if_fail(radio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(radio, MM_ERROR_RADIO_NOT_INITIALIZED); MMRADIO_CMD_LOCK(radio); @@ -267,7 +267,7 @@ int mm_radio_stop(MMHandleType hradio) MMRADIO_LOG_FENTER(); - return_val_if_fail(radio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(radio, MM_ERROR_RADIO_NOT_INITIALIZED); MMRADIO_CMD_LOCK(radio); @@ -287,8 +287,9 @@ int mm_radio_seek(MMHandleType hradio, MMRadioSeekDirectionType direction) MMRADIO_LOG_FENTER(); - return_val_if_fail(radio, MM_ERROR_RADIO_NOT_INITIALIZED); - return_val_if_fail(direction >= MM_RADIO_SEEK_UP && direction <= MM_RADIO_SEEK_DOWN, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(radio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(direction >= MM_RADIO_SEEK_UP + && direction <= MM_RADIO_SEEK_DOWN, MM_ERROR_INVALID_ARGUMENT); MMRADIO_CMD_LOCK(radio); @@ -310,7 +311,7 @@ int mm_radio_set_frequency(MMHandleType hradio, int freq) MMRADIO_LOG_FENTER(); - return_val_if_fail(radio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(radio, MM_ERROR_RADIO_NOT_INITIALIZED); MMRADIO_CMD_LOCK(radio); @@ -331,8 +332,8 @@ int mm_radio_get_frequency(MMHandleType hradio, int *pFreq) MMRADIO_LOG_FENTER(); - return_val_if_fail(radio, MM_ERROR_RADIO_NOT_INITIALIZED); - return_val_if_fail(pFreq, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(radio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(pFreq, MM_ERROR_INVALID_ARGUMENT); MMRADIO_CMD_LOCK(radio); @@ -354,7 +355,7 @@ int mm_radio_scan_start(MMHandleType hradio) MMRADIO_LOG_FENTER(); - return_val_if_fail(radio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(radio, MM_ERROR_RADIO_NOT_INITIALIZED); MMRADIO_CMD_LOCK(radio); @@ -374,7 +375,7 @@ int mm_radio_scan_stop(MMHandleType hradio) MMRADIO_LOG_FENTER(); - return_val_if_fail(radio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(radio, MM_ERROR_RADIO_NOT_INITIALIZED); MMRADIO_CMD_LOCK(radio); @@ -394,7 +395,7 @@ int mm_radio_set_mute(MMHandleType hradio, bool muted) MMRADIO_LOG_FENTER(); - return_val_if_fail(radio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(radio, MM_ERROR_RADIO_NOT_INITIALIZED); MMRADIO_CMD_LOCK(radio); @@ -412,8 +413,8 @@ int mm_radio_set_mute(MMHandleType hradio, bool muted) int mm_radio_get_signal_strength(MMHandleType hradio, int *value) { - return_val_if_fail(hradio, MM_ERROR_RADIO_NOT_INITIALIZED); - return_val_if_fail(value, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(hradio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(value, MM_ERROR_INVALID_ARGUMENT); MMRADIO_LOG_FENTER(); @@ -436,8 +437,8 @@ int mm_radio_get_signal_strength(MMHandleType hradio, int *value) int mm_radio_get_region_type(MMHandleType hradio, MMRadioRegionType *type) { MMRADIO_LOG_FENTER(); - return_val_if_fail(hradio, MM_ERROR_RADIO_NOT_INITIALIZED); - return_val_if_fail(type, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(hradio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(type, MM_ERROR_INVALID_ARGUMENT); int result = MM_ERROR_NONE; mm_radio_t *radio = (mm_radio_t *)hradio; @@ -456,8 +457,8 @@ int mm_radio_get_region_frequency_range(MMHandleType hradio, unsigned int *min, { MMRADIO_LOG_FENTER(); - return_val_if_fail(hradio, MM_ERROR_RADIO_NOT_INITIALIZED); - return_val_if_fail(min && max, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(hradio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(min && max, MM_ERROR_INVALID_ARGUMENT); int result = MM_ERROR_NONE; mm_radio_t *radio = (mm_radio_t *)hradio; @@ -479,8 +480,8 @@ int mm_radio_get_channel_spacing(MMHandleType hradio, int *channel_spacing) { MMRADIO_LOG_FENTER(); - return_val_if_fail(hradio, MM_ERROR_RADIO_NOT_INITIALIZED); - return_val_if_fail(channel_spacing, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(hradio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(channel_spacing, MM_ERROR_INVALID_ARGUMENT); int result = MM_ERROR_NONE; mm_radio_t *radio = (mm_radio_t *)hradio; @@ -502,7 +503,7 @@ int mm_radio_set_volume(MMHandleType hradio, float volume) MMRADIO_LOG_FENTER(); - return_val_if_fail(radio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(radio, MM_ERROR_RADIO_NOT_INITIALIZED); MMRADIO_CMD_LOCK(radio); @@ -523,8 +524,8 @@ int mm_radio_get_volume(MMHandleType hradio, float *pVolume) MMRADIO_LOG_FENTER(); - return_val_if_fail(radio, MM_ERROR_RADIO_NOT_INITIALIZED); - return_val_if_fail(pVolume, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(radio, MM_ERROR_RADIO_NOT_INITIALIZED); + MMRADIO_RETURN_VAL_IF_FAIL(pVolume, MM_ERROR_INVALID_ARGUMENT); MMRADIO_CMD_LOCK(radio); diff --git a/src/mm_radio_priv_emulator.c b/src/mm_radio_priv_emulator.c index b82ed06..f282349 100644 --- a/src/mm_radio_priv_emulator.c +++ b/src/mm_radio_priv_emulator.c @@ -429,7 +429,7 @@ int _mmradio_get_frequency(mm_radio_t * radio, int *pFreq) MMRADIO_CHECK_INSTANCE(radio); MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_GET_FREQ); - return_val_if_fail(pFreq, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(pFreq, MM_ERROR_INVALID_ARGUMENT); /* just return stored frequency if radio device is not ready */ if (radio->radio_fd < 0) { @@ -568,7 +568,7 @@ int _mmradio_get_state(mm_radio_t * radio, int *pState) MMRADIO_LOG_FENTER(); MMRADIO_CHECK_INSTANCE(radio); - return_val_if_fail(pState, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(pState, MM_ERROR_INVALID_ARGUMENT); state = __mmradio_get_state(radio); @@ -920,7 +920,7 @@ int _mm_radio_get_signal_strength(mm_radio_t * radio, int *value) MMRADIO_LOG_FENTER(); MMRADIO_CHECK_INSTANCE(radio); - return_val_if_fail(value, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(value, MM_ERROR_INVALID_ARGUMENT); /* just return stored frequency if radio device is not ready */ if (radio->radio_fd < 0) { @@ -1470,7 +1470,7 @@ int _mmradio_get_region_type(mm_radio_t * radio, MMRadioRegionType * type) MMRADIO_CHECK_INSTANCE(radio); MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_GET_REGION); - return_val_if_fail(type, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(type, MM_ERROR_INVALID_ARGUMENT); *type = radio->region_setting.country; @@ -1484,7 +1484,7 @@ int _mmradio_get_region_frequency_range(mm_radio_t * radio, unsigned int *min_fr MMRADIO_CHECK_INSTANCE(radio); MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_GET_REGION); - return_val_if_fail(min_freq && max_freq, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(min_freq && max_freq, MM_ERROR_INVALID_ARGUMENT); *min_freq = radio->region_setting.band_min; *max_freq = radio->region_setting.band_max; @@ -1499,7 +1499,7 @@ int _mmradio_get_channel_spacing(mm_radio_t * radio, unsigned int *ch_spacing) MMRADIO_CHECK_INSTANCE(radio); MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_GET_REGION); - return_val_if_fail(ch_spacing, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(ch_spacing, MM_ERROR_INVALID_ARGUMENT); *ch_spacing = radio->region_setting.channel_spacing; @@ -1582,7 +1582,7 @@ int _mmradio_get_volume(mm_radio_t *radio, float *pVolume) MMRADIO_CHECK_INSTANCE(radio); MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_GET_VOLUME); - return_val_if_fail(pVolume, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(pVolume, MM_ERROR_INVALID_ARGUMENT); MMRADIO_SLOG_DEBUG("volume : %f\n", radio->local_volume); diff --git a/src/mm_radio_priv_hal.c b/src/mm_radio_priv_hal.c index dbbbc5d..6e9cffd 100644 --- a/src/mm_radio_priv_hal.c +++ b/src/mm_radio_priv_hal.c @@ -367,14 +367,12 @@ int _mmradio_destroy(mm_radio_t *radio) /* destroy command lock */ ret = pthread_mutex_destroy(&radio->cmd_lock); - if (ret) { + if (ret) MMRADIO_LOG_ERROR("mutex destroy failed\n"); - } ret = pthread_mutex_destroy(&radio->volume_lock); - if (ret) { + if (ret) MMRADIO_LOG_ERROR("volume mutex destroy failed\n"); - } #ifdef TIZEN_FEATURE_SOUND_FOCUS ret = mmradio_sound_focus_deregister(&radio->sound_focus); @@ -431,7 +429,7 @@ int _mmradio_get_frequency(mm_radio_t *radio, int *pFreq) MMRADIO_CHECK_INSTANCE(radio); MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_GET_FREQ); - return_val_if_fail(pFreq, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(pFreq, MM_ERROR_INVALID_ARGUMENT); ret = radio_hal_get_frequency(radio->hal_inf, &freq); if (ret != MM_ERROR_NONE) { @@ -522,7 +520,7 @@ int _mmradio_get_state(mm_radio_t *radio, int *pState) MMRADIO_LOG_FENTER(); MMRADIO_CHECK_INSTANCE(radio); - return_val_if_fail(pState, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(pState, MM_ERROR_INVALID_ARGUMENT); state = __mmradio_get_state(radio); @@ -932,7 +930,7 @@ int _mm_radio_get_signal_strength(mm_radio_t *radio, int *value) MMRADIO_LOG_FENTER(); MMRADIO_CHECK_INSTANCE(radio); - return_val_if_fail(value, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(value, MM_ERROR_INVALID_ARGUMENT); /* just return stored frequency if radio device is not ready */ ret = radio_hal_get_signal_strength(radio->hal_inf, &strength); @@ -1050,8 +1048,6 @@ FINISHED: FINISHED_ERR: - radio->scan_thread = 0; - if (radio->old_state == MM_RADIO_STATE_PLAYING) { MMRADIO_SET_STATE(radio, MM_RADIO_STATE_PLAYING); } else { @@ -1097,9 +1093,8 @@ FINISHED_ERR: MMRADIO_LOG_FLEAVE(); + radio->scan_thread = 0; pthread_exit(NULL); - - return; } bool __is_tunable_frequency(mm_radio_t *radio, int freq) @@ -1200,10 +1195,8 @@ void __mmradio_seek_thread(mm_radio_t *radio) MMRADIO_LOG_FLEAVE(); pthread_exit(NULL); - return; SEEK_FAILED: - if (radio->seek_unmute) { /* now turn on radio * In the case of limit freq, tuner should be unmuted. @@ -1220,7 +1213,6 @@ SEEK_FAILED: radio->is_seeking = FALSE; radio->seek_thread = 0; pthread_exit(NULL); - return; } static bool __mmradio_post_message(mm_radio_t *radio, enum MMMessageType msgtype, MMMessageParamType *param) @@ -1575,7 +1567,7 @@ int _mmradio_get_region_type(mm_radio_t *radio, MMRadioRegionType *type) MMRADIO_CHECK_INSTANCE(radio); MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_GET_REGION); - return_val_if_fail(type, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(type, MM_ERROR_INVALID_ARGUMENT); *type = radio->region_setting.country; @@ -1589,7 +1581,7 @@ int _mmradio_get_region_frequency_range(mm_radio_t *radio, unsigned int *min_fre MMRADIO_CHECK_INSTANCE(radio); MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_GET_REGION); - return_val_if_fail(min_freq && max_freq, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(min_freq && max_freq, MM_ERROR_INVALID_ARGUMENT); *min_freq = radio->region_setting.band_min; *max_freq = radio->region_setting.band_max; @@ -1604,7 +1596,7 @@ int _mmradio_get_channel_spacing(mm_radio_t *radio, unsigned int *ch_spacing) MMRADIO_CHECK_INSTANCE(radio); MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_GET_REGION); - return_val_if_fail(ch_spacing, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(ch_spacing, MM_ERROR_INVALID_ARGUMENT); *ch_spacing = radio->region_setting.channel_spacing; @@ -1645,7 +1637,7 @@ int _mmradio_get_volume(mm_radio_t *radio, float *pVolume) MMRADIO_CHECK_INSTANCE(radio); MMRADIO_CHECK_STATE_RETURN_IF_FAIL(radio, MMRADIO_COMMAND_GET_VOLUME); - return_val_if_fail(pVolume, MM_ERROR_INVALID_ARGUMENT); + MMRADIO_RETURN_VAL_IF_FAIL(pVolume, MM_ERROR_INVALID_ARGUMENT); ret = radio_hal_get_volume(radio->hal_inf, &volume); if (ret != MM_ERROR_NONE) { diff --git a/src/mm_radio_sound_focus.c b/src/mm_radio_sound_focus.c index e4b70b2..83e7fce 100644 --- a/src/mm_radio_sound_focus.c +++ b/src/mm_radio_sound_focus.c @@ -19,7 +19,6 @@ #include <assert.h> #include <unistd.h> -#include <mm_debug.h> #include <mm_sound.h> #include <mm_sound_focus.h> #include <mm_sound_device.h> |