4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Seungbae Shin <seungbae.shin@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #ifndef __MM_SOUND_PLUGIN_CODEC_H__
23 #define __MM_SOUND_PLUGIN_CODEC_H__
25 #include "mm_sound_plugin.h"
28 #define MAX_STREAM_TYPE_LEN 64
29 #define MM_SOUND_MAX_FILENAME 256
31 enum MMSoundSupportedCodec {
32 MM_SOUND_SUPPORTED_CODEC_INVALID = -1, /**< Invalid codec type */
33 MM_SOUND_SUPPORTED_CODEC_WAVE, /**< WAVE codec */
34 MM_SOUND_SUPPORTED_CODEC_DTMF, /**< DTMF codec */
35 MM_SOUND_SUPPORTED_CODEC_NUM, /**< Number of audio codec type */
45 int duration; /**the wav file play duration, Unit: ms*/
46 } mmsound_codec_info_t;
49 int (*stop_cb)(int, bool);
58 char stream_type[MAX_STREAM_TYPE_LEN];
60 pthread_mutex_t *codec_wave_mutex;
61 } mmsound_codec_param_t;
64 int* (*GetSupportTypes)(void);
65 int (*SetThreadPool) (int (*)(void*, void (*)(void*)));
66 int (*Parse)(const char*, mmsound_codec_info_t*);
67 int (*Create)(mmsound_codec_param_t*, mmsound_codec_info_t*, MMHandleType*);
68 int (*Play)(MMHandleType);
69 int (*Stop)(MMHandleType);
70 int (*Destroy)(MMHandleType);
71 } mmsound_codec_interface_t;
73 /* Utility Functions */
74 #define CODEC_GET_INTERFACE_FUNC_NAME "MMSoundPlugCodecGetInterface"
75 #define MMSoundPlugCodecCastGetInterface(func) ((int (*)(mmsound_codec_interface_t*))(func))
77 int MMSoundPlugCodecGetInterface(mmsound_codec_interface_t *intf);
79 #endif /* __MM_SOUND_PLUGIN_CODEC_H__ */