[vlc-commits] vt_utils: merge cvpxpic_attach functions

Thomas Guillem git at videolan.org
Fri Jan 10 13:01:59 CET 2020


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Thu Jan  9 13:24:12 2020 +0100| [02fac81f014a0fe4fc52dd1345b8aa51612ad88f] | committer: Thomas Guillem

vt_utils: merge cvpxpic_attach functions

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

 modules/codec/videotoolbox.m      |  4 ++--
 modules/codec/vt_utils.c          | 13 ++++---------
 modules/codec/vt_utils.h          |  8 +++-----
 modules/video_chroma/cvpx.c       |  4 ++--
 modules/video_filter/ci_filters.m |  2 +-
 5 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 83c343fc4b..ae99214e49 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -2216,8 +2216,8 @@ static void DecoderCallback(void *decompressionOutputRefCon,
             p_pic->b_top_field_first = p_info->b_top_field_first;
         }
 
-        if (cvpxpic_attach_with_cb(p_pic, imageBuffer, pic_holder_on_cvpx_released,
-                                   p_sys->pic_holder) != VLC_SUCCESS)
+        if (cvpxpic_attach(p_pic, imageBuffer, pic_holder_on_cvpx_released,
+                           p_sys->pic_holder) != VLC_SUCCESS)
         {
             vlc_mutex_lock(&p_sys->lock);
             goto end;
diff --git a/modules/codec/vt_utils.c b/modules/codec/vt_utils.c
index cac1389199..ca61779118 100644
--- a/modules/codec/vt_utils.c
+++ b/modules/codec/vt_utils.c
@@ -104,14 +104,9 @@ cvpxpic_attach_common(picture_t *p_pic, CVPixelBufferRef cvpx,
 }
 
 int
-cvpxpic_attach(picture_t *p_pic, CVPixelBufferRef cvpx)
-{
-    return cvpxpic_attach_common(p_pic, cvpx, cvpxpic_destroy_cb, NULL, NULL);
-}
-
-int cvpxpic_attach_with_cb(picture_t *p_pic, CVPixelBufferRef cvpx,
-                           void (*on_released_cb)(CVPixelBufferRef, void *, unsigned),
-                           void *on_released_data)
+cvpxpic_attach(picture_t *p_pic, CVPixelBufferRef cvpx,
+               void (*on_released_cb)(CVPixelBufferRef, void *, unsigned),
+               void *on_released_data)
 {
     return cvpxpic_attach_common(p_pic, cvpx, cvpxpic_destroy_cb, on_released_cb,
                                  on_released_data);
@@ -219,7 +214,7 @@ cvpxpic_unmap(picture_t *mapped_pic)
         return NULL;
     }
 
-    cvpxpic_attach(hw_pic, cvpxpic_get_ref(mapped_pic));
+    cvpxpic_attach(hw_pic, cvpxpic_get_ref(mapped_pic), NULL, NULL);
     picture_CopyProperties(hw_pic, mapped_pic);
     picture_Release(mapped_pic);
     return hw_pic;
diff --git a/modules/codec/vt_utils.h b/modules/codec/vt_utils.h
index 24cd4aa898..1033450667 100644
--- a/modules/codec/vt_utils.h
+++ b/modules/codec/vt_utils.h
@@ -34,11 +34,9 @@ void cfdict_set_int32(CFMutableDictionaryRef dict, CFStringRef key, int value);
  * The cvpx ref will be released when the picture is released
  * @return VLC_SUCCESS or VLC_ENOMEM
  */
-int cvpxpic_attach(picture_t *p_pic, CVPixelBufferRef cvpx);
-
-int cvpxpic_attach_with_cb(picture_t *p_pic, CVPixelBufferRef cvpx,
-                           void (*on_released_cb)(CVPixelBufferRef, void *, unsigned nb_fields),
-                           void *on_released_data);
+int cvpxpic_attach(picture_t *p_pic, CVPixelBufferRef cvpx,
+                   void (*on_released_cb)(CVPixelBufferRef, void *, unsigned nb_fields),
+                   void *on_released_data);
 
 /*
  * Get the cvpx buffer attached to a picture
diff --git a/modules/video_chroma/cvpx.c b/modules/video_chroma/cvpx.c
index 7a83b982d2..a1e6e2c897 100644
--- a/modules/video_chroma/cvpx.c
+++ b/modules/video_chroma/cvpx.c
@@ -214,7 +214,7 @@ static picture_t *SW_TO_CVPX_Filter(filter_t *p_filter, picture_t *src)
     Copy(p_filter, mapped_dst, src, __MIN(height, src->format.i_visible_height));
 
     /* Attach the CVPX to a new opaque picture */
-    cvpxpic_attach(dst, cvpxpic_get_ref(mapped_dst));
+    cvpxpic_attach(dst, cvpxpic_get_ref(mapped_dst), NULL, NULL);
 
     /* Unlock and unmap the dst picture */
     picture_Release(mapped_dst);
@@ -365,7 +365,7 @@ Filter(filter_t *filter, picture_t *src)
         return NULL;
     }
 
-    cvpxpic_attach(dst, dst_cvpx);
+    cvpxpic_attach(dst, dst_cvpx, NULL, NULL);
 
     picture_CopyProperties(dst, src);
     picture_Release(src);
diff --git a/modules/video_filter/ci_filters.m b/modules/video_filter/ci_filters.m
index 236fc3452a..2bf1ff6974 100644
--- a/modules/video_filter/ci_filters.m
+++ b/modules/video_filter/ci_filters.m
@@ -369,7 +369,7 @@ Filter(filter_t *filter, picture_t *src)
     if (!cvpx)
         goto error;
 
-    if (cvpxpic_attach(dst, cvpx))
+    if (cvpxpic_attach(dst, cvpx, NULL, NULL))
     {
         CFRelease(cvpx);
         goto error;



More information about the vlc-commits mailing list