#define INTF_GAMMA_STEP .1
#define INTF_GAMMA_LIMIT 3
-/* Scaling modifier limits */
-#define INTF_SCALE_LIMIT 10
-
/*
* X11 settings
*/
/* Title of the X11 window */
#define VOUT_TITLE "VideoLAN Client"
-/* Environment variable used in place of DISPLAY if available */
-#define ENV_VLC_DISPLAY "vlc_DISPLAY"
-
/*******************************************************************************
* Input thread configuration
*******************************************************************************/
* Default settings for video output threads
*/
-/* Default dimensions for display window - these dimensions are the standard
- * width and height for broadcasted MPEG-2 */
-#define VOUT_WIDTH 544
-#define VOUT_HEIGHT 576
+/* Environment variable used in place of DISPLAY if available */
+#define VOUT_DISPLAY_VAR "vlc_DISPLAY"
+
+/* Default dimensions for display window - these dimensions are enough for the
+ * standard width and height broadcasted MPEG-2 streams */
+#define VOUT_WIDTH_VAR "vlc_width"
+#define VOUT_HEIGHT_VAR "vlc_height"
+#define VOUT_WIDTH_DEFAULT 640
+#define VOUT_HEIGHT_DEFAULT 480
/* Default video heap size - remember that a decompressed picture is big
* (~1 Mbyte) before using huge values */
#define VOUT_GRAYSCALE_VAR "vlc_grayscale"
#define VOUT_GRAYSCALE_DEFAULT 0
-/* Environment variable for fullscreen output mode, and default value */
-#define VOUT_FULLSCREEN_VAR "vlc_fullscreen"
-#define VOUT_FULLSCREEN_DEFAULT 0
-
/* Default gamma */
#define VOUT_GAMMA 0.
/* Define to enable messages queues - disabling messages queue can be usefull
* when debugging, since it allows messages which would not otherwise be printed,
* due to a crash, to be printed anyway */
-#define INTF_MSG_QUEUE
+//#define INTF_MSG_QUEUE
/* Format of the header for debug messages. The arguments following this header
* are the file (char *), the function (char *) and the line (int) in which the
void intf_Run ( intf_thread_t * p_intf );
void intf_Destroy ( intf_thread_t * p_intf );
-int intf_SelectInput ( intf_thread_t * p_intf, p_input_cfg_t p_cfg );
+int intf_SelectInput ( intf_thread_t * p_intf, int i_index );
int intf_ProcessKey ( intf_thread_t * p_intf, int i_key );
#include "intf_sys.h"
+/*******************************************************************************
+ * Constants
+ *******************************************************************************/
+
+/* INTF_INPUT_CFG: pre-configured inputs */
+#define INTF_MAX_INPUT_CFG 10
+static const input_cfg_t INTF_INPUT_CFG[] =
+{
+ /* properties method
+ * file host ip port vlan */
+
+ /* Local input (unicast) */
+ { INPUT_CFG_METHOD | INPUT_CFG_IP, INPUT_METHOD_TS_UCAST,
+ NULL, NULL, "127.0.0.1", 0, 0 },
+
+ /* Broadcasts */
+ { INPUT_CFG_METHOD | INPUT_CFG_VLAN, INPUT_METHOD_TS_VLAN_BCAST,
+ NULL, NULL, NULL, 0, 0 },
+ { INPUT_CFG_METHOD | INPUT_CFG_VLAN, INPUT_METHOD_TS_VLAN_BCAST,
+ NULL, NULL, NULL, 0, 1 },
+ { INPUT_CFG_METHOD | INPUT_CFG_VLAN, INPUT_METHOD_TS_VLAN_BCAST,
+ NULL, NULL, NULL, 0, 2 },
+ { INPUT_CFG_METHOD | INPUT_CFG_VLAN, INPUT_METHOD_TS_VLAN_BCAST,
+ NULL, NULL, NULL, 0, 3 },
+ { INPUT_CFG_METHOD | INPUT_CFG_VLAN, INPUT_METHOD_TS_VLAN_BCAST,
+ NULL, NULL, NULL, 0, 4 },
+ { INPUT_CFG_METHOD | INPUT_CFG_VLAN, INPUT_METHOD_TS_VLAN_BCAST,
+ NULL, NULL, NULL, 0, 5 },
+ { INPUT_CFG_METHOD | INPUT_CFG_VLAN, INPUT_METHOD_TS_VLAN_BCAST,
+ NULL, NULL, NULL, 0, 6 },
+ { INPUT_CFG_METHOD | INPUT_CFG_VLAN, INPUT_METHOD_TS_VLAN_BCAST,
+ NULL, NULL, NULL, 0, 7 },
+ { INPUT_CFG_METHOD | INPUT_CFG_VLAN, INPUT_METHOD_TS_VLAN_BCAST,
+ NULL, NULL, NULL, 0, 8 }
+};
/*******************************************************************************
* intf_Create: prepare interface before main loop
/*******************************************************************************
* intf_SelectInput: change input stream
*******************************************************************************
- * Kill existing input, if any, and try to open a new one. If p_cfg is NULL,
- * no new input will be openned.
+ * Kill existing input, if any, and try to open a new one, using an input
+ * configuration table.
*******************************************************************************/
-int intf_SelectInput( intf_thread_t * p_intf, input_cfg_t *p_cfg )
+int intf_SelectInput( intf_thread_t * p_intf, int i_index )
{
intf_DbgMsg("0x%x\n", p_intf );
if( p_intf->p_input != NULL )
{
input_DestroyThread( p_intf->p_input /*??, NULL*/ );
- p_intf->p_input = NULL;
}
-
- /* Open new one */
- if( p_cfg != NULL )
+
+ /* Check that input index is valid */
+ if( (i_index < 0) || (INTF_MAX_INPUT_CFG < i_index) )
{
- p_intf->p_input = input_CreateThread( p_cfg /*??, NULL*/ );
- }
+ p_intf->p_input = NULL;
+ return( 1 );
+ }
- return( (p_cfg != NULL) && (p_intf->p_input == NULL) );
+ /* Open a new input */
+ p_intf->p_input = input_CreateThread( &INTF_INPUT_CFG[ i_index ] /*??, NULL*/ );
+ return( p_intf->p_input == NULL );
}
/*******************************************************************************
case '7':
case '8':
case '9':
- // ??
+ if( intf_SelectInput( p_intf, i_key - '0' ) )
+ {
+ intf_ErrMsg("error: can not open channel %d\n", i_key - '0');
+ }
break;
case '+': /* volume + */
// ??
cfg.p_aout = p_main->p_aout;
/* Create the input thread */
- if( intf_SelectInput( p_main->p_intf, &cfg ) == -1)
- {
- return( INTF_OTHER_ERROR );
+ if( p_main->p_intf->p_input != NULL )
+ {
+ input_DestroyThread( p_main->p_intf->p_input /*??, NULL*/ );
}
+ p_main->p_intf->p_input = input_CreateThread( &cfg /*??,NULL*/ );
return( INTF_NO_ERROR );
}
{ "novideo", 0, 0, OPT_NOVIDEO },
{ "grayscale", 0, 0, 'g' },
{ "color", 0, 0, OPT_COLOR },
- { "fullscreen", 0, 0, 'f' },
/* VLAN management options */
{ "novlans", 0, 0, OPT_NOVLANS },
};
/* Short options */
-static const char *psz_shortopts = "hgf";
+static const char *psz_shortopts = "hg";
/*******************************************************************************
* Global variable program_data - this is the one and only, see main.h
case OPT_COLOR: /* --color */
main_PutIntVariable( VOUT_GRAYSCALE_VAR, 0 );
break;
- case 'f': /* -f, --fullscreen */
- main_PutIntVariable( VOUT_FULLSCREEN_VAR, 1 );
- break;
/* VLAN management options */
case OPT_NOVLANS: /* --novlans */
/* Video parameters */
intf_Msg("Video parameters:\n" \
+ " " VOUT_DISPLAY_VAR "=<display name> display used\n"
+ " " VOUT_WIDTH_VAR "=<width> display width\n"
+ " " VOUT_HEIGHT_VAR "=<height> dislay height\n"
" " VOUT_FB_DEV_VAR "=<filename> framebuffer device path\n" \
" " VOUT_GRAYSCALE_VAR "={1|0} grayscale or color output\n" \
);
);
/* Interfaces keys */
- intf_Msg("Interface keys: most interface accept the following commands:\n" \
+ intf_Msg("Interface keys: most interfaces accept the following commands:\n" \
" [esc], q quit\n" \
" +, -, m change volume, mute\n" \
" g, G, c change gamma, toggle grayscale\n" \
/*******************************************************************************
* Local prototypes
*******************************************************************************/
-static int GGIOpenDisplay ( vout_thread_t *p_vout );
+static int GGIOpenDisplay ( vout_thread_t *p_vout, char *psz_display );
static void GGICloseDisplay ( vout_thread_t *p_vout );
/*******************************************************************************
* vout properties to choose the correct mode, and change them according to the
* mode actually used.
*******************************************************************************/
-int vout_SysCreate( vout_thread_t *p_vout )
+int vout_SysCreate( vout_thread_t *p_vout, char *psz_display, int i_root_window )
{
/* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
}
/* Open and initialize device */
- if( GGIOpenDisplay( p_vout ) )
+ if( GGIOpenDisplay( p_vout, psz_display ) )
{
intf_ErrMsg("error: can't initialize GGI display\n");
free( p_vout->p_sys );
* Open and initialize display according to preferences specified in the vout
* thread fields.
*******************************************************************************/
-static int GGIOpenDisplay( vout_thread_t *p_vout )
+static int GGIOpenDisplay( vout_thread_t *p_vout, char *psz_display )
{
ggi_mode mode; /* mode descriptor */
ggi_color col_fg; /* foreground color */
}
/* Open display */
- p_vout->p_sys->p_display = ggiOpen( NULL );
+ p_vout->p_sys->p_display = ggiOpen( psz_display, NULL );
if( p_vout->p_sys->p_display == NULL )
{
intf_ErrMsg("error: can't open GGI default display\n");
return( 1 );
}
+ /* Set clipping for text */
+ if( ggiSetGCClipping(p_vout->p_sys->p_display, 0, 0,
+ mode.visible.x, mode.visible.y ) )
+ {
+ intf_ErrMsg("error: can't set clipping\n");
+ ggiClose( p_vout->p_sys->p_display );
+ ggiExit();
+ return( 1 );
+ }
+
/* Set thread information */
p_vout->i_width = mode.visible.x;
p_vout->i_height = mode.visible.y;
break;
#endif
}
- vlc_mutex_unlock( &p_vout->picture_lock );
#ifdef DEBUG_VIDEO
intf_DbgMsg("picture %p\n", p_pic );
#endif
+
+ vlc_mutex_unlock( &p_vout->picture_lock );
}
/*******************************************************************************
break;
#endif
}
- vlc_mutex_unlock( &p_vout->picture_lock );
#ifdef DEBUG_VIDEO
intf_DbgMsg("picture %p\n", p_pic);
#endif
+
+ vlc_mutex_unlock( &p_vout->picture_lock );
}
/*******************************************************************************
{
vlc_mutex_lock( &p_vout->picture_lock );
p_pic->i_refcount++;
- vlc_mutex_unlock( &p_vout->picture_lock );
#ifdef DEBUG_VIDEO
- intf_DbgMsg("picture %p\n", p_pic);
+ intf_DbgMsg("picture %p refcount=%d\n", p_pic, p_pic->i_refcount );
#endif
+
+ vlc_mutex_unlock( &p_vout->picture_lock );
}
/*******************************************************************************
{
p_pic->i_status = DESTROYED_PICTURE;
}
- vlc_mutex_unlock( &p_vout->picture_lock );
#ifdef DEBUG_VIDEO
- intf_DbgMsg("picture %p\n", p_pic);
+ intf_DbgMsg("picture %p refcount=%d\n", p_pic, p_pic->i_refcount );
#endif
+
+ vlc_mutex_unlock( &p_vout->picture_lock );
}
/* following functions are local */
* go to next picture */
vlc_mutex_lock( &p_vout->picture_lock );
p_pic->i_status = p_pic->i_refcount ? DISPLAYED_PICTURE : DESTROYED_PICTURE;
- vlc_mutex_unlock( &p_vout->picture_lock );
#ifdef DEBUG_VIDEO
- intf_DbgMsg( "warning: late picture %p skipped\n", p_pic );
+ intf_DbgMsg( "warning: late picture %p skipped refcount=%d\n", p_pic, p_pic->i_refcount );
#endif
+ vlc_mutex_unlock( &p_vout->picture_lock );
p_pic = NULL;
}
else if( pic_date > current_date + VOUT_DISPLAY_DELAY )
static void RenderBlank( vout_thread_t *p_vout )
{
//?? toooooo slow
- int i_index; /* current 32 bits sample */
- int i_width; /* number of 32 bits samples */
- u32 *p_pic; /* pointer to 32 bits samples */
+ int i_index; /* current 64 bits sample */
+ int i_width; /* number of 64 bits samples */
+ u64 *p_pic; /* pointer to 64 bits samples */
/* Initialize variables */
p_pic = vout_SysGetPicture( p_vout );
- i_width = p_vout->i_bytes_per_line * p_vout->i_height / 128;
+ i_width = p_vout->i_bytes_per_line * p_vout->i_height / 256;
- /* Clear beginning of screen by 128 bytes blocks */
+ /* Clear beginning of screen by 256 bytes blocks */
for( i_index = 0; i_index < i_width; i_index++ )
{
*p_pic++ = 0; *p_pic++ = 0;
CONVERT_YUV_RGB( 444 )
}
-//-------------------- walken code follow --------------------------------
+//-------------------- walken code follow ---------------------------------------
/*
* YUV to RGB routines.