]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/magnify.c
macosx: Remove VLCEmbeddedDetachedVout because it's not used. (Or at leat doesn't...
[vlc] / modules / video_filter / magnify.c
index fd0cb06b974a1e1c26e836ea9b6cf0ca04c42fc9..6b38557eb1ef63f1b1f6b99ddd83050490324bdc 100644 (file)
@@ -29,7 +29,8 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_vout.h>
 
 #include <math.h>
@@ -60,8 +61,8 @@ static int  MouseEvent   ( vlc_object_t *, char const *,
  * Module descriptor
  *****************************************************************************/
 vlc_module_begin();
-    set_description( _("Magnify/Zoom interactive video filter") );
-    set_shortname( _( "Magnify" ));
+    set_description( N_("Magnify/Zoom interactive video filter") );
+    set_shortname( N_( "Magnify" ));
     set_capability( "video filter", 0 );
     set_category( CAT_VIDEO );
     set_subcategory( SUBCAT_VIDEO_VFILTER );
@@ -112,10 +113,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->p_sys->p_image = image_HandlerCreate( p_vout );
 
@@ -211,7 +209,7 @@ static void Destroy( vlc_object_t *p_this )
     {
         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 );
+        vlc_object_release( p_vout->p_sys->p_vout );
     }
 
     image_HandlerDelete( p_vout->p_sys->p_image );
@@ -243,7 +241,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
     while( ( p_outpic = vout_CreatePicture( p_vout->p_sys->p_vout, 0, 0, 0 ) )
               == NULL )
     {
-        if( p_vout->b_die || p_vout->b_error )
+        if( !vlc_object_alive (p_vout) || p_vout->b_error )
         {
             return;
         }
@@ -361,8 +359,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
     {
         for( i_plane = 0; i_plane < p_pic->i_planes; i_plane++ )
         {
-        p_vout->p_libvlc->
-        pf_memcpy( p_outpic->p[i_plane].p_pixels, p_pic->p[i_plane].p_pixels,
+        vlc_memcpy( p_outpic->p[i_plane].p_pixels, p_pic->p[i_plane].p_pixels,
             p_outpic->p[i_plane].i_lines * p_outpic->p[i_plane].i_pitch );
         }
     }
@@ -379,7 +376,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
         {
             for( y=0; y<p_converted->p[i_plane].i_visible_lines; y++)
             {
-                p_vout->p_libvlc->pf_memcpy(
+                vlc_memcpy(
                 p_outpic->p[i_plane].p_pixels+y*p_outpic->p[i_plane].i_pitch,
                 p_converted->p[i_plane].p_pixels+y*p_converted->p[i_plane].i_pitch,
                 p_converted->p[i_plane].i_visible_pitch );
@@ -391,7 +388,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
         v_w = p_oyp->i_pitch*ZOOM_FACTOR/(VIS_ZOOM*o_zoom);
         v_h = (o_y+p_oyp->i_lines*ZOOM_FACTOR/o_zoom)/VIS_ZOOM;
         /* top line */
-        p_vout->p_libvlc->pf_memset( p_oyp->p_pixels
+        vlc_memset( p_oyp->p_pixels
                                      + o_y/VIS_ZOOM*p_oyp->i_pitch
                                      + o_x/VIS_ZOOM, 0xff, v_w+1 );
 
@@ -407,7 +404,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
             ] = 0xff;
         }
         /* bottom line */
-        p_vout->p_libvlc->pf_memset( p_oyp->p_pixels
+        vlc_memset( p_oyp->p_pixels
                                      + v_h*p_oyp->i_pitch
                                      + o_x/VIS_ZOOM, 0xff, v_w+1 );
 
@@ -450,18 +447,14 @@ o o X o o o X X X X X o o X X X X o o o X X X X X o o X X X o o o X X X o o X o
     if( p_vout->p_sys->b_visible )
     {
         /* zoom gauge */
-        p_vout->p_libvlc->pf_memset( p_oyp->p_pixels
-                                     + (v_h+9)*p_oyp->i_pitch,
-                                     0xff, 41 );
+        vlc_memset( p_oyp->p_pixels + (v_h+9)*p_oyp->i_pitch, 0xff, 41 );
         for( y = v_h + 10; y < v_h + 90; y++ )
         {
             int width = v_h + 90 - y;
             width = (width*width)/160;
-            if( (80 - y + v_h)*10 < o_zoom )
+            if( (80 - y + v_h)*ZOOM_FACTOR/10 < o_zoom )
             {
-                p_vout->p_libvlc->pf_memset( p_oyp->p_pixels
-                                             + y*p_oyp->i_pitch,
-                                             0xff, width );
+                vlc_memset( p_oyp->p_pixels + y*p_oyp->i_pitch, 0xff, width );
             }
             else
             {