On Thu, Mar 23, 2017 at 02:01:52PM +0100, wm4 wrote:
> --- a/libavcodec/vdpau.c
> +++ b/libavcodec/vdpau.c
> @@ -60,6 +60,10 @@ static int vdpau_error(VdpStatus status)
>  
> +// Note: becomes private with FF_API_VDPAU_OLD_API
> +#if !FF_API_VDPAU_OLD_API
> +static
> +#endif
>  int av_vdpau_get_surface_parameters(AVCodecContext *avctx,
>                                      VdpChromaType *type,
>                                      uint32_t *width, uint32_t *height)

see below

> @@ -122,7 +128,11 @@ int ff_vdpau_common_init(AVCodecContext *avctx, 
> VdpDecoderProfile profile,
>      if (av_vdpau_get_surface_parameters(avctx, &type, &width, &height))
>          return AVERROR(ENOSYS);
>  
> +#if FF_API_VDPAU_OLD_API
>      if (hwctx) {
> +        av_log(avctx, AV_LOG_WARNING, "Using deprecated struct "
> +               "AVVDPAUContext in decode.\n");
> +
>          hwctx->reset            = 0;
>  
>          if (hwctx->context.decoder != VDP_INVALID_HANDLE) {
> @@ -141,7 +151,9 @@ int ff_vdpau_common_init(AVCodecContext *avctx, 
> VdpDecoderProfile profile,
>          if (!(hwctx->flags & AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH) &&
>              type != VDP_CHROMA_TYPE_420)
>              return AVERROR(ENOSYS);
> -    } else {
> +    } else
> +#endif
> +    {
>          AVHWFramesContext *frames_ctx = NULL;
>          AVVDPAUDeviceContext *dev_ctx;

Maybe indent the else-block right away instead of leaving it in odd,
unneeded block braces after the old api is removed?

Then again, you might leave it as-is and hope for the person that deletes
the old API to reindent. Maybe that will even happen ;)

> --- a/libavcodec/vdpau.h
> +++ b/libavcodec/vdpau.h
> @@ -68,8 +70,10 @@
>   * The size of this structure is not a part of the public ABI and must not
>   * be used outside of libavcodec. Use av_vdpau_alloc_context() to allocate an
>   * AVVDPAUContext.
> + *
> + * @deprecated Use hw_frames_ctx or hw_device_ctx decode API instead.
>   */
> -typedef struct AVVDPAUContext {
> +typedef struct attribute_deprecated AVVDPAUContext {
>      /**
>       * VDPAU decoder handle
>       *

I think this won't work as expected, you need to place the attribute after
the struct declaration, see ed6a891c364f8b0850b557d9578b8920cc15a937.

Diego
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to