Ticket #3133: 0001-vdpau-restore-compatibility-with-deprecated-fields-i.patch

File 0001-vdpau-restore-compatibility-with-deprecated-fields-i.patch, 2.9 KB (added by Hendrik, 13 years ago)
  • libavcodec/vdpau.c

    From 31cf40886425fa587c8f7baa16c4c4104993fd33 Mon Sep 17 00:00:00 2001
    From: Hendrik Leppkes <h.leppkes@gmail.com>
    Date: Fri, 10 Jan 2014 16:43:27 +0100
    Subject: [PATCH] vdpau: restore compatibility with deprecated fields in
     AVVDPAUContext
    
    ---
     libavcodec/vdpau.c      | 17 +++++++++++++++++
     libavcodec/vdpau_h264.c | 17 +++++++++++++++++
     2 files changed, 34 insertions(+)
    
    diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
    index 32a3843..e294e49 100644
    a b int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx)  
    6969    struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
    7070    VdpVideoSurface surf = ff_vdpau_get_surface_id(pic);
    7171
     72#if FF_API_BUFS_VDPAU
     73FF_DISABLE_DEPRECATION_WARNINGS
     74    hwctx->info = pic_ctx->info;
     75    hwctx->bitstream_buffers = pic_ctx->bitstream_buffers;
     76    hwctx->bitstream_buffers_used = pic_ctx->bitstream_buffers_used;
     77    hwctx->bitstream_buffers_allocated = pic_ctx->bitstream_buffers_allocated;
     78FF_ENABLE_DEPRECATION_WARNINGS
     79#endif
     80
    7281    if (!hwctx->render) {
    7382        res = hwctx->render2(avctx, &pic->f, (void *)&pic_ctx->info,
    7483                             pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
    … … int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx)  
    7988    ff_mpeg_draw_horiz_band(s, 0, s->avctx->height);
    8089    av_freep(&pic_ctx->bitstream_buffers);
    8190
     91#if FF_API_BUFS_VDPAU
     92FF_DISABLE_DEPRECATION_WARNINGS
     93    hwctx->bitstream_buffers = NULL;
     94    hwctx->bitstream_buffers_used = 0;
     95    hwctx->bitstream_buffers_allocated = 0;
     96FF_ENABLE_DEPRECATION_WARNINGS
     97#endif
     98
    8299    return res;
    83100}
    84101#endif
  • libavcodec/vdpau_h264.c

    diff --git a/libavcodec/vdpau_h264.c b/libavcodec/vdpau_h264.c
    index 3f6415d..ea69c14 100644
    a b static int vdpau_h264_end_frame(AVCodecContext *avctx)  
    195195    struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private;
    196196    VdpVideoSurface surf = ff_vdpau_get_surface_id(pic);
    197197
     198#if FF_API_BUFS_VDPAU
     199FF_DISABLE_DEPRECATION_WARNINGS
     200    hwctx->info = pic_ctx->info;
     201    hwctx->bitstream_buffers = pic_ctx->bitstream_buffers;
     202    hwctx->bitstream_buffers_used = pic_ctx->bitstream_buffers_used;
     203    hwctx->bitstream_buffers_allocated = pic_ctx->bitstream_buffers_allocated;
     204FF_ENABLE_DEPRECATION_WARNINGS
     205#endif
     206
    198207    if (!hwctx->render) {
    199208        res = hwctx->render2(avctx, &pic->f, (void *)&pic_ctx->info,
    200209                             pic_ctx->bitstream_buffers_used, pic_ctx->bitstream_buffers);
    … … static int vdpau_h264_end_frame(AVCodecContext *avctx)  
    205214    ff_h264_draw_horiz_band(h, 0, h->avctx->height);
    206215    av_freep(&pic_ctx->bitstream_buffers);
    207216
     217#if FF_API_BUFS_VDPAU
     218FF_DISABLE_DEPRECATION_WARNINGS
     219    hwctx->bitstream_buffers = NULL;
     220    hwctx->bitstream_buffers_used = 0;
     221    hwctx->bitstream_buffers_allocated = 0;
     222FF_ENABLE_DEPRECATION_WARNINGS
     223#endif
     224
    208225    return res;
    209226}
    210227