1 #ifndef _UAPI_MSM_VIDC_ENC_H_ 2 #define _UAPI_MSM_VIDC_ENC_H_ 3 4 #include <linux/types.h> 5 #include <linux/ioctl.h> 6 7 /** STATUS CODES*/ 8 /* Base value for status codes */ 9 #define VEN_S_BASE 0x00000000 10 #define VEN_S_SUCCESS (VEN_S_BASE)/* Success */ 11 #define VEN_S_EFAIL (VEN_S_BASE+1)/* General failure */ 12 #define VEN_S_EFATAL (VEN_S_BASE+2)/* Fatal irrecoverable failure*/ 13 #define VEN_S_EBADPARAM (VEN_S_BASE+3)/* Error passed parameters*/ 14 /*Command called in invalid state*/ 15 #define VEN_S_EINVALSTATE (VEN_S_BASE+4) 16 #define VEN_S_ENOSWRES (VEN_S_BASE+5)/* Insufficient OS resources*/ 17 #define VEN_S_ENOHWRES (VEN_S_BASE+6)/*Insufficient HW resources */ 18 #define VEN_S_EBUFFREQ (VEN_S_BASE+7)/* Buffer requirements were not met*/ 19 #define VEN_S_EINVALCMD (VEN_S_BASE+8)/* Invalid command called */ 20 #define VEN_S_ETIMEOUT (VEN_S_BASE+9)/* Command timeout. */ 21 /*Re-attempt was made when multiple invocation not supported for API.*/ 22 #define VEN_S_ENOREATMPT (VEN_S_BASE+10) 23 #define VEN_S_ENOPREREQ (VEN_S_BASE+11)/*Pre-requirement is not met for API*/ 24 #define VEN_S_ECMDQFULL (VEN_S_BASE+12)/*Command queue is full*/ 25 #define VEN_S_ENOTSUPP (VEN_S_BASE+13)/*Command not supported*/ 26 #define VEN_S_ENOTIMPL (VEN_S_BASE+14)/*Command not implemented.*/ 27 #define VEN_S_ENOTPMEM (VEN_S_BASE+15)/*Buffer is not from PMEM*/ 28 #define VEN_S_EFLUSHED (VEN_S_BASE+16)/*returned buffer was flushed*/ 29 #define VEN_S_EINSUFBUF (VEN_S_BASE+17)/*provided buffer size insufficient*/ 30 #define VEN_S_ESAMESTATE (VEN_S_BASE+18) 31 #define VEN_S_EINVALTRANS (VEN_S_BASE+19) 32 33 #define VEN_INTF_VER 1 34 35 /*Asynchronous messages from driver*/ 36 #define VEN_MSG_INDICATION 0 37 #define VEN_MSG_INPUT_BUFFER_DONE 1 38 #define VEN_MSG_OUTPUT_BUFFER_DONE 2 39 #define VEN_MSG_NEED_OUTPUT_BUFFER 3 40 #define VEN_MSG_FLUSH_INPUT_DONE 4 41 #define VEN_MSG_FLUSH_OUPUT_DONE 5 42 #define VEN_MSG_START 6 43 #define VEN_MSG_STOP 7 44 #define VEN_MSG_PAUSE 8 45 #define VEN_MSG_RESUME 9 46 #define VEN_MSG_STOP_READING_MSG 10 47 #define VEN_MSG_LTRUSE_FAILED 11 48 #define VEN_MSG_HW_OVERLOAD 12 49 #define VEN_MSG_MAX_CLIENTS 13 50 51 52 /*Buffer flags bits masks*/ 53 #define VEN_BUFFLAG_EOS 0x00000001 54 #define VEN_BUFFLAG_ENDOFFRAME 0x00000010 55 #define VEN_BUFFLAG_SYNCFRAME 0x00000020 56 #define VEN_BUFFLAG_EXTRADATA 0x00000040 57 #define VEN_BUFFLAG_CODECCONFIG 0x00000080 58 59 /*Post processing flags bit masks*/ 60 #define VEN_EXTRADATA_NONE 0x001 61 #define VEN_EXTRADATA_QCOMFILLER 0x002 62 #define VEN_EXTRADATA_SLICEINFO 0x100 63 #define VEN_EXTRADATA_LTRINFO 0x200 64 #define VEN_EXTRADATA_MBINFO 0x400 65 66 /*ENCODER CONFIGURATION CONSTANTS*/ 67 68 /*Encoded video frame types*/ 69 #define VEN_FRAME_TYPE_I 1/* I frame type */ 70 #define VEN_FRAME_TYPE_P 2/* P frame type */ 71 #define VEN_FRAME_TYPE_B 3/* B frame type */ 72 73 /*Video codec types*/ 74 #define VEN_CODEC_MPEG4 1/* MPEG4 Codec */ 75 #define VEN_CODEC_H264 2/* H.264 Codec */ 76 #define VEN_CODEC_H263 3/* H.263 Codec */ 77 78 /*Video codec profile types.*/ 79 #define VEN_PROFILE_MPEG4_SP 1/* 1 - MPEG4 SP profile */ 80 #define VEN_PROFILE_MPEG4_ASP 2/* 2 - MPEG4 ASP profile */ 81 #define VEN_PROFILE_H264_BASELINE 3/* 3 - H264 Baseline profile */ 82 #define VEN_PROFILE_H264_MAIN 4/* 4 - H264 Main profile */ 83 #define VEN_PROFILE_H264_HIGH 5/* 5 - H264 High profile */ 84 #define VEN_PROFILE_H263_BASELINE 6/* 6 - H263 Baseline profile */ 85 86 /*Video codec profile level types.*/ 87 #define VEN_LEVEL_MPEG4_0 0x1/* MPEG4 Level 0 */ 88 #define VEN_LEVEL_MPEG4_1 0x2/* MPEG4 Level 1 */ 89 #define VEN_LEVEL_MPEG4_2 0x3/* MPEG4 Level 2 */ 90 #define VEN_LEVEL_MPEG4_3 0x4/* MPEG4 Level 3 */ 91 #define VEN_LEVEL_MPEG4_4 0x5/* MPEG4 Level 4 */ 92 #define VEN_LEVEL_MPEG4_5 0x6/* MPEG4 Level 5 */ 93 #define VEN_LEVEL_MPEG4_3b 0x7/* MPEG4 Level 3b */ 94 #define VEN_LEVEL_MPEG4_6 0x8/* MPEG4 Level 6 */ 95 96 #define VEN_LEVEL_H264_1 0x9/* H.264 Level 1 */ 97 #define VEN_LEVEL_H264_1b 0xA/* H.264 Level 1b */ 98 #define VEN_LEVEL_H264_1p1 0xB/* H.264 Level 1.1 */ 99 #define VEN_LEVEL_H264_1p2 0xC/* H.264 Level 1.2 */ 100 #define VEN_LEVEL_H264_1p3 0xD/* H.264 Level 1.3 */ 101 #define VEN_LEVEL_H264_2 0xE/* H.264 Level 2 */ 102 #define VEN_LEVEL_H264_2p1 0xF/* H.264 Level 2.1 */ 103 #define VEN_LEVEL_H264_2p2 0x10/* H.264 Level 2.2 */ 104 #define VEN_LEVEL_H264_3 0x11/* H.264 Level 3 */ 105 #define VEN_LEVEL_H264_3p1 0x12/* H.264 Level 3.1 */ 106 #define VEN_LEVEL_H264_3p2 0x13/* H.264 Level 3.2 */ 107 #define VEN_LEVEL_H264_4 0x14/* H.264 Level 4 */ 108 109 #define VEN_LEVEL_H263_10 0x15/* H.263 Level 10 */ 110 #define VEN_LEVEL_H263_20 0x16/* H.263 Level 20 */ 111 #define VEN_LEVEL_H263_30 0x17/* H.263 Level 30 */ 112 #define VEN_LEVEL_H263_40 0x18/* H.263 Level 40 */ 113 #define VEN_LEVEL_H263_45 0x19/* H.263 Level 45 */ 114 #define VEN_LEVEL_H263_50 0x1A/* H.263 Level 50 */ 115 #define VEN_LEVEL_H263_60 0x1B/* H.263 Level 60 */ 116 #define VEN_LEVEL_H263_70 0x1C/* H.263 Level 70 */ 117 118 /*Entropy coding model selection for H.264 encoder.*/ 119 #define VEN_ENTROPY_MODEL_CAVLC 1 120 #define VEN_ENTROPY_MODEL_CABAC 2 121 /*Cabac model number (0,1,2) for encoder.*/ 122 #define VEN_CABAC_MODEL_0 1/* CABAC Model 0. */ 123 #define VEN_CABAC_MODEL_1 2/* CABAC Model 1. */ 124 #define VEN_CABAC_MODEL_2 3/* CABAC Model 2. */ 125 126 /*Deblocking filter control type for encoder.*/ 127 #define VEN_DB_DISABLE 1/* 1 - Disable deblocking filter*/ 128 #define VEN_DB_ALL_BLKG_BNDRY 2/* 2 - All blocking boundary filtering*/ 129 #define VEN_DB_SKIP_SLICE_BNDRY 3/* 3 - Filtering except sliceboundary*/ 130 131 /*Different methods of Multi slice selection.*/ 132 #define VEN_MSLICE_OFF 1 133 #define VEN_MSLICE_CNT_MB 2 /*number of MBscount per slice*/ 134 #define VEN_MSLICE_CNT_BYTE 3 /*number of bytes count per slice.*/ 135 #define VEN_MSLICE_GOB 4 /*Multi slice by GOB for H.263 only.*/ 136 137 /*Different modes for Rate Control.*/ 138 #define VEN_RC_OFF 1 139 #define VEN_RC_VBR_VFR 2 140 #define VEN_RC_VBR_CFR 3 141 #define VEN_RC_CBR_VFR 4 142 #define VEN_RC_CBR_CFR 5 143 144 /*Different modes for flushing buffers*/ 145 #define VEN_FLUSH_INPUT 1 146 #define VEN_FLUSH_OUTPUT 2 147 #define VEN_FLUSH_ALL 3 148 149 /*Different input formats for YUV data.*/ 150 #define VEN_INPUTFMT_NV12 1/* NV12 Linear */ 151 #define VEN_INPUTFMT_NV21 2/* NV21 Linear */ 152 #define VEN_INPUTFMT_NV12_16M2KA 3/* NV12 Linear */ 153 154 /*Different allowed rotation modes.*/ 155 #define VEN_ROTATION_0 1/* 0 degrees */ 156 #define VEN_ROTATION_90 2/* 90 degrees */ 157 #define VEN_ROTATION_180 3/* 180 degrees */ 158 #define VEN_ROTATION_270 4/* 270 degrees */ 159 160 /*IOCTL timeout values*/ 161 #define VEN_TIMEOUT_INFINITE 0xffffffff 162 163 /*Different allowed intra refresh modes.*/ 164 #define VEN_IR_OFF 1 165 #define VEN_IR_CYCLIC 2 166 #define VEN_IR_RANDOM 3 167 168 /*IOCTL BASE CODES Not to be used directly by the client.*/ 169 /* Base value for ioctls that are not related to encoder configuration.*/ 170 #define VEN_IOCTLBASE_NENC 0x800 171 /* Base value for encoder configuration ioctls*/ 172 #define VEN_IOCTLBASE_ENC 0x850 173 174 struct venc_ioctl_msg{ 175 void __user *in; 176 void __user *out; 177 }; 178 179 /*NON ENCODER CONFIGURATION IOCTLs*/ 180 181 /*IOCTL params:SET: InputData - unsigned long, OutputData - NULL*/ 182 #define VEN_IOCTL_SET_INTF_VERSION \ 183 _IOW(VEN_IOCTLBASE_NENC, 0, struct venc_ioctl_msg) 184 185 /*IOCTL params:CMD: InputData - venc_timeout, OutputData - venc_msg*/ 186 #define VEN_IOCTL_CMD_READ_NEXT_MSG \ 187 _IOWR(VEN_IOCTLBASE_NENC, 1, struct venc_ioctl_msg) 188 189 /*IOCTL params:CMD: InputData - NULL, OutputData - NULL*/ 190 #define VEN_IOCTL_CMD_STOP_READ_MSG _IO(VEN_IOCTLBASE_NENC, 2) 191 192 /*IOCTL params:SET: InputData - venc_allocatorproperty, OutputData - NULL 193 GET: InputData - NULL, OutputData - venc_allocatorproperty*/ 194 #define VEN_IOCTL_SET_INPUT_BUFFER_REQ \ 195 _IOW(VEN_IOCTLBASE_NENC, 3, struct venc_ioctl_msg) 196 #define VEN_IOCTL_GET_INPUT_BUFFER_REQ \ 197 _IOR(VEN_IOCTLBASE_NENC, 4, struct venc_ioctl_msg) 198 199 /*IOCTL params:CMD: InputData - venc_bufferpayload, OutputData - NULL*/ 200 #define VEN_IOCTL_CMD_ALLOC_INPUT_BUFFER \ 201 _IOW(VEN_IOCTLBASE_NENC, 5, struct venc_ioctl_msg) 202 203 /*IOCTL params:CMD: InputData - venc_bufferpayload, OutputData - NULL*/ 204 #define VEN_IOCTL_SET_INPUT_BUFFER \ 205 _IOW(VEN_IOCTLBASE_NENC, 6, struct venc_ioctl_msg) 206 207 /*IOCTL params: CMD: InputData - venc_bufferpayload, OutputData - NULL*/ 208 #define VEN_IOCTL_CMD_FREE_INPUT_BUFFER \ 209 _IOW(VEN_IOCTLBASE_NENC, 7, struct venc_ioctl_msg) 210 211 /*IOCTL params:SET: InputData - venc_allocatorproperty, OutputData - NULL 212 GET: InputData - NULL, OutputData - venc_allocatorproperty*/ 213 #define VEN_IOCTL_SET_OUTPUT_BUFFER_REQ \ 214 _IOW(VEN_IOCTLBASE_NENC, 8, struct venc_ioctl_msg) 215 #define VEN_IOCTL_GET_OUTPUT_BUFFER_REQ \ 216 _IOR(VEN_IOCTLBASE_NENC, 9, struct venc_ioctl_msg) 217 218 /*IOCTL params:CMD: InputData - venc_bufferpayload, OutputData - NULL*/ 219 #define VEN_IOCTL_CMD_ALLOC_OUTPUT_BUFFER \ 220 _IOW(VEN_IOCTLBASE_NENC, 10, struct venc_ioctl_msg) 221 222 223 /*IOCTL params:CMD: InputData - venc_bufferpayload, OutputData - NULL*/ 224 #define VEN_IOCTL_SET_OUTPUT_BUFFER \ 225 _IOW(VEN_IOCTLBASE_NENC, 11, struct venc_ioctl_msg) 226 227 /*IOCTL params:CMD: InputData - venc_bufferpayload, OutputData - NULL.*/ 228 #define VEN_IOCTL_CMD_FREE_OUTPUT_BUFFER \ 229 _IOW(VEN_IOCTLBASE_NENC, 12, struct venc_ioctl_msg) 230 231 232 /* Asynchronous respone message code:* VEN_MSG_START*/ 233 #define VEN_IOCTL_CMD_START _IO(VEN_IOCTLBASE_NENC, 13) 234 235 236 /*IOCTL params:CMD: InputData - venc_buffer, OutputData - NULL 237 Asynchronous respone message code:VEN_MSG_INPUT_BUFFER_DONE*/ 238 #define VEN_IOCTL_CMD_ENCODE_FRAME \ 239 _IOW(VEN_IOCTLBASE_NENC, 14, struct venc_ioctl_msg) 240 241 242 /*IOCTL params:CMD: InputData - venc_buffer, OutputData - NULL 243 Asynchronous response message code:VEN_MSG_OUTPUT_BUFFER_DONE*/ 244 #define VEN_IOCTL_CMD_FILL_OUTPUT_BUFFER \ 245 _IOW(VEN_IOCTLBASE_NENC, 15, struct venc_ioctl_msg) 246 247 /*IOCTL params:CMD: InputData - venc_bufferflush, OutputData - NULL 248 * Asynchronous response message code:VEN_MSG_INPUT_BUFFER_DONE*/ 249 #define VEN_IOCTL_CMD_FLUSH \ 250 _IOW(VEN_IOCTLBASE_NENC, 16, struct venc_ioctl_msg) 251 252 253 /*Asynchronous respone message code:VEN_MSG_PAUSE*/ 254 #define VEN_IOCTL_CMD_PAUSE _IO(VEN_IOCTLBASE_NENC, 17) 255 256 /*Asynchronous respone message code:VEN_MSG_RESUME*/ 257 #define VEN_IOCTL_CMD_RESUME _IO(VEN_IOCTLBASE_NENC, 18) 258 259 /* Asynchronous respone message code:VEN_MSG_STOP*/ 260 #define VEN_IOCTL_CMD_STOP _IO(VEN_IOCTLBASE_NENC, 19) 261 262 #define VEN_IOCTL_SET_RECON_BUFFER \ 263 _IOW(VEN_IOCTLBASE_NENC, 20, struct venc_ioctl_msg) 264 265 #define VEN_IOCTL_FREE_RECON_BUFFER \ 266 _IOW(VEN_IOCTLBASE_NENC, 21, struct venc_ioctl_msg) 267 268 #define VEN_IOCTL_GET_RECON_BUFFER_SIZE \ 269 _IOW(VEN_IOCTLBASE_NENC, 22, struct venc_ioctl_msg) 270 271 272 273 /*ENCODER PROPERTY CONFIGURATION & CAPABILITY IOCTLs*/ 274 275 /*IOCTL params:SET: InputData - venc_basecfg, OutputData - NULL 276 GET: InputData - NULL, OutputData - venc_basecfg*/ 277 #define VEN_IOCTL_SET_BASE_CFG \ 278 _IOW(VEN_IOCTLBASE_ENC, 1, struct venc_ioctl_msg) 279 #define VEN_IOCTL_GET_BASE_CFG \ 280 _IOR(VEN_IOCTLBASE_ENC, 2, struct venc_ioctl_msg) 281 282 /*IOCTL params:SET: InputData - venc_switch, OutputData - NULL 283 GET: InputData - NULL, OutputData - venc_switch*/ 284 #define VEN_IOCTL_SET_LIVE_MODE \ 285 _IOW(VEN_IOCTLBASE_ENC, 3, struct venc_ioctl_msg) 286 #define VEN_IOCTL_GET_LIVE_MODE \ 287 _IOR(VEN_IOCTLBASE_ENC, 4, struct venc_ioctl_msg) 288 289 290 /*IOCTL params:SET: InputData - venc_profile, OutputData - NULL 291 GET: InputData - NULL, OutputData - venc_profile*/ 292 #define VEN_IOCTL_SET_CODEC_PROFILE \ 293 _IOW(VEN_IOCTLBASE_ENC, 5, struct venc_ioctl_msg) 294 #define VEN_IOCTL_GET_CODEC_PROFILE \ 295 _IOR(VEN_IOCTLBASE_ENC, 6, struct venc_ioctl_msg) 296 297 298 /*IOCTL params:SET: InputData - ven_profilelevel, OutputData - NULL 299 GET: InputData - NULL, OutputData - ven_profilelevel*/ 300 #define VEN_IOCTL_SET_PROFILE_LEVEL \ 301 _IOW(VEN_IOCTLBASE_ENC, 7, struct venc_ioctl_msg) 302 303 #define VEN_IOCTL_GET_PROFILE_LEVEL \ 304 _IOR(VEN_IOCTLBASE_ENC, 8, struct venc_ioctl_msg) 305 306 /*IOCTL params:SET: InputData - venc_switch, OutputData - NULL 307 GET: InputData - NULL, OutputData - venc_switch*/ 308 #define VEN_IOCTL_SET_SHORT_HDR \ 309 _IOW(VEN_IOCTLBASE_ENC, 9, struct venc_ioctl_msg) 310 #define VEN_IOCTL_GET_SHORT_HDR \ 311 _IOR(VEN_IOCTLBASE_ENC, 10, struct venc_ioctl_msg) 312 313 314 /*IOCTL params: SET: InputData - venc_sessionqp, OutputData - NULL 315 GET: InputData - NULL, OutputData - venc_sessionqp*/ 316 #define VEN_IOCTL_SET_SESSION_QP \ 317 _IOW(VEN_IOCTLBASE_ENC, 11, struct venc_ioctl_msg) 318 #define VEN_IOCTL_GET_SESSION_QP \ 319 _IOR(VEN_IOCTLBASE_ENC, 12, struct venc_ioctl_msg) 320 321 322 /*IOCTL params:SET: InputData - venc_intraperiod, OutputData - NULL 323 GET: InputData - NULL, OutputData - venc_intraperiod*/ 324 #define VEN_IOCTL_SET_INTRA_PERIOD \ 325 _IOW(VEN_IOCTLBASE_ENC, 13, struct venc_ioctl_msg) 326 #define VEN_IOCTL_GET_INTRA_PERIOD \ 327 _IOR(VEN_IOCTLBASE_ENC, 14, struct venc_ioctl_msg) 328 329 330 /* Request an Iframe*/ 331 #define VEN_IOCTL_CMD_REQUEST_IFRAME _IO(VEN_IOCTLBASE_ENC, 15) 332 333 /*IOCTL params:GET: InputData - NULL, OutputData - venc_capability*/ 334 #define VEN_IOCTL_GET_CAPABILITY \ 335 _IOR(VEN_IOCTLBASE_ENC, 16, struct venc_ioctl_msg) 336 337 338 /*IOCTL params:GET: InputData - NULL, OutputData - venc_seqheader*/ 339 #define VEN_IOCTL_GET_SEQUENCE_HDR \ 340 _IOR(VEN_IOCTLBASE_ENC, 17, struct venc_ioctl_msg) 341 342 /*IOCTL params:SET: InputData - venc_entropycfg, OutputData - NULL 343 GET: InputData - NULL, OutputData - venc_entropycfg*/ 344 #define VEN_IOCTL_SET_ENTROPY_CFG \ 345 _IOW(VEN_IOCTLBASE_ENC, 18, struct venc_ioctl_msg) 346 #define VEN_IOCTL_GET_ENTROPY_CFG \ 347 _IOR(VEN_IOCTLBASE_ENC, 19, struct venc_ioctl_msg) 348 349 /*IOCTL params:SET: InputData - venc_dbcfg, OutputData - NULL 350 GET: InputData - NULL, OutputData - venc_dbcfg*/ 351 #define VEN_IOCTL_SET_DEBLOCKING_CFG \ 352 _IOW(VEN_IOCTLBASE_ENC, 20, struct venc_ioctl_msg) 353 #define VEN_IOCTL_GET_DEBLOCKING_CFG \ 354 _IOR(VEN_IOCTLBASE_ENC, 21, struct venc_ioctl_msg) 355 356 357 /*IOCTL params:SET: InputData - venc_intrarefresh, OutputData - NULL 358 GET: InputData - NULL, OutputData - venc_intrarefresh*/ 359 #define VEN_IOCTL_SET_INTRA_REFRESH \ 360 _IOW(VEN_IOCTLBASE_ENC, 22, struct venc_ioctl_msg) 361 #define VEN_IOCTL_GET_INTRA_REFRESH \ 362 _IOR(VEN_IOCTLBASE_ENC, 23, struct venc_ioctl_msg) 363 364 365 /*IOCTL params:SET: InputData - venc_multiclicecfg, OutputData - NULL 366 GET: InputData - NULL, OutputData - venc_multiclicecfg*/ 367 #define VEN_IOCTL_SET_MULTI_SLICE_CFG \ 368 _IOW(VEN_IOCTLBASE_ENC, 24, struct venc_ioctl_msg) 369 #define VEN_IOCTL_GET_MULTI_SLICE_CFG \ 370 _IOR(VEN_IOCTLBASE_ENC, 25, struct venc_ioctl_msg) 371 372 /*IOCTL params:SET: InputData - venc_ratectrlcfg, OutputData - NULL 373 GET: InputData - NULL, OutputData - venc_ratectrlcfg*/ 374 #define VEN_IOCTL_SET_RATE_CTRL_CFG \ 375 _IOW(VEN_IOCTLBASE_ENC, 26, struct venc_ioctl_msg) 376 #define VEN_IOCTL_GET_RATE_CTRL_CFG \ 377 _IOR(VEN_IOCTLBASE_ENC, 27, struct venc_ioctl_msg) 378 379 380 /*IOCTL params:SET: InputData - venc_voptimingcfg, OutputData - NULL 381 GET: InputData - NULL, OutputData - venc_voptimingcfg*/ 382 #define VEN_IOCTL_SET_VOP_TIMING_CFG \ 383 _IOW(VEN_IOCTLBASE_ENC, 28, struct venc_ioctl_msg) 384 #define VEN_IOCTL_GET_VOP_TIMING_CFG \ 385 _IOR(VEN_IOCTLBASE_ENC, 29, struct venc_ioctl_msg) 386 387 388 /*IOCTL params:SET: InputData - venc_framerate, OutputData - NULL 389 GET: InputData - NULL, OutputData - venc_framerate*/ 390 #define VEN_IOCTL_SET_FRAME_RATE \ 391 _IOW(VEN_IOCTLBASE_ENC, 30, struct venc_ioctl_msg) 392 #define VEN_IOCTL_GET_FRAME_RATE \ 393 _IOR(VEN_IOCTLBASE_ENC, 31, struct venc_ioctl_msg) 394 395 396 /*IOCTL params:SET: InputData - venc_targetbitrate, OutputData - NULL 397 GET: InputData - NULL, OutputData - venc_targetbitrate*/ 398 #define VEN_IOCTL_SET_TARGET_BITRATE \ 399 _IOW(VEN_IOCTLBASE_ENC, 32, struct venc_ioctl_msg) 400 #define VEN_IOCTL_GET_TARGET_BITRATE \ 401 _IOR(VEN_IOCTLBASE_ENC, 33, struct venc_ioctl_msg) 402 403 404 /*IOCTL params:SET: InputData - venc_rotation, OutputData - NULL 405 GET: InputData - NULL, OutputData - venc_rotation*/ 406 #define VEN_IOCTL_SET_ROTATION \ 407 _IOW(VEN_IOCTLBASE_ENC, 34, struct venc_ioctl_msg) 408 #define VEN_IOCTL_GET_ROTATION \ 409 _IOR(VEN_IOCTLBASE_ENC, 35, struct venc_ioctl_msg) 410 411 412 /*IOCTL params:SET: InputData - venc_headerextension, OutputData - NULL 413 GET: InputData - NULL, OutputData - venc_headerextension*/ 414 #define VEN_IOCTL_SET_HEC \ 415 _IOW(VEN_IOCTLBASE_ENC, 36, struct venc_ioctl_msg) 416 #define VEN_IOCTL_GET_HEC \ 417 _IOR(VEN_IOCTLBASE_ENC, 37, struct venc_ioctl_msg) 418 419 /*IOCTL params:SET: InputData - venc_switch, OutputData - NULL 420 GET: InputData - NULL, OutputData - venc_switch*/ 421 #define VEN_IOCTL_SET_DATA_PARTITION \ 422 _IOW(VEN_IOCTLBASE_ENC, 38, struct venc_ioctl_msg) 423 #define VEN_IOCTL_GET_DATA_PARTITION \ 424 _IOR(VEN_IOCTLBASE_ENC, 39, struct venc_ioctl_msg) 425 426 /*IOCTL params:SET: InputData - venc_switch, OutputData - NULL 427 GET: InputData - NULL, OutputData - venc_switch*/ 428 #define VEN_IOCTL_SET_RVLC \ 429 _IOW(VEN_IOCTLBASE_ENC, 40, struct venc_ioctl_msg) 430 #define VEN_IOCTL_GET_RVLC \ 431 _IOR(VEN_IOCTLBASE_ENC, 41, struct venc_ioctl_msg) 432 433 434 /*IOCTL params:SET: InputData - venc_switch, OutputData - NULL 435 GET: InputData - NULL, OutputData - venc_switch*/ 436 #define VEN_IOCTL_SET_AC_PREDICTION \ 437 _IOW(VEN_IOCTLBASE_ENC, 42, struct venc_ioctl_msg) 438 #define VEN_IOCTL_GET_AC_PREDICTION \ 439 _IOR(VEN_IOCTLBASE_ENC, 43, struct venc_ioctl_msg) 440 441 442 /*IOCTL params:SET: InputData - venc_qprange, OutputData - NULL 443 GET: InputData - NULL, OutputData - venc_qprange*/ 444 #define VEN_IOCTL_SET_QP_RANGE \ 445 _IOW(VEN_IOCTLBASE_ENC, 44, struct venc_ioctl_msg) 446 #define VEN_IOCTL_GET_QP_RANGE \ 447 _IOR(VEN_IOCTLBASE_ENC, 45, struct venc_ioctl_msg) 448 449 #define VEN_IOCTL_GET_NUMBER_INSTANCES \ 450 _IOR(VEN_IOCTLBASE_ENC, 46, struct venc_ioctl_msg) 451 452 #define VEN_IOCTL_SET_METABUFFER_MODE \ 453 _IOW(VEN_IOCTLBASE_ENC, 47, struct venc_ioctl_msg) 454 455 456 /*IOCTL params:SET: InputData - unsigned int, OutputData - NULL.*/ 457 #define VEN_IOCTL_SET_EXTRADATA \ 458 _IOW(VEN_IOCTLBASE_ENC, 48, struct venc_ioctl_msg) 459 /*IOCTL params:GET: InputData - NULL, OutputData - unsigned int.*/ 460 #define VEN_IOCTL_GET_EXTRADATA \ 461 _IOR(VEN_IOCTLBASE_ENC, 49, struct venc_ioctl_msg) 462 463 /*IOCTL params:SET: InputData - NULL, OutputData - NULL.*/ 464 #define VEN_IOCTL_SET_SLICE_DELIVERY_MODE \ 465 _IO(VEN_IOCTLBASE_ENC, 50) 466 467 #define VEN_IOCTL_SET_H263_PLUSPTYPE \ 468 _IOW(VEN_IOCTLBASE_ENC, 51, struct venc_ioctl_msg) 469 470 /*IOCTL params:SET: InputData - venc_range, OutputData - NULL.*/ 471 #define VEN_IOCTL_SET_CAPABILITY_LTRCOUNT \ 472 _IOW(VEN_IOCTLBASE_ENC, 52, struct venc_ioctl_msg) 473 /*IOCTL params:GET: InputData - NULL, OutputData - venc_range.*/ 474 #define VEN_IOCTL_GET_CAPABILITY_LTRCOUNT \ 475 _IOR(VEN_IOCTLBASE_ENC, 53, struct venc_ioctl_msg) 476 477 /*IOCTL params:SET: InputData - venc_ltrmode, OutputData - NULL.*/ 478 #define VEN_IOCTL_SET_LTRMODE \ 479 _IOW(VEN_IOCTLBASE_ENC, 54, struct venc_ioctl_msg) 480 /*IOCTL params:GET: InputData - NULL, OutputData - venc_ltrmode.*/ 481 #define VEN_IOCTL_GET_LTRMODE \ 482 _IOR(VEN_IOCTLBASE_ENC, 55, struct venc_ioctl_msg) 483 484 /*IOCTL params:SET: InputData - venc_ltrcount, OutputData - NULL.*/ 485 #define VEN_IOCTL_SET_LTRCOUNT \ 486 _IOW(VEN_IOCTLBASE_ENC, 56, struct venc_ioctl_msg) 487 /*IOCTL params:GET: InputData - NULL, OutputData - venc_ltrcount.*/ 488 #define VEN_IOCTL_GET_LTRCOUNT \ 489 _IOR(VEN_IOCTLBASE_ENC, 57, struct venc_ioctl_msg) 490 491 /*IOCTL params:SET: InputData - venc_ltrperiod, OutputData - NULL.*/ 492 #define VEN_IOCTL_SET_LTRPERIOD \ 493 _IOW(VEN_IOCTLBASE_ENC, 58, struct venc_ioctl_msg) 494 /*IOCTL params:GET: InputData - NULL, OutputData - venc_ltrperiod.*/ 495 #define VEN_IOCTL_GET_LTRPERIOD \ 496 _IOR(VEN_IOCTLBASE_ENC, 59, struct venc_ioctl_msg) 497 498 /*IOCTL params:SET: InputData - venc_ltruse, OutputData - NULL.*/ 499 #define VEN_IOCTL_SET_LTRUSE \ 500 _IOW(VEN_IOCTLBASE_ENC, 60, struct venc_ioctl_msg) 501 /*IOCTL params:GET: InputData - NULL, OutputData - venc_ltruse.*/ 502 #define VEN_IOCTL_GET_LTRUSE \ 503 _IOR(VEN_IOCTLBASE_ENC, 61, struct venc_ioctl_msg) 504 505 /*IOCTL params:SET: InputData - venc_ltrmark, OutputData - NULL.*/ 506 #define VEN_IOCTL_SET_LTRMARK \ 507 _IOW(VEN_IOCTLBASE_ENC, 62, struct venc_ioctl_msg) 508 /*IOCTL params:GET: InputData - NULL, OutputData - venc_ltrmark.*/ 509 #define VEN_IOCTL_GET_LTRMARK \ 510 _IOR(VEN_IOCTLBASE_ENC, 63, struct venc_ioctl_msg) 511 512 /*IOCTL params:SET: InputData - unsigned int, OutputData - NULL*/ 513 #define VEN_IOCTL_SET_SPS_PPS_FOR_IDR \ 514 _IOW(VEN_IOCTLBASE_ENC, 64, struct venc_ioctl_msg) 515 516 struct venc_range { 517 unsigned long max; 518 unsigned long min; 519 unsigned long step_size; 520 }; 521 522 struct venc_switch{ 523 unsigned char status; 524 }; 525 526 struct venc_allocatorproperty{ 527 unsigned long mincount; 528 unsigned long maxcount; 529 unsigned long actualcount; 530 unsigned long datasize; 531 unsigned long suffixsize; 532 unsigned long alignment; 533 unsigned long bufpoolid; 534 }; 535 536 struct venc_bufferpayload{ 537 unsigned char *pbuffer; 538 size_t sz; 539 int fd; 540 unsigned int offset; 541 unsigned int maped_size; 542 unsigned long filled_len; 543 }; 544 545 struct venc_buffer{ 546 unsigned char *ptrbuffer; 547 unsigned long sz; 548 unsigned long len; 549 unsigned long offset; 550 long long timestamp; 551 unsigned long flags; 552 void *clientdata; 553 }; 554 555 struct venc_basecfg{ 556 unsigned long input_width; 557 unsigned long input_height; 558 unsigned long dvs_width; 559 unsigned long dvs_height; 560 unsigned long codectype; 561 unsigned long fps_num; 562 unsigned long fps_den; 563 unsigned long targetbitrate; 564 unsigned long inputformat; 565 }; 566 567 struct venc_profile{ 568 unsigned long profile; 569 }; 570 struct ven_profilelevel{ 571 unsigned long level; 572 }; 573 574 struct venc_sessionqp{ 575 unsigned long iframeqp; 576 unsigned long pframqp; 577 }; 578 579 struct venc_qprange{ 580 unsigned long maxqp; 581 unsigned long minqp; 582 }; 583 584 struct venc_plusptype { 585 unsigned long plusptype_enable; 586 }; 587 588 struct venc_intraperiod{ 589 unsigned long num_pframes; 590 unsigned long num_bframes; 591 }; 592 struct venc_seqheader{ 593 unsigned char *hdrbufptr; 594 unsigned long bufsize; 595 unsigned long hdrlen; 596 }; 597 598 struct venc_capability{ 599 unsigned long codec_types; 600 unsigned long maxframe_width; 601 unsigned long maxframe_height; 602 unsigned long maxtarget_bitrate; 603 unsigned long maxframe_rate; 604 unsigned long input_formats; 605 unsigned char dvs; 606 }; 607 608 struct venc_entropycfg{ 609 unsigned longentropysel; 610 unsigned long cabacmodel; 611 }; 612 613 struct venc_dbcfg{ 614 unsigned long db_mode; 615 unsigned long slicealpha_offset; 616 unsigned long slicebeta_offset; 617 }; 618 619 struct venc_intrarefresh{ 620 unsigned long irmode; 621 unsigned long mbcount; 622 }; 623 624 struct venc_multiclicecfg{ 625 unsigned long mslice_mode; 626 unsigned long mslice_size; 627 }; 628 629 struct venc_bufferflush{ 630 unsigned long flush_mode; 631 }; 632 633 struct venc_ratectrlcfg{ 634 unsigned long rcmode; 635 }; 636 637 struct venc_voptimingcfg{ 638 unsigned long voptime_resolution; 639 }; 640 struct venc_framerate{ 641 unsigned long fps_denominator; 642 unsigned long fps_numerator; 643 }; 644 645 struct venc_targetbitrate{ 646 unsigned long target_bitrate; 647 }; 648 649 650 struct venc_rotation{ 651 unsigned long rotation; 652 }; 653 654 struct venc_timeout{ 655 unsigned long millisec; 656 }; 657 658 struct venc_headerextension{ 659 unsigned long header_extension; 660 }; 661 662 struct venc_msg{ 663 unsigned long statuscode; 664 unsigned long msgcode; 665 struct venc_buffer buf; 666 unsigned long msgdata_size; 667 }; 668 669 struct venc_recon_addr{ 670 unsigned char *pbuffer; 671 unsigned long buffer_size; 672 unsigned long pmem_fd; 673 unsigned long offset; 674 }; 675 676 struct venc_recon_buff_size{ 677 int width; 678 int height; 679 int size; 680 int alignment; 681 }; 682 683 struct venc_ltrmode { 684 unsigned long ltr_mode; 685 }; 686 687 struct venc_ltrcount { 688 unsigned long ltr_count; 689 }; 690 691 struct venc_ltrperiod { 692 unsigned long ltr_period; 693 }; 694 695 struct venc_ltruse { 696 unsigned long ltr_id; 697 unsigned long ltr_frames; 698 }; 699 700 #endif /* _UAPI_MSM_VIDC_ENC_H_ */ 701