]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/rotate.c
XCB/window: implement --video-title, UTF-8 names
[vlc] / modules / video_filter / rotate.c
index 38f3c062df1ca59e1d15893a4b19fcc561f88f94..8a0873e0c8749d054e05925dded8bd55051432a5 100644 (file)
  * Preamble
  *****************************************************************************/
 
-#include <math.h>                                            /* sin(), cos() */
-
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
 
+#include <math.h>                                            /* sin(), cos() */
+
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_vout.h>
@@ -63,19 +63,19 @@ static int PreciseRotateCallback( vlc_object_t *p_this, char const *psz_var,
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
-vlc_module_begin();
-    set_description( N_("Rotate video filter") );
-    set_shortname( N_( "Rotate" ));
-    set_capability( "video filter2", 0 );
-    set_category( CAT_VIDEO );
-    set_subcategory( SUBCAT_VIDEO_VFILTER );
+vlc_module_begin ()
+    set_description( N_("Rotate video filter") )
+    set_shortname( N_( "Rotate" ))
+    set_capability( "video filter2", 0 )
+    set_category( CAT_VIDEO )
+    set_subcategory( SUBCAT_VIDEO_VFILTER )
 
     add_integer_with_range( FILTER_PREFIX "angle", 30, 0, 359, NULL,
-        ANGLE_TEXT, ANGLE_LONGTEXT, false );
+        ANGLE_TEXT, ANGLE_LONGTEXT, false )
 
-    add_shortcut( "rotate" );
-    set_callbacks( Create, Destroy );
-vlc_module_end();
+    add_shortcut( "rotate" )
+    set_callbacks( Create, Destroy )
+vlc_module_end ()
 
 static const char *const ppsz_filter_options[] = {
     "angle", NULL
@@ -157,6 +157,10 @@ static void Destroy( vlc_object_t *p_this )
 {
     filter_t *p_filter = (filter_t *)p_this;
 
+    var_DelCallback( p_filter, FILTER_PREFIX "angle", RotateCallback, p_filter->p_sys );
+    var_DelCallback( p_filter, FILTER_PREFIX "deciangle",
+                     PreciseRotateCallback, p_filter->p_sys );
+
     free( p_filter->p_sys );
 }
 
@@ -172,12 +176,10 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
 
     if( !p_pic ) return NULL;
 
-    p_outpic = p_filter->pf_vout_buffer_new( p_filter );
+    p_outpic = filter_NewPicture( p_filter );
     if( !p_outpic )
     {
-        msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
@@ -301,17 +303,14 @@ static picture_t *FilterPacked( filter_t *p_filter, picture_t *p_pic )
     {
         msg_Warn( p_filter, "Unsupported input chroma (%4s)",
                   (char*)&(p_pic->format.i_chroma) );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
-    p_outpic = p_filter->pf_vout_buffer_new( p_filter );
+    p_outpic = filter_NewPicture( p_filter );
     if( !p_outpic )
     {
-        msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }