[legacy]: Fix for windows simulation compile

Change-Id: I1f3ea32878b194ecaf380f1af5cca33179aa8300
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen 2017-04-07 09:09:09 +08:00
parent 4a1e6c3671
commit 61fb2802d0
3 changed files with 74 additions and 15 deletions

View File

@ -4,8 +4,12 @@ include_directories(.)
# ----------------------------------------------------------------------------
# add mpp implement
# ----------------------------------------------------------------------------
if(RKPLATFORM)
set(RKPLAT_VPU_LEGACY vpu.c)
endif(RKPLATFORM)
set (MPP_LEGACY_SRC
vpu.c
${RKPLAT_VPU_LEGACY}
vpu_api.cpp
vpu_api_legacy.cpp
vpu_mem_legacy.c

View File

@ -16,16 +16,18 @@
#define MODULE_TAG "vpu"
#include "mpp_env.h"
#include "mpp_log.h"
#include "mpp_common.h"
#include "vpu.h"
#ifdef RKPLATFORM
#include <sys/ioctl.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include "mpp_env.h"
#include "mpp_log.h"
#include "vpu.h"
#define VPU_IOC_MAGIC 'l'
@ -232,4 +234,63 @@ RK_S32 VPUClientGetIOMMUStatus()
{
return 1;
}
#else
int VPUClientInit(VPU_CLIENT_TYPE type)
{
(void)type;
return 0;
}
RK_S32 VPUClientRelease(int socket)
{
(void)socket;
return 0;
}
RK_S32 VPUClientSendReg(int socket, RK_U32 *regs, RK_U32 nregs)
{
(void)socket;
(void)regs;
(void)nregs;
return 0;
}
RK_S32 VPUClientSendReg2(RK_S32 socket, RK_S32 offset, RK_S32 size, void *param)
{
(void)socket;
(void)offset;
(void)size;
(void)param;
return 0;
}
RK_S32 VPUClientWaitResult(int socket, RK_U32 *regs, RK_U32 nregs, VPU_CMD_TYPE *cmd, RK_S32 *len)
{
(void)socket;
(void)regs;
(void)nregs;
(void)cmd;
(void)len;
return 0;
}
RK_S32 VPUClientGetHwCfg(int socket, RK_U32 *cfg, RK_U32 cfg_size)
{
(void)socket;
(void)cfg;
(void)cfg_size;
return 0;
}
RK_U32 VPUCheckSupportWidth()
{
return 0;
}
RK_S32 VPUClientGetIOMMUStatus()
{
return 1;
}
#endif

View File

@ -13,13 +13,7 @@ macro(add_mpp_test module)
option(${test_tag} "Build mpp ${module} unit test" ON)
if(${test_tag})
add_executable(${test_name} ${test_name}.c)
# NOTE: use share library on Linux and Android
# use static library for window debug
if(UNIX)
target_link_libraries(${test_name} mpp_shared utils)
else()
target_link_libraries(${test_name} mpp_shared utils)
endif()
target_link_libraries(${test_name} mpp_shared utils)
set_target_properties(${test_name} PROPERTIES FOLDER "test")
#install(TARGETS ${test_name} RUNTIME DESTINATION ${TEST_INSTALL_DIR})
#add_test(NAME ${test_name} COMMAND ${test_name})
@ -54,7 +48,7 @@ macro(add_legacy_test module)
option(${test_tag} "Build legacy ${module} unit test" ON)
if(${test_tag})
add_executable(${test_name} ${test_name}.c)
target_link_libraries(${test_name} mpp_legacy_shared utils)
target_link_libraries(${test_name} mpp_shared mpp_legacy_shared utils)
set_target_properties(${test_name} PROPERTIES FOLDER "test")
#install(TARGETS ${test_name} RUNTIME DESTINATION ${TEST_INSTALL_DIR})
#add_test(NAME ${test_name} COMMAND ${test_name})