]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/panoramix.c
macosx: Ask to send a mail to our bugreport ML if a crash log is detected.
[vlc] / modules / video_filter / panoramix.c
index 340e69eb005adb848b6ca82e88050d794bb9cb20..1d4a8ba70aa53f0a111ec677d7e487638940d751 100644 (file)
@@ -30,7 +30,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_vout.h>
 
@@ -40,7 +40,7 @@
 #define OVERLAP        2350
 #ifdef OVERLAP
     #include <math.h>
-    // OS CODE DEPENDANT to get display dimensions
+    // OS CODE DEPENDENT to get display dimensions
     #ifdef SYS_MINGW32
         #include <windows.h>
     #else
@@ -94,7 +94,7 @@ static int  SendEvents( vlc_object_t *, char const *,
 
 vlc_module_begin();
     set_description( N_("Panoramix: wall with overlap video filter") );
-    set_shortname( _("Panoramix" ));
+    set_shortname( N_("Panoramix" ));
     set_capability( "video filter", 0 );
     set_category( CAT_VIDEO );
     set_subcategory( SUBCAT_VIDEO_VFILTER );
@@ -201,7 +201,7 @@ vlc_module_begin();
     set_callbacks( Create, Destroy );
 vlc_module_end();
 
-static const char *ppsz_filter_options[] = {
+static const char *const ppsz_filter_options[] = {
     "cols", "rows", "offset-x", "bz-length", "bz-height", "attenuate",
     "bz-begin", "bz-middle", "bz-end", "bz-middle-pos", "bz-gamma-red",
     "bz-gamma-green", "bz-gamma-blue", "bz-blackcrush-red",
@@ -295,10 +295,7 @@ static int Create( vlc_object_t *p_this )
     /* Allocate structure */
     p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
     if( p_vout->p_sys == NULL )
-    {
-        msg_Err( p_vout, "out of memory" );
         return VLC_ENOMEM;
-    }
 
     p_vout->pf_init = Init;
     p_vout->pf_end = End;
@@ -360,7 +357,7 @@ case VLC_FOURCC('c','y','u','v'):    // packed by 2
     p_vout->p_sys->i_col = var_CreateGetInteger( p_vout, CFG_PREFIX "cols" );
     p_vout->p_sys->i_row = var_CreateGetInteger( p_vout, CFG_PREFIX "rows" );
 
-// OS dependant code :  Autodetect number of displays in wall
+// OS dependent code :  Autodetect number of displays in wall
 #ifdef SYS_MINGW32
     if ((p_vout->p_sys->i_col < 0) || (p_vout->p_sys->i_row < 0) )
     {
@@ -430,7 +427,6 @@ case VLC_FOURCC('c','y','u','v'):    // packed by 2
                                      sizeof(struct vout_list_t) );
     if( p_vout->p_sys->pp_vout == NULL )
     {
-        msg_Err( p_vout, "out of memory" );
         free( p_vout->p_sys );
         return VLC_ENOMEM;
     }
@@ -552,7 +548,7 @@ static int AdjustHeight( vout_thread_t *p_vout )
     double d_halfLength_calculated;
     int    i_offset = 0;
 
-// OS DEPENDANT CODE to get display dimensions
+// OS DEPENDENT CODE to get display dimensions
         if (b_fullscreen)
         {
 #ifdef SYS_MINGW32
@@ -877,15 +873,20 @@ static void End( vout_thread_t *p_vout )
 {
     int i_index;
 
-#ifdef OVERLAP
-    var_SetInteger( p_vout, "bz-length", p_vout->p_sys->bz_length);
-#endif
+    DEL_PARENT_CALLBACKS( SendEventsToChild );
+
     /* Free the fake output buffers we allocated */
     for( i_index = I_OUTPUTPICTURES ; i_index ; )
     {
         i_index--;
         free( PP_OUTPUTPICTURE[ i_index ]->p_data_orig );
     }
+
+    RemoveAllVout( p_vout );
+
+#ifdef OVERLAP
+    var_SetInteger( p_vout, "bz-length", p_vout->p_sys->bz_length);
+#endif
 }
 
 /*****************************************************************************
@@ -897,16 +898,6 @@ static void Destroy( vlc_object_t *p_this )
 {
     vout_thread_t *p_vout = (vout_thread_t *)p_this;
 
-#ifdef GLOBAL_OUTPUT
-    DEL_CALLBACKS( p_vout->p_sys->p_vout, SendEvents);
-    vlc_object_detach( p_vout->p_sys->p_vout );
-    vout_Destroy( p_vout->p_sys->p_vout );
-    DEL_PARENT_CALLBACKS( SendEventsToChild);
-#endif
-
-    RemoveAllVout( p_vout );
-    DEL_PARENT_CALLBACKS( SendEventsToChild );
-
     free( p_vout->p_sys->pp_vout );
     free( p_vout->p_sys );
 
@@ -968,7 +959,7 @@ static void RenderPlanarYUV( vout_thread_t *p_vout, picture_t *p_pic )
                                     0, 0, 0 )
                    ) == NULL )
             {
-                if( p_vout->b_die || p_vout->b_error )
+                if( !vlc_object_alive (p_vout) || p_vout->b_error )
                 {
                     vout_DestroyPicture(
                         p_vout->p_sys->pp_vout[ i_vout ].p_vout, p_outpic );
@@ -1312,7 +1303,7 @@ static void RenderPackedRGB( vout_thread_t *p_vout, picture_t *p_pic )
                                     0, 0, 0 )
                    ) == NULL )
             {
-                if( p_vout->b_die || p_vout->b_error )
+                if( !vlc_object_alive (p_vout) || p_vout->b_error )
                 {
                     vout_DestroyPicture(
                         p_vout->p_sys->pp_vout[ i_vout ].p_vout, p_outpic );
@@ -1650,7 +1641,7 @@ static void RenderPackedYUV( vout_thread_t *p_vout, picture_t *p_pic )
                                     0, 0, 0 )
                    ) == NULL )
             {
-                if( p_vout->b_die || p_vout->b_error )
+                if( !vlc_object_alive (p_vout) || p_vout->b_error )
                 {
                     vout_DestroyPicture(
                         p_vout->p_sys->pp_vout[ i_vout ].p_vout, p_outpic );
@@ -1912,10 +1903,7 @@ static void RemoveAllVout( vout_thread_t *p_vout )
              DEL_CALLBACKS(
                  p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout,
                  SendEvents );
-             vlc_object_detach(
-                 p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout );
-             vout_Destroy(
-                 p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout );
+             vout_CloseAndRelease( p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout );
          }
     }
 }