mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-09-27 21:42:08 +08:00
refactor:[kmpp]: Move kmpp to seperate directory
Signed-off-by: Herman Chen <herman.chen@rock-chips.com> Change-Id: I85eb166a3ebb1ae64a44c7127808fc469c6415a8
This commit is contained in:
@@ -335,11 +335,21 @@ add_subdirectory(osal)
|
|||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
add_subdirectory(utils)
|
add_subdirectory(utils)
|
||||||
|
|
||||||
|
# Media Process Platform include
|
||||||
|
include_directories(mpp/inc)
|
||||||
|
include_directories(mpp/base/inc)
|
||||||
|
# Kernel Media Process Platform include
|
||||||
|
include_directories(kmpp/inc)
|
||||||
|
include_directories(kmpp/base/inc)
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# Kernel Media Process Platform library
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
add_subdirectory(kmpp)
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
# Media Process Platform library
|
# Media Process Platform library
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
# Media Process Platform include
|
|
||||||
include_directories(mpp/inc)
|
|
||||||
add_subdirectory(mpp)
|
add_subdirectory(mpp)
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
|
@@ -9,40 +9,40 @@
|
|||||||
#include "rk_type.h"
|
#include "rk_type.h"
|
||||||
#include "mpp_err.h"
|
#include "mpp_err.h"
|
||||||
|
|
||||||
typedef void* MppVencKcfg;
|
typedef void* KmppVenccfg;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
MPP_VENC_KCFG_TYPE_INIT,
|
KMPP_VENC_CFG_TYPE_INIT,
|
||||||
MPP_VENC_KCFG_TYPE_DEINIT,
|
KMPP_VENC_CFG_TYPE_DEINIT,
|
||||||
MPP_VENC_KCFG_TYPE_RESET,
|
KMPP_VENC_CFG_TYPE_RESET,
|
||||||
MPP_VENC_KCFG_TYPE_START,
|
KMPP_VENC_CFG_TYPE_START,
|
||||||
MPP_VENC_KCFG_TYPE_STOP,
|
KMPP_VENC_CFG_TYPE_STOP,
|
||||||
MPP_VENC_KCFG_TYPE_BUTT,
|
KMPP_VENC_CFG_TYPE_BUTT,
|
||||||
} MppVencKcfgType;
|
} MppVencKcfgType;
|
||||||
|
|
||||||
MPP_RET mpp_venc_kcfg_init(MppVencKcfg *cfg, MppVencKcfgType type);
|
MPP_RET kmpp_venc_cfg_init(KmppVenccfg *cfg, MppVencKcfgType type);
|
||||||
MPP_RET mpp_venc_kcfg_init_by_name(MppVencKcfg *cfg, const char *name);
|
MPP_RET kmpp_venc_cfg_init_by_name(KmppVenccfg *cfg, const char *name);
|
||||||
MPP_RET mpp_venc_kcfg_deinit(MppVencKcfg cfg);
|
MPP_RET kmpp_venc_cfg_deinit(KmppVenccfg cfg);
|
||||||
|
|
||||||
MPP_RET mpp_venc_kcfg_set_s32(MppVencKcfg cfg, const char *name, RK_S32 val);
|
MPP_RET kmpp_venc_cfg_set_s32(KmppVenccfg cfg, const char *name, RK_S32 val);
|
||||||
MPP_RET mpp_venc_kcfg_set_u32(MppVencKcfg cfg, const char *name, RK_U32 val);
|
MPP_RET kmpp_venc_cfg_set_u32(KmppVenccfg cfg, const char *name, RK_U32 val);
|
||||||
MPP_RET mpp_venc_kcfg_set_s64(MppVencKcfg cfg, const char *name, RK_S64 val);
|
MPP_RET kmpp_venc_cfg_set_s64(KmppVenccfg cfg, const char *name, RK_S64 val);
|
||||||
MPP_RET mpp_venc_kcfg_set_u64(MppVencKcfg cfg, const char *name, RK_U64 val);
|
MPP_RET kmpp_venc_cfg_set_u64(KmppVenccfg cfg, const char *name, RK_U64 val);
|
||||||
MPP_RET mpp_venc_kcfg_set_ptr(MppVencKcfg cfg, const char *name, void *val);
|
MPP_RET kmpp_venc_cfg_set_ptr(KmppVenccfg cfg, const char *name, void *val);
|
||||||
MPP_RET mpp_venc_kcfg_set_st(MppVencKcfg cfg, const char *name, void *val);
|
MPP_RET kmpp_venc_cfg_set_st(KmppVenccfg cfg, const char *name, void *val);
|
||||||
|
|
||||||
MPP_RET mpp_venc_kcfg_get_s32(MppVencKcfg cfg, const char *name, RK_S32 *val);
|
MPP_RET kmpp_venc_cfg_get_s32(KmppVenccfg cfg, const char *name, RK_S32 *val);
|
||||||
MPP_RET mpp_venc_kcfg_get_u32(MppVencKcfg cfg, const char *name, RK_U32 *val);
|
MPP_RET kmpp_venc_cfg_get_u32(KmppVenccfg cfg, const char *name, RK_U32 *val);
|
||||||
MPP_RET mpp_venc_kcfg_get_s64(MppVencKcfg cfg, const char *name, RK_S64 *val);
|
MPP_RET kmpp_venc_cfg_get_s64(KmppVenccfg cfg, const char *name, RK_S64 *val);
|
||||||
MPP_RET mpp_venc_kcfg_get_u64(MppVencKcfg cfg, const char *name, RK_U64 *val);
|
MPP_RET kmpp_venc_cfg_get_u64(KmppVenccfg cfg, const char *name, RK_U64 *val);
|
||||||
MPP_RET mpp_venc_kcfg_get_ptr(MppVencKcfg cfg, const char *name, void **val);
|
MPP_RET kmpp_venc_cfg_get_ptr(KmppVenccfg cfg, const char *name, void **val);
|
||||||
MPP_RET mpp_venc_kcfg_get_st(MppVencKcfg cfg, const char *name, void *val);
|
MPP_RET kmpp_venc_cfg_get_st(KmppVenccfg cfg, const char *name, void *val);
|
||||||
|
|
||||||
void mpp_venc_kcfg_show(MppVencKcfg cfg);
|
void kmpp_venc_cfg_show(KmppVenccfg cfg);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
23
kmpp/CMakeLists.txt
Normal file
23
kmpp/CMakeLists.txt
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# vim: syntax=cmake
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# add include directory
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/mpp/codec/inc)
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# add kmpp base component
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
add_subdirectory(base)
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# add kmpp implement
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
set (KMPP_SRC
|
||||||
|
kmpp.c
|
||||||
|
)
|
||||||
|
|
||||||
|
add_library(kmpp STATIC ${KMPP_SRC})
|
||||||
|
target_link_libraries(kmpp kmpp_base)
|
||||||
|
set_target_properties(kmpp PROPERTIES FOLDER "kmpp")
|
||||||
|
|
15
kmpp/base/CMakeLists.txt
Normal file
15
kmpp/base/CMakeLists.txt
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# vim: syntax=cmake
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# add kmpp basic components
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
add_library(kmpp_base STATIC
|
||||||
|
kmpp_obj.c
|
||||||
|
kmpp_venc_cfg.c
|
||||||
|
)
|
||||||
|
|
||||||
|
target_link_libraries(kmpp_base osal)
|
||||||
|
set_target_properties(kmpp_base PROPERTIES FOLDER "kmpp/base")
|
||||||
|
|
||||||
|
# unit test
|
||||||
|
add_subdirectory(test)
|
@@ -3,9 +3,8 @@
|
|||||||
* Copyright (c) 2024 Rockchip Electronics Co., Ltd.
|
* Copyright (c) 2024 Rockchip Electronics Co., Ltd.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define MODULE_TAG "mpp_venc_kcfg"
|
#define MODULE_TAG "kmpp_venc_cfg"
|
||||||
|
|
||||||
#include "rk_venc_kcfg.h"
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
@@ -15,6 +14,7 @@
|
|||||||
#include "mpp_common.h"
|
#include "mpp_common.h"
|
||||||
|
|
||||||
#include "kmpp_obj.h"
|
#include "kmpp_obj.h"
|
||||||
|
#include "rk_venc_kcfg.h"
|
||||||
|
|
||||||
#define VENC_KCFG_DBG_FUNC (0x00000001)
|
#define VENC_KCFG_DBG_FUNC (0x00000001)
|
||||||
#define VENC_KCFG_DBG_INFO (0x00000002)
|
#define VENC_KCFG_DBG_INFO (0x00000002)
|
||||||
@@ -31,19 +31,19 @@
|
|||||||
static RK_U32 venc_kcfg_debug = 0;
|
static RK_U32 venc_kcfg_debug = 0;
|
||||||
|
|
||||||
static char *kcfg_names[] = {
|
static char *kcfg_names[] = {
|
||||||
[MPP_VENC_KCFG_TYPE_INIT] = "KmppVencInitCfg",
|
[KMPP_VENC_CFG_TYPE_INIT] = "KmppVencInitCfg",
|
||||||
[MPP_VENC_KCFG_TYPE_DEINIT] = "KmppVencDeinitCfg",
|
[KMPP_VENC_CFG_TYPE_DEINIT] = "KmppVencDeinitCfg",
|
||||||
[MPP_VENC_KCFG_TYPE_RESET] = "KmppVencResetCfg",
|
[KMPP_VENC_CFG_TYPE_RESET] = "KmppVencResetCfg",
|
||||||
[MPP_VENC_KCFG_TYPE_START] = "KmppVencStartCfg",
|
[KMPP_VENC_CFG_TYPE_START] = "KmppVencStartCfg",
|
||||||
[MPP_VENC_KCFG_TYPE_STOP] = "KmppVencStopCfg",
|
[KMPP_VENC_CFG_TYPE_STOP] = "KmppVencStopCfg",
|
||||||
};
|
};
|
||||||
static KmppObjDef kcfg_defs[MPP_VENC_KCFG_TYPE_BUTT] = {NULL};
|
static KmppObjDef kcfg_defs[KMPP_VENC_CFG_TYPE_BUTT] = {NULL};
|
||||||
static pthread_mutex_t lock;
|
static pthread_mutex_t lock;
|
||||||
|
|
||||||
static void mpp_venc_kcfg_def_init() __attribute__((constructor));
|
static void kmpp_venc_cfg_def_init() __attribute__((constructor));
|
||||||
static void mpp_venc_kcfg_def_deinit() __attribute__((destructor));
|
static void kmpp_venc_cfg_def_deinit() __attribute__((destructor));
|
||||||
|
|
||||||
static void mpp_venc_kcfg_def_init(void)
|
static void kmpp_venc_cfg_def_init(void)
|
||||||
{
|
{
|
||||||
pthread_mutexattr_t attr;
|
pthread_mutexattr_t attr;
|
||||||
|
|
||||||
@@ -53,12 +53,12 @@ static void mpp_venc_kcfg_def_init(void)
|
|||||||
pthread_mutexattr_destroy(&attr);
|
pthread_mutexattr_destroy(&attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mpp_venc_kcfg_def_deinit(void)
|
static void kmpp_venc_cfg_def_deinit(void)
|
||||||
{
|
{
|
||||||
RK_U32 i;
|
RK_U32 i;
|
||||||
|
|
||||||
pthread_mutex_lock(&lock);
|
pthread_mutex_lock(&lock);
|
||||||
for (i = 0; i < MPP_VENC_KCFG_TYPE_BUTT; i++) {
|
for (i = 0; i < KMPP_VENC_CFG_TYPE_BUTT; i++) {
|
||||||
if (kcfg_defs[i]) {
|
if (kcfg_defs[i]) {
|
||||||
kmpp_objdef_put(kcfg_defs[i]);
|
kmpp_objdef_put(kcfg_defs[i]);
|
||||||
kcfg_defs[i] = NULL;
|
kcfg_defs[i] = NULL;
|
||||||
@@ -68,7 +68,7 @@ static void mpp_venc_kcfg_def_deinit(void)
|
|||||||
pthread_mutex_destroy(&lock);
|
pthread_mutex_destroy(&lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
MPP_RET mpp_venc_kcfg_init(MppVencKcfg *cfg, MppVencKcfgType type)
|
MPP_RET kmpp_venc_cfg_init(KmppVenccfg *cfg, MppVencKcfgType type)
|
||||||
{
|
{
|
||||||
KmppObj obj = NULL;
|
KmppObj obj = NULL;
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ MPP_RET mpp_venc_kcfg_init(MppVencKcfg *cfg, MppVencKcfgType type)
|
|||||||
return MPP_ERR_NULL_PTR;
|
return MPP_ERR_NULL_PTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type >= MPP_VENC_KCFG_TYPE_BUTT) {
|
if (type >= KMPP_VENC_CFG_TYPE_BUTT) {
|
||||||
mpp_err_f("invalid config type %d\n", type);
|
mpp_err_f("invalid config type %d\n", type);
|
||||||
return MPP_ERR_VALUE;
|
return MPP_ERR_VALUE;
|
||||||
}
|
}
|
||||||
@@ -103,10 +103,10 @@ MPP_RET mpp_venc_kcfg_init(MppVencKcfg *cfg, MppVencKcfgType type)
|
|||||||
return obj ? MPP_OK : MPP_NOK;
|
return obj ? MPP_OK : MPP_NOK;
|
||||||
}
|
}
|
||||||
|
|
||||||
MPP_RET mpp_venc_kcfg_init_by_name(MppVencKcfg *cfg, const char *name)
|
MPP_RET kmpp_venc_cfg_init_by_name(KmppVenccfg *cfg, const char *name)
|
||||||
{
|
{
|
||||||
KmppObj obj = NULL;
|
KmppObj obj = NULL;
|
||||||
MppVencKcfgType type = MPP_VENC_KCFG_TYPE_BUTT;
|
MppVencKcfgType type = KMPP_VENC_CFG_TYPE_BUTT;
|
||||||
RK_U32 i;
|
RK_U32 i;
|
||||||
|
|
||||||
if (!cfg) {
|
if (!cfg) {
|
||||||
@@ -114,14 +114,14 @@ MPP_RET mpp_venc_kcfg_init_by_name(MppVencKcfg *cfg, const char *name)
|
|||||||
return MPP_ERR_NULL_PTR;
|
return MPP_ERR_NULL_PTR;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < MPP_VENC_KCFG_TYPE_BUTT; i++) {
|
for (i = 0; i < KMPP_VENC_CFG_TYPE_BUTT; i++) {
|
||||||
if (!strncmp(name, kcfg_names[i], strlen(kcfg_names[i]))) {
|
if (!strncmp(name, kcfg_names[i], strlen(kcfg_names[i]))) {
|
||||||
type = i;
|
type = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type >= MPP_VENC_KCFG_TYPE_BUTT) {
|
if (type >= KMPP_VENC_CFG_TYPE_BUTT) {
|
||||||
mpp_err_f("invalid config name %s\n", name);
|
mpp_err_f("invalid config name %s\n", name);
|
||||||
return MPP_ERR_VALUE;
|
return MPP_ERR_VALUE;
|
||||||
}
|
}
|
||||||
@@ -135,7 +135,7 @@ MPP_RET mpp_venc_kcfg_init_by_name(MppVencKcfg *cfg, const char *name)
|
|||||||
return obj ? MPP_OK : MPP_NOK;
|
return obj ? MPP_OK : MPP_NOK;
|
||||||
}
|
}
|
||||||
|
|
||||||
MPP_RET mpp_venc_kcfg_deinit(MppVencKcfg cfg)
|
MPP_RET kmpp_venc_cfg_deinit(KmppVenccfg cfg)
|
||||||
{
|
{
|
||||||
KmppObj obj = cfg;
|
KmppObj obj = cfg;
|
||||||
|
|
||||||
@@ -149,8 +149,8 @@ MPP_RET mpp_venc_kcfg_deinit(MppVencKcfg cfg)
|
|||||||
return MPP_OK;
|
return MPP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MPP_VENC_KCFG_ACCESS(set_type, get_type, cfg_type) \
|
#define KMPP_VENC_CFG_ACCESS(set_type, get_type, cfg_type) \
|
||||||
MPP_RET mpp_venc_kcfg_set_##cfg_type(MppVencKcfg cfg, const char *name, set_type val) \
|
MPP_RET kmpp_venc_cfg_set_##cfg_type(KmppVenccfg cfg, const char *name, set_type val) \
|
||||||
{ \
|
{ \
|
||||||
if (!cfg || !name) { \
|
if (!cfg || !name) { \
|
||||||
mpp_err_f("invalid input cfg %p name %p\n", cfg, name); \
|
mpp_err_f("invalid input cfg %p name %p\n", cfg, name); \
|
||||||
@@ -160,7 +160,7 @@ MPP_RET mpp_venc_kcfg_deinit(MppVencKcfg cfg)
|
|||||||
MPP_RET ret = (MPP_RET)kmpp_obj_set_##cfg_type(obj, name, val); \
|
MPP_RET ret = (MPP_RET)kmpp_obj_set_##cfg_type(obj, name, val); \
|
||||||
return ret; \
|
return ret; \
|
||||||
} \
|
} \
|
||||||
MPP_RET mpp_venc_kcfg_get_##cfg_type(MppVencKcfg cfg, const char *name, get_type val) \
|
MPP_RET kmpp_venc_cfg_get_##cfg_type(KmppVenccfg cfg, const char *name, get_type val) \
|
||||||
{ \
|
{ \
|
||||||
if (!cfg || !name) { \
|
if (!cfg || !name) { \
|
||||||
mpp_err_f("invalid input cfg %p name %p\n", cfg, name); \
|
mpp_err_f("invalid input cfg %p name %p\n", cfg, name); \
|
||||||
@@ -171,14 +171,14 @@ MPP_RET mpp_venc_kcfg_deinit(MppVencKcfg cfg)
|
|||||||
return ret; \
|
return ret; \
|
||||||
}
|
}
|
||||||
|
|
||||||
MPP_VENC_KCFG_ACCESS(RK_S32, RK_S32*, s32);
|
KMPP_VENC_CFG_ACCESS(RK_S32, RK_S32*, s32);
|
||||||
MPP_VENC_KCFG_ACCESS(RK_U32, RK_U32*, u32);
|
KMPP_VENC_CFG_ACCESS(RK_U32, RK_U32*, u32);
|
||||||
MPP_VENC_KCFG_ACCESS(RK_S64, RK_S64*, s64);
|
KMPP_VENC_CFG_ACCESS(RK_S64, RK_S64*, s64);
|
||||||
MPP_VENC_KCFG_ACCESS(RK_U64, RK_U64*, u64);
|
KMPP_VENC_CFG_ACCESS(RK_U64, RK_U64*, u64);
|
||||||
MPP_VENC_KCFG_ACCESS(void *, void **, ptr);
|
KMPP_VENC_CFG_ACCESS(void *, void **, ptr);
|
||||||
MPP_VENC_KCFG_ACCESS(void *, void *, st);
|
KMPP_VENC_CFG_ACCESS(void *, void *, st);
|
||||||
|
|
||||||
void mpp_venc_kcfg_show(MppVencKcfg cfg)
|
void kmpp_venc_cfg_show(KmppVenccfg cfg)
|
||||||
{
|
{
|
||||||
KmppObj obj = cfg;
|
KmppObj obj = cfg;
|
||||||
|
|
23
kmpp/base/test/CMakeLists.txt
Normal file
23
kmpp/base/test/CMakeLists.txt
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# vim: syntax=cmake
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# kmpp/base built-in unit test case
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# macro for adding osal sub-module unit test
|
||||||
|
macro(add_kmpp_base_test module)
|
||||||
|
set(test_name ${module}_test)
|
||||||
|
string(TOUPPER ${test_name} test_tag)
|
||||||
|
#message(STATUS "moduule : ${module}")
|
||||||
|
#message(STATUS "test_name : ${test_name}")
|
||||||
|
#message(STATUS "test_tag : ${test_tag}")
|
||||||
|
|
||||||
|
option(${test_tag} "Build base ${module} unit test" ${BUILD_TEST})
|
||||||
|
if(${test_tag})
|
||||||
|
add_executable(${test_name} ${test_name}.c)
|
||||||
|
target_link_libraries(${test_name} ${MPP_SHARED})
|
||||||
|
set_target_properties(${test_name} PROPERTIES FOLDER "osal/test")
|
||||||
|
add_test(NAME ${test_name} COMMAND ${test_name})
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
# kmpp object unit test
|
||||||
|
add_kmpp_base_test(kmpp_obj)
|
@@ -40,7 +40,6 @@ add_subdirectory(hal)
|
|||||||
# add mpp implement
|
# add mpp implement
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
set (MPP_SRC
|
set (MPP_SRC
|
||||||
kmpp.c
|
|
||||||
mpp_info.cpp
|
mpp_info.cpp
|
||||||
mpp.cpp
|
mpp.cpp
|
||||||
mpp_impl.cpp
|
mpp_impl.cpp
|
||||||
@@ -63,7 +62,7 @@ endif()
|
|||||||
|
|
||||||
set_target_properties(${MPP_SHARED} PROPERTIES FOLDER "mpp")
|
set_target_properties(${MPP_SHARED} PROPERTIES FOLDER "mpp")
|
||||||
set_target_properties(${MPP_SHARED} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
set_target_properties(${MPP_SHARED} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
||||||
target_link_libraries(${MPP_SHARED} mpp_codec mpp_hal mpp_vproc
|
target_link_libraries(${MPP_SHARED} mpp_codec mpp_hal mpp_vproc kmpp
|
||||||
${BEGIN_WHOLE_ARCHIVE} mpp_base ${END_WHOLE_ARCHIVE})
|
${BEGIN_WHOLE_ARCHIVE} mpp_base ${END_WHOLE_ARCHIVE})
|
||||||
|
|
||||||
# build static library
|
# build static library
|
||||||
|
@@ -26,8 +26,6 @@ add_library(mpp_base STATIC
|
|||||||
mpp_cfg.cpp
|
mpp_cfg.cpp
|
||||||
mpp_2str.c
|
mpp_2str.c
|
||||||
mpp_dec_hdr_meta.c
|
mpp_dec_hdr_meta.c
|
||||||
kmpp_obj.c
|
|
||||||
mpp_venc_kcfg.c
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(mpp_base PROPERTIES FOLDER "mpp/base")
|
set_target_properties(mpp_base PROPERTIES FOLDER "mpp/base")
|
||||||
|
@@ -55,8 +55,5 @@ add_mpp_base_test(mpp_dec_cfg)
|
|||||||
# mpp_sys_cfg unit test
|
# mpp_sys_cfg unit test
|
||||||
add_mpp_base_test(mpp_sys_cfg)
|
add_mpp_base_test(mpp_sys_cfg)
|
||||||
|
|
||||||
# kmpp_obj unit test
|
|
||||||
add_mpp_base_test(kmpp_obj)
|
|
||||||
|
|
||||||
# mpp_sys_cfgi unit test
|
# mpp_sys_cfgi unit test
|
||||||
add_mpp_base_test(mpp_sys_cfg_st)
|
add_mpp_base_test(mpp_sys_cfg_st)
|
||||||
|
@@ -100,7 +100,7 @@ typedef struct {
|
|||||||
CamSource *cam_ctx;
|
CamSource *cam_ctx;
|
||||||
MppEncRoiCtx roi_ctx;
|
MppEncRoiCtx roi_ctx;
|
||||||
|
|
||||||
MppVencKcfg init_kcfg;
|
KmppVenccfg init_kcfg;
|
||||||
|
|
||||||
// resources
|
// resources
|
||||||
size_t header_size;
|
size_t header_size;
|
||||||
@@ -204,11 +204,11 @@ static RK_S32 get_mdinfo_size(MpiEncTestData *p, MppCodingType type)
|
|||||||
|
|
||||||
static MPP_RET kmpp_cfg_init(MpiEncMultiCtxInfo *info)
|
static MPP_RET kmpp_cfg_init(MpiEncMultiCtxInfo *info)
|
||||||
{
|
{
|
||||||
MppVencKcfg init_kcfg = NULL;
|
KmppVenccfg init_kcfg = NULL;
|
||||||
MpiEncTestData *p = &info->ctx;
|
MpiEncTestData *p = &info->ctx;
|
||||||
MPP_RET ret = MPP_NOK;
|
MPP_RET ret = MPP_NOK;
|
||||||
|
|
||||||
mpp_venc_kcfg_init(&init_kcfg, MPP_VENC_KCFG_TYPE_INIT);
|
kmpp_venc_cfg_init(&init_kcfg, KMPP_VENC_CFG_TYPE_INIT);
|
||||||
if (!init_kcfg) {
|
if (!init_kcfg) {
|
||||||
mpp_err_f("kmpp_venc_init_cfg_init failed\n");
|
mpp_err_f("kmpp_venc_init_cfg_init failed\n");
|
||||||
return ret;
|
return ret;
|
||||||
@@ -216,21 +216,21 @@ static MPP_RET kmpp_cfg_init(MpiEncMultiCtxInfo *info)
|
|||||||
|
|
||||||
p->init_kcfg = init_kcfg;
|
p->init_kcfg = init_kcfg;
|
||||||
|
|
||||||
mpp_venc_kcfg_set_u32(init_kcfg, "type", MPP_CTX_ENC);
|
kmpp_venc_cfg_set_u32(init_kcfg, "type", MPP_CTX_ENC);
|
||||||
mpp_venc_kcfg_set_u32(init_kcfg, "coding", p->type);
|
kmpp_venc_cfg_set_u32(init_kcfg, "coding", p->type);
|
||||||
mpp_venc_kcfg_set_s32(init_kcfg, "chan_id", 0);
|
kmpp_venc_cfg_set_s32(init_kcfg, "chan_id", 0);
|
||||||
mpp_venc_kcfg_set_s32(init_kcfg, "online", 0);
|
kmpp_venc_cfg_set_s32(init_kcfg, "online", 0);
|
||||||
mpp_venc_kcfg_set_u32(init_kcfg, "buf_size", 0);
|
kmpp_venc_cfg_set_u32(init_kcfg, "buf_size", 0);
|
||||||
mpp_venc_kcfg_set_u32(init_kcfg, "max_strm_cnt", 0);
|
kmpp_venc_cfg_set_u32(init_kcfg, "max_strm_cnt", 0);
|
||||||
mpp_venc_kcfg_set_u32(init_kcfg, "shared_buf_en", 0);
|
kmpp_venc_cfg_set_u32(init_kcfg, "shared_buf_en", 0);
|
||||||
mpp_venc_kcfg_set_u32(init_kcfg, "smart_en", 0);
|
kmpp_venc_cfg_set_u32(init_kcfg, "smart_en", 0);
|
||||||
mpp_venc_kcfg_set_u32(init_kcfg, "max_width", p->width);
|
kmpp_venc_cfg_set_u32(init_kcfg, "max_width", p->width);
|
||||||
mpp_venc_kcfg_set_u32(init_kcfg, "max_height", p->height);
|
kmpp_venc_cfg_set_u32(init_kcfg, "max_height", p->height);
|
||||||
mpp_venc_kcfg_set_u32(init_kcfg, "max_lt_cnt", 0);
|
kmpp_venc_cfg_set_u32(init_kcfg, "max_lt_cnt", 0);
|
||||||
mpp_venc_kcfg_set_u32(init_kcfg, "qpmap_en", 0);
|
kmpp_venc_cfg_set_u32(init_kcfg, "qpmap_en", 0);
|
||||||
mpp_venc_kcfg_set_u32(init_kcfg, "chan_dup", 0);
|
kmpp_venc_cfg_set_u32(init_kcfg, "chan_dup", 0);
|
||||||
mpp_venc_kcfg_set_u32(init_kcfg, "tmvp_enable", 0);
|
kmpp_venc_cfg_set_u32(init_kcfg, "tmvp_enable", 0);
|
||||||
mpp_venc_kcfg_set_u32(init_kcfg, "only_smartp", 0);
|
kmpp_venc_cfg_set_u32(init_kcfg, "only_smartp", 0);
|
||||||
|
|
||||||
ret = p->mpi->control(p->ctx, MPP_SET_VENC_INIT_KCFG, init_kcfg);
|
ret = p->mpi->control(p->ctx, MPP_SET_VENC_INIT_KCFG, init_kcfg);
|
||||||
if (ret)
|
if (ret)
|
||||||
@@ -1178,7 +1178,7 @@ MPP_TEST_OUT:
|
|||||||
p->roi_ctx = NULL;
|
p->roi_ctx = NULL;
|
||||||
}
|
}
|
||||||
if (p->init_kcfg)
|
if (p->init_kcfg)
|
||||||
mpp_venc_kcfg_deinit(p->init_kcfg);
|
kmpp_venc_cfg_deinit(p->init_kcfg);
|
||||||
|
|
||||||
test_ctx_deinit(p);
|
test_ctx_deinit(p);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user