Beispiel #1
0
int ff_vdpau_common_end_frame(AVCodecContext *avctx, AVFrame *frame,
                              struct vdpau_picture_context *pic_ctx)
{
    VDPAUContext *vdctx = avctx->internal->hwaccel_priv_data;
    AVVDPAUContext *hwctx = avctx->hwaccel_context;
    VdpVideoSurface surf = ff_vdpau_get_surface_id(frame);
    VdpStatus status;
    int val;

    val = ff_vdpau_common_reinit(avctx);
    if (val < 0)
        return val;

    if (hwctx && !hwctx->render && hwctx->render2) {
        status = hwctx->render2(avctx, frame, (void *)&pic_ctx->info,
                                pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
    } else
    status = vdctx->render(vdctx->decoder, surf, &pic_ctx->info,
                           pic_ctx->bitstream_buffers_used,
                           pic_ctx->bitstream_buffers);

    av_freep(&pic_ctx->bitstream_buffers);

    return vdpau_error(status);
}
Beispiel #2
0
static int vdpau_h264_end_frame(AVCodecContext *avctx)
{
    AVVDPAUContext *hwctx = avctx->hwaccel_context;
    H264Context *h = avctx->priv_data;
    VdpVideoSurface surf = ff_vdpau_get_surface_id(h->cur_pic_ptr);

    hwctx->render(hwctx->decoder, surf, (void *)&hwctx->info,
                  hwctx->bitstream_buffers_used, hwctx->bitstream_buffers);

    ff_h264_draw_horiz_band(h, 0, h->avctx->height);
    hwctx->bitstream_buffers_used = 0;

    return 0;
}
Beispiel #3
0
int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx)
{
    AVVDPAUContext *hwctx = avctx->hwaccel_context;
    MpegEncContext *s = avctx->priv_data;
    VdpVideoSurface surf = ff_vdpau_get_surface_id(s->current_picture_ptr);

    hwctx->render(hwctx->decoder, surf, (void *)&hwctx->info,
                  hwctx->bitstream_buffers_used, hwctx->bitstream_buffers);

    ff_mpeg_draw_horiz_band(s, 0, s->avctx->height);
    hwctx->bitstream_buffers_used = 0;

    return 0;
}
Beispiel #4
0
static int vdpau_h264_end_frame(AVCodecContext *avctx)
{
    AVVDPAUContext *hwctx = avctx->hwaccel_context;
    H264Context *h = avctx->priv_data;
    Picture *pic   = h->cur_pic_ptr;
    struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
    VdpVideoSurface surf = ff_vdpau_get_surface_id(pic);

    hwctx->render(hwctx->decoder, surf, (void *)&pic_ctx->info,
                  pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);

    ff_h264_draw_horiz_band(h, 0, h->avctx->height);
    av_freep(&pic_ctx->bitstream_buffers);

    return 0;
}
Beispiel #5
0
int ff_vdpau_common_end_frame(AVCodecContext *avctx, AVFrame *frame,
                              struct vdpau_picture_context *pic_ctx)
{
    VDPAUContext *vdctx = avctx->internal->hwaccel_priv_data;
    AVVDPAUContext *hwctx = avctx->hwaccel_context;
    VdpVideoSurface surf = ff_vdpau_get_surface_id(frame);
    VdpStatus status;
    int val;

    val = ff_vdpau_common_reinit(avctx);
    if (val < 0)
        return val;

#if FF_API_BUFS_VDPAU
FF_DISABLE_DEPRECATION_WARNINGS
    if (hwctx) {
    av_assert0(sizeof(hwctx->info) <= sizeof(pic_ctx->info));
    memcpy(&hwctx->info, &pic_ctx->info, sizeof(hwctx->info));
    hwctx->bitstream_buffers = pic_ctx->bitstream_buffers;
    hwctx->bitstream_buffers_used = pic_ctx->bitstream_buffers_used;
    hwctx->bitstream_buffers_allocated = pic_ctx->bitstream_buffers_allocated;
    }
FF_ENABLE_DEPRECATION_WARNINGS
#endif

    if (hwctx && !hwctx->render && hwctx->render2) {
        status = hwctx->render2(avctx, frame, (void *)&pic_ctx->info,
                                pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
    } else
    status = vdctx->render(vdctx->decoder, surf, &pic_ctx->info,
                           pic_ctx->bitstream_buffers_used,
                           pic_ctx->bitstream_buffers);

    av_freep(&pic_ctx->bitstream_buffers);

#if FF_API_BUFS_VDPAU
FF_DISABLE_DEPRECATION_WARNINGS
    if (hwctx) {
    hwctx->bitstream_buffers = NULL;
    hwctx->bitstream_buffers_used = 0;
    hwctx->bitstream_buffers_allocated = 0;
    }
FF_ENABLE_DEPRECATION_WARNINGS
#endif

    return vdpau_error(status);
}
Beispiel #6
0
int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx)
{
    int res = 0;
    AVVDPAUContext *hwctx = avctx->hwaccel_context;
    MpegEncContext *s = avctx->priv_data;
    Picture *pic = s->current_picture_ptr;
    struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
    VdpVideoSurface surf = ff_vdpau_get_surface_id(pic);

    if (!hwctx->render) {
        res = hwctx->render2(avctx, &pic->f, (void *)&pic_ctx->info,
                             pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
    } else
    hwctx->render(hwctx->decoder, surf, (void *)&pic_ctx->info,
                  pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);

    ff_mpeg_draw_horiz_band(s, 0, s->avctx->height);
    av_freep(&pic_ctx->bitstream_buffers);

    return res;
}
Beispiel #7
0
int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx)
{
    int res = 0;
    AVVDPAUContext *hwctx = avctx->hwaccel_context;
    MpegEncContext *s = avctx->priv_data;
    Picture *pic = s->current_picture_ptr;
    struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
    VdpVideoSurface surf = ff_vdpau_get_surface_id(pic);

#if FF_API_BUFS_VDPAU
FF_DISABLE_DEPRECATION_WARNINGS
    hwctx->info = pic_ctx->info;
    hwctx->bitstream_buffers = pic_ctx->bitstream_buffers;
    hwctx->bitstream_buffers_used = pic_ctx->bitstream_buffers_used;
    hwctx->bitstream_buffers_allocated = pic_ctx->bitstream_buffers_allocated;
FF_ENABLE_DEPRECATION_WARNINGS
#endif

    if (!hwctx->render) {
        res = hwctx->render2(avctx, &pic->f, (void *)&pic_ctx->info,
                             pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
    } else
    hwctx->render(hwctx->decoder, surf, (void *)&pic_ctx->info,
                  pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);

    ff_mpeg_draw_horiz_band(s, 0, s->avctx->height);
    av_freep(&pic_ctx->bitstream_buffers);

#if FF_API_BUFS_VDPAU
FF_DISABLE_DEPRECATION_WARNINGS
    hwctx->bitstream_buffers = NULL;
    hwctx->bitstream_buffers_used = 0;
    hwctx->bitstream_buffers_allocated = 0;
FF_ENABLE_DEPRECATION_WARNINGS
#endif

    return res;
}