mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-04 00:36:23 +08:00
[meta]: modify metadata type and key definition
This is prepare for adding metadata key tree. Change-Id: Ibd8f4a2c820cdeb5c59ade9a0f80d29e803143da Signed-off-by: herman.chen <herman.chen@rock-chips.com>
This commit is contained in:
@@ -45,27 +45,44 @@ typedef enum MppMetaDataType_e {
|
|||||||
* mpp meta data of data flow
|
* mpp meta data of data flow
|
||||||
* reference counter will be used for these meta data type
|
* reference counter will be used for these meta data type
|
||||||
*/
|
*/
|
||||||
MPP_META_TYPE_FRAME = 'mfrm',
|
TYPE_FRAME = 'mfrm',
|
||||||
MPP_META_TYPE_PACKET = 'mpkt',
|
TYPE_PACKET = 'mpkt',
|
||||||
MPP_META_TYPE_BUFFER = 'mbuf',
|
TYPE_BUFFER = 'mbuf',
|
||||||
|
|
||||||
/* mpp meta data of normal data type */
|
/* mpp meta data of normal data type */
|
||||||
MPP_META_TYPE_S32 = 's32 ',
|
TYPE_S32 = 's32 ',
|
||||||
MPP_META_TYPE_S64 = 's64 ',
|
TYPE_S64 = 's64 ',
|
||||||
MPP_META_TYPE_PTR = 'ptr ',
|
TYPE_PTR = 'ptr ',
|
||||||
} MppMetaType;
|
} MppMetaType;
|
||||||
|
|
||||||
typedef enum MppMetaKey_e {
|
typedef enum MppMetaKey_e {
|
||||||
MPP_META_KEY_INPUT_FRM = 'ifrm',
|
/* data flow key */
|
||||||
MPP_META_KEY_INPUT_PKT = 'ipkt',
|
KEY_INPUT_FRAME = 'ifrm',
|
||||||
MPP_META_KEY_OUTPUT_FRM = 'ofrm',
|
KEY_INPUT_PACKET = 'ipkt',
|
||||||
MPP_META_KEY_OUTPUT_PKT = 'opkt',
|
KEY_OUTPUT_FRAME = 'ofrm',
|
||||||
MPP_META_KEY_MOTION_INFO = 'mvif', /* output motion information for motion detection */
|
KEY_OUTPUT_PACKET = 'opkt',
|
||||||
|
KEY_MOTION_INFO = 'mvif', /* output motion information for motion detection */
|
||||||
|
|
||||||
MPP_META_KEY_INPUT_BLOCK = 'iblk',
|
/* flow control key */
|
||||||
MPP_META_KEY_OUTPUT_BLOCK = 'oblk',
|
KEY_INPUT_BLOCK = 'iblk',
|
||||||
MPP_META_KEY_INPUT_IDR_REQ = 'iidr', /* input idr frame request flag */
|
KEY_OUTPUT_BLOCK = 'oblk',
|
||||||
MPP_META_KEY_OUTPUT_INTRA = 'oidr', /* output intra frame indicator */
|
KEY_INPUT_IDR_REQ = 'iidr', /* input idr frame request flag */
|
||||||
|
KEY_OUTPUT_INTRA = 'oidr', /* output intra frame indicator */
|
||||||
|
|
||||||
|
/* flow control key */
|
||||||
|
KEY_WIDTH = 'wdth',
|
||||||
|
KEY_HEIGHT = 'hght',
|
||||||
|
KEY_BITRATE = 'bps ',
|
||||||
|
KEY_BITRATE_UP = 'bpsu',
|
||||||
|
KEY_BITRATE_LOW = 'bpsl',
|
||||||
|
KEY_INPUT_FPS = 'ifps',
|
||||||
|
KEY_OUTPUT_FPS = 'ofps',
|
||||||
|
KEY_GOP = 'gop ',
|
||||||
|
KEY_QP = 'qp ',
|
||||||
|
KEY_QP_MIN = 'qmin',
|
||||||
|
KEY_QP_MAX = 'qmax',
|
||||||
|
KEY_QP_DIFF_RANGE = 'qdif',
|
||||||
|
KEY_RC_MODE = 'rcmo',
|
||||||
} MppMetaKey;
|
} MppMetaKey;
|
||||||
|
|
||||||
typedef void* MppMeta;
|
typedef void* MppMeta;
|
||||||
|
@@ -63,14 +63,14 @@ typedef struct MppMetaNode_t {
|
|||||||
static MppMetaDef meta_defs[] = {
|
static MppMetaDef meta_defs[] = {
|
||||||
/* categorized by type */
|
/* categorized by type */
|
||||||
/* data flow type */
|
/* data flow type */
|
||||||
{ MPP_META_KEY_INPUT_FRM, MPP_META_TYPE_FRAME, },
|
{ KEY_INPUT_FRAME, TYPE_FRAME, },
|
||||||
{ MPP_META_KEY_OUTPUT_FRM, MPP_META_TYPE_FRAME, },
|
{ KEY_OUTPUT_FRAME, TYPE_FRAME, },
|
||||||
{ MPP_META_KEY_INPUT_PKT, MPP_META_TYPE_PACKET, },
|
{ KEY_INPUT_PACKET, TYPE_PACKET, },
|
||||||
{ MPP_META_KEY_OUTPUT_PKT, MPP_META_TYPE_PACKET, },
|
{ KEY_OUTPUT_PACKET, TYPE_PACKET, },
|
||||||
{ MPP_META_KEY_MOTION_INFO, MPP_META_TYPE_BUFFER, }, /* buffer for motion detection */
|
{ KEY_MOTION_INFO, TYPE_BUFFER, }, /* buffer for motion detection */
|
||||||
|
|
||||||
{ MPP_META_KEY_INPUT_BLOCK, MPP_META_TYPE_S32, },
|
{ KEY_INPUT_BLOCK, TYPE_S32, },
|
||||||
{ MPP_META_KEY_OUTPUT_BLOCK, MPP_META_TYPE_S32, },
|
{ KEY_OUTPUT_BLOCK, TYPE_S32, },
|
||||||
};
|
};
|
||||||
|
|
||||||
class MppMetaService
|
class MppMetaService
|
||||||
@@ -242,13 +242,13 @@ void MppMetaService::put_node(MppMetaNode *node)
|
|||||||
node_count--;
|
node_count--;
|
||||||
// TODO: may be we need to release MppFrame / MppPacket / MppBuffer here
|
// TODO: may be we need to release MppFrame / MppPacket / MppBuffer here
|
||||||
switch (meta_defs[node->type_id].type) {
|
switch (meta_defs[node->type_id].type) {
|
||||||
case MPP_META_TYPE_FRAME : {
|
case TYPE_FRAME : {
|
||||||
// mpp_frame_deinit(&node->val.frame);
|
// mpp_frame_deinit(&node->val.frame);
|
||||||
} break;
|
} break;
|
||||||
case MPP_META_TYPE_PACKET : {
|
case TYPE_PACKET : {
|
||||||
// mpp_packet_deinit(&node->val.packet);
|
// mpp_packet_deinit(&node->val.packet);
|
||||||
} break;
|
} break;
|
||||||
case MPP_META_TYPE_BUFFER : {
|
case TYPE_BUFFER : {
|
||||||
//mpp_buffer_put(node->val.buffer);
|
//mpp_buffer_put(node->val.buffer);
|
||||||
} break;
|
} break;
|
||||||
default : {
|
default : {
|
||||||
@@ -330,7 +330,7 @@ MPP_RET mpp_meta_set_s32(MppMeta meta, MppMetaKey key, RK_S32 val)
|
|||||||
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
||||||
MppMetaVal meta_val;
|
MppMetaVal meta_val;
|
||||||
meta_val.val_s32 = val;
|
meta_val.val_s32 = val;
|
||||||
return set_val_by_key(impl, key, MPP_META_TYPE_S32, &meta_val);
|
return set_val_by_key(impl, key, TYPE_S32, &meta_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
MPP_RET mpp_meta_set_s64(MppMeta meta, MppMetaKey key, RK_S64 val)
|
MPP_RET mpp_meta_set_s64(MppMeta meta, MppMetaKey key, RK_S64 val)
|
||||||
@@ -343,7 +343,7 @@ MPP_RET mpp_meta_set_s64(MppMeta meta, MppMetaKey key, RK_S64 val)
|
|||||||
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
||||||
MppMetaVal meta_val;
|
MppMetaVal meta_val;
|
||||||
meta_val.val_s64 = val;
|
meta_val.val_s64 = val;
|
||||||
return set_val_by_key(impl, key, MPP_META_TYPE_S64, &meta_val);
|
return set_val_by_key(impl, key, TYPE_S64, &meta_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
MPP_RET mpp_meta_set_ptr(MppMeta meta, MppMetaKey key, void *val)
|
MPP_RET mpp_meta_set_ptr(MppMeta meta, MppMetaKey key, void *val)
|
||||||
@@ -356,7 +356,7 @@ MPP_RET mpp_meta_set_ptr(MppMeta meta, MppMetaKey key, void *val)
|
|||||||
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
||||||
MppMetaVal meta_val;
|
MppMetaVal meta_val;
|
||||||
meta_val.val_ptr = val;
|
meta_val.val_ptr = val;
|
||||||
return set_val_by_key(impl, key, MPP_META_TYPE_PTR, &meta_val);
|
return set_val_by_key(impl, key, TYPE_PTR, &meta_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
MPP_RET mpp_meta_get_s32(MppMeta meta, MppMetaKey key, RK_S32 *val)
|
MPP_RET mpp_meta_get_s32(MppMeta meta, MppMetaKey key, RK_S32 *val)
|
||||||
@@ -368,7 +368,7 @@ MPP_RET mpp_meta_get_s32(MppMeta meta, MppMetaKey key, RK_S32 *val)
|
|||||||
|
|
||||||
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
||||||
MppMetaVal meta_val;
|
MppMetaVal meta_val;
|
||||||
MPP_RET ret = get_val_by_key(impl, key, MPP_META_TYPE_S32, &meta_val);
|
MPP_RET ret = get_val_by_key(impl, key, TYPE_S32, &meta_val);
|
||||||
if (MPP_OK == ret)
|
if (MPP_OK == ret)
|
||||||
*val = meta_val.val_s32;
|
*val = meta_val.val_s32;
|
||||||
|
|
||||||
@@ -384,7 +384,7 @@ MPP_RET mpp_meta_get_s64(MppMeta meta, MppMetaKey key, RK_S64 *val)
|
|||||||
|
|
||||||
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
||||||
MppMetaVal meta_val;
|
MppMetaVal meta_val;
|
||||||
MPP_RET ret = get_val_by_key(impl, key, MPP_META_TYPE_S64, &meta_val);
|
MPP_RET ret = get_val_by_key(impl, key, TYPE_S64, &meta_val);
|
||||||
if (MPP_OK == ret)
|
if (MPP_OK == ret)
|
||||||
*val = meta_val.val_s64;
|
*val = meta_val.val_s64;
|
||||||
|
|
||||||
@@ -400,7 +400,7 @@ MPP_RET mpp_meta_get_ptr(MppMeta meta, MppMetaKey key, void **val)
|
|||||||
|
|
||||||
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
||||||
MppMetaVal meta_val;
|
MppMetaVal meta_val;
|
||||||
MPP_RET ret = get_val_by_key(impl, key, MPP_META_TYPE_PTR, &meta_val);
|
MPP_RET ret = get_val_by_key(impl, key, TYPE_PTR, &meta_val);
|
||||||
if (MPP_OK == ret)
|
if (MPP_OK == ret)
|
||||||
*val = meta_val.val_ptr;
|
*val = meta_val.val_ptr;
|
||||||
|
|
||||||
@@ -417,7 +417,7 @@ MPP_RET mpp_meta_set_frame(MppMeta meta, MppMetaKey key, MppFrame frame)
|
|||||||
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
||||||
MppMetaVal meta_val;
|
MppMetaVal meta_val;
|
||||||
meta_val.frame = frame;
|
meta_val.frame = frame;
|
||||||
return set_val_by_key(impl, key, MPP_META_TYPE_FRAME, &meta_val);
|
return set_val_by_key(impl, key, TYPE_FRAME, &meta_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
MPP_RET mpp_meta_set_packet(MppMeta meta, MppMetaKey key, MppPacket packet)
|
MPP_RET mpp_meta_set_packet(MppMeta meta, MppMetaKey key, MppPacket packet)
|
||||||
@@ -430,7 +430,7 @@ MPP_RET mpp_meta_set_packet(MppMeta meta, MppMetaKey key, MppPacket packet)
|
|||||||
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
||||||
MppMetaVal meta_val;
|
MppMetaVal meta_val;
|
||||||
meta_val.packet = packet;
|
meta_val.packet = packet;
|
||||||
return set_val_by_key(impl, key, MPP_META_TYPE_PACKET, &meta_val);
|
return set_val_by_key(impl, key, TYPE_PACKET, &meta_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
MPP_RET mpp_meta_set_buffer(MppMeta meta, MppMetaKey key, MppBuffer buffer)
|
MPP_RET mpp_meta_set_buffer(MppMeta meta, MppMetaKey key, MppBuffer buffer)
|
||||||
@@ -443,7 +443,7 @@ MPP_RET mpp_meta_set_buffer(MppMeta meta, MppMetaKey key, MppBuffer buffer)
|
|||||||
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
||||||
MppMetaVal meta_val;
|
MppMetaVal meta_val;
|
||||||
meta_val.buffer = buffer;
|
meta_val.buffer = buffer;
|
||||||
return set_val_by_key(impl, key, MPP_META_TYPE_BUFFER, &meta_val);
|
return set_val_by_key(impl, key, TYPE_BUFFER, &meta_val);
|
||||||
}
|
}
|
||||||
|
|
||||||
MPP_RET mpp_meta_get_frame(MppMeta meta, MppMetaKey key, MppFrame *frame)
|
MPP_RET mpp_meta_get_frame(MppMeta meta, MppMetaKey key, MppFrame *frame)
|
||||||
@@ -455,7 +455,7 @@ MPP_RET mpp_meta_get_frame(MppMeta meta, MppMetaKey key, MppFrame *frame)
|
|||||||
|
|
||||||
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
||||||
MppMetaVal meta_val;
|
MppMetaVal meta_val;
|
||||||
MPP_RET ret = get_val_by_key(impl, key, MPP_META_TYPE_FRAME, &meta_val);
|
MPP_RET ret = get_val_by_key(impl, key, TYPE_FRAME, &meta_val);
|
||||||
if (MPP_OK == ret)
|
if (MPP_OK == ret)
|
||||||
*frame = meta_val.frame;
|
*frame = meta_val.frame;
|
||||||
|
|
||||||
@@ -471,7 +471,7 @@ MPP_RET mpp_meta_get_packet(MppMeta meta, MppMetaKey key, MppPacket *packet)
|
|||||||
|
|
||||||
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
||||||
MppMetaVal meta_val;
|
MppMetaVal meta_val;
|
||||||
MPP_RET ret = get_val_by_key(impl, key, MPP_META_TYPE_PACKET, &meta_val);
|
MPP_RET ret = get_val_by_key(impl, key, TYPE_PACKET, &meta_val);
|
||||||
if (MPP_OK == ret)
|
if (MPP_OK == ret)
|
||||||
*packet = meta_val.packet;
|
*packet = meta_val.packet;
|
||||||
|
|
||||||
@@ -487,7 +487,7 @@ MPP_RET mpp_meta_get_buffer(MppMeta meta, MppMetaKey key, MppBuffer *buffer)
|
|||||||
|
|
||||||
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
MppMetaImpl *impl = (MppMetaImpl *)meta;
|
||||||
MppMetaVal meta_val;
|
MppMetaVal meta_val;
|
||||||
MPP_RET ret = get_val_by_key(impl, key, MPP_META_TYPE_BUFFER, &meta_val);
|
MPP_RET ret = get_val_by_key(impl, key, TYPE_BUFFER, &meta_val);
|
||||||
if (MPP_OK == ret)
|
if (MPP_OK == ret)
|
||||||
*buffer = meta_val.buffer;
|
*buffer = meta_val.buffer;
|
||||||
|
|
||||||
|
@@ -48,12 +48,12 @@ static MPP_RET release_task_in_port(MppPort port)
|
|||||||
if (mpp_task) {
|
if (mpp_task) {
|
||||||
packet = NULL;
|
packet = NULL;
|
||||||
frame = NULL;
|
frame = NULL;
|
||||||
ret = mpp_task_meta_get_frame(mpp_task, MPP_META_KEY_INPUT_FRM, &frame);
|
ret = mpp_task_meta_get_frame(mpp_task, KEY_INPUT_FRAME, &frame);
|
||||||
if (frame) {
|
if (frame) {
|
||||||
mpp_frame_deinit(&frame);
|
mpp_frame_deinit(&frame);
|
||||||
frame = NULL;
|
frame = NULL;
|
||||||
}
|
}
|
||||||
ret = mpp_task_meta_get_packet(mpp_task, MPP_META_KEY_OUTPUT_PKT, &packet);
|
ret = mpp_task_meta_get_packet(mpp_task, KEY_OUTPUT_PACKET, &packet);
|
||||||
if (packet) {
|
if (packet) {
|
||||||
mpp_packet_deinit(&packet);
|
mpp_packet_deinit(&packet);
|
||||||
packet = NULL;
|
packet = NULL;
|
||||||
@@ -93,8 +93,8 @@ void *mpp_enc_control_thread(void *data)
|
|||||||
thd_enc->unlock();
|
thd_enc->unlock();
|
||||||
|
|
||||||
if (mpp_task != NULL) {
|
if (mpp_task != NULL) {
|
||||||
mpp_task_meta_get_frame (mpp_task, MPP_META_KEY_INPUT_FRM, &frame);
|
mpp_task_meta_get_frame (mpp_task, KEY_INPUT_FRAME, &frame);
|
||||||
mpp_task_meta_get_packet(mpp_task, MPP_META_KEY_OUTPUT_PKT, &packet);
|
mpp_task_meta_get_packet(mpp_task, KEY_OUTPUT_PACKET, &packet);
|
||||||
|
|
||||||
if (NULL == frame) {
|
if (NULL == frame) {
|
||||||
mpp_port_enqueue(input, mpp_task);
|
mpp_port_enqueue(input, mpp_task);
|
||||||
@@ -149,19 +149,19 @@ void *mpp_enc_control_thread(void *data)
|
|||||||
* then enqueue task back to input port
|
* then enqueue task back to input port
|
||||||
* final user will release the mpp_frame they had input
|
* final user will release the mpp_frame they had input
|
||||||
*/
|
*/
|
||||||
mpp_task_meta_set_frame(mpp_task, MPP_META_KEY_INPUT_FRM, frame);
|
mpp_task_meta_set_frame(mpp_task, KEY_INPUT_FRAME, frame);
|
||||||
mpp_port_enqueue(input, mpp_task);
|
mpp_port_enqueue(input, mpp_task);
|
||||||
mpp_task = NULL;
|
mpp_task = NULL;
|
||||||
|
|
||||||
// send finished task to output port
|
// send finished task to output port
|
||||||
mpp_port_dequeue(output, &mpp_task);
|
mpp_port_dequeue(output, &mpp_task);
|
||||||
mpp_task_meta_set_packet(mpp_task, MPP_META_KEY_OUTPUT_PKT, packet);
|
mpp_task_meta_set_packet(mpp_task, KEY_OUTPUT_PACKET, packet);
|
||||||
|
|
||||||
{
|
{
|
||||||
RK_S32 is_intra = enc_task->is_intra;
|
RK_S32 is_intra = enc_task->is_intra;
|
||||||
RK_U32 flag = mpp_packet_get_flag(packet);
|
RK_U32 flag = mpp_packet_get_flag(packet);
|
||||||
|
|
||||||
mpp_task_meta_set_s32(mpp_task, MPP_META_KEY_OUTPUT_INTRA, is_intra);
|
mpp_task_meta_set_s32(mpp_task, KEY_OUTPUT_INTRA, is_intra);
|
||||||
if (is_intra) {
|
if (is_intra) {
|
||||||
mpp_packet_set_flag(packet, flag | MPP_PACKET_FLAG_INTRA);
|
mpp_packet_set_flag(packet, flag | MPP_PACKET_FLAG_INTRA);
|
||||||
}
|
}
|
||||||
|
@@ -670,8 +670,8 @@ RK_S32 VpuApiLegacy::encode(VpuCodecContext *ctx, EncInputStream_t *aEncInStrm,
|
|||||||
break;
|
break;
|
||||||
} while (1);
|
} while (1);
|
||||||
|
|
||||||
mpp_task_meta_set_frame (task, MPP_META_KEY_INPUT_FRM, frame);
|
mpp_task_meta_set_frame (task, KEY_INPUT_FRAME, frame);
|
||||||
mpp_task_meta_set_packet(task, MPP_META_KEY_OUTPUT_PKT, packet);
|
mpp_task_meta_set_packet(task, KEY_OUTPUT_PACKET, packet);
|
||||||
|
|
||||||
if (mpi != NULL) {
|
if (mpi != NULL) {
|
||||||
ret = mpi->enqueue(mpp_ctx, MPP_PORT_INPUT, task);
|
ret = mpi->enqueue(mpp_ctx, MPP_PORT_INPUT, task);
|
||||||
@@ -692,7 +692,7 @@ RK_S32 VpuApiLegacy::encode(VpuCodecContext *ctx, EncInputStream_t *aEncInStrm,
|
|||||||
MppFrame frame_out = NULL;
|
MppFrame frame_out = NULL;
|
||||||
MppFrame packet_out = NULL;
|
MppFrame packet_out = NULL;
|
||||||
|
|
||||||
mpp_task_meta_get_packet(task, MPP_META_KEY_OUTPUT_PKT, &packet_out);
|
mpp_task_meta_get_packet(task, KEY_OUTPUT_PACKET, &packet_out);
|
||||||
|
|
||||||
mpp_assert(packet_out == packet);
|
mpp_assert(packet_out == packet);
|
||||||
vpu_api_dbg_func("encoded frame %d\n", frame_count);
|
vpu_api_dbg_func("encoded frame %d\n", frame_count);
|
||||||
@@ -712,7 +712,7 @@ RK_S32 VpuApiLegacy::encode(VpuCodecContext *ctx, EncInputStream_t *aEncInStrm,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
mpp_assert(task);
|
mpp_assert(task);
|
||||||
ret = mpp_task_meta_get_frame(task, MPP_META_KEY_INPUT_FRM, &frame_out);
|
ret = mpp_task_meta_get_frame(task, KEY_INPUT_FRAME, &frame_out);
|
||||||
mpp_assert(frame_out == frame);
|
mpp_assert(frame_out == frame);
|
||||||
ret = mpi->enqueue(mpp_ctx, MPP_PORT_INPUT, task);
|
ret = mpi->enqueue(mpp_ctx, MPP_PORT_INPUT, task);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
@@ -303,7 +303,7 @@ MPP_RET Mpp::put_frame(MppFrame frame)
|
|||||||
|
|
||||||
mpp_assert(task);
|
mpp_assert(task);
|
||||||
|
|
||||||
ret = mpp_task_meta_set_frame(task, MPP_META_KEY_INPUT_FRM, frame);
|
ret = mpp_task_meta_set_frame(task, KEY_INPUT_FRAME, frame);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
mpp_log_f("failed to set input frame to task ret %d\n", ret);
|
mpp_log_f("failed to set input frame to task ret %d\n", ret);
|
||||||
break;
|
break;
|
||||||
@@ -327,7 +327,7 @@ MPP_RET Mpp::put_frame(MppFrame frame)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mpp_assert(task);
|
mpp_assert(task);
|
||||||
ret = mpp_task_meta_get_frame(task, MPP_META_KEY_INPUT_FRM, &frame);
|
ret = mpp_task_meta_get_frame(task, KEY_INPUT_FRAME, &frame);
|
||||||
if (frame) {
|
if (frame) {
|
||||||
mpp_frame_deinit(&frame);
|
mpp_frame_deinit(&frame);
|
||||||
frame = NULL;
|
frame = NULL;
|
||||||
@@ -371,7 +371,7 @@ MPP_RET Mpp::get_packet(MppPacket *packet)
|
|||||||
|
|
||||||
mpp_assert(task);
|
mpp_assert(task);
|
||||||
|
|
||||||
ret = mpp_task_meta_get_packet(task, MPP_META_KEY_OUTPUT_PKT, packet);
|
ret = mpp_task_meta_get_packet(task, KEY_OUTPUT_PACKET, packet);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
mpp_log_f("failed to get output packet from task ret %d\n", ret);
|
mpp_log_f("failed to get output packet from task ret %d\n", ret);
|
||||||
break;
|
break;
|
||||||
|
@@ -310,7 +310,7 @@ int mpi_enc_test(MpiEncTestCmd *cmd)
|
|||||||
} else {
|
} else {
|
||||||
MppFrame frame_out = NULL;
|
MppFrame frame_out = NULL;
|
||||||
|
|
||||||
mpp_task_meta_get_frame (task, MPP_META_KEY_INPUT_FRM, &frame_out);
|
mpp_task_meta_get_frame (task, KEY_INPUT_FRAME, &frame_out);
|
||||||
if (frame_out)
|
if (frame_out)
|
||||||
mpp_assert(frame_out == frame);
|
mpp_assert(frame_out == frame);
|
||||||
|
|
||||||
@@ -319,8 +319,8 @@ int mpi_enc_test(MpiEncTestCmd *cmd)
|
|||||||
} while (1);
|
} while (1);
|
||||||
|
|
||||||
|
|
||||||
mpp_task_meta_set_frame (task, MPP_META_KEY_INPUT_FRM, frame);
|
mpp_task_meta_set_frame (task, KEY_INPUT_FRAME, frame);
|
||||||
mpp_task_meta_set_packet(task, MPP_META_KEY_OUTPUT_PKT, packet);
|
mpp_task_meta_set_packet(task, KEY_OUTPUT_PACKET, packet);
|
||||||
|
|
||||||
ret = mpi->enqueue(ctx, MPP_PORT_INPUT, task);
|
ret = mpi->enqueue(ctx, MPP_PORT_INPUT, task);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
@@ -340,7 +340,7 @@ int mpi_enc_test(MpiEncTestCmd *cmd)
|
|||||||
if (task) {
|
if (task) {
|
||||||
MppFrame packet_out = NULL;
|
MppFrame packet_out = NULL;
|
||||||
|
|
||||||
mpp_task_meta_get_packet(task, MPP_META_KEY_OUTPUT_PKT, &packet_out);
|
mpp_task_meta_get_packet(task, KEY_OUTPUT_PACKET, &packet_out);
|
||||||
|
|
||||||
mpp_assert(packet_out == packet);
|
mpp_assert(packet_out == packet);
|
||||||
if (packet) {
|
if (packet) {
|
||||||
|
Reference in New Issue
Block a user