diff options
author | Seungbae Shin <seungbae.shin@samsung.com> | 2016-03-23 21:57:06 +0900 |
---|---|---|
committer | Seungbae Shin <seungbae.shin@samsung.com> | 2016-03-23 21:57:39 +0900 |
commit | 3679c4c79d5bd4f60a3f4552e879c31c960ffe59 (patch) | |
tree | c6967e1a6ea94ad8ab06f0b0aa66ab1dc5c10c3c | |
parent | 3cdef9c950ee75607d56e2079d392d4533c0e981 (diff) | |
download | audio-hal-wm1831-3679c4c79d5bd4f60a3f4552e879c31c960ffe59.tar.gz audio-hal-wm1831-3679c4c79d5bd4f60a3f4552e879c31c960ffe59.tar.bz2 audio-hal-wm1831-3679c4c79d5bd4f60a3f4552e879c31c960ffe59.zip |
Add missing file of previous commitsubmit/tizen/20160323.135640accepted/tizen/wearable/20160324.011103accepted/tizen/tv/20160324.011019accepted/tizen/mobile/20160324.010952accepted/tizen/ivi/20160324.011125accepted/tizen/common/20160323.185816
Version] 0.1.3
[Profile] Common
[Issue Type] Bug
Change-Id: Iaa22a4dacc88a26d9683f68c3015926625181687
-rw-r--r-- | packaging/audio-hal-wm1831.spec | 2 | ||||
-rw-r--r-- | tizen-audio-comm.c | 91 |
2 files changed, 92 insertions, 1 deletions
diff --git a/packaging/audio-hal-wm1831.spec b/packaging/audio-hal-wm1831.spec index 576e82a..5aec7d3 100644 --- a/packaging/audio-hal-wm1831.spec +++ b/packaging/audio-hal-wm1831.spec @@ -1,6 +1,6 @@ Name: audio-hal-wm1831 Summary: TIZEN Audio HAL for WM1831 -Version: 0.1.2 +Version: 0.1.3 Release: 0 Group: System/Libraries License: Apache-2.0 diff --git a/tizen-audio-comm.c b/tizen-audio-comm.c new file mode 100644 index 0000000..d94aa22 --- /dev/null +++ b/tizen-audio-comm.c @@ -0,0 +1,91 @@ +/* + * audio-hal + * + * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#include "tizen-audio-internal.h" + +audio_return_t _audio_comm_send_message(audio_hal_t *ah, const char *name, int value) +{ + audio_return_t audio_ret = AUDIO_RET_OK; + + AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); + AUDIO_RETURN_VAL_IF_FAIL(name, AUDIO_ERR_PARAMETER); + + AUDIO_LOG_DEBUG("send message : name(%s), value(%d)", name, value); + if (ah->comm.msg_cb) { + ah->comm.msg_cb(name, value, ah->comm.user_data); + } + + return audio_ret; +} + +audio_return_t _audio_comm_set_message_callback(audio_hal_t *ah, message_cb callback, void *user_data) +{ + audio_return_t audio_ret = AUDIO_RET_OK; + + AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); + AUDIO_RETURN_VAL_IF_FAIL(callback, AUDIO_ERR_PARAMETER); + + ah->comm.msg_cb = callback; + ah->comm.user_data = user_data; + + AUDIO_LOG_DEBUG("message callback is set, callback(%p), user_data(%p)", ah->comm.msg_cb, ah->comm.user_data); + + return audio_ret; +} + +audio_return_t _audio_comm_unset_message_callback(audio_hal_t *ah) +{ + audio_return_t audio_ret = AUDIO_RET_OK; + + AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); + + ah->comm.msg_cb = NULL; + ah->comm.user_data = NULL; + + AUDIO_LOG_DEBUG("message callback is unset"); + + return audio_ret; +} + +audio_return_t _audio_comm_init(audio_hal_t *ah) +{ + audio_return_t audio_ret = AUDIO_RET_OK; + + AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); + + ah->comm.msg_cb = NULL; + ah->comm.user_data = NULL; + + return audio_ret; +} + +audio_return_t _audio_comm_deinit(audio_hal_t *ah) +{ + audio_return_t audio_ret = AUDIO_RET_OK; + + AUDIO_RETURN_VAL_IF_FAIL(ah, AUDIO_ERR_PARAMETER); + + ah->comm.msg_cb = NULL; + ah->comm.user_data = NULL; + + return audio_ret; +} |