[vlc-devel] [PATCH 3/7] opencv_wrapper: Remove the weird custom verbosity

Edward Wang edward.c.wang at compdigitec.com
Thu Aug 9 21:19:11 CEST 2012


---
 modules/video_filter/opencv_wrapper.c |   65 ++++++++++-----------------------
 1 files changed, 20 insertions(+), 45 deletions(-)

diff --git a/modules/video_filter/opencv_wrapper.c b/modules/video_filter/opencv_wrapper.c
index 7400351..11daeb2 100644
--- a/modules/video_filter/opencv_wrapper.c
+++ b/modules/video_filter/opencv_wrapper.c
@@ -93,10 +93,6 @@ vlc_module_begin ()
                           N_("Wrapper filter output"),
                           N_("Determines what (if any) video is displayed by the wrapper filter"), false);
         change_string_list( output_list, output_list_text, 0);
-    add_string( "opencv-verbosity", "error",
-                          N_("Wrapper filter verbosity"),
-                          N_("Determines wrapper filter verbosity level"), false);
-        change_string_list( verbosity_list, verbosity_list_text, 0);
     add_string( "opencv-filter-name", "none",
                           N_("OpenCV internal filter name"),
                           N_("Name of internal OpenCV plugin filter to use"), false);
@@ -152,7 +148,6 @@ struct filter_sys_t
 
     int i_wrapper_output;
     int i_internal_chroma;
-    int i_verbosity;
 
     IplImage *p_cv_image[VOUT_MAX_PLANES];
 
@@ -224,42 +219,17 @@ static int Create( vlc_object_t *p_this )
     }
     free( psz_output );
 
-    psz_verbosity = var_InheritString( p_filter, "opencv-verbosity" );
-    if( psz_verbosity == NULL )
-    {
-        msg_Err( p_filter, "configuration variable %s empty, using 'input'",
-                         "opencv-verbosity" );
-        p_filter->p_sys->i_verbosity = VERB_ERROR;
-    }
-    else
-    {
-        if( !strcmp( psz_verbosity, "error" ) )
-            p_filter->p_sys->i_verbosity = VERB_ERROR;
-        else if( !strcmp( psz_verbosity, "warning" ) )
-            p_filter->p_sys->i_verbosity = VERB_WARN;
-        else if( !strcmp( psz_verbosity, "debug" ) )
-            p_filter->p_sys->i_verbosity = VERB_DEBUG;
-        else
-        {
-            msg_Err( p_filter, "no valid opencv-verbosity provided, using 'error'" );
-            p_filter->p_sys->i_verbosity = VERB_ERROR;
-        }
-    }
-    free( psz_verbosity);
-
     p_filter->p_sys->psz_inner_name =
         var_InheritString( p_filter, "opencv-filter-name" );
     p_filter->p_sys->f_scale =
         var_InheritFloat( p_filter, "opencv-scale" );
 
-    if (p_filter->p_sys->i_verbosity > VERB_WARN)
-        msg_Info(p_filter, "Configuration: opencv-scale: %f, opencv-chroma: %d, "
-            "opencv-output: %d, opencv-verbosity %d, opencv-filter %s",
-            p_filter->p_sys->f_scale,
-            p_filter->p_sys->i_internal_chroma,
-            p_filter->p_sys->i_wrapper_output,
-            p_filter->p_sys->i_verbosity,
-            p_filter->p_sys->psz_inner_name);
+    msg_Info(p_filter, "Configuration: opencv-scale: %f, opencv-chroma: %d, "
+        "opencv-output: %d, opencv-filter %s",
+        p_filter->p_sys->f_scale,
+        p_filter->p_sys->i_internal_chroma,
+        p_filter->p_sys->i_wrapper_output,
+        p_filter->p_sys->psz_inner_name);
 
     /* Load the internal opencv filter */
     /* We don't need to set up video formats for this filter as it not actually using a picture_t */
@@ -281,9 +251,9 @@ static int Create( vlc_object_t *p_this )
         return VLC_ENOMOD;
     }
 
-    /* Try to open the real video output */
-    if (p_filter->p_sys->i_verbosity > VERB_WARN)
-        msg_Dbg( p_filter, "spawning the real video output" );
+#ifndef NDEBUG
+    msg_Dbg( p_filter, "opencv_wrapper successfully started" );
+#endif
 
     p_filter->pf_video_filter = Filter;
 
@@ -333,8 +303,10 @@ static void ReleaseImages(filter_t *p_filter)
         picture_Release( p_sys->p_to_be_freed );
         p_sys->p_to_be_freed = NULL;
     }
-    if (p_sys->i_verbosity > VERB_WARN)
-        msg_Dbg( p_filter, "images released" );
+
+#ifndef NDEBUG
+    msg_Dbg( p_filter, "images released" );
+#endif
 }
 
 /*****************************************************************************
@@ -426,8 +398,10 @@ static void VlcPictureToIplImage( filter_t* p_filter, picture_t* p_in )
     //calculate duration of conversion
     finish = clock();
     duration = (double)(finish - start) / CLOCKS_PER_SEC;
-    if (p_sys->i_verbosity > VERB_WARN)
-        msg_Dbg( p_filter, "VlcPictureToIplImageRgb took %2.4f seconds", duration );
+
+#ifndef NDEBUG
+    msg_Dbg( p_filter, "VlcPictureToIplImageRgb took %2.4f seconds", duration );
+#endif
 }
 
 /*****************************************************************************
@@ -464,8 +438,9 @@ static picture_t* Filter( filter_t* p_filter, picture_t* p_pic )
     //calculate duration
     clock_t finish = clock();
     double duration = (double)(finish - start) / CLOCKS_PER_SEC;
-    if (p_filter->p_sys->i_verbosity > VERB_WARN)
-        msg_Dbg( p_filter, "Filter took %2.4f seconds", duration );
+#ifndef NDEBUG
+    msg_Dbg( p_filter, "Filter took %2.4f seconds", duration );
+#endif
 
     if( p_filter->p_sys->i_wrapper_output == VINPUT ) {
         picture_Release( p_pic );
-- 
1.7.5.4




More information about the vlc-devel mailing list