Modify param to avoid build warning
[platform/core/api/mediacodec.git] / include / media_codec_util.h
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17 #ifndef __TIZEN_MEDIA_CODEC_UTIL_H__
18 #define __TIZEN_MEDIA_CODEC_UTIL_H__
19
20 #include <stdio.h>
21 #include <stdlib.h>
22 #include <glib.h>
23 #include <tizen.h>
24 //#include <mm_types.h>
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 typedef enum
31 {
32     CODEC_RET_SUCCESS         =  0,
33     CODEC_RET_FAIL            = -1,
34     CODEC_RET_NOT_SUPPORT     = -2,
35     CODEC_RET_INVALID_ARG     = -3,
36     CODEC_RET_INVALID_CONFIG  = -4,
37     CODEC_RET_CORRUPTED_BS    = -5,
38     CODEC_RET_SMALL_IMG_BUF   = -6,
39     CODEC_RET_HW_ERROR        = -7,
40     CODEC_RET_NOT_AVAILABLE   = -8,
41     CODEC_RET_NOT_EXPECTED    = -9,
42     CODEC_RET_UNKNOWN_ERR     = -100,
43 } CodecRet;
44
45 typedef struct _mc_sem_t mc_sem_t;
46
47 struct _mc_sem_t
48 {
49     GCond cond;
50     GMutex mutex;
51     int counter;
52 };
53
54 void *mc_aligned_malloc(int size, int alignment);
55 void mc_aligned_free(void *mem);
56
57 mc_sem_t *mc_sem_new();
58 void mc_sem_free(mc_sem_t *sem);
59 void mc_sem_down(mc_sem_t *sem);
60 void mc_sem_up(mc_sem_t *sem);
61
62 void mc_hex_dump(char *desc, void *addr, int len);
63
64 #define MC_FREEIF(x) \
65 if ( x ) \
66     g_free( x ); \
67 x = NULL;
68
69 #ifdef __cplusplus
70 }
71 #endif
72
73 #endif /* __TIZEN_MEDIA_CODEC_UTIL_H__ */