int index = INVALID_IDX;
ulong expires;
- if (hw->is_used_v4l && hw->eos) {
- expires = jiffies + msecs_to_jiffies(2000);
- while (INVALID_IDX == (index = v4l_get_free_buf_idx(vdec))) {
- if (time_after(jiffies, expires) ||
- v4l2_m2m_num_dst_bufs_ready(ctx->m2m_ctx))
- break;
- }
+ if (hw->eos) {
+ if (hw->is_used_v4l) {
+ expires = jiffies + msecs_to_jiffies(2000);
+ while (INVALID_IDX == (index = v4l_get_free_buf_idx(vdec))) {
+ if (time_after(jiffies, expires) ||
+ v4l2_m2m_num_dst_bufs_ready(ctx->m2m_ctx))
+ break;
+ }
- if (index == INVALID_IDX) {
- if (vdec_v4l_get_buffer(hw->v4l2_ctx, &fb) < 0) {
- pr_err("[%d] EOS get free buff fail.\n", ctx->id);
- return -1;
+ if (index == INVALID_IDX) {
+ if (vdec_v4l_get_buffer(hw->v4l2_ctx, &fb) < 0) {
+ pr_err("[%d] EOS get free buff fail.\n", ctx->id);
+ return -1;
+ }
}
}
vf_notify_receiver(vdec->vf_provider_name,
VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL);
- pr_info("[%d] H264 EOS notify.\n", ctx->id);
+ pr_info("[%d] H264 EOS notify.\n", (hw->is_used_v4l)?ctx->id:vdec->id);
}
return 0;
amhevc_stop();
hw->eos = 1;
flush_dpb(p_H264_Dpb);
- if (hw->is_used_v4l)
- notify_v4l_eos(hw_to_vdec(hw));
+ notify_v4l_eos(hw_to_vdec(hw));
mutex_lock(&hw->chunks_mutex);
vdec_vframe_dirty(hw_to_vdec(hw), hw->chunk);
hw->chunk = NULL;
int index = INVALID_IDX;
ulong expires;
- if (hw->is_used_v4l && hw->eos) {
- expires = jiffies + msecs_to_jiffies(2000);
- while (INVALID_IDX == (index = get_free_buf_idx(hw))) {
- if (time_after(jiffies, expires) ||
- v4l2_m2m_num_dst_bufs_ready(ctx->m2m_ctx))
- break;
- }
+ if (hw->eos) {
+ if (hw->is_used_v4l) {
+ expires = jiffies + msecs_to_jiffies(2000);
+ while (INVALID_IDX == (index = get_free_buf_idx(hw))) {
+ if (time_after(jiffies, expires) ||
+ v4l2_m2m_num_dst_bufs_ready(ctx->m2m_ctx))
+ break;
+ }
- if (index == INVALID_IDX) {
- if (vdec_v4l_get_buffer(hw->v4l2_ctx, &fb) < 0) {
- pr_err("[%d] EOS get free buff fail.\n", ctx->id);
- return -1;
+ if (index == INVALID_IDX) {
+ if (vdec_v4l_get_buffer(hw->v4l2_ctx, &fb) < 0) {
+ pr_err("[%d] EOS get free buff fail.\n", ctx->id);
+ return -1;
+ }
}
}
vf_notify_receiver(vdec->vf_provider_name,
VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL);
- pr_info("[%d] H265 EOS notify.\n", ctx->id);
+ pr_info("[%d] H265 EOS notify.\n", (hw->is_used_v4l)?ctx->id:vdec->id);
}
return 0;
"%s: end of stream, last dec poc %d => 0x%pf\n",
__func__, hevc->curr_POC, pic);
flush_output(hevc, pic);
-
- if (hevc->is_used_v4l)
- notify_v4l_eos(hw_to_vdec(hevc));
+ /* dummy vf with eos flag to backend */
+ notify_v4l_eos(hw_to_vdec(hevc));
#ifdef CONFIG_AMLOGIC_MEDIA_ENHANCEMENT_DOLBYVISION
hevc->shift_byte_count_lo
= READ_VREG(HEVC_SHIFT_BYTE_COUNT);
struct aml_vcodec_ctx *ctx = (struct aml_vcodec_ctx *)(hw->v4l2_ctx);
struct vframe_s *vf = NULL;
struct vdec_v4l2_buffer *fb = NULL;
- int index;
+ int index = -1;
- if (hw->is_used_v4l && hw->eos) {
+ if (hw->eos) {
if (kfifo_get(&hw->newframe_q, &vf) == 0 || vf == NULL) {
mmjpeg_debug_print(DECODE_ID(hw), PRINT_FLAG_ERROR,
"%s fatal error, no available buffer slot.\n",
return -1;
}
- index = find_free_buffer(hw);
-
- if ((index == -1) && vdec_v4l_get_buffer(hw->v4l2_ctx, &fb)) {
- pr_err("[%d] get fb fail.\n", ctx->id);
- return -1;
+ if (hw->is_used_v4l) {
+ index = find_free_buffer(hw);
+ if ((index == -1) && vdec_v4l_get_buffer(hw->v4l2_ctx, &fb)) {
+ pr_err("[%d] get fb fail.\n", ctx->id);
+ return -1;
+ }
}
vf->type |= VIDTYPE_V4L_EOS;
vf_notify_receiver(vdec->vf_provider_name,
VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL);
- pr_info("[%d] mpeg12 EOS notify.\n", ctx->id);
+ pr_info("[%d] mpeg12 EOS notify.\n", (hw->is_used_v4l)?ctx->id:vdec->id);
}
return 0;
hw->stat &= ~STAT_VDEC_RUN;
}
hw->eos = 1;
- if (hw->is_used_v4l)
- notify_v4l_eos(vdec);
+ notify_v4l_eos(vdec);
vdec_vframe_dirty(hw_to_vdec(hw), hw->chunk);
hw->chunk = NULL;
struct aml_vcodec_ctx *ctx = (struct aml_vcodec_ctx *)(hw->v4l2_ctx);
struct vframe_s *vf = NULL;
struct vdec_v4l2_buffer *fb = NULL;
- int index;
+ int index = -1;
- if (hw->is_used_v4l && hw->eos) {
+ if (hw->eos) {
if (kfifo_get(&hw->newframe_q, &vf) == 0 || vf == NULL) {
debug_print(DECODE_ID(hw), PRINT_FLAG_ERROR,
"%s fatal error, no available buffer slot.\n",
__func__);
return -1;
}
- index = find_free_buffer(hw);
- if ((index == -1) &&
- vdec_v4l_get_buffer(hw->v4l2_ctx, &fb)) {
- pr_err("[%d] get fb fail.\n", ctx->id);
- return -1;
+ if (hw->is_used_v4l) {
+ index = find_free_buffer(hw);
+ if ((index == -1) &&
+ vdec_v4l_get_buffer(hw->v4l2_ctx, &fb)) {
+ pr_err("[%d] get fb fail.\n", ctx->id);
+ return -1;
+ }
}
vf->type |= VIDTYPE_V4L_EOS;
vf_notify_receiver(vdec->vf_provider_name,
VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL);
- pr_info("[%d] mpeg12 EOS notify.\n", ctx->id);
+ pr_info("[%d] mpeg12 EOS notify.\n", (hw->is_used_v4l)?ctx->id:vdec->id);
}
return 0;
hw->chunk = NULL;
vdec_clean_input(vdec);
flush_output(hw);
- if (hw->is_used_v4l)
- notify_v4l_eos(vdec);
+ notify_v4l_eos(vdec);
debug_print(DECODE_ID(hw), 0,
"%s: end of stream, num %d(%d)\n",
struct aml_vcodec_ctx *ctx = (struct aml_vcodec_ctx *)(hw->v4l2_ctx);
struct vframe_s *vf = NULL;
struct vdec_v4l2_buffer *fb = NULL;
- int index;
+ int index = -1;
- if (hw->is_used_v4l && hw->eos) {
+ if (hw->eos) {
if (kfifo_get(&hw->newframe_q, &vf) == 0 || vf == NULL) {
mmpeg4_debug_print(DECODE_ID(hw), PRINT_FLAG_ERROR,
"%s fatal error, no available buffer slot.\n",
return -1;
}
- index = find_free_buffer(hw);
-
- if ((index == -1) &&
- vdec_v4l_get_buffer(hw->v4l2_ctx, &fb)) {
- pr_err("[%d] get fb fail.\n", ctx->id);
- return -1;
+ if (hw->is_used_v4l) {
+ index = find_free_buffer(hw);
+ if ((index == -1) &&
+ vdec_v4l_get_buffer(hw->v4l2_ctx, &fb)) {
+ pr_err("[%d] get fb fail.\n", ctx->id);
+ return -1;
+ }
}
vf->type |= VIDTYPE_V4L_EOS;
vf_notify_receiver(vdec->vf_provider_name,
VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL);
- pr_info("[%d] mpeg4 EOS notify.\n", ctx->id);
+ pr_info("[%d] mpeg4 EOS notify.\n", (hw->is_used_v4l)?ctx->id:vdec->id);
}
return 0;
hw->chunk = NULL;
vdec_clean_input(vdec);
flush_output(hw);
-
- if (hw->is_used_v4l)
- notify_v4l_eos(vdec);
+ notify_v4l_eos(vdec);
mmpeg4_debug_print(DECODE_ID(hw), 0,
"%s: eos flushed, frame_num %d\n",
int index = INVALID_IDX;
ulong expires;
- if (hw->is_used_v4l && hw->eos) {
- expires = jiffies + msecs_to_jiffies(2000);
- while (INVALID_IDX == (index = v4l_get_free_fb(hw))) {
- if (time_after(jiffies, expires) ||
- v4l2_m2m_num_dst_bufs_ready(ctx->m2m_ctx))
- break;
- }
+ if (hw->eos) {
+ if (hw->is_used_v4l) {
+ expires = jiffies + msecs_to_jiffies(2000);
+ while (INVALID_IDX == (index = v4l_get_free_fb(hw))) {
+ if (time_after(jiffies, expires) ||
+ v4l2_m2m_num_dst_bufs_ready(ctx->m2m_ctx))
+ break;
+ }
- if (index == INVALID_IDX) {
- if (vdec_v4l_get_buffer(hw->v4l2_ctx, &fb) < 0) {
- pr_err("[%d] EOS get free buff fail.\n", ctx->id);
- return -1;
+ if (index == INVALID_IDX) {
+ if (vdec_v4l_get_buffer(hw->v4l2_ctx, &fb) < 0) {
+ pr_err("[%d] EOS get free buff fail.\n", ctx->id);
+ return -1;
+ }
}
}
VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL);
av1_print(hw, PRINT_FLAG_V4L_DETAIL,
- "[%d] AV1 EOS notify.\n", ctx->id);
+ "[%d] AV1 EOS notify.\n", (hw->is_used_v4l)?ctx->id:vdec->id);
}
return 0;
hw->eos = 1;
av1_postproc(hw);
- if (hw->is_used_v4l)
- notify_v4l_eos(hw_to_vdec(hw));
+ notify_v4l_eos(hw_to_vdec(hw));
vdec_vframe_dirty(hw_to_vdec(hw), hw->chunk);
} else if (hw->dec_result == DEC_RESULT_FORCE_EXIT) {
int index = INVALID_IDX;
ulong expires;
- if (hw->is_used_v4l && hw->eos) {
- expires = jiffies + msecs_to_jiffies(2000);
- while (INVALID_IDX == (index = v4l_get_free_fb(hw))) {
- if (time_after(jiffies, expires) ||
- v4l2_m2m_num_dst_bufs_ready(ctx->m2m_ctx))
- break;
- }
+ if (hw->eos) {
+ if (hw->is_used_v4l) {
+ expires = jiffies + msecs_to_jiffies(2000);
+ while (INVALID_IDX == (index = v4l_get_free_fb(hw))) {
+ if (time_after(jiffies, expires) ||
+ v4l2_m2m_num_dst_bufs_ready(ctx->m2m_ctx))
+ break;
+ }
- if (index == INVALID_IDX) {
- if (vdec_v4l_get_buffer(hw->v4l2_ctx, &fb) < 0) {
- pr_err("[%d] EOS get free buff fail.\n", ctx->id);
- return -1;
+ if (index == INVALID_IDX) {
+ if (vdec_v4l_get_buffer(hw->v4l2_ctx, &fb) < 0) {
+ pr_err("[%d] EOS get free buff fail.\n", ctx->id);
+ return -1;
+ }
}
}
vf_notify_receiver(vdec->vf_provider_name,
VFRAME_EVENT_PROVIDER_VFRAME_READY, NULL);
- pr_info("[%d] VP9 EOS notify.\n", ctx->id);
+ pr_info("[%d] VP9 EOS notify.\n", (hw->is_used_v4l)?ctx->id:vdec->id);
}
return 0;
pbi->eos = 1;
vp9_bufmgr_postproc(pbi);
- if (pbi->is_used_v4l)
- notify_v4l_eos(hw_to_vdec(pbi));
+ notify_v4l_eos(hw_to_vdec(pbi));
vdec_vframe_dirty(hw_to_vdec(pbi), pbi->chunk);
} else if (pbi->dec_result == DEC_RESULT_FORCE_EXIT) {