PSDK QNX API Guide
vpu_usr.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022, QNX Software Systems.
3  * Copyright 2022, Texas Instruments Incorporated - http://www.ti.com/
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining
6  * a copy of this software and associated documentation files (the
7  * "Software"), to deal in the Software without restriction, including
8  * without limitation the rights to use, copy, modify, merge, publish,
9  * distribute, sublicense, and/or sell copies of the Software, and to
10  * permit persons to whom the Software is furnished to do so, subject
11  * to the following conditions:
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  *
23  */
24 
38 /* @} */
39 
40 
55 #ifndef __VPU_USR_H__
56 #define __VPU_USR_H__
57 
58 
59 
60 #include "vpuapi.h"
61 
62 #if defined (__cplusplus)
63 extern "C" {
64 #endif
65 
66 #include <sys/slog.h>
67 #include <sys/slogcodes.h>
68 
69 #include "main_helper.h" // TODO change name for this. Needed for the tivpu_enc_config_t struct
70 
74 /* Used to indicate the type of buffer passed to buf_prepare devctl */
75 typedef enum {
79 
80 
81 /* Functions exposed by the resmgr user lib */
90 void *vpu_codec_open(void);
91 
100 void vpu_codec_close(void *hdl);
101 
112 int32_t vpu_get_product_info(void *hdl, uint32_t coreIdx, VpuAttr *vpuHwInfo);
113 
122 int32_t vpu_enc_init(void *hdl, tivpu_enc_config_t *config);
123 
135 int32_t vpu_enc_buf_prepare(void *hdl, vpu_buffer_t *bufs, int nbuf, vpu_buf_dir buf_dir);
136 
151 int32_t vpu_encode_frame(void *hdl, unsigned long ip_buf, unsigned long op_buf, unsigned long op_first_buf,
152  uint8_t is_eos, vpu_enc_status_t *enc_status);
153 
164 int32_t vpu_enc_get_buf_info(void *hdl, uint32_t *nbuffers, uint32_t *max_size);
165 
174 int32_t vpu_enc_start_streaming(void *hdl);
175 
184 int32_t vpu_enc_stop_streaming(void *hdl);
185 
194 int32_t vpu_enc_deinit(void *hdl);
195 
196 /* Decoder apis */
197 
206 int32_t vpu_dec_init(void *hdl, tivpu_dec_config_t *config);
207 int32_t vpu_dec_start_streaming(void *hdl);
208 int32_t vpu_dec_stop_streaming(void *hdl);
209 int32_t vpu_dec_deinit(void *hdl);
210 int32_t vpu_dec_close(void *hdl);
211 
223 int32_t vpu_dec_buf_prepare(void *hdl, vpu_buffer_t *bufs, int nbuf, vpu_buf_dir buf_dir);
224 
239 int32_t vpu_decode_frame(void *hdl, unsigned long ip_buf, unsigned long op_buf,
240  uint8_t is_eos, uint32_t in_filled_len, vpu_dec_status_t *dec_status);
241 
242 #if defined (__cplusplus)
243 }
244 #endif
245 
246 #endif // __VPU_USR_H__
247 
248 /* @} */
int32_t vpu_enc_init(void *hdl, tivpu_enc_config_t *config)
vpu_enc_init
void * vpu_codec_open(void)
vpu_codec_open
int32_t vpu_dec_init(void *hdl, tivpu_dec_config_t *config)
vpu_dec_init
int32_t vpu_encode_frame(void *hdl, unsigned long ip_buf, unsigned long op_buf, unsigned long op_first_buf, uint8_t is_eos, vpu_enc_status_t *enc_status)
vpu_encode_frame
int32_t vpu_dec_buf_prepare(void *hdl, vpu_buffer_t *bufs, int nbuf, vpu_buf_dir buf_dir)
vpu_dec_buf_prepare
int32_t vpu_enc_start_streaming(void *hdl)
vpu_enc_start_streaming
int32_t vpu_dec_close(void *hdl)
void vpu_codec_close(void *hdl)
vpu_codec_close
int32_t vpu_enc_buf_prepare(void *hdl, vpu_buffer_t *bufs, int nbuf, vpu_buf_dir buf_dir)
vpu_enc_buf_prepare
int32_t vpu_decode_frame(void *hdl, unsigned long ip_buf, unsigned long op_buf, uint8_t is_eos, uint32_t in_filled_len, vpu_dec_status_t *dec_status)
vpu_decode_frame
int32_t vpu_dec_deinit(void *hdl)
int32_t vpu_enc_stop_streaming(void *hdl)
vpu_enc_stop_streaming
int32_t vpu_enc_get_buf_info(void *hdl, uint32_t *nbuffers, uint32_t *max_size)
vpu_enc_get_buf_info
int32_t vpu_get_product_info(void *hdl, uint32_t coreIdx, VpuAttr *vpuHwInfo)
vpu_get_product_info
int32_t vpu_dec_start_streaming(void *hdl)
int32_t vpu_dec_stop_streaming(void *hdl)
int32_t vpu_enc_deinit(void *hdl)
vpu_enc_deinit
vpu_buf_dir
vpu_buf_dir enumeration. Identifies if it is an input of an output buffer
Definition: vpu_usr.h:75
@ TIVPU_BUFDIR_INPUT
Definition: vpu_usr.h:77
@ TIVPU_BUFDIR_OUTPUT
Definition: vpu_usr.h:76