2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #define LOG_TAG "CAPI_MEDIA_WAV_PLAYER"
21 #include <mm_sound_private.h>
28 #include "wav_player_private.h"
30 int __convert_wav_player_error_code(const char *func, int code)
32 int ret = WAV_PLAYER_ERROR_INVALID_OPERATION;
33 char *errorstr = NULL;
37 ret = WAV_PLAYER_ERROR_NONE;
38 errorstr = "ERROR_NONE";
40 case MM_ERROR_INVALID_ARGUMENT:
41 case MM_ERROR_SOUND_INVALID_POINTER:
42 case WAV_PLAYER_ERROR_INVALID_PARAMETER:
43 ret = WAV_PLAYER_ERROR_INVALID_PARAMETER;
44 errorstr = "INVALID_PARAMETER";
46 case MM_ERROR_SOUND_INTERNAL:
47 ret = WAV_PLAYER_ERROR_INVALID_OPERATION;
48 errorstr = "INVALID_OPERATION";
50 case MM_ERROR_SOUND_UNSUPPORTED_MEDIA_TYPE:
51 ret = WAV_PLAYER_ERROR_FORMAT_NOT_SUPPORTED;
52 errorstr = "FORMAT_NOT_SUPPORTED";
55 ret = WAV_PLAYER_ERROR_INVALID_OPERATION;
56 errorstr = "INVALID_OPERATION";
59 LOGE( "[%s] %s(0x%08x)",func, errorstr, ret);
64 void __internal_complete_cb(void *user_data, int id)
66 _cb_data * cb_data = (_cb_data*)user_data;
71 LOGD( "user callback for handle %d call", id);
72 cb_data->cb(id, cb_data->user_data);