[vlc-commits] vt_utils: add cvtx to cvpxpic_create_mapped

Thomas Guillem git at videolan.org
Fri Jan 10 13:02:05 CET 2020


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jan  9 15:42:37 2020 +0100| [8404b9e97703678181909a2cb741e5b5cd521f14] | committer: Thomas Guillem

vt_utils: add cvtx to cvpxpic_create_mapped

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8404b9e97703678181909a2cb741e5b5cd521f14
---

 modules/codec/vt_utils.c    | 5 +++--
 modules/codec/vt_utils.h    | 3 ++-
 modules/video_chroma/cvpx.c | 5 +++--
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/modules/codec/vt_utils.c b/modules/codec/vt_utils.c
index c23ff75b08..9e7cf7f3ef 100644
--- a/modules/codec/vt_utils.c
+++ b/modules/codec/vt_utils.c
@@ -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;
diff --git a/modules/codec/vt_utils.h b/modules/codec/vt_utils.h
index e981237ed6..6132eae614 100644
--- a/modules/codec/vt_utils.h
+++ b/modules/codec/vt_utils.h
@@ -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
diff --git a/modules/video_chroma/cvpx.c b/modules/video_chroma/cvpx.c
index 6522ca710a..fc34f76593 100644
--- a/modules/video_chroma/cvpx.c
+++ b/modules/video_chroma/cvpx.c
@@ -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)
     {



More information about the vlc-commits mailing list