1 /* 2 * Copyright 2021 Rockchip Electronics Co. LTD 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef SRC_TESTS_RT_MPI_COMMON_TEST_COMM_VENC_H_ 18 #define SRC_TESTS_RT_MPI_COMMON_TEST_COMM_VENC_H_ 19 20 #include "rk_common.h" 21 #include "rk_comm_venc.h" 22 23 #ifdef __cplusplus 24 #if __cplusplus 25 extern "C" { 26 #endif 27 #endif /* End of #ifdef __cplusplus */ 28 29 typedef struct _COMMON_TEST_VENC_CTX_S { 30 VENC_CHN VencChn; 31 RK_U32 u32Width; 32 RK_U32 u32Height; 33 RK_U32 u32StreamBufCnt; 34 RK_S32 s32RecvPicNum; 35 RK_CODEC_ID_E enType; 36 RK_U32 u32ReadPicNum; // for performance test, read one picture to test. 37 PIXEL_FORMAT_E enPixFmt; 38 const char *pSrcFramePath; 39 const char *pSaveStreamPath; 40 } COMMON_TEST_VENC_CTX_S; 41 42 RK_S32 TEST_VENC_Create(COMMON_TEST_VENC_CTX_S *vencCtx); 43 44 RK_S32 TEST_VENC_Start(COMMON_TEST_VENC_CTX_S *vencCtx); 45 RK_S32 TEST_VENC_Stop(VENC_CHN VencChn); 46 47 RK_S32 TEST_VENC_SnapStart(COMMON_TEST_VENC_CTX_S *vencCtx); 48 RK_S32 TEST_VENC_SnapProcess(COMMON_TEST_VENC_CTX_S *vencCtx); 49 RK_S32 TEST_VENC_SnapStop(VENC_CHN VencChn); 50 51 RK_S32 TEST_VENC_SET_BitRate(VENC_RC_ATTR_S *pRcAttr, RK_U32 u32BitRate, RK_U32 u32BitRateMax, RK_U32 u32BitRateMin); 52 RK_S32 TEST_VENC_SET_GopSize(VENC_RC_ATTR_S *pRcAttr, RK_U32 u32GopSize); 53 RK_S32 TEST_VENC_SET_FrameRate(VENC_RC_ATTR_S *pRcAttr, RK_U32 u32Fps); 54 RK_S32 TEST_VENC_SET_FixQp(VENC_RC_ATTR_S *pRcAttr, RK_U32 u32FixIQp, 55 RK_U32 u32FixPQp, RK_U32 u32FixBQp); 56 RK_S32 TEST_VENC_SET_StatTime(VENC_RC_ATTR_S *pRcAttr, RK_U32 u32StatTime); 57 58 #ifdef __cplusplus 59 #if __cplusplus 60 } 61 #endif 62 #endif /* End of #ifdef __cplusplus */ 63 64 #endif // SRC_TESTS_RT_MPI_COMMON_TEST_COMM_VENC_H_ 65