[legacy]: update hevc device node name

I also fix a number of compiler warnings in this commmit.
A funtion is forgot to be exported and some functions should not
be exported.

Change-Id: I945456721a7507d448cfa0559418c356c6cb6ace
Signed-off-by: Randy Li <randy.li@rock-chips.com>
This commit is contained in:
Randy Li
2016-11-02 16:45:05 +08:00
committed by Herman Chen
parent bce0f19097
commit ab07acf076
3 changed files with 38 additions and 25 deletions

View File

@@ -429,7 +429,7 @@ RK_S32 VPUMemFlush(VPUMemLinear_t *p);
RK_S32 VPUMemClean(VPUMemLinear_t *p); RK_S32 VPUMemClean(VPUMemLinear_t *p);
RK_S32 VPUMemInvalidate(VPUMemLinear_t *p); RK_S32 VPUMemInvalidate(VPUMemLinear_t *p);
RK_S32 VPUMemGetFD(VPUMemLinear_t *p); RK_S32 VPUMemGetFD(VPUMemLinear_t *p);
RK_S32 VPUMallocLinearFromRender(VPUMemLinear_t *p, RK_U32 size, void *ctx);
/* /*
* vpu memory allocator and manager interface * vpu memory allocator and manager interface

View File

@@ -31,7 +31,8 @@
#include "vpu_api_legacy.h" #include "vpu_api_legacy.h"
#include "vpu_mem_legacy.h" #include "vpu_mem_legacy.h"
static RK_S32 vpu_api_init(VpuCodecContext *ctx, RK_U8 *extraData, RK_U32 extra_size) static RK_S32
vpu_api_init(VpuCodecContext *ctx, RK_U8 *extraData, RK_U32 extra_size)
{ {
vpu_api_dbg_func("vpu_api_init in, extra_size: %d", extra_size); vpu_api_dbg_func("vpu_api_init in, extra_size: %d", extra_size);
@@ -48,7 +49,8 @@ static RK_S32 vpu_api_init(VpuCodecContext *ctx, RK_U8 *extraData, RK_U32 extra_
return api->init(ctx, extraData, extra_size); return api->init(ctx, extraData, extra_size);
} }
static RK_S32 vpu_api_decode(VpuCodecContext *ctx, VideoPacket_t *pkt, DecoderOut_t *aDecOut) static RK_S32
vpu_api_decode(VpuCodecContext *ctx, VideoPacket_t *pkt, DecoderOut_t *aDecOut)
{ {
if (ctx == NULL) { if (ctx == NULL) {
mpp_log("vpu_api_decode fail, input invalid"); mpp_log("vpu_api_decode fail, input invalid");
@@ -95,7 +97,8 @@ static RK_S32 vpu_api_getframe(VpuCodecContext *ctx, DecoderOut_t *aDecOut)
return api->decode_getoutframe(aDecOut); return api->decode_getoutframe(aDecOut);
} }
static RK_S32 vpu_api_sendframe(VpuCodecContext *ctx, EncInputStream_t *aEncInStrm) static RK_S32
vpu_api_sendframe(VpuCodecContext *ctx, EncInputStream_t *aEncInStrm)
{ {
if (ctx == NULL) { if (ctx == NULL) {
mpp_log("vpu_api_decode fail, input invalid"); mpp_log("vpu_api_decode fail, input invalid");
@@ -127,9 +130,9 @@ static RK_S32 vpu_api_getstream(VpuCodecContext *ctx, EncoderOut_t *aEncOut)
return api->encoder_getstream(ctx, aEncOut); return api->encoder_getstream(ctx, aEncOut);
} }
static RK_S32
vpu_api_encode(VpuCodecContext *ctx, EncInputStream_t *aEncInStrm,
static RK_S32 vpu_api_encode(VpuCodecContext *ctx, EncInputStream_t *aEncInStrm, EncoderOut_t *aEncOut) EncoderOut_t *aEncOut)
{ {
if (ctx == NULL) { if (ctx == NULL) {
mpp_log("vpu_api_encode fail, input invalid"); mpp_log("vpu_api_encode fail, input invalid");
@@ -162,7 +165,8 @@ static RK_S32 vpu_api_flush(VpuCodecContext *ctx)
return api->flush(ctx); return api->flush(ctx);
} }
static RK_S32 vpu_api_control(VpuCodecContext *ctx, VPU_API_CMD cmdType, void *param) static RK_S32
vpu_api_control(VpuCodecContext *ctx, VPU_API_CMD cmdType, void *param)
{ {
if (ctx == NULL) { if (ctx == NULL) {
mpp_log("vpu_api_decode fail, input invalid"); mpp_log("vpu_api_decode fail, input invalid");
@@ -178,7 +182,8 @@ static RK_S32 vpu_api_control(VpuCodecContext *ctx, VPU_API_CMD cmdType, void *p
vpu_api_dbg_func("enter\n"); vpu_api_dbg_func("enter\n");
switch (cmdType) { switch (cmdType) {
case VPU_API_SET_VPUMEM_CONTEXT: { case VPU_API_SET_VPUMEM_CONTEXT: {
vpu_display_mem_pool_impl *p_mempool = (vpu_display_mem_pool_impl *)param; vpu_display_mem_pool_impl *p_mempool =
(vpu_display_mem_pool_impl *)param;
param = (void*)p_mempool->group; param = (void*)p_mempool->group;
break; break;
@@ -218,8 +223,10 @@ public:
} }
if (rkapi_hdl) { if (rkapi_hdl) {
rkvpu_open_cxt = (RK_S32 (*)(VpuCodecContext **ctx))dlsym(rkapi_hdl, "vpu_open_context"); rkvpu_open_cxt = (RK_S32 (*)(VpuCodecContext **ctx))
rkvpu_close_cxt = (RK_S32 (*)(VpuCodecContext **ctx))dlsym(rkapi_hdl, "vpu_close_context"); dlsym(rkapi_hdl, "vpu_open_context");
rkvpu_close_cxt = (RK_S32 (*)(VpuCodecContext **ctx))
dlsym(rkapi_hdl, "vpu_close_context");
mpp_log("dlopen vpu lib success\n"); mpp_log("dlopen vpu lib success\n");
} else { } else {
mpp_err("dlopen vpu lib failed\n"); mpp_err("dlopen vpu lib failed\n");
@@ -236,12 +243,12 @@ public:
static VpulibDlsym gVpulib; static VpulibDlsym gVpulib;
RK_S32 check_orign_vpu() static RK_S32 check_orign_vpu()
{ {
return (gVpulib.rkapi_hdl) ? (MPP_OK) : (MPP_NOK); return (gVpulib.rkapi_hdl) ? (MPP_OK) : (MPP_NOK);
} }
RK_S32 open_orign_vpu(VpuCodecContext **ctx) static RK_S32 open_orign_vpu(VpuCodecContext **ctx)
{ {
if (gVpulib.rkvpu_open_cxt && ctx) { if (gVpulib.rkvpu_open_cxt && ctx) {
return (gVpulib.rkvpu_open_cxt)(ctx); return (gVpulib.rkvpu_open_cxt)(ctx);
@@ -249,7 +256,7 @@ RK_S32 open_orign_vpu(VpuCodecContext **ctx)
return MPP_NOK; return MPP_NOK;
} }
RK_S32 close_orign_vpu(VpuCodecContext **ctx) static RK_S32 close_orign_vpu(VpuCodecContext **ctx)
{ {
if (gVpulib.rkvpu_close_cxt && ctx) { if (gVpulib.rkvpu_close_cxt && ctx) {
return (gVpulib.rkvpu_close_cxt)(ctx); return (gVpulib.rkvpu_close_cxt)(ctx);
@@ -317,7 +324,8 @@ RK_S32 vpu_open_context(VpuCodecContext **ctx)
} else if (!!access("/dev/rkvdec", F_OK)) { } else if (!!access("/dev/rkvdec", F_OK)) {
/* if there is no rkvdec it means the platform must be vpu1 */ /* if there is no rkvdec it means the platform must be vpu1 */
if (s && s->videoCoding == OMX_RK_VIDEO_CodingHEVC && if (s && s->videoCoding == OMX_RK_VIDEO_CodingHEVC &&
!access("/dev/hevc_service", F_OK)) { (!access("/dev/hevc-service", F_OK)
|| !access("/dev/hevc_service", F_OK))) {
/* if this is a hevc request and exist hevc_service for decoding use mpp */ /* if this is a hevc request and exist hevc_service for decoding use mpp */
use_mpp = 1; use_mpp = 1;
} else { } else {
@@ -328,13 +336,15 @@ RK_S32 vpu_open_context(VpuCodecContext **ctx)
/* caller is original vpuapi path. Force use original vpuapi path */ /* caller is original vpuapi path. Force use original vpuapi path */
use_mpp = 0; use_mpp = 0;
} else { } else {
if (s->videoCoding == OMX_RK_VIDEO_CodingAVC && s->codecType == CODEC_DECODER && if (s->videoCoding == OMX_RK_VIDEO_CodingAVC
s->width <= 1920 && s->height <= 1088) { && s->codecType == CODEC_DECODER && s->width <= 1920
&& s->height <= 1088) {
/* H.264 smaller than 1080p use original vpuapi library for better error process */ /* H.264 smaller than 1080p use original vpuapi library for better error process */
use_mpp = 0; use_mpp = 0;
} else { } else {
MppCtxType type = (s->codecType == CODEC_DECODER) ? (MPP_CTX_DEC) : MppCtxType type = (s->codecType == CODEC_DECODER) ? (MPP_CTX_DEC) :
(s->codecType == CODEC_ENCODER) ? (MPP_CTX_ENC) : (MPP_CTX_BUTT); (s->codecType == CODEC_ENCODER)
? (MPP_CTX_ENC) : (MPP_CTX_BUTT);
MppCodingType coding = (MppCodingType)s->videoCoding; MppCodingType coding = (MppCodingType)s->videoCoding;
if (MPP_OK == mpp_check_support_format(type, coding)) { if (MPP_OK == mpp_check_support_format(type, coding)) {

View File

@@ -21,7 +21,8 @@
#include "vpu.h" #include "vpu.h"
#include <string.h> #include <string.h>
static RK_S32 commit_memory_handle(vpu_display_mem_pool *p, RK_S32 mem_hdl, RK_S32 size) static RK_S32
commit_memory_handle(vpu_display_mem_pool *p, RK_S32 mem_hdl, RK_S32 size)
{ {
MppBufferInfo info; MppBufferInfo info;
vpu_display_mem_pool_impl *p_mempool = (vpu_display_mem_pool_impl *)p; vpu_display_mem_pool_impl *p_mempool = (vpu_display_mem_pool_impl *)p;
@@ -104,7 +105,8 @@ static RK_S32 reset_vpu_mem_pool(vpu_display_mem_pool *p)
vpu_display_mem_pool* open_vpu_memory_pool() vpu_display_mem_pool* open_vpu_memory_pool()
{ {
vpu_display_mem_pool_impl *p_mempool = mpp_calloc(vpu_display_mem_pool_impl, 1); vpu_display_mem_pool_impl *p_mempool =
mpp_calloc(vpu_display_mem_pool_impl, 1);
if (NULL == p_mempool) { if (NULL == p_mempool) {
return NULL; return NULL;
@@ -133,9 +135,11 @@ void close_vpu_memory_pool(vpu_display_mem_pool *p)
return; return;
} }
int create_vpu_memory_pool_allocator(vpu_display_mem_pool **ipool, int num, int size) int create_vpu_memory_pool_allocator(vpu_display_mem_pool **ipool,
int num, int size)
{ {
vpu_display_mem_pool_impl *p_mempool = mpp_calloc(vpu_display_mem_pool_impl, 1); vpu_display_mem_pool_impl *p_mempool =
mpp_calloc(vpu_display_mem_pool_impl, 1);
if (NULL == p_mempool) { if (NULL == p_mempool) {
return -1; return -1;
} }
@@ -205,7 +209,8 @@ RK_S32 VPUMallocLinearFromRender(VPUMemLinear_t *p, RK_U32 size, void *ctx)
if (ctx == NULL) { if (ctx == NULL) {
return VPUMallocLinear(p, size); return VPUMallocLinear(p, size);
} }
dma_buf = (VPUMemLinear_t *)p_mempool->get_free((vpu_display_mem_pool *)ctx); dma_buf = (VPUMemLinear_t *)
p_mempool->get_free((vpu_display_mem_pool *)ctx);
memset(p, 0, sizeof(VPUMemLinear_t)); memset(p, 0, sizeof(VPUMemLinear_t));
if (dma_buf != NULL) { if (dma_buf != NULL) {
if (dma_buf->size < size) { if (dma_buf->size < size) {
@@ -219,7 +224,6 @@ RK_S32 VPUMallocLinearFromRender(VPUMemLinear_t *p, RK_U32 size, void *ctx)
return -1; return -1;
} }
RK_S32 VPUFreeLinear(VPUMemLinear_t *p) RK_S32 VPUFreeLinear(VPUMemLinear_t *p)
{ {
if (p->offset != NULL) { if (p->offset != NULL) {
@@ -228,7 +232,6 @@ RK_S32 VPUFreeLinear(VPUMemLinear_t *p)
return 0; return 0;
} }
RK_S32 VPUMemDuplicate(VPUMemLinear_t *dst, VPUMemLinear_t *src) RK_S32 VPUMemDuplicate(VPUMemLinear_t *dst, VPUMemLinear_t *src)
{ {
MppBuffer buffer = (MppBuffer)src->offset; MppBuffer buffer = (MppBuffer)src->offset;