Commit d3154bfb authored by Sam Hocevar's avatar Sam Hocevar

  * Fixed stuff in the wall filter. Extended syntax:
     --filter wall         % open a wall (3x3 is the default value)
     --filter wall:2       % open a 2x2 wall
     --filter wall:3x2     % open a 3x2 wall
     --filter wall:2x1:0   % open a 2x1 wall, only display block 0
     --filter wall:2:0,3   % open a 2x2 wall, only display blocks 0 and 3
    For instance, if you have 2 computers listening to a network stream, on
    the left computer you use --filter wall:2x1:0 and on the right computer
    you use --filter wall:2x1:1
parent ee87a691
List of vlc plugins List of vlc plugins
$Id: MODULES,v 1.2 2002/01/21 00:52:06 sam Exp $ $Id: MODULES,v 1.3 2002/01/30 00:09:49 sam Exp $
* ac3_adec: software AC3 decoder. * ac3_adec: software AC3 decoder.
...@@ -131,6 +131,8 @@ $Id: MODULES,v 1.2 2002/01/21 00:52:06 sam Exp $ ...@@ -131,6 +131,8 @@ $Id: MODULES,v 1.2 2002/01/21 00:52:06 sam Exp $
* vcd: input module for accessing Video CDs. * vcd: input module for accessing Video CDs.
* waveout: simple audio output module for Windows.
* x11: video output module using the X11 API. * x11: video output module using the X11 API.
* xvideo: video output module using the XVideo API. * xvideo: video output module using the XVideo API.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* wall.c : Wall video plugin for vlc * wall.c : Wall video plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: wall.c,v 1.10 2002/01/09 02:01:14 sam Exp $ * $Id: wall.c,v 1.11 2002/01/30 00:09:49 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -74,6 +74,7 @@ typedef struct vout_sys_s ...@@ -74,6 +74,7 @@ typedef struct vout_sys_s
int i_vout; int i_vout;
struct vout_list_s struct vout_list_s
{ {
boolean_t b_active;
int i_width; int i_width;
int i_height; int i_height;
struct vout_thread_s *p_vout; struct vout_thread_s *p_vout;
...@@ -126,6 +127,9 @@ static int vout_Probe( probedata_t *p_data ) ...@@ -126,6 +127,9 @@ static int vout_Probe( probedata_t *p_data )
*****************************************************************************/ *****************************************************************************/
static int vout_Create( vout_thread_t *p_vout ) static int vout_Create( vout_thread_t *p_vout )
{ {
char *psz_method, *psz_tmp;
int i_vout;
/* Allocate structure */ /* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) ); p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL ) if( p_vout->p_sys == NULL )
...@@ -134,8 +138,73 @@ static int vout_Create( vout_thread_t *p_vout ) ...@@ -134,8 +138,73 @@ static int vout_Create( vout_thread_t *p_vout )
return( 1 ); return( 1 );
} }
p_vout->p_sys->i_col = 6; /* Look what method was requested */
p_vout->p_sys->i_row = 6; psz_method = main_GetPszVariable( VOUT_FILTER_VAR, "" );
while( *psz_method && *psz_method != ':' )
{
psz_method++;
}
if( *psz_method )
{
psz_method++;
psz_tmp = psz_method;
while( *psz_tmp && *psz_tmp != 'x' && *psz_tmp != ':' )
{
psz_tmp++;
}
if( *psz_tmp == 'x' )
{
*psz_tmp = '\0';
p_vout->p_sys->i_col = atoi( psz_method );
psz_tmp++;
psz_method = psz_tmp;
while( *psz_tmp && *psz_tmp != ':' )
{
psz_tmp++;
}
if( *psz_tmp )
{
*psz_tmp = '\0';
p_vout->p_sys->i_row = atoi( psz_method );
psz_method = psz_tmp + 1;
}
else
{
p_vout->p_sys->i_row = atoi( psz_method );
psz_method = NULL;
}
}
else if( *psz_tmp == ':' )
{
p_vout->p_sys->i_col = p_vout->p_sys->i_row = atoi( psz_method );
psz_method = psz_tmp + 1;
}
else
{
p_vout->p_sys->i_col = p_vout->p_sys->i_row = atoi( psz_method );
psz_method = NULL;
}
}
else
{
intf_ErrMsg( "filter error: no valid wall size provided, "
"using wall:3x3" );
p_vout->p_sys->i_col = 3;
p_vout->p_sys->i_row = 3;
}
p_vout->p_sys->i_col = MAX( 1, MIN( 15, p_vout->p_sys->i_col ) );
p_vout->p_sys->i_row = MAX( 1, MIN( 15, p_vout->p_sys->i_row ) );
intf_WarnMsg( 3, "filter info: opening a %i x %i wall",
p_vout->p_sys->i_col, p_vout->p_sys->i_row );
p_vout->p_sys->pp_vout = malloc( p_vout->p_sys->i_row * p_vout->p_sys->pp_vout = malloc( p_vout->p_sys->i_row *
p_vout->p_sys->i_col * p_vout->p_sys->i_col *
...@@ -147,6 +216,51 @@ static int vout_Create( vout_thread_t *p_vout ) ...@@ -147,6 +216,51 @@ static int vout_Create( vout_thread_t *p_vout )
return( 1 ); return( 1 );
} }
/* If no trailing vout are specified, take them all */
if( psz_method == NULL )
{
for( i_vout = p_vout->p_sys->i_row * p_vout->p_sys->i_col;
i_vout--; )
{
p_vout->p_sys->pp_vout[i_vout].b_active = 1;
}
}
/* If trailing vout are specified, activate only the requested ones */
else
{
for( i_vout = p_vout->p_sys->i_row * p_vout->p_sys->i_col;
i_vout--; )
{
p_vout->p_sys->pp_vout[i_vout].b_active = 0;
}
while( *psz_method )
{
psz_tmp = psz_method;
while( *psz_tmp && *psz_tmp != ',' )
{
psz_tmp++;
}
if( *psz_tmp )
{
*psz_tmp = '\0';
i_vout = atoi( psz_method );
psz_method = psz_tmp + 1;
}
else
{
i_vout = atoi( psz_method );
psz_method = psz_tmp;
}
if( i_vout >= 0 &&
i_vout < p_vout->p_sys->i_row * p_vout->p_sys->i_col )
{
p_vout->p_sys->pp_vout[i_vout].b_active = 1;
}
}
}
return( 0 ); return( 0 );
} }
...@@ -205,6 +319,15 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -205,6 +319,15 @@ static int vout_Init( vout_thread_t *p_vout )
/ p_vout->p_sys->i_row ) & ~0x3 ) * i_row; / p_vout->p_sys->i_row ) & ~0x3 ) * i_row;
} }
p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].i_width = i_width;
p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].i_height = i_height;
if( !p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].b_active )
{
p_vout->p_sys->i_vout++;
continue;
}
p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout = p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout =
vout_CreateThread( NULL, i_width, i_height, vout_CreateThread( NULL, i_width, i_height,
p_vout->render.i_chroma, p_vout->render.i_chroma,
...@@ -298,6 +421,18 @@ static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -298,6 +421,18 @@ static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
for( i_col = 0; i_col < p_vout->p_sys->i_col; i_col++ ) for( i_col = 0; i_col < p_vout->p_sys->i_col; i_col++ )
{ {
if( !p_vout->p_sys->pp_vout[ i_vout ].b_active )
{
for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
{
pi_left_skip[i_plane] +=
p_vout->p_sys->pp_vout[ i_vout ].i_width
* p_pic->p[i_plane].i_pitch / p_vout->output.i_width;
}
i_vout++;
continue;
}
while( ( p_outpic = while( ( p_outpic =
vout_CreatePicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout, vout_CreatePicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
0, 0, 0 ) 0, 0, 0 )
...@@ -339,7 +474,7 @@ static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -339,7 +474,7 @@ static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
p_out += i_out_pitch; p_out += i_out_pitch;
} }
pi_left_skip[i_plane] += p_outpic->p[i_plane].i_pitch; pi_left_skip[i_plane] += i_out_pitch;
} }
vout_UnlinkPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout, vout_UnlinkPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
...@@ -352,7 +487,9 @@ static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -352,7 +487,9 @@ static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ ) for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
{ {
pi_top_skip[i_plane] += p_outpic->p[i_plane].i_lines pi_top_skip[i_plane] += p_vout->p_sys->pp_vout[ i_vout ].i_height
* p_pic->p[i_plane].i_lines
/ p_vout->output.i_height
* p_pic->p[i_plane].i_pitch; * p_pic->p[i_plane].i_pitch;
} }
} }
...@@ -370,13 +507,19 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -370,13 +507,19 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
; ;
} }
/*****************************************************************************
* RemoveAllVout: destroy all the child video output threads
*****************************************************************************/
static void RemoveAllVout( vout_thread_t *p_vout ) static void RemoveAllVout( vout_thread_t *p_vout )
{ {
while( p_vout->p_sys->i_vout ) while( p_vout->p_sys->i_vout )
{ {
--p_vout->p_sys->i_vout; --p_vout->p_sys->i_vout;
if( p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].b_active )
{
vout_DestroyThread( vout_DestroyThread(
p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout, NULL ); p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout, NULL );
} }
}
} }
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