static int dxva2_h264_end_frame(AVCodecContext *avctx) { H264Context *h = avctx->priv_data; struct dxva2_picture_context *ctx_pic = h->cur_pic_ptr->f.hwaccel_picture_private; int ret; if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) return -1; // Wait for an I-frame before start decoding. Workaround for ATI UVD and UVD+ GPUs if (!h->got_first_iframe) { if (!(ctx_pic->pp.wBitFields & (1 << 15))) return -1; h->got_first_iframe = 1; } ret = ff_dxva2_common_end_frame(avctx, h->cur_pic_ptr, &ctx_pic->pp, sizeof(ctx_pic->pp), &ctx_pic->qm, sizeof(ctx_pic->qm), commit_bitstream_and_slice_buffer); if (!ret) ff_h264_draw_horiz_band(h, 0, h->avctx->height); return ret; }
static int end_frame(AVCodecContext *avctx) { H264Context *h = avctx->priv_data; MpegEncContext *s = &h->s; struct dxva2_picture_context *ctx_pic = h->s.current_picture_ptr->hwaccel_picture_private; if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) return -1; return ff_dxva2_common_end_frame(avctx, s, &ctx_pic->pp, sizeof(ctx_pic->pp), &ctx_pic->qm, sizeof(ctx_pic->qm), commit_bitstream_and_slice_buffer); }
static int dxva2_hevc_end_frame(AVCodecContext *avctx) { HEVCContext *h = avctx->priv_data; struct hevc_dxva2_picture_context *ctx_pic = h->ref->hwaccel_picture_private; int scale = ctx_pic->pp.dwCodingParamToolFlags & 1; int ret; if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) return -1; ret = ff_dxva2_common_end_frame(avctx, h->ref->frame, &ctx_pic->pp, sizeof(ctx_pic->pp), scale ? &ctx_pic->qm : NULL, scale ? sizeof(ctx_pic->qm) : 0, commit_bitstream_and_slice_buffer); return ret; }
static int dxva2_h264_end_frame(AVCodecContext *avctx) { H264Context *h = avctx->priv_data; struct dxva2_picture_context *ctx_pic = h->cur_pic_ptr->hwaccel_picture_private; int ret; if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) return -1; ret = ff_dxva2_common_end_frame(avctx, h->cur_pic_ptr, &ctx_pic->pp, sizeof(ctx_pic->pp), &ctx_pic->qm, sizeof(ctx_pic->qm), commit_bitstream_and_slice_buffer); if (!ret) ff_h264_draw_horiz_band(h, 0, h->avctx->height); return ret; }