mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-09 11:00:53 +08:00
[buf_slot]: remove hw use function
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@330 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
@@ -139,7 +139,7 @@ MPP_RET dummy_dec_prepare(void *dec, MppPacket pkt, HalDecTask *task)
|
|||||||
mpp_frame_init(&frame);
|
mpp_frame_init(&frame);
|
||||||
mpp_frame_set_pts(frame, mpp_packet_get_pts(pkt));
|
mpp_frame_set_pts(frame, mpp_packet_get_pts(pkt));
|
||||||
mpp_buf_slot_get_unused(slots, &output);
|
mpp_buf_slot_get_unused(slots, &output);
|
||||||
mpp_buf_slot_set_hw_use(slots, output);
|
mpp_buf_slot_set_flag(slots, output, SLOT_HAL_OUTPUT);
|
||||||
mpp_buf_slot_set_frame(slots, output, frame);
|
mpp_buf_slot_set_frame(slots, output, frame);
|
||||||
mpp_frame_deinit(&frame);
|
mpp_frame_deinit(&frame);
|
||||||
mpp_assert(NULL == frame);
|
mpp_assert(NULL == frame);
|
||||||
|
@@ -156,7 +156,7 @@ int mpp_hevc_set_new_ref(HEVCContext *s, MppFrame *mframe, int poc)
|
|||||||
ref->flags = HEVC_FRAME_FLAG_OUTPUT | HEVC_FRAME_FLAG_SHORT_REF;
|
ref->flags = HEVC_FRAME_FLAG_OUTPUT | HEVC_FRAME_FLAG_SHORT_REF;
|
||||||
|
|
||||||
mpp_buf_slot_set_flag(s->slots, ref->slot_index, SLOT_CODEC_USE);
|
mpp_buf_slot_set_flag(s->slots, ref->slot_index, SLOT_CODEC_USE);
|
||||||
mpp_buf_slot_set_hw_use(s->slots, ref->slot_index);
|
mpp_buf_slot_set_flag(s->slots, ref->slot_index, SLOT_HAL_OUTPUT);
|
||||||
mpp_buf_slot_set_frame(s->slots, ref->slot_index, ref->frame);
|
mpp_buf_slot_set_frame(s->slots, ref->slot_index, ref->frame);
|
||||||
s->task->output = ref->slot_index;
|
s->task->output = ref->slot_index;
|
||||||
|
|
||||||
|
@@ -245,7 +245,7 @@ static RK_S32 poll_task(void *hal, MppBufSlots slots, HalDecTask *dec)
|
|||||||
syn.dec = *dec;
|
syn.dec = *dec;
|
||||||
hal_h265d_wait(hal, &syn);
|
hal_h265d_wait(hal, &syn);
|
||||||
mpp_err("dec->output = %d", dec->output);
|
mpp_err("dec->output = %d", dec->output);
|
||||||
mpp_buf_slot_clr_hw_use(slots, dec->output);
|
mpp_buf_slot_clr_flag(slots, dec->output, SLOT_HAL_OUTPUT);
|
||||||
for (i = 0; i < MPP_ARRAY_ELEMS(dec->refer); i++) {
|
for (i = 0; i < MPP_ARRAY_ELEMS(dec->refer); i++) {
|
||||||
RK_S32 id;
|
RK_S32 id;
|
||||||
id = dec->refer[i];
|
id = dec->refer[i];
|
||||||
@@ -383,7 +383,7 @@ RK_S32 hevc_parser_test(ParserDemoCmdContext_t *cmd)
|
|||||||
if (cutask->valid) {
|
if (cutask->valid) {
|
||||||
HalTaskInfo syn;
|
HalTaskInfo syn;
|
||||||
syn.dec = *cutask;
|
syn.dec = *cutask;
|
||||||
mpp_buf_slot_get_hw_use(slots, &index);
|
index = cutask->output;
|
||||||
|
|
||||||
if (NULL == mpp_buf_slot_get_buffer(slots, index)) {
|
if (NULL == mpp_buf_slot_get_buffer(slots, index)) {
|
||||||
MppBuffer buffer = NULL;
|
MppBuffer buffer = NULL;
|
||||||
|
@@ -171,10 +171,6 @@ RK_U32 mpp_buf_slot_get_size(MppBufSlots slots);
|
|||||||
*/
|
*/
|
||||||
MPP_RET mpp_buf_slot_get_unused(MppBufSlots slots, RK_U32 *index);
|
MPP_RET mpp_buf_slot_get_unused(MppBufSlots slots, RK_U32 *index);
|
||||||
|
|
||||||
MPP_RET mpp_buf_slot_set_hw_use(MppBufSlots slots, RK_U32 index);
|
|
||||||
MPP_RET mpp_buf_slot_clr_hw_use(MppBufSlots slots, RK_U32 index);
|
|
||||||
MPP_RET mpp_buf_slot_get_hw_use(MppBufSlots slots, RK_U32 *index);
|
|
||||||
|
|
||||||
MPP_RET mpp_buf_slot_inc_hw_ref(MppBufSlots slots, RK_U32 index);
|
MPP_RET mpp_buf_slot_inc_hw_ref(MppBufSlots slots, RK_U32 index);
|
||||||
MPP_RET mpp_buf_slot_dec_hw_ref(MppBufSlots slots, RK_U32 index);
|
MPP_RET mpp_buf_slot_dec_hw_ref(MppBufSlots slots, RK_U32 index);
|
||||||
|
|
||||||
|
@@ -158,9 +158,6 @@ struct MppBufSlotsImpl_t {
|
|||||||
RK_U32 new_count;
|
RK_U32 new_count;
|
||||||
RK_U32 new_size;
|
RK_U32 new_size;
|
||||||
|
|
||||||
// to record current output slot index
|
|
||||||
RK_S32 hw_use;
|
|
||||||
|
|
||||||
// list for display
|
// list for display
|
||||||
struct list_head queue[QUEUE_BUTT];
|
struct list_head queue[QUEUE_BUTT];
|
||||||
|
|
||||||
@@ -485,52 +482,6 @@ MPP_RET mpp_buf_slot_get_unused(MppBufSlots slots, RK_U32 *index)
|
|||||||
return MPP_NOK;
|
return MPP_NOK;
|
||||||
}
|
}
|
||||||
|
|
||||||
MPP_RET mpp_buf_slot_set_hw_use(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_SET_HAL_OUTPUT);
|
|
||||||
impl->hw_use = index;
|
|
||||||
return MPP_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
MPP_RET mpp_buf_slot_clr_hw_use(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_CLR_HAL_OUTPUT);
|
|
||||||
slot_ops_with_log(impl->logs, slot, SLOT_CLR_NOT_READY);
|
|
||||||
impl->decode_count++;
|
|
||||||
check_entry_unused(impl, slot);
|
|
||||||
return MPP_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
MPP_RET mpp_buf_slot_get_hw_use(MppBufSlots slots, RK_U32 *index)
|
|
||||||
{
|
|
||||||
if (NULL == slots || NULL == index) {
|
|
||||||
mpp_err_f("found NULL input\n");
|
|
||||||
return MPP_ERR_NULL_PTR;
|
|
||||||
}
|
|
||||||
|
|
||||||
MppBufSlotsImpl *impl = (MppBufSlotsImpl *)slots;
|
|
||||||
*index = impl->hw_use;
|
|
||||||
return MPP_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
MPP_RET mpp_buf_slot_inc_hw_ref(MppBufSlots slots, RK_U32 index)
|
MPP_RET mpp_buf_slot_inc_hw_ref(MppBufSlots slots, RK_U32 index)
|
||||||
{
|
{
|
||||||
if (NULL == slots) {
|
if (NULL == slots) {
|
||||||
@@ -733,6 +684,10 @@ MPP_RET mpp_buf_slot_clr_flag(MppBufSlots slots, RK_U32 index, SlotUsageType typ
|
|||||||
slot_assert(impl, index < impl->count);
|
slot_assert(impl, index < impl->count);
|
||||||
MppBufSlotEntry *slot = &impl->slots[index];
|
MppBufSlotEntry *slot = &impl->slots[index];
|
||||||
slot_ops_with_log(impl->logs, slot, clr_flag_op[type]);
|
slot_ops_with_log(impl->logs, slot, clr_flag_op[type]);
|
||||||
|
|
||||||
|
if (type == SLOT_HAL_OUTPUT)
|
||||||
|
impl->decode_count++;
|
||||||
|
|
||||||
check_entry_unused(impl, slot);
|
check_entry_unused(impl, slot);
|
||||||
return MPP_OK;
|
return MPP_OK;
|
||||||
}
|
}
|
||||||
|
@@ -168,8 +168,7 @@ void *mpp_dec_parser_thread(void *data)
|
|||||||
* - need buffer in different side, need to send a info change
|
* - need buffer in different side, need to send a info change
|
||||||
* frame to hal loop.
|
* frame to hal loop.
|
||||||
*/
|
*/
|
||||||
RK_U32 output;
|
RK_S32 output = task_dec->output;
|
||||||
mpp_buf_slot_get_hw_use(frame_slots, &output);
|
|
||||||
if (NULL == mpp_buf_slot_get_buffer(frame_slots, output)) {
|
if (NULL == mpp_buf_slot_get_buffer(frame_slots, output)) {
|
||||||
MppBuffer buffer = NULL;
|
MppBuffer buffer = NULL;
|
||||||
RK_U32 size = mpp_buf_slot_get_size(frame_slots);
|
RK_U32 size = mpp_buf_slot_get_size(frame_slots);
|
||||||
@@ -262,7 +261,7 @@ void *mpp_dec_hal_thread(void *data)
|
|||||||
* 3. add frame to output list
|
* 3. add frame to output list
|
||||||
* repeat 2 and 3 until not frame can be output
|
* repeat 2 and 3 until not frame can be output
|
||||||
*/
|
*/
|
||||||
mpp_buf_slot_clr_hw_use(frame_slots, task_dec->output);
|
mpp_buf_slot_clr_flag(frame_slots, task_dec->output, SLOT_HAL_OUTPUT);
|
||||||
for (RK_U32 i = 0; i < MPP_ARRAY_ELEMS(task_dec->refer); i++) {
|
for (RK_U32 i = 0; i < MPP_ARRAY_ELEMS(task_dec->refer); i++) {
|
||||||
RK_S32 index = task_dec->refer[i];
|
RK_S32 index = task_dec->refer[i];
|
||||||
if (index >= 0)
|
if (index >= 0)
|
||||||
|
Reference in New Issue
Block a user