[vlc-commits] mmal/converter: use a Close callback in the operations structure

Steve Lhomme git at videolan.org
Mon Oct 12 15:56:05 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Oct  6 12:08:45 2020 +0200| [766a37d4cc1d6bd598ba9474a0ccc4d17b1ed7c6] | committer: Steve Lhomme

mmal/converter: use a Close callback in the operations structure

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

 modules/hw/mmal/converter.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/modules/hw/mmal/converter.c b/modules/hw/mmal/converter.c
index 87299f6a34..dbdee120b5 100644
--- a/modules/hw/mmal/converter.c
+++ b/modules/hw/mmal/converter.c
@@ -62,7 +62,6 @@ static const char * const  ppsz_converter_text[] = {
 };
 
 int OpenConverter(vlc_object_t *);
-void CloseConverter(vlc_object_t *);
 
 vlc_module_begin()
     add_submodule()
@@ -76,7 +75,7 @@ vlc_module_begin()
     add_integer( MMAL_CONVERTER_TYPE_NAME, FILTER_RESIZER_HVS, MMAL_CONVERTER_TYPE_TEXT, MMAL_CONVERTER_TYPE_LONGTEXT, true )
         change_integer_list( pi_converter_modes, ppsz_converter_text )
 #endif
-    set_callbacks(OpenConverter, CloseConverter)
+    set_callback(OpenConverter)
 vlc_module_end()
 
 #define MMAL_SLICE_HEIGHT 16
@@ -717,9 +716,8 @@ fail:
     return NULL;
 }
 
-void CloseConverter(vlc_object_t * obj)
+static void CloseConverter(filter_t *p_filter)
 {
-    filter_t * const p_filter = (filter_t *)obj;
     converter_sys_t * const sys = p_filter->p_sys;
 
     if (sys == NULL)
@@ -782,7 +780,7 @@ static MMAL_FOURCC_T filter_enc_in(const video_format_t * const fmt)
 
 
 static const struct vlc_filter_operations filter_ops = {
-    .filter_video = conv_filter, .flush = conv_flush,
+    .filter_video = conv_filter, .flush = conv_flush, .close = CloseConverter,
 };
 
 int OpenConverter(vlc_object_t * obj)
@@ -896,7 +894,7 @@ retry:
     if (status != MMAL_SUCCESS) {
         if (resizer_type == FILTER_RESIZER_HVS) {
             msg_Warn(p_filter, "Failed to create HVS resizer - retrying with ISP");
-            CloseConverter(obj);
+            CloseConverter(p_filter);
             resizer_type = FILTER_RESIZER_ISP;
             goto retry;
         }
@@ -979,7 +977,7 @@ retry:
     return VLC_SUCCESS;
 
 fail:
-    CloseConverter(obj);
+    CloseConverter(p_filter);
 
     if (resizer_type != FILTER_RESIZER_RESIZER && status == MMAL_ENOMEM) {
         resizer_type = FILTER_RESIZER_RESIZER;



More information about the vlc-commits mailing list