mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-11-02 05:24:15 +08:00
[buf_slot]: remove mpp_buf_slot_set_display
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@328 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
@@ -166,7 +166,7 @@ MPP_RET dummy_dec_prepare(void *dec, MppPacket pkt, HalDecTask *task)
|
||||
/*
|
||||
* update dpb status assuming that hw has decoded the frame
|
||||
*/
|
||||
mpp_buf_slot_set_display(slots, output);
|
||||
mpp_buf_slot_enqueue(slots, output, QUEUE_DISPLAY);
|
||||
|
||||
// add new reference buffer
|
||||
if (mpp_packet_get_eos(pkt)) {
|
||||
|
||||
@@ -1342,7 +1342,7 @@ static RK_S32 mpp_hevc_output_frame(void *ctx, int flush)
|
||||
frame->flags &= ~(HEVC_FRAME_FLAG_OUTPUT);
|
||||
s->output_frame_idx = min_idx;
|
||||
|
||||
mpp_buf_slot_set_display(s->slots, frame->slot_index);
|
||||
mpp_buf_slot_enqueue(s->slots, frame->slot_index, QUEUE_DISPLAY);
|
||||
|
||||
h265d_dbg(H265D_DBG_REF,
|
||||
"Output frame with POC %d frame->slot_index = %d\n", frame->poc, frame->slot_index);
|
||||
|
||||
@@ -197,7 +197,6 @@ MppBuffer mpp_buf_slot_get_buffer(MppBufSlots slots, RK_U32 index);
|
||||
MPP_RET mpp_buf_slot_set_frame(MppBufSlots slots, RK_U32 index, MppFrame frame);
|
||||
MppFrame mpp_buf_slot_get_frame(MppBufSlots slots, RK_U32 index);
|
||||
|
||||
MPP_RET mpp_buf_slot_set_display(MppBufSlots slots, RK_U32 index);
|
||||
MPP_RET mpp_buf_slot_get_display(MppBufSlots slots, MppFrame *frame);
|
||||
|
||||
|
||||
@@ -234,8 +233,8 @@ typedef enum SlotQueueType_e {
|
||||
QUEUE_BUTT,
|
||||
} SlotQueueType;
|
||||
|
||||
MPP_RET mpp_buf_slot_enqueue(MppBufSlots slots, SlotQueueType type, RK_U32 index);
|
||||
MPP_RET mpp_buf_slot_dequeue(MppBufSlots slots, SlotQueueType type, RK_U32 *index);
|
||||
MPP_RET mpp_buf_slot_enqueue(MppBufSlots slots, RK_U32 index, SlotQueueType type);
|
||||
MPP_RET mpp_buf_slot_dequeue(MppBufSlots slots, RK_U32 *index, SlotQueueType type);
|
||||
|
||||
typedef enum SlotPropType_e {
|
||||
SLOT_EOS,
|
||||
|
||||
@@ -56,6 +56,8 @@ typedef struct MppBufSlotsImpl_t MppBufSlotsImpl;
|
||||
typedef enum MppBufSlotOps_e {
|
||||
// status opertaion
|
||||
SLOT_INIT,
|
||||
SLOT_SET_ON_USE,
|
||||
SLOT_CLR_ON_USE,
|
||||
SLOT_SET_NOT_READY,
|
||||
SLOT_CLR_NOT_READY,
|
||||
SLOT_SET_CODEC_READY,
|
||||
@@ -82,6 +84,8 @@ typedef enum MppBufSlotOps_e {
|
||||
|
||||
static const char op_string[][16] = {
|
||||
"init ",
|
||||
"set on use ",
|
||||
"clr on use ",
|
||||
"set not ready ",
|
||||
"set ready ",
|
||||
"set codec ready",
|
||||
@@ -511,25 +515,6 @@ MPP_RET mpp_buf_slot_clr_dpb_ref(MppBufSlots slots, RK_U32 index)
|
||||
return MPP_OK;
|
||||
}
|
||||
|
||||
MPP_RET mpp_buf_slot_set_display(MppBufSlots slots, RK_U32 index)
|
||||
{
|
||||
if (NULL == slots) {
|
||||
mpp_err_f("found NULL input\n");
|
||||
return MPP_ERR_NULL_PTR;
|
||||
}
|
||||
|
||||
MppBufSlotsImpl *impl = (MppBufSlotsImpl *)slots;
|
||||
Mutex::Autolock auto_lock(impl->lock);
|
||||
slot_assert(impl, index < impl->count);
|
||||
MppBufSlotEntry *slot = &impl->slots[index];
|
||||
slot_ops_with_log(impl->logs, slot, SLOT_ENQUEUE);
|
||||
|
||||
// add slot to display list
|
||||
list_del_init(&slot->list);
|
||||
list_add_tail(&slot->list, &impl->queue[QUEUE_DISPLAY]);
|
||||
return MPP_OK;
|
||||
}
|
||||
|
||||
MPP_RET mpp_buf_slot_set_hw_use(MppBufSlots slots, RK_U32 index)
|
||||
{
|
||||
if (NULL == slots) {
|
||||
@@ -739,9 +724,10 @@ MPP_RET mpp_buf_slot_get_idle(MppBufSlots slots, RK_U32 *index)
|
||||
}
|
||||
|
||||
static const MppBufSlotOps set_flag_op[SLOT_USAGE_BUTT] = {
|
||||
SLOT_SET_CODEC_READY,
|
||||
SLOT_SET_CODEC_USE,
|
||||
SLOT_SET_HAL_INPUT,
|
||||
SLOT_SET_HAL_OUTPUT,
|
||||
SLOT_SET_CODEC_USE,
|
||||
};
|
||||
|
||||
MPP_RET mpp_buf_slot_set_flag(MppBufSlots slots, RK_U32 index, SlotUsageType type)
|
||||
@@ -759,9 +745,10 @@ MPP_RET mpp_buf_slot_set_flag(MppBufSlots slots, RK_U32 index, SlotUsageType typ
|
||||
}
|
||||
|
||||
static const MppBufSlotOps clr_flag_op[SLOT_USAGE_BUTT] = {
|
||||
SLOT_CLR_CODEC_READY,
|
||||
SLOT_CLR_CODEC_USE,
|
||||
SLOT_CLR_HAL_INPUT,
|
||||
SLOT_CLR_HAL_OUTPUT,
|
||||
SLOT_CLR_CODEC_USE,
|
||||
};
|
||||
|
||||
MPP_RET mpp_buf_slot_clr_flag(MppBufSlots slots, RK_U32 index, SlotUsageType type)
|
||||
@@ -778,7 +765,7 @@ MPP_RET mpp_buf_slot_clr_flag(MppBufSlots slots, RK_U32 index, SlotUsageType typ
|
||||
return MPP_OK;
|
||||
}
|
||||
|
||||
MPP_RET mpp_buf_slot_enqueue(MppBufSlots slots, SlotQueueType type, RK_U32 index)
|
||||
MPP_RET mpp_buf_slot_enqueue(MppBufSlots slots, RK_U32 index, SlotQueueType type)
|
||||
{
|
||||
if (NULL == slots) {
|
||||
mpp_err_f("found NULL input\n");
|
||||
@@ -797,7 +784,7 @@ MPP_RET mpp_buf_slot_enqueue(MppBufSlots slots, SlotQueueType type, RK_U32 index
|
||||
return MPP_OK;
|
||||
}
|
||||
|
||||
MPP_RET mpp_buf_slot_dequeue(MppBufSlots slots, SlotQueueType type, RK_U32 *index)
|
||||
MPP_RET mpp_buf_slot_dequeue(MppBufSlots slots, RK_U32 *index, SlotQueueType type)
|
||||
{
|
||||
if (NULL == slots || NULL == index) {
|
||||
mpp_err_f("found NULL input\n");
|
||||
|
||||
Reference in New Issue
Block a user