Commit 89e32e31 authored by Eric Petit's avatar Eric Petit

enabled changing filters on the fly

parent 008accd0
......@@ -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
......@@ -247,11 +249,20 @@ void PreferencesWindow::ApplyChanges()
config_GetFloat( p_intf, "contrast" ) != 1 ||
config_GetInt( p_intf, "hue" ) != 0 ||
config_GetFloat( p_intf, "saturation" ) != 1 )
{
if( !config_GetPsz( p_intf, "filter" ) ||
strcmp( config_GetPsz( p_intf, "filter" ), "adjust" ) )
{
config_PutPsz( p_intf, "filter", "adjust" );
p_wrapper->FilterChange();
}
}
else
{
if( config_GetPsz( p_intf, "filter" ) )
{
config_PutPsz( p_intf, "filter", NULL );
p_wrapper->FilterChange();
}
}
}
......@@ -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>
......@@ -30,9 +30,11 @@
#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 );
}
......@@ -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>
......@@ -124,6 +124,7 @@ public:
/* Miscellanous */
void LoadSubFile( char * psz_file );
void FilterChange();
private:
intf_thread_t * p_intf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment