On Thu, Mar 23, 2017 at 2:01 PM, wm4 <nfx...@googlemail.com> wrote:
> This deprecates the old vdpau API (av_vdpau_bind_context()) and the very
> old vdpau API (setting up AVVDPAUContext manually). We don't need 3
> APIs.
>
> AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH makes sense only with one of the old
> vdpau APIs, so deprecate it as well.
> ---
>  doc/APIchanges              |  9 +++++++++
>  libavcodec/avcodec.h        |  6 ++++++
>  libavcodec/vdpau.c          | 24 ++++++++++++++++++++++--
>  libavcodec/vdpau.h          | 33 ++++++++++++++++++++++++---------
>  libavcodec/vdpau_internal.h |  2 ++
>  libavcodec/version.h        |  5 ++++-
>  6 files changed, 67 insertions(+), 12 deletions(-)
>
> diff --git a/doc/APIchanges b/doc/APIchanges
> index a0ca3b7ac0..d78798d58f 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -13,6 +13,15 @@ libavutil:     2017-03-23
>
>  API changes, most recent first:
>
> +2017-03-xx - xxxxxxx - lavc 58.1.0 - vdpau.h, avcodec.h
> +  Deprecate struct AVVDPAUContext, av_vdpau_bind_context(),
> +  av_vdpau_get_surface_parameters(), av_vdpau_alloc_context,

nit: av_vdpau_alloc_context()

> +  and the vdpau.h installed header.
> +  Callers should set AVCodecContext.hw_frames_ctx or
> +  AVCodecContext.hw_device_ctx instead.
> +  Also deprecate AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH, which is used
> +  by the vdpau API only.
> +
>  2017-03-xx - xxxxxxx - lavc 57.37.0 - avcodec.h
>    Add AVCodecContext.hwaccel_flags field. This will control some hwaccels at
>    a later point.
> diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c
> index 68d0813f65..d75d2bd47d 100644
> --- 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)

how about just

+#if FF_API_VDPAU_OLD_API
 int av_vdpau_get_surface_parameters
+#else
+static int vdpau_get_surface_parameters
+#endif
                                     (AVCodecContext *avctx,
                                      VdpChromaType *type,
                                      uint32_t *width, uint32_t *height)

so that we don't introduce av-prefixed static functions?

> @@ -103,7 +107,9 @@ int av_vdpau_get_surface_parameters(AVCodecContext *avctx,
>  int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile,
>                           int level)
>  {
> +#if FF_API_VDPAU_OLD_API
>      VDPAUHWContext *hwctx = avctx->hwaccel_context;
> +#endif

would be nice to disable warnings here

>      VDPAUContext *vdctx = avctx->internal->hwaccel_priv_data;
>      VdpVideoSurfaceQueryCapabilities *surface_query_caps;
>      VdpDecoderQueryCapabilities *decoder_query_caps;
> @@ -279,14 +291,20 @@ int ff_vdpau_common_uninit(AVCodecContext *avctx)
>
>  static int ff_vdpau_common_reinit(AVCodecContext *avctx)
>  {
> -    VDPAUHWContext *hwctx = avctx->hwaccel_context;
>      VDPAUContext *vdctx = avctx->internal->hwaccel_priv_data;
> +#if FF_API_VDPAU_OLD_API
> +    VDPAUHWContext *hwctx = avctx->hwaccel_context;
>
>      if (vdctx->device == VDP_INVALID_HANDLE)
>          return 0; /* Decoder created by user */
>      if (avctx->coded_width == vdctx->width &&
>          avctx->coded_height == vdctx->height && (!hwctx || !hwctx->reset))
>          return 0;

same

> +#else
> +    if (avctx->coded_width == vdctx->width &&
> +        avctx->coded_height == vdctx->height)
> +        return 0;
> +#endif
>
>      avctx->hwaccel->uninit(avctx);
>      return avctx->hwaccel->init(avctx);

seems ok otherwise
-- 
Vittorio
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to