]> git.sesse.net Git - vlc/commitdiff
enabled changing filters on the fly
authorEric Petit <titer@videolan.org>
Wed, 29 Jan 2003 00:02:09 +0000 (00:02 +0000)
committerEric Petit <titer@videolan.org>
Wed, 29 Jan 2003 00:02:09 +0000 (00:02 +0000)
modules/gui/beos/PreferencesWindow.cpp
modules/gui/beos/VlcWrapper.cpp
modules/gui/beos/VlcWrapper.h

index 93e14fcdb4cf03742f90d2a86bfd123441aea249..2e1a3a513457b8a4fe30dce3715f20d19e2409ee 100644 (file)
@@ -2,7 +2,7 @@
  * PreferencesWindow.cpp: beos interface
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: PreferencesWindow.cpp,v 1.11 2003/01/28 10:05:15 titer Exp $
+ * $Id: PreferencesWindow.cpp,v 1.12 2003/01/29 00:02:09 titer Exp $
  *
  * Authors: Eric Petit <titer@videolan.org>
  *
@@ -229,6 +229,8 @@ void PreferencesWindow::SetDefaults()
  *****************************************************************************/
 void PreferencesWindow::ApplyChanges()
 {
+    VlcWrapper * p_wrapper = p_intf->p_sys->p_wrapper;
+
     if( fDvdMenusCheck->Value() )
         p_intf->p_sys->b_dvdmenus = true;
     else
@@ -248,10 +250,19 @@ void PreferencesWindow::ApplyChanges()
         config_GetInt( p_intf, "hue" ) != 0 ||
         config_GetFloat( p_intf, "saturation" ) != 1 )
     {
-        config_PutPsz( p_intf, "filter", "adjust" );
+        if( !config_GetPsz( p_intf, "filter" ) ||
+            strcmp( config_GetPsz( p_intf, "filter" ), "adjust" ) )
+        {
+            config_PutPsz( p_intf, "filter", "adjust" );
+            p_wrapper->FilterChange();
+        }
     }
     else
     {
-        config_PutPsz( p_intf, "filter", NULL );
+        if( config_GetPsz( p_intf, "filter" ) )
+        {
+            config_PutPsz( p_intf, "filter", NULL );
+            p_wrapper->FilterChange();
+        }
     }
 }
index 3b5fbf5e6850f901a36526548b394dfe78c821b1..29e87f78db58c3b3e41be21448b7e6cd23fa79d5 100644 (file)
@@ -2,7 +2,7 @@
  * VlcWrapper.cpp: BeOS plugin for vlc (derived from MacOS X port)
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: VlcWrapper.cpp,v 1.22 2003/01/27 10:29:22 titer Exp $
+ * $Id: VlcWrapper.cpp,v 1.23 2003/01/29 00:02:09 titer Exp $
  *
  * Authors: Florian G. Pflug <fgp@phlo.org>
  *          Jon Lech Johansen <jon-vl@nanocrew.net>
 
 #include <vlc/vlc.h>
 #include <vlc/intf.h>
-extern "C" {
-#include <audio_output.h>
-#include <aout_internal.h>
+#include <vlc/vout.h>
+extern "C"
+{
+  #include <audio_output.h>
+  #include <aout_internal.h>
 }
 
 #include "VlcWrapper.h"
@@ -855,3 +857,33 @@ void VlcWrapper::LoadSubFile( char * psz_file )
 {
     config_PutPsz( p_intf, "sub-file", strdup( psz_file ) );
 }
+
+void VlcWrapper::FilterChange()
+{
+    if( !p_input )
+        return;
+    
+    vout_thread_t * p_vout;
+    vlc_mutex_lock( &p_input->stream.stream_lock );
+
+    /* Warn the vout we are about to change the filter chain */
+    p_vout = (vout_thread_t*)vlc_object_find( p_intf, VLC_OBJECT_VOUT,
+                                              FIND_ANYWHERE );
+    if( p_vout )
+    {
+        p_vout->b_filter_change = VLC_TRUE;
+        vlc_object_release( p_vout );
+    }
+
+    /* restart all video stream */
+    for( unsigned int i = 0; i < p_input->stream.i_es_number; i++ )
+    {
+        if( ( p_input->stream.pp_es[i]->i_cat == VIDEO_ES ) &&
+            ( p_input->stream.pp_es[i]->p_decoder_fifo != NULL ) )
+        {
+            input_UnselectES( p_input, p_input->stream.pp_es[i] );
+            input_SelectES( p_input, p_input->stream.pp_es[i] );
+        }
+    }
+    vlc_mutex_unlock( &p_input->stream.stream_lock );
+}
index be0c84c88cf7ff6b9c50d09b231381a383238aa3..4623ebbf5afbf3e17b5c7ab5d173f8c9f20cd599 100644 (file)
@@ -2,7 +2,7 @@
  * VlcWrapper.h: BeOS plugin for vlc (derived from MacOS X port)
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: VlcWrapper.h,v 1.17 2003/01/27 10:29:22 titer Exp $
+ * $Id: VlcWrapper.h,v 1.18 2003/01/29 00:02:09 titer Exp $
  *
  * Authors: Florian G. Pflug <fgp@phlo.org>
  *          Jon Lech Johansen <jon-vl@nanocrew.net>
@@ -123,7 +123,8 @@ public:
     void    ChapterInfo( int32& currentIndex, int32& maxIndex );
     
     /* Miscellanous */
-    void         LoadSubFile( char * psz_file );
+    void LoadSubFile( char * psz_file );
+    void FilterChange();
     
 private:
     intf_thread_t *   p_intf;