Commit 192bf986 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vdpau: helper to detach a VDPAU context from a picture

This enables releasing the VLC picture while keeping the VDPAU surface
for internal usage.
parent aba52bc1
......@@ -119,3 +119,14 @@ VdpStatus vlc_vdp_video_copy(picture_t *restrict dst, picture_t *restrict src)
atomic_fetch_add(&frame->refs, 1);
return VDP_STATUS_OK;
}
vlc_vdp_video_field_t *vlc_vdp_video_detach(picture_t *pic)
{
vlc_vdp_video_field_t *field = pic->context;
assert(pic->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_420
|| pic->format.i_chroma == VLC_CODEC_VDPAU_VIDEO_422);
//assert(!picture_IsReferenced(pic));
pic->context = NULL;
return field;
}
......@@ -274,4 +274,10 @@ VdpStatus vlc_vdp_video_attach(vdp_t *, VdpVideoSurface, picture_t *);
* Copies the VDPAU video surface from a VLC picture into another VLC picture.
*/
VdpStatus vlc_vdp_video_copy(picture_t *dst, picture_t *src);
/**
* Detaches a VDPAU video surface as context from a VLC picture.
* @return the detached context, or NULL on error.
*/
vlc_vdp_video_field_t *vlc_vdp_video_detach(picture_t *);
#endif
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