]> git.sesse.net Git - vlc/blobdiff - modules/video_output/sdl.c
Make it possible to change the blur factor after filter launch.
[vlc] / modules / video_output / sdl.c
index fa4fa29adb09b60e30235bb4d23084ffaabb317e..19a15ffa0100207d83c7362c7179908cb92e060c 100644 (file)
@@ -20,7 +20,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
@@ -31,9 +31,9 @@
 #include <string.h>                                            /* strerror() */
 
 #include <vlc/vlc.h>
-#include <vlc/intf.h>
-#include <vlc/vout.h>
-#include <vlc/aout.h>
+#include <vlc_interface.h>
+#include <vlc_vout.h>
+#include <vlc_aout.h>
 
 #include <sys/types.h>
 #ifndef WIN32
@@ -42,7 +42,8 @@
 
 #include SDL_INCLUDE_FILE
 
-#define SDL_MAX_DIRECTBUFFERS 10
+/* SDL is not able to crop overlays - so use only 1 direct buffer */
+#define SDL_MAX_DIRECTBUFFERS 1
 #define SDL_DEFAULT_BPP 16
 
 /*****************************************************************************
@@ -109,7 +110,7 @@ vlc_module_begin();
     add_shortcut( "sdl" );
     set_callbacks( Open, Close );
     /* XXX: check for conflicts with the SDL audio output */
-    var_Create( p_module->p_libvlc, "sdl", VLC_VAR_MUTEX );
+    var_Create( p_module->p_libvlc_global, "sdl", VLC_VAR_MUTEX );
 #if defined( __i386__ ) || defined( __x86_64__ )
     /* On i386, SDL is linked against svgalib */
     linked_with_a_crap_library_which_uses_atexit();
@@ -132,7 +133,7 @@ static int Open ( vlc_object_t *p_this )
     char *psz_method;
 #endif
 
-    var_Get( p_this->p_libvlc, "sdl", &lockval );
+    var_Get( p_this->p_libvlc_global, "sdl", &lockval );
     vlc_mutex_lock( lockval.p_address );
 
     if( SDL_WasInit( SDL_INIT_VIDEO ) != 0 )
@@ -326,7 +327,7 @@ static int Manage( vout_thread_t *p_vout )
 {
     SDL_Event event;                                            /* SDL event */
     vlc_value_t val;
-    int i_width, i_height, i_x, i_y;
+    unsigned int i_width, i_height, i_x, i_y;
 
     /* Process events */
     while( SDL_PollEvent(&event) )
@@ -416,7 +417,7 @@ static int Manage( vout_thread_t *p_vout )
             break;
 
         case SDL_QUIT:
-            p_vout->p_vlc->b_die = 1;
+            p_vout->p_libvlc->b_die = 1;
             break;
 
         case SDL_KEYDOWN:                             /* if a key is pressed */
@@ -430,12 +431,12 @@ static int Manage( vout_thread_t *p_vout )
                 }
                 else
                 {
-                    p_vout->p_vlc->b_die = 1;
+                    p_vout->p_libvlc->b_die = 1;
                 }
                 break;
 
             case SDLK_q:                                             /* quit */
-                p_vout->p_vlc->b_die = 1;
+                p_vout->p_libvlc->b_die = 1;
                 break;
 
             case SDLK_f:                             /* switch to fullscreen */
@@ -575,7 +576,7 @@ static int Manage( vout_thread_t *p_vout )
  *****************************************************************************/
 static void Display( vout_thread_t *p_vout, picture_t *p_pic )
 {
-    int x, y, w, h;
+    unsigned int x, y, w, h;
     SDL_Rect disp;
 
     vout_PlacePicture( p_vout, p_vout->p_sys->i_width, p_vout->p_sys->i_height,
@@ -929,7 +930,7 @@ static void SetPalette( vout_thread_t *p_vout,
     /* Set palette */
     if( SDL_SetColors( p_vout->p_sys->p_display, colors, 0, 256 ) == 0 )
     {
-        msg_Err( p_vout, "failed setting palette" );
+        msg_Err( p_vout, "failed to set palette" );
     }
 }