]> git.sesse.net Git - vlc/commitdiff
* src/video_output/video_output.c: new "deinterlace" object variable.
authorGildas Bazin <gbazin@videolan.org>
Sat, 24 May 2003 20:54:27 +0000 (20:54 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sat, 24 May 2003 20:54:27 +0000 (20:54 +0000)
* modules/gui/macosx/prefs.m: compilation fix.
* modules/gui/wxwindows/menus.cpp: use the "deinterlace" object var.
* modules/gui/skins/*: couple of fixes.

modules/gui/macosx/prefs.m
modules/gui/skins/src/themeloader.cpp
modules/gui/skins/x11/x11_run.cpp
modules/gui/wxwindows/menus.cpp
src/video_output/video_output.c

index 2905895556e6859ef8005da3d5894fbb73144216..44e966a86c28fdf789fa85f1d25fef2a062b1ee9 100644 (file)
@@ -2,7 +2,7 @@
  * prefs.m: MacOS X plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: prefs.m,v 1.25 2003/05/24 02:48:55 hartman Exp $
+ * $Id: prefs.m,v 1.26 2003/05/24 20:54:27 gbazin Exp $
  *
  * Authors:    Jon Lech Johansen <jon-vl@nanocrew.net>
  *             Derk-Jan Hartman <thedj at users.sf.net>
             NSString *o_value;
 
             o_value = [o_vlc_config titleOfSelectedItem];
-            [o_value isEqualToString: _NS("Auto") ] ? psz_value = "" :
-                psz_value = (char *)[o_value lossyCString];
+            psz_value = [o_value isEqualToString: _NS("Auto") ] ? "" :
+                (char *)[o_value lossyCString];
             config_PutPsz( p_intf, psz_name, psz_value );
         }
         break;
index f431f29578150481d5a1f7e07e6aa9c07ce0244b..f8cc5a39f0e86749776b2867d5ed53cd95839eee 100644 (file)
@@ -2,7 +2,7 @@
  * themeloader.cpp: ThemeLoader class
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: themeloader.cpp,v 1.9 2003/05/02 15:53:32 gbazin Exp $
+ * $Id: themeloader.cpp,v 1.10 2003/05/24 20:54:27 gbazin Exp $
  *
  * Authors: Olivier Teulière <ipkiss@via.ecp.fr>
  *          Emmanuel Puig    <karibu@via.ecp.fr>
@@ -331,8 +331,12 @@ int tar_extract_all( TAR *t, char *prefix )
          * Always expect complete blocks to process
          * the tar information.
          */
-        if(len != BLOCKSIZE) fprintf(stderr, "gzread: incomplete block read");
-      
+        if(len != BLOCKSIZE)
+        {
+            fprintf(stderr, "gzread: incomplete block read");
+            return -1;
+        }
+
         /*
          * If we have to get a tar header
          */
index a8880370185e054a4fa76a6fcd99702eda7be526..ff3a3061c27c6bea317151190a03fee947ef2477 100644 (file)
@@ -2,7 +2,7 @@
  * x11_run.cpp:
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: x11_run.cpp,v 1.6 2003/05/19 21:39:34 asmax Exp $
+ * $Id: x11_run.cpp,v 1.7 2003/05/24 20:54:27 gbazin Exp $
  *
  * Authors: Cyril Deguet     <asmax@videolan.org>
  *
@@ -344,9 +344,10 @@ void OSRun( intf_thread_t *p_intf )
 
     VlcProc *proc = new VlcProc( p_intf );
     
-/*    wxTheApp = new Instance( p_intf, callbackobj );
-    wxEntry( 1, p_args );*/
-
+#ifndef BASIC_SKINS
+    wxTheApp = new Instance( p_intf );
+    wxEntry( 1, p_args );
+#endif
 
     Display *display = ((OSTheme *)p_intf->p_sys->p_theme)->GetDisplay();
     
index 1ce9c79e55965b89f7f4eb7d459a5ba5565b3238..c5501d42b1d7e21b64fe1a1fc7d07da6777eb496 100644 (file)
@@ -2,7 +2,7 @@
  * menus.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: menus.cpp,v 1.12 2003/05/21 13:27:25 gbazin Exp $
+ * $Id: menus.cpp,v 1.13 2003/05/24 20:54:27 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -129,6 +129,8 @@ void PopupMenu( intf_thread_t *_p_intf, Interface *_p_main_interface,
     {
         ppsz_varnames[i] = "fullscreen";
         pi_objects[i++] = p_object->i_object_id;
+        ppsz_varnames[i] = "deinterlace";
+        pi_objects[i++] = p_object->i_object_id;
         ppsz_varnames[i] = "directx-on-top";
         pi_objects[i++] = p_object->i_object_id;
         vlc_object_release( p_object );
@@ -225,6 +227,8 @@ wxMenu *VideoMenu( intf_thread_t *_p_intf, Interface *_p_main_interface )
     {
         ppsz_varnames[i] = "fullscreen";
         pi_objects[i++] = p_object->i_object_id;
+        ppsz_varnames[i] = "deinterlace";
+        pi_objects[i++] = p_object->i_object_id;
         ppsz_varnames[i] = "directx-on-top";
         pi_objects[i++] = p_object->i_object_id;
         vlc_object_release( p_object );
index 517135007196265bffdf4dd57208d65b638e6f97..c0ac983d2f6d8af05c645c3a691209dfb3d1edac 100644 (file)
@@ -5,7 +5,7 @@
  * thread, and destroy a previously oppened video output thread.
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: video_output.c,v 1.222 2003/05/21 13:27:25 gbazin Exp $
+ * $Id: video_output.c,v 1.223 2003/05/24 20:54:27 gbazin Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -60,6 +60,8 @@ static void     InitWindowSize    ( vout_thread_t *, int *, int * );
 /* Object variables callbacks */
 static int FullscreenCallback( vlc_object_t *, char const *,
                                vlc_value_t, vlc_value_t, void * );
+static int DeinterlaceCallback( vlc_object_t *, char const *,
+                                vlc_value_t, vlc_value_t, void * );
 
 /*****************************************************************************
  * vout_Request: find a video output thread, create one, or destroy one.
@@ -383,6 +385,25 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent,
     var_Change( p_vout, "fullscreen", VLC_VAR_SETTEXT, &text, NULL );
     var_AddCallback( p_vout, "fullscreen", FullscreenCallback, NULL );
 
+    var_Create( p_vout, "deinterlace", VLC_VAR_STRING | VLC_VAR_HASCHOICE );
+    text.psz_string = _("Deinterlace");
+    var_Change( p_vout, "deinterlace", VLC_VAR_SETTEXT, &text, NULL );
+    val.psz_string = ""; text.psz_string = _("Disable");
+    var_Change( p_vout, "deinterlace", VLC_VAR_ADDCHOICE, &val, &text );
+    var_Set( p_vout, "deinterlace", val );
+    val.psz_string = "discard"; text.psz_string = _("Discard");
+    var_Change( p_vout, "deinterlace", VLC_VAR_ADDCHOICE, &val, &text );
+    val.psz_string = "blend"; text.psz_string = _("Blend");
+    var_Change( p_vout, "deinterlace", VLC_VAR_ADDCHOICE, &val, &text );
+    val.psz_string = "mean"; text.psz_string = _("Mean");
+    var_Change( p_vout, "deinterlace", VLC_VAR_ADDCHOICE, &val, &text );
+    val.psz_string = "bob"; text.psz_string = _("Bob");
+    var_Change( p_vout, "deinterlace", VLC_VAR_ADDCHOICE, &val, &text );
+    val.psz_string = "linear"; text.psz_string = _("Linear");
+    var_Change( p_vout, "deinterlace", VLC_VAR_ADDCHOICE, &val, &text );
+    //var_Change( p_vout, "deinterlace", VLC_VAR_INHERITVALUE, NULL, NULL );
+    var_AddCallback( p_vout, "deinterlace", DeinterlaceCallback, NULL );
+
     /* Calculate delay created by internal caching */
     p_input_thread = (input_thread_t *)vlc_object_find( p_vout,
                                            VLC_OBJECT_INPUT, FIND_ANYWHERE );
@@ -1175,3 +1196,76 @@ static int FullscreenCallback( vlc_object_t *p_this, char const *psz_cmd,
     var_Set( p_vout, "intf-change", val );
     return VLC_SUCCESS;
 }
+
+static int DeinterlaceCallback( vlc_object_t *p_this, char const *psz_cmd,
+                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
+{
+    vout_thread_t *p_vout = (vout_thread_t *)p_this;
+    input_thread_t *p_input;
+    vlc_value_t val;
+
+    char *psz_mode = newval.psz_string;
+    char *psz_filter;
+    unsigned int  i;
+
+    psz_filter = config_GetPsz( p_vout, "filter" );
+
+    if( !psz_mode || !*psz_mode )
+    {
+        config_PutPsz( p_vout, "filter", "" );
+    }
+    else
+    {
+        if( !psz_filter || !*psz_filter )
+        {
+            config_PutPsz( p_vout, "filter", "deinterlace" );
+        }
+        else
+        {
+            if( strstr( psz_filter, "deinterlace" ) == NULL )
+            {
+                psz_filter = realloc( psz_filter, strlen( psz_filter ) + 20 );
+                strcat( psz_filter, ",deinterlace" );
+            }
+            config_PutPsz( p_vout, "filter", psz_filter );
+        }
+    }
+
+    if( psz_filter ) free( psz_filter );
+
+    /* now restart all video streams */
+    p_input = (input_thread_t *)vlc_object_find( p_this, VLC_OBJECT_INPUT,
+                                                 FIND_PARENT );
+    if( p_input )
+    {
+        vlc_mutex_lock( &p_input->stream.stream_lock );
+
+        p_vout->b_filter_change = VLC_TRUE;
+
+#define ES p_input->stream.pp_es[i]
+
+        for( i = 0 ; i < p_input->stream.i_es_number ; i++ )
+        {
+            if( ( ES->i_cat == VIDEO_ES ) && ES->p_decoder_fifo != NULL )
+            {
+                input_UnselectES( p_input, ES );
+                input_SelectES( p_input, ES );
+            }
+#undef ES
+        }
+        vlc_mutex_unlock( &p_input->stream.stream_lock );
+
+        vlc_object_release( p_input );
+    }
+
+    if( psz_mode && *psz_mode )
+    {
+        val.psz_string = psz_mode;
+        if( var_Set( p_vout, "deinterlace-mode", val ) != VLC_SUCCESS )
+            config_PutPsz( p_vout, "deinterlace-mode", psz_mode );
+    }
+
+    val.b_bool = VLC_TRUE;
+    var_Set( p_vout, "intf-change", val );
+    return VLC_SUCCESS;
+}