summaryrefslogtreecommitdiffstats
path: root/README
diff options
context:
space:
mode:
authorSaurabh Bipin Chandra2013-09-06 07:01:06 -0500
committerSaurabh Bipin Chandra2013-09-06 09:14:54 -0500
commit71a368d4d01d0dd7bd80f1189fe205f4645fd320 (patch)
tree47ce3b0b21dbbb3d59fceb3f4ccc72c282c6d161 /README
parenta8794806a4f31a4e170cb6e6ce7ab53d0369f77a (diff)
downloadhardware-ti-libdce-71a368d4d01d0dd7bd80f1189fe205f4645fd320.tar.gz
hardware-ti-libdce-71a368d4d01d0dd7bd80f1189fe205f4645fd320.tar.xz
hardware-ti-libdce-71a368d4d01d0dd7bd80f1189fe205f4645fd320.zip
[DOC] Update ReadMe
ReadMe now contains: 1. Build Information for QNX 2. Build Information for Linux 3. API Information 4. API call flow 5. Version Info of headers in packages folder. Change-Id: If76f6bae18bfac0cb9c6d918d365f5263c539d0d Signed-off-by: Saurabh Bipin Chandra <a0131926@ti.com>
Diffstat (limited to 'README')
-rw-r--r--README437
1 files changed, 429 insertions, 8 deletions
diff --git a/README b/README
index 1979601..6db110e 100644
--- a/README
+++ b/README
@@ -1,6 +1,26 @@
1************** LIBDCE Build ************** 1****************************** LIBDCE README ******************************
2 2
3## For QNX ## 3The libDCE component provides an interface for applications running on the
4MPU (HLOS) to invoke the Codec Engine APIs on the remote core (IPU). It
5enables the Video Encode/Decode Usecases. Apart from the exposed CE APIs,
6it provides a memplugin utility to allocate memory that can be read/written
7from the remote IPU core.
8
9This ReadMe file comprises:
101. LibDCE Build Information
11 a. For QNX
12 b. For Linux
13 c. For Android
142. Supported API information
15 a. Codec Engine APIs
16 b. libDCE APIs
173. API call flow
18 a. Decoder Application
194. Version Info of Headers included in packages folder
20
21****************************** BUILD INFO *****************************
22
23########################### For QNX ###########################
4 24
5Exporting QNX variables: 25Exporting QNX variables:
6export QNX_ROOT=/opt/qnx650 26export QNX_ROOT=/opt/qnx650
@@ -14,19 +34,20 @@ export PATH=${QNX_HOST}/usr/bin:${PATH}:${QNX_CONFIGURATION}/bin
14export QNX_USERNAME=<registered email-id at QNX> //not important 34export QNX_USERNAME=<registered email-id at QNX> //not important
15eval `qconfig -n "QNX Software Development Platform 6.5.0" -e` 35eval `qconfig -n "QNX Software Development Platform 6.5.0" -e`
16 36
17If previous eval doesn't work, that is it doesn't output: 37If previous eval doesn't work, that is it doesn't output the following:
18" 38"
19export QNX_HOST="/opt/qnx650/host/linux/x86"; 39export QNX_HOST="/opt/qnx650/host/linux/x86";
20export QNX_TARGET="/opt/qnx650/target/qnx6"; 40export QNX_TARGET="/opt/qnx650/target/qnx6";
21export PATH="/opt/qnx650/host/linux/x86/usr/bin:/opt/qnx650/host/linux/x86/bin:/opt/qnx650/host/ 41export PATH="/opt/qnx650/host/linux/x86/usr/bin:/opt/qnx650/host/linux/x86/bin:/opt/qnx650/host/
22 linux/x86/sbin:/opt/qnx650/host/linux/x86/usr/sbin:/opt/qnx650/host/linux/x86/usr/photon/appbuilder: 42linux/x86/sbin:/opt/qnx650/host/linux/x86/usr/sbin:/opt/qnx650/host/linux/x86/usr/photon/appbuilder:
23 /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/etc/qnx/bin:/etc/qnx/bin: 43/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/etc/qnx/bin:/etc/qnx/bin:
24 /opt/qnx650:/etc/qnx/bin:/etc/qnx/bin:/etc/qnx/bin:/etc/qnx/bin"; 44/opt/qnx650:/etc/qnx/bin:/etc/qnx/bin:/etc/qnx/bin:/etc/qnx/bin";
25export LD_LIBRARY_PATH="/opt/qnx650/host/linux/x86/usr/lib"; 45export LD_LIBRARY_PATH="/opt/qnx650/host/linux/x86/usr/lib";
26export MAKEFLAGS="-I/opt/qnx650/target/qnx6/usr/include"; 46export MAKEFLAGS="-I/opt/qnx650/target/qnx6/usr/include";
27" 47"
28 48
29then try : /opt/qnx650/host/linux/x86/usr/bin/qconfig -n "QNX Software Development Platform 6.5.0" -e 49then try:
50/opt/qnx650/host/linux/x86/usr/bin/qconfig -n "QNX Software Development Platform 6.5.0" -e
30 51
31Exporting LIBDCE variables: 52Exporting LIBDCE variables:
32export IPCHEADERS=<path to IPC Headers> 53export IPCHEADERS=<path to IPC Headers>
@@ -53,7 +74,407 @@ INSTALL_ROOT/armle-v7/bin/dce_test
53INSTALL_ROOT/armle-v7/bin/dce_enc_test 74INSTALL_ROOT/armle-v7/bin/dce_enc_test
54 75
55 76
56**** Version Info of Headers included in packages folder **** 77########################## For Linux ##########################
78
79Exporting LIBDCE variables:
80export IPC_HEADERS=<path to IPC Headers> (MmRpc.h)
81
82Building:
83
84 user@target:~/libdce# ./autogen.sh --prefix=/usr
85 This will check for required packages, compiler,
86 headers and generates the Makefile. --prefix=/usr
87 will confirure the install directory to /usr
88
89 user@target:~/libdce# make
90 Running make will build the library. It generates
91 the shared objects, static library, libdce.la
92 file for linking (Used by libtool) and
93 libdce.pc used for querying using pkg-config.
94
95 user@target:~/libdce# make install
96 Installs the library files(libdce.so*, libdce.a,
97 libdce.la) to $(--prefix)/lib.
98 Installs libdce.pc to $(--prefix)/lib/pkgconfig
99 Installs libdce.h and required headers to
100 $(--prefix)/include/dce/
101
102Clean:
103
104 user@target:~/libdce# make clean
105 This will clean the build. Run make to build.
106 user@target:~/libdce# make distclean
107 This will clean the build and remove Makefiles.
108 Follow build steps above to build again.
109
110######################### For Android #########################
111
112
113
114
115
116
117******************************* API DETAILS *******************************
118
119######################### Codec Engine APIs #########################
120
121/*==================================================================*/
122/** Engine_open : Codec Engine Exposed API to open
123 * Codec Engine.
124 * @ param name [in] : Name of Encoder or Decoder codec.
125 * @ param attrs [in] : Pointer to Engine Attributes structure.
126 NULL is valid.
127 * @ param ec [out] : Pointer to Engine Error structure for Codec
128 * to write error code. NULL is valid.
129 * @ return : Codec Engine Handle is returned to be used
130 * to create codec.
131 * In case of error, NULL is returned.
132 */
133Engine_Handle Engine_open(String name, Engine_Attrs *attrs, Engine_Error *ec)
134
135
136######################### VIDDEC3 APIs #########################
137/*==================================================================*/
138/** VIDDEC3_create : Create Decoder codec.
139 *
140 * @ param engine [in] : Engine Handle obtained in Engine_open() call.
141 * @ param name [in] : Name of Decoder codec.
142 * @ param params [in] : Pointer to Static parameters structure of codec
143 * allocated using dce_alloc() API.
144 * @ return : Codec Handle is returned to be used for
145 * future CE calls.
146 * In case of error, NULL is returned.
147 */
148VIDDEC3_Handle VIDDEC3_create(Engine_Handle engine, String name,
149 VIDDEC3_Params *params)
150
151
152/*==================================================================*/
153/** VIDDEC3_control : Codec control call.
154 *
155 * @ param codec [in] : Codec Handle obtained in VIDDEC3_create() call.
156 * @ param id [in] : Command id for XDM control operation.
157 * @ param dynParams [in] : Pointer to dynamic parameters structure
158 * of codec allocated using dce_alloc() API.
159 * @ param status [out] : Pointer to status parameters structure
160 * of codec allocated using dce_alloc() API.
161 * If 'id' is XDM_GETVERSION, then
162 * status->data.buf should have a pointer to a
163 * buffer allocated through dce_alloc() API.
164 * @ return : DCE error status of control call is returned.
165 * #DCE_EOK [0] : Success.
166 * #DCE_EXDM_FAIL [-1] : XDM Failure.
167 * #DCE_EXDM_UNSUPPORTED [-3] : Unsupported XDM request.
168 * #DCE_EIPC_CALL_FAIL [-5] : MmRpc Call failed.
169 * #DCE_EINVALID_INPUT [-6] : Invalid Inputs.
170 */
171XDAS_Int32 VIDDEC3_control(VIDDEC3_Handle codec, VIDDEC3_Cmd id,
172 VIDDEC3_DynamicParams *dynParams, VIDDEC3_Status *status)
173
174
175/*==================================================================*/
176/** VIDDEC3_process : Decode process call.
177 *
178 * @ param codec [in] : Codec Handle obtained in VIDDEC3_create() call.
179 * @ param inBufs [in] : Pointer to Input Buffer Descriptor structure
180 * of codec allocated using dce_alloc() API.
181 * inBufs->descs[0].buf should have a virtual pointer
182 * to the Input Buffer in QNX. In Linux/Android, it
183 * should have a DMA Buf FD to the Input Buffer.
184 * @ param outBufs [in] : Pointer to Output Buffer Descriptor structure
185 * of codec allocated using dce_alloc() API.
186 * outBufs->descs[0].buf and outBufs->descs[1].buf
187 * should have virtual pointers to the Output
188 * Luma and Chroma Buffers respectively in QNX.
189 * In Linux/Android, these fields should have
190 * DMA Buf FDs to the Output Buffers.
191 * @ param inArgs [in] : Pointer to Input Arguments structure
192 * of codec allocated using dce_alloc() API.
193 * @ param outArgs [out] : Pointer to Output Arguments structure
194 * of codec allocated using dce_alloc() API.
195 * @ return : DCE error status of process call is returned.
196 * #DCE_EOK [0] : Success.
197 * #DCE_EXDM_FAIL [-1] : XDM Failure.
198 * #DCE_EXDM_UNSUPPORTED [-3] : Unsupported XDM request.
199 * #DCE_EIPC_CALL_FAIL [-5] : MmRpc Call failed.
200 * #DCE_EINVALID_INPUT [-6] : Invalid Inputs.
201 */
202XDAS_Int32 VIDDEC3_process(VIDDEC3_Handle codec,
203 XDM2_BufDesc *inBufs, XDM2_BufDesc *outBufs,
204 VIDDEC3_InArgs *inArgs, VIDDEC3_OutArgs *outArgs)
205
206
207/*===============================================================*/
208/** VIDDEC3_delete : Delete Decode codec instance.
209 *
210 * @ param codec [in] : Codec Handle obtained in VIDDEC3_create() call.
211 * @ return : NIL.
212 */
213Void VIDDEC3_delete(VIDDEC3_Handle codec)
214
215
216######################### VIDDENC2 APIs #########################
217/*==================================================================*/
218/** VIDENC2_create : Create Encoder codec.
219 *
220 * @ param engine [in] : Engine Handle obtained in Engine_open() call.
221 * @ param name [in] : Name of Encoder codec.
222 * @ param params [in] : Pointer to Static parameters structure of codec
223 * allocated using dce_alloc() API.
224 * @ return : Codec Handle is returned to be used for
225 * future CE calls.
226 * In case of error, NULL is returned.
227 */
228VIDENC2_Handle VIDENC2_create(Engine_Handle engine, String name,
229 VIDENC2_Params *params)
230
231
232/*==================================================================*/
233/** VIDENC2_control : Codec control call.
234 *
235 * @ param codec [in] : Codec Handle obtained in VIDENC2_create() call.
236 * @ param id [in] : Command id for XDM control operation.
237 * @ param dynParams [in] : Pointer to dynamic parameters structure
238 * of codec allocated using dce_alloc() API.
239 * @ param status [out] : Pointer to status parameters structure
240 * of codec allocated using dce_alloc() API.
241 * If 'id' is XDM_GETVERSION, then
242 * status->data.buf should have a pointer to a
243 * buffer allocated through dce_alloc() API.
244 * @ return : DCE error status of control call is returned.
245 * #DCE_EOK [0] : Success.
246 * #DCE_EXDM_FAIL [-1] : XDM Failure.
247 * #DCE_EXDM_UNSUPPORTED [-3] : Unsupported XDM request.
248 * #DCE_EIPC_CALL_FAIL [-5] : MmRpc Call failed.
249 * #DCE_EINVALID_INPUT [-6] : Invalid Inputs.
250 */
251XDAS_Int32 VIDENC2_control(VIDENC2_Handle codec, VIDENC2_Cmd id,
252 VIDENC2_DynamicParams *dynParams, VIDENC2_Status *status)
253
254
255/*==================================================================*/
256/** VIDENC2_process : Encode process call.
257 *
258 * @ param codec [in] : Codec Handle obtained in VIDENC2_create() call.
259 * @ param inBufs [in] : Pointer to Input Buffer Descriptor structure
260 * of codec allocated using dce_alloc() API.
261 * inBufs->planeDesc[0].buf and inBufs->planeDesc[1].buf
262 * should have virtual pointers to the Output
263 * Luma and Chroma Buffers respectively in QNX.
264 * In Linux/Android, these fields should have
265 * DMA Buf FDs to the Output Buffers.
266 * @ param outBufs [in] : Pointer to Output Buffer Descriptor structure
267 * of codec allocated using dce_alloc() API.
268 * OutBufs->descs[0].buf should have a virtual pointer
269 * to the Input Buffer in QNX. In Linux/Android, it
270 * should have a DMA Buf FD to the Input Buffer.
271 * @ param inArgs [in] : Pointer to Input Arguments structure
272 * of codec allocated using dce_alloc() API.
273 * @ param outArgs [out] : Pointer to Output Arguments structure
274 * of codec allocated using dce_alloc() API.
275 * @ return : DCE error status of process call is returned.
276 * #DCE_EOK [0] : Success.
277 * #DCE_EXDM_FAIL [-1] : XDM Failure.
278 * #DCE_EXDM_UNSUPPORTED [-3] : Unsupported XDM request.
279 * #DCE_EIPC_CALL_FAIL [-5] : MmRpc Call failed.
280 * #DCE_EINVALID_INPUT [-6] : Invalid Inputs.
281 */
282XDAS_Int32 VIDENC2_process(VIDENC2_Handle codec,
283 IVIDEO2_BufDesc *inBufs, XDM2_BufDesc *outBufs,
284 VIDENC2_InArgs *inArgs, VIDENC2_OutArgs *outArgs)
285
286
287/*===============================================================*/
288/** VIDENC2_delete : Delete Encode codec instance.
289 *
290 * @ param codec [in] : Codec Handle obtained in VIDENC2_create() call.
291 * @ return : NIL.
292 */
293Void VIDENC2_delete(VIDENC2_Handle codec)
294
295
296/*==================================================================*/
297/** Engine_close : Codec Engine Exposed API to Close Engine.
298 *
299 * @ param engine [in] : Engine Handle obtained in Engine_open() call.
300 */
301Void Engine_close(Engine_Handle engine)
302
303
304############################ libDCE APIs ############################
305
306/*==================================================================*/
307/** dce_alloc : Allocate the Data structures passed to
308 * codec-engine APIs except Input/Output buffers.
309 * @ param sz [in] : Size of memory to be allocated.
310 * @ return : Pointer to allocated memory.
311 */
312void *dce_alloc(int sz)
313
314
315/*==================================================================*/
316/** dce_free : Free the Data structures passed to codec-engine APIs
317 * allocated through the dce_alloc() API.
318 * @ param ptr [in] : Pointer to allocated memory.
319 */
320void dce_free(void *ptr)
321
322
323/*================ The below APIs are LINUX specifc ================*/
324/*==================================================================*/
325/** dce_init : Initialize DCE. Only Linux applications
326 * should call this API.
327 * @ return : Pointer to omap_device structure.
328 */
329void *dce_init(void)
330
331
332/*===============================================================*/
333/** dce_deinit : Deinitialize DCE. Only Linux applications
334 * should call this API.
335 * @ param dev [in] : Pointer to omap_device structure.
336 */
337void dce_deinit(void *dev)
338
339
340/*===============================================================*/
341/** dce_buf_lock : Pin or lock Tiler Buffers which would be
342 * used by the codec as reference buffers.
343 * Only Linux applications should call this API.
344 * @ param num [in] : Number of buffers to be locked.
345 * @ param handle [in] : Pointer to array of DMA Buf FDs of the
346 * buffers to be locked.
347 * @ return : DCE error status is returned.
348 * #DCE_EOK [0] : Success.
349 * #DCE_EOUT_OF_MEMORY [-2] : Out of Shared/Tiler Memory.
350 * #DCE_EIPC_CALL_FAIL [-5] : MmRpc Call failed.
351 * #DCE_EINVALID_INPUT [-6] : Invalid Inputs.
352 */
353int dce_buf_lock(int num, size_t *handle)
354
355
356/*===============================================================*/
357/** dce_buf_unlock : Unpin or unlock Tiler Buffers which were
358 * locked to be used by the codec as
359 * reference buffers. Only Linux
360 * applications should call this API.
361 * @ param num [in] : Number of buffers to be unlocked.
362 * @ param handle [in] : Pointer to array of DMA Buf FDs of
363 * the buffers to be unlocked.
364 * @ return : DCE error status is returned.
365 * #DCE_EOK [0] : Success.
366 * #DCE_EXDM_FAIL [-1] : XDM Failure.
367 * #DCE_EOUT_OF_MEMORY [-2] : Out of Shared/Tiler Memory.
368 * #DCE_EXDM_UNSUPPORTED [-3] : Unsupported XDM request.
369 * #DCE_EIPC_CALL_FAIL [-5] : MmRpc Call failed.
370 * #DCE_EINVALID_INPUT [-6] : Invalid Inputs.
371 */
372int dce_buf_unlock(int num, size_t *handle)
373
374
375/*===============================================================*/
376/** dce_get_fd : Get OMAP DRM File Descriptor. Only Linux
377 * applications should call this API.
378 * @ return : OMAP DRM File Descriptor.
379 */
380int dce_get_fd()
381
382
383/*===============================================================*/
384/** dce_set_fd : Set OMAP DRM File Descriptor. Only Linux
385 * applications should call this API.
386 * @ param fd [in] : OMAP DRM File Descriptor.
387 */
388void dce_set_fd(int fd)
389
390
391******************************* API call flow ******************************
392
393// For a Decoder Application
394If (BUILDOS_LINUX) {
395 dev = dce_init()
396}
397 engine = Engine_open(String name, Engine_Attrs *attrs, Engine_Error *ec)
398
399 params = *dce_alloc(int sz)
400 Fill params
401
402 codec = VIDDEC3_create(Engine_Handle engine, String name,
403 VIDDEC3_Params *params)
404
405 dynParams = *dce_alloc(int sz)
406 Fill dynParams
407 status = *dce_alloc(int sz)
408
409 XDAS_Int32 VIDDEC3_control(VIDDEC3_Handle codec, VIDDEC3_Cmd id,
410 VIDDEC3_DynamicParams *dynParams, VIDDEC3_Status *status)
411
412 inBufs = *dce_alloc(int sz)
413 Fill inBufs
414 outBufs = *dce_alloc(int sz)
415 Fill outBufs
416 inArgs = *dce_alloc(int sz)
417 Fill inArgs
418 outArgs = *dce_alloc(int sz)
419 Fill outArgs
420
421 while(end of stream) {
422 if(BUILDOS_QNX) {
423
424 inBufs->descs[0].buf = virtual pointer of Input Buffer
425 outBufs->descs[0].buf = virtual pointer of Output Luma Buffer
426 outBufs->descs[1].buf = virtual pointer of Output Chroma Buffer
427
428 } else if (BUILDOS_LINUX || BUILDOS_ANDROID) {
429
430 inBufs->descs[0].buf = DMA Buf FD of Input Buffer
431
432 if( Output Buffer == MultiPlanar ) {
433 outBufs->descs[0].buf = DMA Buf FD of Output Luma Buffer
434 outBufs->descs[1].buf = DMA Buf FD of Output Chroma Buffer
435
436 } else { // Output Buffer is Single Planar
437 outBufs->descs[0].buf = DMA Buf FD of Output Luma Buffer
438 outBufs->descs[1].buf = DMA Buf FD of Output Luma Buffer +
439 Offset of Chroma Buffer
440 }
441 }
442
443 if (BUILDOS_LINUX) {
444 handle <- (inArgs.inputID).DMA_Buf_FD of Luma [and/or] chroma
445 dce_buf_lock(int num, size_t *handle)
446 }
447
448 XDAS_Int32 VIDDEC3_process(VIDDEC3_Handle codec,
449 XDM2_BufDesc *inBufs, XDM2_BufDesc *outBufs,
450 VIDDEC3_InArgs *inArgs, VIDDEC3_OutArgs *outArgs)
451
452 if (BUILDOS_LINUX) {
453 handle <- (outArgs.freeBufID).DMA_Buf_FD of Luma [and/or] chroma
454 dce_buf_unlock(int num, size_t *handle)
455 }
456
457 }
458
459 Void VIDDEC3_delete(VIDDEC3_Handle codec)
460
461 Void Engine_close(Engine_Handle engine)
462
463If (BUILDOS_LINUX) {
464 dce_deinit(dev)
465}
466
467 dce_free(params)
468 dce_free(dynParams)
469 dce_free(status)
470 dce_free(inBufs)
471 dce_free(outBufs)
472 dce_free(inArgs)
473 dce_free(outArgs)
474
475
476
477************ Version Info of Headers included in packages folder ***********
57 478
58Tools: 479Tools:
59XDC version : xdctools_3_25_02_70 480XDC version : xdctools_3_25_02_70