/src/libhevc/encoder/ihevce_sys_api.c
Line | Count | Source (jump to first uncovered line) |
1 | | /****************************************************************************** |
2 | | * |
3 | | * Copyright (C) 2018 The Android Open Source Project |
4 | | * |
5 | | * Licensed under the Apache License, Version 2.0 (the "License"); |
6 | | * you may not use this file except in compliance with the License. |
7 | | * You may obtain a copy of the License at: |
8 | | * |
9 | | * http://www.apache.org/licenses/LICENSE-2.0 |
10 | | * |
11 | | * Unless required by applicable law or agreed to in writing, software |
12 | | * distributed under the License is distributed on an "AS IS" BASIS, |
13 | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
14 | | * See the License for the specific language governing permissions and |
15 | | * limitations under the License. |
16 | | * |
17 | | ***************************************************************************** |
18 | | * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore |
19 | | */ |
20 | | /*! |
21 | | ****************************************************************************** |
22 | | * \file ihevce_sys_api.c |
23 | | * |
24 | | * \brief |
25 | | * This file contains wrapper utilities to use hevc encoder library |
26 | | * |
27 | | * \date |
28 | | * 15/04/2014 |
29 | | * |
30 | | * \author |
31 | | * Ittiam |
32 | | * |
33 | | * List of Functions |
34 | | * |
35 | | * |
36 | | ****************************************************************************** |
37 | | */ |
38 | | |
39 | | /*****************************************************************************/ |
40 | | /* File Includes */ |
41 | | /*****************************************************************************/ |
42 | | /* System include files */ |
43 | | #include <stdio.h> |
44 | | #include <string.h> |
45 | | #include <stdlib.h> |
46 | | #include <assert.h> |
47 | | #include <stdarg.h> |
48 | | #include <math.h> |
49 | | |
50 | | /* User include files */ |
51 | | #include "ihevc_typedefs.h" |
52 | | #include "ihevc_macros.h" |
53 | | |
54 | | #include "itt_video_api.h" |
55 | | #include "ihevce_api.h" |
56 | | |
57 | | /*****************************************************************************/ |
58 | | /* Function Definitions */ |
59 | | /*****************************************************************************/ |
60 | | |
61 | | /*! |
62 | | ****************************************************************************** |
63 | | * \if Function name : ihevce_printf \endif |
64 | | * |
65 | | * \brief |
66 | | * This function implements printf |
67 | | * |
68 | | ***************************************************************************** |
69 | | */ |
70 | | WORD32 ihevce_printf(void *pv_handle, const char *format, ...) |
71 | 8.78k | { |
72 | 8.78k | UNUSED(pv_handle); |
73 | 8.78k | UNUSED(format); |
74 | 8.78k | return 0; |
75 | 8.78k | } |
76 | | |
77 | | /*! |
78 | | ****************************************************************************** |
79 | | * \if Function name : ihevce_fopen \endif |
80 | | * |
81 | | * \brief |
82 | | * This function implements fopen |
83 | | * |
84 | | ***************************************************************************** |
85 | | */ |
86 | | FILE *ihevce_fopen(void *pv_handle, const char *filename, const char *mode) |
87 | 0 | { |
88 | 0 | UNUSED(pv_handle); |
89 | 0 | UNUSED(filename); |
90 | 0 | UNUSED(mode); |
91 | 0 | return NULL; |
92 | 0 | } |
93 | | |
94 | | /*! |
95 | | ****************************************************************************** |
96 | | * \if Function name : ihevce_fclose \endif |
97 | | * |
98 | | * \brief |
99 | | * This function implements fclose |
100 | | * |
101 | | ***************************************************************************** |
102 | | */ |
103 | | int ihevce_fclose(void *pv_handle, FILE *file_ptr) |
104 | 0 | { |
105 | 0 | UNUSED(pv_handle); |
106 | 0 | UNUSED(file_ptr); |
107 | 0 | return -1; |
108 | 0 | } |
109 | | |
110 | | /*! |
111 | | ****************************************************************************** |
112 | | * \if Function name : ihevce_fflush \endif |
113 | | * |
114 | | * \brief |
115 | | * This function implements fflush |
116 | | * |
117 | | ***************************************************************************** |
118 | | */ |
119 | | int ihevce_fflush(void *pv_handle, FILE *file_ptr) |
120 | 0 | { |
121 | 0 | UNUSED(pv_handle); |
122 | 0 | UNUSED(file_ptr); |
123 | 0 | return -1; |
124 | 0 | } |
125 | | |
126 | | /*! |
127 | | ****************************************************************************** |
128 | | * \if Function name : ihevce_fseek \endif |
129 | | * |
130 | | * \brief |
131 | | * This function implements fseek |
132 | | * |
133 | | ***************************************************************************** |
134 | | */ |
135 | | int ihevce_fseek(void *pv_handle, FILE *file_ptr, long offset, int origin) |
136 | 0 | { |
137 | 0 | UNUSED(pv_handle); |
138 | 0 | UNUSED(file_ptr); |
139 | 0 | UNUSED(offset); |
140 | 0 | UNUSED(origin); |
141 | 0 | return -1; |
142 | 0 | } |
143 | | |
144 | | /*! |
145 | | ****************************************************************************** |
146 | | * \if Function name : ihevce_fscanf \endif |
147 | | * |
148 | | * \brief |
149 | | * This function implements fscanf |
150 | | * |
151 | | ***************************************************************************** |
152 | | */ |
153 | | int ihevce_fscanf( |
154 | | void *pv_handle, IHEVCE_DATA_TYPE e_data_type, FILE *file_ptr, const char *format, void *pv_dst) |
155 | 0 | { |
156 | 0 | UNUSED(pv_handle); |
157 | 0 | UNUSED(e_data_type); |
158 | 0 | UNUSED(file_ptr); |
159 | 0 | UNUSED(format); |
160 | 0 | UNUSED(pv_dst); |
161 | 0 | return 0; |
162 | 0 | } |
163 | | |
164 | | /*! |
165 | | ****************************************************************************** |
166 | | * \if Function name : ihevce_fgets \endif |
167 | | * |
168 | | * \brief |
169 | | * This function implements fgets |
170 | | * |
171 | | ***************************************************************************** |
172 | | */ |
173 | | char *ihevce_fgets(void *pv_handle, char *pi1_str, int i4_size, FILE *pf_stream) |
174 | 0 | { |
175 | 0 | UNUSED(pv_handle); |
176 | 0 | UNUSED(pi1_str); |
177 | 0 | UNUSED(i4_size); |
178 | 0 | UNUSED(pf_stream); |
179 | 0 | return NULL; |
180 | 0 | } |
181 | | |
182 | | /*! |
183 | | ****************************************************************************** |
184 | | * \if Function name : ihevce_fread \endif |
185 | | * |
186 | | * \brief |
187 | | * This function implements fread |
188 | | * |
189 | | ***************************************************************************** |
190 | | */ |
191 | | size_t |
192 | | ihevce_fread(void *pv_handle, void *pv_dst, size_t element_size, size_t count, FILE *file_ptr) |
193 | 0 | { |
194 | 0 | UNUSED(pv_handle); |
195 | 0 | UNUSED(pv_dst); |
196 | 0 | UNUSED(element_size); |
197 | 0 | UNUSED(count); |
198 | 0 | UNUSED(file_ptr); |
199 | 0 | return 0; |
200 | 0 | } |
201 | | |
202 | | /*! |
203 | | ****************************************************************************** |
204 | | * \if Function name : ihevce_sscanf \endif |
205 | | * |
206 | | * \brief |
207 | | * This function implements sscanf |
208 | | * |
209 | | ***************************************************************************** |
210 | | */ |
211 | | int ihevce_sscanf(void *pv_handle, const char *pv_src, const char *format, int *p_dst_int) |
212 | 0 | { |
213 | 0 | UNUSED(pv_handle); |
214 | 0 | UNUSED(pv_src); |
215 | 0 | UNUSED(format); |
216 | 0 | UNUSED(p_dst_int); |
217 | 0 | return 0; |
218 | 0 | } |
219 | | |
220 | | /*! |
221 | | ****************************************************************************** |
222 | | * \if Function name : ihevce_fprintf \endif |
223 | | * |
224 | | * \brief |
225 | | * This function implements fprintf |
226 | | * |
227 | | ***************************************************************************** |
228 | | */ |
229 | | int ihevce_fprintf(void *pv_handle, FILE *file_ptr, const char *format, ...) |
230 | 0 | { |
231 | 0 | UNUSED(pv_handle); |
232 | 0 | UNUSED(file_ptr); |
233 | 0 | UNUSED(format); |
234 | 0 | return 0; |
235 | 0 | } |
236 | | |
237 | | /*! |
238 | | ****************************************************************************** |
239 | | * \if Function name : ihevce_fwrite \endif |
240 | | * |
241 | | * \brief |
242 | | * This function implements fwrite |
243 | | * |
244 | | ***************************************************************************** |
245 | | */ |
246 | | size_t ihevce_fwrite( |
247 | | void *pv_handle, const void *pv_src, size_t element_size, size_t count, FILE *file_ptr) |
248 | 0 | { |
249 | 0 | UNUSED(pv_handle); |
250 | 0 | UNUSED(pv_src); |
251 | 0 | UNUSED(element_size); |
252 | 0 | UNUSED(count); |
253 | 0 | UNUSED(file_ptr); |
254 | 0 | return 0; |
255 | 0 | } |
256 | | |
257 | | /*! |
258 | | ****************************************************************************** |
259 | | * \if Function name : ihevce_sprintf \endif |
260 | | * |
261 | | * \brief |
262 | | * This function implements sprintf |
263 | | * |
264 | | ***************************************************************************** |
265 | | */ |
266 | | int ihevce_sprintf(void *pv_handle, char *dst, const char *format, ...) |
267 | 0 | { |
268 | 0 | UNUSED(pv_handle); |
269 | 0 | UNUSED(dst); |
270 | 0 | UNUSED(format); |
271 | 0 | return 0; |
272 | 0 | } |
273 | | |
274 | | /*! |
275 | | ****************************************************************************** |
276 | | * \if Function name : ihevce_init_sys_api \endif |
277 | | * |
278 | | * \brief |
279 | | * This function initialises sysstem call apis |
280 | | * |
281 | | * \param[in] |
282 | | * pv_main_ctxt : This is used only for storing. |
283 | | * ps_sys_api : This is address to sys_api structure of static_cfg_prms |
284 | | * |
285 | | * \return |
286 | | * None |
287 | | * |
288 | | * \author |
289 | | * Ittiam |
290 | | * |
291 | | ***************************************************************************** |
292 | | */ |
293 | | void ihevce_init_sys_api(void *pv_cb_handle, ihevce_sys_api_t *ps_sys_api) |
294 | 8.25k | { |
295 | 8.25k | ps_sys_api->pv_cb_handle = pv_cb_handle; |
296 | | |
297 | | /* Console IO APIs */ |
298 | 8.25k | ps_sys_api->ihevce_printf = ihevce_printf; |
299 | | |
300 | 8.25k | ps_sys_api->ihevce_sscanf = ihevce_sscanf; |
301 | 8.25k | ps_sys_api->ihevce_sprintf = ihevce_sprintf; |
302 | | |
303 | | /* File IO APIs */ |
304 | 8.25k | ps_sys_api->s_file_io_api.ihevce_fopen = ihevce_fopen; |
305 | 8.25k | ps_sys_api->s_file_io_api.ihevce_fclose = ihevce_fclose; |
306 | 8.25k | ps_sys_api->s_file_io_api.ihevce_fflush = ihevce_fflush; |
307 | 8.25k | ps_sys_api->s_file_io_api.ihevce_fseek = ihevce_fseek; |
308 | | |
309 | 8.25k | ps_sys_api->s_file_io_api.ihevce_fscanf = ihevce_fscanf; |
310 | 8.25k | ps_sys_api->s_file_io_api.ihevce_fread = ihevce_fread; |
311 | | |
312 | 8.25k | ps_sys_api->s_file_io_api.ihevce_fprintf = ihevce_fprintf; |
313 | 8.25k | ps_sys_api->s_file_io_api.ihevce_fwrite = ihevce_fwrite; |
314 | 8.25k | ps_sys_api->s_file_io_api.ihevce_fgets = ihevce_fgets; |
315 | 8.25k | } |