]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit '5c1585c4c3b5281835d784c5daef0069915ccd57'
authorJames Almer <jamrial@gmail.com>
Sun, 22 Oct 2017 02:48:29 +0000 (23:48 -0300)
committerJames Almer <jamrial@gmail.com>
Sun, 22 Oct 2017 02:48:29 +0000 (23:48 -0300)
* commit '5c1585c4c3b5281835d784c5daef0069915ccd57':
  lavc: Drop deprecated VDPAU buffer fields

Merged-by: James Almer <jamrial@gmail.com>
1  2 
libavcodec/vdpau.c
libavcodec/vdpau.h
libavcodec/version.h

index 4cc51cb79ed12f99b0dce1e31d820f2f8b6735f6,68d0813f658d91be864d8c87249c0328c9a6f5cc..7053dd162a5e51a03c8ef03673918a199a97f96a
  #include "h264dec.h"
  #include "vc1.h"
  #include "vdpau.h"
 +#include "vdpau_compat.h"
  #include "vdpau_internal.h"
  
- #if FF_API_BUFS_VDPAU
- #include "libavutil/avassert.h"
- #endif
 +// XXX: at the time of adding this ifdefery, av_assert* wasn't use outside.
 +// When dropping it, make sure other av_assert* were not added since then.
 +
 +#if FF_API_VDPAU
 +#undef NDEBUG
 +#include <assert.h>
 +#endif
 +
  /**
   * @addtogroup VDPAU_Decoding
   *
@@@ -353,38 -314,11 +350,16 @@@ int ff_vdpau_common_end_frame(AVCodecCo
      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);
  }
  
index 458e4fa605e3eff18b7c237a1277c3ea35e91d7b,a5d31cb37b9db856f2087f6af7a78be6844ae951..4d9994336911865d839731c6d360102e9eaa27cc
  #include "avcodec.h"
  #include "version.h"
  
- #if FF_API_BUFS_VDPAU
- union AVVDPAUPictureInfo {
-     VdpPictureInfoH264        h264;
-     VdpPictureInfoMPEG1Or2    mpeg;
-     VdpPictureInfoVC1          vc1;
-     VdpPictureInfoMPEG4Part2 mpeg4;
- };
- #endif
 +struct AVCodecContext;
 +struct AVFrame;
 +
 +typedef int (*AVVDPAU_Render2)(struct AVCodecContext *, struct AVFrame *,
 +                               const VdpPictureInfo *, uint32_t,
 +                               const VdpBitstreamBuffer *);
 +
  /**
   * This structure is used to share data between the libavcodec library and
   * the client video application.
@@@ -101,54 -83,8 +92,20 @@@ typedef struct AVVDPAUContext 
       * Set by the user.
       */
      VdpDecoderRender *render;
- #if FF_API_BUFS_VDPAU
-     /**
-      * VDPAU picture information
-      *
-      * Set by libavcodec.
-      */
-     attribute_deprecated
-     union AVVDPAUPictureInfo info;
-     /**
-      * Allocated size of the bitstream_buffers table.
-      *
-      * Set by libavcodec.
-      */
-     attribute_deprecated
-     int bitstream_buffers_allocated;
-     /**
-      * Useful bitstream buffers in the bitstream buffers table.
-      *
-      * Set by libavcodec.
-      */
-     attribute_deprecated
-     int bitstream_buffers_used;
-    /**
-      * Table of bitstream buffers.
-      * The user is responsible for freeing this buffer using av_freep().
-      *
-      * Set by libavcodec.
-      */
-     attribute_deprecated
-     VdpBitstreamBuffer *bitstream_buffers;
- #endif
 +
 +    AVVDPAU_Render2 render2;
  } AVVDPAUContext;
  
 +/**
 + * @brief allocation function for AVVDPAUContext
 + *
 + * Allows extending the struct without breaking API/ABI
 + */
 +AVVDPAUContext *av_alloc_vdpaucontext(void);
 +
 +AVVDPAU_Render2 av_vdpau_hwaccel_get_render2(const AVVDPAUContext *);
 +void av_vdpau_hwaccel_set_render2(AVVDPAUContext *, AVVDPAU_Render2);
 +
  /**
   * Associate a VDPAU device with a codec context for hardware acceleration.
   * This function is meant to be called from the get_format() codec callback,
index 0335a2868c080b3dcf0f503cc0d23109d7a0b848,033909a1e403d26d1d00aab0996f58a77335e9fe..55b7cfff118b8a600f3b6afcb7dbf2e43c11f305
   * FF_API_* defines may be placed below to indicate public API that will be
   * dropped at a future version bump. The defines themselves are not part of
   * the public API and may change, break or disappear at any time.
 + *
 + * @note, when bumping the major version it is recommended to manually
 + * disable each FF_API_* in its own commit instead of disabling them all
 + * at once through the bump. This improves the git bisect-ability of the change.
   */
  
- #ifndef FF_API_BUFS_VDPAU
- #define FF_API_BUFS_VDPAU        (LIBAVCODEC_VERSION_MAJOR < 58)
- #endif
 +#ifndef FF_API_VIMA_DECODER
 +#define FF_API_VIMA_DECODER     (LIBAVCODEC_VERSION_MAJOR < 58)
 +#endif
 +#ifndef FF_API_LOWRES
 +#define FF_API_LOWRES            (LIBAVCODEC_VERSION_MAJOR < 59)
 +#endif
  #ifndef FF_API_VOXWARE
  #define FF_API_VOXWARE           (LIBAVCODEC_VERSION_MAJOR < 58)
  #endif