Skip to content
Snippets Groups Projects
Commit 8404b9e9 authored by Thomas Guillem's avatar Thomas Guillem
Browse files

vt_utils: add cvtx to cvpxpic_create_mapped

parent b81811fc
No related branches found
No related tags found
No related merge requests found
......@@ -138,7 +138,8 @@ cvpxpic_destroy_mapped_rw_cb(picture_context_t *opaque)
picture_t *
cvpxpic_create_mapped(const video_format_t *fmt, CVPixelBufferRef cvpx,
bool readonly)
vlc_video_context *vctx, bool readonly)
{
unsigned planes_count;
switch (fmt->i_chroma)
......@@ -180,7 +181,7 @@ cvpxpic_create_mapped(const video_format_t *fmt, CVPixelBufferRef cvpx,
picture_t *pic = picture_NewFromResource(fmt, &rsc);
if (pic == NULL
|| cvpxpic_attach_common(pic, cvpx, pf_destroy, NULL, NULL) != VLC_SUCCESS)
|| cvpxpic_attach_common(pic, cvpx, pf_destroy, vctx, NULL) != VLC_SUCCESS)
{
CVPixelBufferUnlockBaseAddress(cvpx, lock);
return NULL;
......
......@@ -52,7 +52,8 @@ CVPixelBufferRef cvpxpic_get_ref(picture_t *pic);
* the picture and unmap the cvpx buffer.
*/
picture_t *cvpxpic_create_mapped(const video_format_t *fmt,
CVPixelBufferRef cvpx, bool readonly);
CVPixelBufferRef cvpx, vlc_video_context *vctx,
bool readonly);
/*
* Create a picture attached to an unmapped cvpx buffer
......
......@@ -154,7 +154,8 @@ static picture_t *CVPX_TO_SW_Filter(filter_t *p_filter, picture_t *src)
filter_sys_t *p_sys = p_filter->p_sys;
CVPixelBufferRef cvpx = cvpxpic_get_ref(src);
picture_t *src_sw = cvpxpic_create_mapped(&p_sys->sw.fmt, cvpx, true);
picture_t *src_sw =
cvpxpic_create_mapped(&p_sys->sw.fmt, cvpx, NULL, true);
if (!src_sw)
{
picture_Release(src);
......@@ -193,7 +194,7 @@ static picture_t *SW_TO_CVPX_Filter(filter_t *p_filter, picture_t *src)
/* Allocate a CPVX backed picture mapped for read/write */
picture_t *mapped_dst =
cvpxpic_create_mapped(&p_sys->sw.fmt, cvpx, false);
cvpxpic_create_mapped(&p_sys->sw.fmt, cvpx, NULL, false);
CFRelease(cvpx);
if (!mapped_dst)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment