[vlc-commits] vdpau: create a dummy video context
Steve Lhomme
git at videolan.org
Wed Oct 9 10:16:29 CEST 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Sep 23 16:22:39 2019 +0200| [3915af3cd365389d4b5d916dcb13916c923eb186] | committer: Steve Lhomme
vdpau: create a dummy video context
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3915af3cd365389d4b5d916dcb13916c923eb186
---
modules/hw/vdpau/avcodec.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/modules/hw/vdpau/avcodec.c b/modules/hw/vdpau/avcodec.c
index 757a158558..33ac52c0cb 100644
--- a/modules/hw/vdpau/avcodec.c
+++ b/modules/hw/vdpau/avcodec.c
@@ -48,6 +48,7 @@ struct vlc_va_sys_t
void *hwaccel_context;
uint32_t width;
uint32_t height;
+ vlc_video_context *vctx;
vlc_vdp_video_field_t *pool[];
};
@@ -126,6 +127,7 @@ static void Close(vlc_va_t *va)
for (unsigned i = 0; sys->pool[i] != NULL; i++)
vlc_vdp_video_destroy(sys->pool[i]);
vdp_release_x11(sys->vdp);
+ vlc_video_context_Release(sys->vctx);
if (sys->hwaccel_context)
av_free(sys->hwaccel_context);
free(sys);
@@ -211,6 +213,10 @@ static int Open(vlc_va_t *va, AVCodecContext *avctx, const AVPixFmtDescriptor *d
goto error;
}
+ sys->vctx = vlc_video_context_Create( dec_device, VLC_VIDEO_CONTEXT_VDPAU, 0, NULL );
+ if (sys->vctx == NULL)
+ goto error;
+
if (i < refs)
msg_Warn(va, "video RAM low (allocated %u of %u buffers)",
i, refs);
@@ -219,6 +225,7 @@ static int Open(vlc_va_t *va, AVCodecContext *avctx, const AVPixFmtDescriptor *d
if (vdp_get_information_string(sys->vdp, &infos) == VDP_STATUS_OK)
msg_Info(va, "Using %s", infos);
+ *vtcx_out = sys->vctx;
va->ops = &ops;
return VLC_SUCCESS;
More information about the vlc-commits
mailing list