On Sun, 22 Oct 2017 02:15:07 +0200
Diego Biurrun <[email protected]> wrote:

> On Thu, Oct 19, 2017 at 05:25:17PM +0200, wm4  wrote:
> > Module: libav
> > Author:    wm4 <[email protected]>
> > Committer: Anton Khirnov <[email protected]>
> > Date:      Thu Oct 19 16:38:20 2017 +0200
> > 
> > lavc: external hardware frame pool initialization
> > 
> > This adds a new API, which allows the API user to query the required
> > AVHWFramesContext parameters. This also reduces code duplication across
> > the hwaccels by introducing ff_decode_get_hw_frames_ctx(), which uses
> > the new API function. It takes care of initializing the hw_frames_ctx
> > if needed, and does additional error handling and API usage checking.
> > 
> > ---
> > 
> > --- a/libavcodec/avcodec.h
> > +++ b/libavcodec/avcodec.h
> > @@ -3984,6 +3994,109 @@ int avcodec_send_frame(AVCodecContext *avctx, const 
> > AVFrame *frame);
> > +int avcodec_get_hw_frames_parameters(AVCodecContext *avctx,
> > +                                     AVBufferRef *device_ref,
> > +                                     enum AVPixelFormat hw_pix_fmt,
> > +                                     AVBufferRef **out_frames_ref);
> > +
> > +
> > --- a/libavcodec/decode.c
> > +++ b/libavcodec/decode.c
> > @@ -669,6 +669,88 @@ static AVHWAccel *find_hwaccel(enum AVCodecID codec_id,
> > +int ff_decode_get_hw_frames_ctx(AVCodecContext *avctx,
> > +                                enum AVHWDeviceType dev_type)
> > +{
> > +    ret = avcodec_get_hw_frames_parameters(avctx,
> > +                                           avctx->hw_device_ctx,
> > +                                           avctx->hwaccel->pix_fmt,
> > +                                           avctx->hw_frames_ctx);  
> 
> This generates a very suspicious warning:
> 
> libavcodec/decode.c: In function ‘ff_decode_get_hw_frames_ctx’:
> libavcodec/decode.c:701:44: warning: passing argument 4 of 
> avcodec_get_hw_frames_parameters’ from incompatible pointer type 
> [-Wincompatible-pointer-types]
>                                             avctx->hw_frames_ctx);
>                                             ^~~~~
> In file included from libavcodec/decode.c:34:0:
> libavcodec/avcodec.h:4094:5: note: expected ‘AVBufferRef ** {aka struct 
> AVBufferRef **}’ but argument is of type ‘AVBufferRef * {aka struct 
> AVBufferRef *}’
>  int avcodec_get_hw_frames_parameters(AVCodecContext *avctx,
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Probably forgot to update and test this part. Possibly crashes in
hw_device_ctx mode.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to