[vlc-devel] [PATCH 19/26] vaapi: use the decoder device to get the VADisplay
Steve Lhomme
robux4 at ycbcr.xyz
Fri Sep 20 16:28:49 CEST 2019
---
modules/codec/avcodec/vaapi.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c
index 569fc6cec81..dff3d6a771e 100644
--- a/modules/codec/avcodec/vaapi.c
+++ b/modules/codec/avcodec/vaapi.c
@@ -149,9 +149,9 @@ static void Delete(vlc_va_t *va)
static const struct vlc_va_operations ops = { Get, Delete, };
static int Create(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
- const es_format_t *fmt, void *p_sys, vlc_decoder_device *device)
+ const es_format_t *fmt, void *p_sys, vlc_decoder_device *dec_device)
{
- if (pix_fmt != AV_PIX_FMT_VAAPI_VLD || p_sys == NULL)
+ if (pix_fmt != AV_PIX_FMT_VAAPI_VLD || dec_device == NULL)
return VLC_EGENERIC;
vlc_va_sys_t *sys = malloc(sizeof *sys);
@@ -163,10 +163,8 @@ static int Create(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
int ret = VLC_EGENERIC;
- /* The picture must be allocated by the vout */
- VADisplay va_dpy;
- vlc_decoder_device *dec_device =
- vlc_vaapi_PicSysHoldInstance(p_sys, &va_dpy);
+ assert(dec_device->type == VLC_DECODER_DEVICE_VAAPI);
+ VADisplay va_dpy = dec_device->opaque;
VAProfile i_profile;
unsigned count;
--
2.17.1
More information about the vlc-devel
mailing list