OSDN Git Service

original
[gb-231r1-is01/Gingerbread_2.3.3_r1_IS01.git] / frameworks / base / media / libstagefright / codecs / common / include / cmnMemory.h
1 /*\r
2  ** Copyright 2003-2010, VisualOn, Inc.\r
3  **\r
4  ** Licensed under the Apache License, Version 2.0 (the "License");\r
5  ** you may not use this file except in compliance with the License.\r
6  ** You may obtain a copy of the License at\r
7  **\r
8  **     http://www.apache.org/licenses/LICENSE-2.0\r
9  **\r
10  ** Unless required by applicable law or agreed to in writing, software\r
11  ** distributed under the License is distributed on an "AS IS" BASIS,\r
12  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  ** See the License for the specific language governing permissions and\r
14  ** limitations under the License.\r
15  */\r
16 /*******************************************************************************\r
17         File:           cmnMemory.h\r
18 \r
19         Content:        memory operator implementation header file\r
20 \r
21 *******************************************************************************/\r
22 \r
23 #ifndef __cmnMemory_H__\r
24 #define __cmnMemory_H__\r
25 \r
26 #ifdef __cplusplus\r
27 extern "C" {\r
28 #endif /* __cplusplus */\r
29 \r
30 #include <voMem.h>\r
31 \r
32 //extern VO_MEM_OPERATOR        g_memOP;\r
33 \r
34 /**\r
35  * Allocate memory\r
36  * \param uID [in] module ID\r
37  * \param uSize [in] size of memory\r
38  * \return value is the allocated memory address. NULL is failed.\r
39  */\r
40 VO_U32  cmnMemAlloc (VO_S32 uID,  VO_MEM_INFO * pMemInfo);\r
41 \r
42 /**\r
43  * Free up memory\r
44  * \param uID [in] module ID\r
45  * \param pMem [in] address of memory\r
46  * \return value 0, if succeeded.\r
47  */\r
48 VO_U32  cmnMemFree (VO_S32 uID, VO_PTR pBuffer);\r
49 \r
50 /**\r
51  * memory set function\r
52  * \param uID [in] module ID\r
53  * \param pBuff [in/out] address of memory\r
54  * \param uValue [in] the value to be set\r
55  * \param uSize [in] the size to be set\r
56  * \return value 0, if succeeded.\r
57  */\r
58 VO_U32  cmnMemSet (VO_S32 uID, VO_PTR pBuff, VO_U8 uValue, VO_U32 uSize);\r
59 \r
60 /**\r
61  * memory copy function\r
62  * \param uID [in] module ID\r
63  * \param pDest [in/out] address of destination memory\r
64  * \param pSource [in] address of source memory\r
65  * \param uSize [in] the size to be copied\r
66  * \return value 0, if succeeded.\r
67  */\r
68 VO_U32  cmnMemCopy (VO_S32 uID, VO_PTR pDest, VO_PTR pSource, VO_U32 uSize);\r
69 \r
70 /**\r
71  * memory check function\r
72  * \param uID [in] module ID\r
73  * \param pBuff [in] address of buffer to be checked\r
74  * \param uSize [in] the size to be checked\r
75  * \return value 0, if succeeded.\r
76  */\r
77 VO_U32  cmnMemCheck (VO_S32 uID, VO_PTR pBuffer, VO_U32 uSize);\r
78 \r
79 /**\r
80  * memory compare function\r
81  * \param uID [in] module ID\r
82  * \param pBuffer1 [in] address of buffer 1 to be compared\r
83  * \param pBuffer2 [in] address of buffer 2 to be compared\r
84  * \param uSize [in] the size to be compared\r
85  * \return value: same as standard C run-time memcmp() function.\r
86  */\r
87 VO_S32  cmnMemCompare (VO_S32 uID, VO_PTR pBuffer1, VO_PTR pBuffer2, VO_U32 uSize);\r
88 \r
89 /**\r
90  * memory move function\r
91  * \param uID [in] module ID\r
92  * \param pDest [in/out] address of destination memory\r
93  * \param pSource [in] address of source memory\r
94  * \param uSize [in] the size to be moved\r
95  * \return value 0, if succeeded.\r
96  */\r
97 VO_U32  cmnMemMove (VO_S32 uID, VO_PTR pDest, VO_PTR pSource, VO_U32 uSize);\r
98 \r
99 \r
100 #ifdef __cplusplus\r
101 }\r
102 #endif /* __cplusplus */\r
103 \r
104 #endif // __cmnMemory_H__\r
105 \r
106 \r