mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-04 16:52:40 +08:00
[mpi]: rename mpi_flush to mpi_reset
[h264d]: fix warning on strupr git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@535 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
33
inc/rk_mpi.h
33
inc/rk_mpi.h
@@ -139,12 +139,30 @@ typedef struct MppEncConfig_t {
|
||||
RK_S32 trans8x8_en;
|
||||
} MppEncConfig;
|
||||
|
||||
/*
|
||||
* mpp main work function set
|
||||
* size : MppApi structure size
|
||||
* version : Mpp svn revision
|
||||
*
|
||||
* decode : both send video stream packet to decoder and get video frame from
|
||||
* decoder at the same time.
|
||||
* decode_put_packet: send video stream packet to decoder only, async interface
|
||||
* decode_get_frame : get video frame from decoder only, async interface
|
||||
*
|
||||
* encode : both send video frame to encoder and get encoded video stream from
|
||||
* encoder at the same time.
|
||||
* encode_put_frame : send video frame to encoder only, async interface
|
||||
* encode_get_packet: get encoded video packet from encoder only, async interface
|
||||
*
|
||||
* reset : discard all packet and frame, reset all component,
|
||||
* for both decoder and encoder
|
||||
* control : control function for mpp property setting
|
||||
* config : config function for encoder, not implement yet.
|
||||
*/
|
||||
typedef struct MppApi_t {
|
||||
RK_U32 size;
|
||||
RK_U32 version;
|
||||
|
||||
MPP_RET (*config)(MppCtx ctx, MppEncConfig cfg);
|
||||
|
||||
// sync interface
|
||||
MPP_RET (*decode)(MppCtx ctx, MppPacket packet, MppFrame *frame);
|
||||
MPP_RET (*encode)(MppCtx ctx, MppFrame frame, MppPacket *packet);
|
||||
@@ -156,8 +174,9 @@ typedef struct MppApi_t {
|
||||
MPP_RET (*encode_put_frame)(MppCtx ctx, MppFrame frame);
|
||||
MPP_RET (*encode_get_packet)(MppCtx ctx, MppPacket *packet);
|
||||
|
||||
MPP_RET (*flush)(MppCtx ctx);
|
||||
MPP_RET (*reset)(MppCtx ctx);
|
||||
MPP_RET (*control)(MppCtx ctx, MpiCmd cmd, MppParam param);
|
||||
MPP_RET (*config)(MppCtx ctx, MppEncConfig cfg);
|
||||
|
||||
RK_U32 reserv[16];
|
||||
} MppApi;
|
||||
@@ -168,7 +187,13 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* mpp interface
|
||||
* mpp interface work flow
|
||||
*
|
||||
* 1. mpp_create : Create empty context structure and mpi function pointers.
|
||||
* 2. mpp_init : Call after mpp_create to setup mpp type and video format.
|
||||
* This function will call internal context init function.
|
||||
* 3. Use functions in MppApi to access mpp services.
|
||||
* 4. mpp_destory: Destroy mpp context and free both context and mpi structure
|
||||
*/
|
||||
MPP_RET mpp_create(MppCtx *ctx, MppApi **mpi);
|
||||
MPP_RET mpp_init(MppCtx ctx, MppCtxType type, MppCodingType coding);
|
||||
|
@@ -29,7 +29,7 @@
|
||||
|
||||
#ifndef _WIN32
|
||||
#include <ctype.h>
|
||||
char *strupr(char *str)
|
||||
char *_strupr(char *str)
|
||||
{
|
||||
char *orign=str;
|
||||
for (; *str != '\0'; str++) {
|
||||
@@ -86,7 +86,7 @@ static MPP_RET interpret_user_data_unregistered_info(RK_U8 *payload, RK_S32 size
|
||||
}
|
||||
#endif
|
||||
|
||||
sei_msg->user_data_DivX_flag = strstr(strupr((char *)&payload[16]), "DIVX") ? 1 : 0;
|
||||
sei_msg->user_data_DivX_flag = strstr(_strupr((char *)&payload[16]), "DIVX") ? 1 : 0;
|
||||
if (sei_msg->user_data_DivX_flag) {
|
||||
H264D_ERR("DivX is not supported. \n");
|
||||
sei_msg->p_Dec->err_ctx.err_flag |= VPU_FRAME_ERR_UNSUPPORT;
|
||||
|
@@ -85,8 +85,8 @@ RK_S32 VpuApi::flush(VpuCodecContext *ctx)
|
||||
{
|
||||
(void)ctx;
|
||||
mpp_log_f("in\n");
|
||||
if (mpi && mpi->flush) {
|
||||
mpi->flush(mpp_ctx);
|
||||
if (mpi && mpi->reset) {
|
||||
mpi->reset(mpp_ctx);
|
||||
}
|
||||
mpp_log_f("ok\n");
|
||||
return 0;
|
||||
|
@@ -126,7 +126,7 @@ static MPP_RET mpi_encode_get_packet(MppCtx ctx, MppPacket *packet)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static MPP_RET mpi_flush(MppCtx ctx)
|
||||
static MPP_RET mpi_reset(MppCtx ctx)
|
||||
{
|
||||
MpiImpl *p = (MpiImpl *)ctx;
|
||||
MPP_RET ret = MPP_OK;
|
||||
@@ -150,15 +150,15 @@ static MPP_RET mpi_control(MppCtx ctx, MpiCmd cmd, MppParam param)
|
||||
static MppApi mpp_api = {
|
||||
sizeof(mpp_api),
|
||||
0,
|
||||
mpi_config,
|
||||
mpi_decode,
|
||||
mpi_encode,
|
||||
mpi_decode_put_packet,
|
||||
mpi_decode_get_frame,
|
||||
mpi_encode_put_frame,
|
||||
mpi_encode_get_packet,
|
||||
mpi_flush,
|
||||
mpi_reset,
|
||||
mpi_control,
|
||||
mpi_config,
|
||||
{0},
|
||||
};
|
||||
|
||||
@@ -202,7 +202,6 @@ MPP_RET mpp_create(MppCtx *ctx, MppApi **mpi)
|
||||
return MPP_OK;
|
||||
}
|
||||
|
||||
|
||||
MPP_RET mpp_init(MppCtx ctx, MppCtxType type, MppCodingType coding)
|
||||
{
|
||||
MpiImpl *p = (MpiImpl*)ctx;
|
||||
|
@@ -166,9 +166,9 @@ int mpi_test()
|
||||
}
|
||||
|
||||
|
||||
ret = mpi->flush(ctx);
|
||||
ret = mpi->reset(ctx);
|
||||
if (MPP_OK != ret) {
|
||||
mpp_err("mpi->flush failed\n");
|
||||
mpp_err("mpi->reset failed\n");
|
||||
goto MPP_TEST_FAILED;
|
||||
}
|
||||
|
||||
@@ -247,9 +247,9 @@ int mpi_test()
|
||||
}
|
||||
|
||||
|
||||
ret = mpi->flush(ctx);
|
||||
ret = mpi->reset(ctx);
|
||||
if (MPP_OK != ret) {
|
||||
mpp_err("mpi->flush failed\n");
|
||||
mpp_err("mpi->reset failed\n");
|
||||
goto MPP_TEST_FAILED;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user