Commit ac1f5fe2 authored by Steve Lhomme's avatar Steve Lhomme Committed by Rémi Denis-Courmont

avcodec: va: respect the buffer release prototype

It has always have an extra uint8_t pointer.

--
replaces https://patches.videolan.org/patch/15166/
fix compilation
Signed-off-by: Rémi Denis-Courmont's avatarRémi Denis-Courmont <remi@remlab.net>
parent 89c70235
......@@ -415,7 +415,7 @@ int directx_va_Get(vlc_va_t *va, directx_sys_t *dx_sys, picture_t *pic, uint8_t
return VLC_SUCCESS;
}
void directx_va_Release(void *opaque)
void directx_va_Release(void *opaque, uint8_t *data)
{
picture_t *pic = opaque;
vlc_va_surface_t *surface = pic->context;
......
......@@ -138,7 +138,7 @@ int directx_va_Open(vlc_va_t *, directx_sys_t *, AVCodecContext *ctx, const es_f
void directx_va_Close(vlc_va_t *, directx_sys_t *);
int directx_va_Setup(vlc_va_t *, directx_sys_t *, AVCodecContext *avctx);
int directx_va_Get(vlc_va_t *, directx_sys_t *, picture_t *pic, uint8_t **data);
void directx_va_Release(void *opaque);
void directx_va_Release(void *opaque, uint8_t *data);
char *directx_va_GetDecoderName(const GUID *guid);
#endif /* AVCODEC_DIRECTX_VA_H */
......@@ -41,7 +41,7 @@ struct vlc_va_t {
void (*setup)(vlc_va_t *, vlc_fourcc_t *output);
#endif
int (*get)(vlc_va_t *, picture_t *pic, uint8_t **data);
void (*release)(void *pic);
void (*release)(void *pic, uint8_t *data);
int (*extract)(vlc_va_t *, picture_t *pic, uint8_t *data);
};
......@@ -95,7 +95,7 @@ static inline int vlc_va_Get(vlc_va_t *va, picture_t *pic, uint8_t **data)
*/
static inline void vlc_va_Release(vlc_va_t *va, picture_t *pic)
{
va->release(pic);
va->release(pic, NULL);
}
/**
......
......@@ -167,8 +167,9 @@ static int Get( vlc_va_t *va, picture_t *pic, uint8_t **data )
return VLC_SUCCESS;
}
static void Release( void *opaque )
static void Release( void *opaque, uint8_t *data )
{
(void) data;
picture_t *pic = opaque;
VASurfaceID *surface = pic->context;
vlc_va_sys_t *sys = (void *)((((uintptr_t)surface)
......
......@@ -166,9 +166,10 @@ static int Get( vlc_va_t *va, picture_t *p_picture, uint8_t **data )
}
// Never called
static void Release( void *opaque )
static void Release( void *opaque, uint8_t *data )
{
VLC_UNUSED(opaque);
VLC_UNUSED(data);
}
static int Extract( vlc_va_t *va, picture_t *p_picture, uint8_t *data )
......
......@@ -1106,8 +1106,9 @@ static void ffmpeg_InitCodec( decoder_t *p_dec )
}
}
static void lavc_ReleaseFrame(void *opaque)
static void lavc_ReleaseFrame(void *opaque, uint8_t *data)
{
(void) data;
picture_t *picture = opaque;
picture_Release(picture);
......@@ -1129,14 +1130,14 @@ static int lavc_va_GetFrame(struct AVCodecContext *ctx, AVFrame *frame,
* data[3] actually contains the format-specific surface handle. */
frame->data[3] = frame->data[0];
void (*release)(void *) = va->release;
void (*release)(void *, uint8_t *) = va->release;
if (va->release == NULL)
release = lavc_ReleaseFrame;
frame->buf[0] = av_buffer_create(frame->data[0], 0, release, pic, 0);
if (unlikely(frame->buf[0] == NULL))
{
release(pic);
release(pic, frame->data[0]);
return -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment