Commit 75eb696d authored by Sam Hocevar's avatar Sam Hocevar

 * added --intf option to vlc
 * started cleaning vout_sdl.c
 * the dummy plugin works again
 * added a slider to the Gnome interface so that we can browse through streams

  There is a problem with the slider: we sometimes get unexpected async
  replies, which would mean that we don't properly lock our Xlib calls.
  Which is true. But we also get these errors when using `--vout dummy'.
  I'll investigate.
parent e8ceb0e1
...@@ -22,7 +22,7 @@ ac_help="$ac_help ...@@ -22,7 +22,7 @@ ac_help="$ac_help
ac_help="$ac_help ac_help="$ac_help
--disable-optimizations Disable compiler optimizations (default enabled)" --disable-optimizations Disable compiler optimizations (default enabled)"
ac_help="$ac_help ac_help="$ac_help
--enable-dummy dummy audio and video support (default disabled)" --disable-dummy dummy module (default enabled)"
ac_help="$ac_help ac_help="$ac_help
--disable-null Null module (default enabled)" --disable-null Null module (default enabled)"
ac_help="$ac_help ac_help="$ac_help
...@@ -3419,9 +3419,10 @@ else ...@@ -3419,9 +3419,10 @@ else
# Check whether --enable-dummy or --disable-dummy was given. # Check whether --enable-dummy or --disable-dummy was given.
if test "${enable_dummy+set}" = set; then if test "${enable_dummy+set}" = set; then
enableval="$enable_dummy" enableval="$enable_dummy"
if test x$enable_dummy = xyes; then PLUGINS=${PLUGINS}"dummy "; fi :
fi fi
if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi
# Check whether --enable-null or --disable-null was given. # Check whether --enable-null or --disable-null was given.
if test "${enable_null+set}" = set; then if test "${enable_null+set}" = set; then
enableval="$enable_null" enableval="$enable_null"
...@@ -3508,17 +3509,17 @@ if test "${enable_alsa+set}" = set; then ...@@ -3508,17 +3509,17 @@ if test "${enable_alsa+set}" = set; then
enableval="$enable_alsa" enableval="$enable_alsa"
if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'` if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6 echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6
echo "configure:3512: checking for sys/asoundlib.h" >&5 echo "configure:3513: checking for sys/asoundlib.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3517 "configure" #line 3518 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/asoundlib.h> #include <sys/asoundlib.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3522: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:3523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -3535,7 +3536,7 @@ fi ...@@ -3535,7 +3536,7 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6 echo "$ac_t""yes" 1>&6
echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6 echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6
echo "configure:3539: checking for main in -lasound" >&5 echo "configure:3540: checking for main in -lasound" >&5
ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'` ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -3543,14 +3544,14 @@ else ...@@ -3543,14 +3544,14 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lasound $LIBS" LIBS="-lasound $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3547 "configure" #line 3548 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
main() main()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:3555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
......
...@@ -138,8 +138,8 @@ dnl default case ...@@ -138,8 +138,8 @@ dnl default case
else else
AC_ARG_ENABLE(dummy, AC_ARG_ENABLE(dummy,
[ --enable-dummy dummy audio and video support (default disabled)], [ --disable-dummy dummy module (default enabled)])
[if test x$enable_dummy = xyes; then PLUGINS=${PLUGINS}"dummy "; fi]) if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi
AC_ARG_ENABLE(null, AC_ARG_ENABLE(null,
[ --disable-null Null module (default enabled)]) [ --disable-null Null module (default enabled)])
if test x$enable_null != xno; then PLUGINS=${PLUGINS}"null "; fi if test x$enable_null != xno; then PLUGINS=${PLUGINS}"null "; fi
......
...@@ -32,6 +32,9 @@ follows the usual GNU command line syntax, with long ...@@ -32,6 +32,9 @@ follows the usual GNU command line syntax, with long
options starting with two dashes (`-'). options starting with two dashes (`-').
A summary of options is included below. A summary of options is included below.
.TP .TP
.B \-\-intf <module>
Specify an interface module: "gnome", "curses", "shell", for instance.
.TP
.B \-\-noaudio .B \-\-noaudio
Disable audio output. Disable audio output.
.TP .TP
...@@ -45,7 +48,7 @@ Choose stereo or mono audio output ...@@ -45,7 +48,7 @@ Choose stereo or mono audio output
Disable video output. Disable video output.
.TP .TP
.B \-\-vout <module> .B \-\-vout <module>
Specify a video output module: "gnome", "fb", "glide", for instance. Specify a video output module: "x11", "sdl", "fb", for instance.
.TP .TP
.B \-\-motion <module> .B \-\-motion <module>
Specify a module for motion compensation: "motion", "motionmmx", for instance. Specify a module for motion compensation: "motion", "motionmmx", for instance.
...@@ -85,9 +88,6 @@ displaying of all images. ...@@ -85,9 +88,6 @@ displaying of all images.
Note that the vlc is certainly going to crash if you ask it to Note that the vlc is certainly going to crash if you ask it to
display more images than your CPU can cope with. display more images than your CPU can cope with.
.TP .TP
.B \-\-dvd
Activate DVD mode, by directly accessing the DVD drive (no need to mount
it). By default,
.B vlc .B vlc
opens /dev/dvd, but this behaviour may be overridden by the vlc_dvd_device opens /dev/dvd, but this behaviour may be overridden by the vlc_dvd_device
environment variable (see below). environment variable (see below).
...@@ -124,6 +124,7 @@ Output version information and exit. ...@@ -124,6 +124,7 @@ Output version information and exit.
also accepts a lot of parameters to customize its behaviour. also accepts a lot of parameters to customize its behaviour.
.TP .TP
.B Interface parameters: .B Interface parameters:
vlc_intf=<method name> interface method
vlc_init=<filename> initialization script vlc_init=<filename> initialization script
vlc_channels=<filename> channels list vlc_channels=<filename> channels list
warning_level=<level> warning level warning_level=<level> warning level
......
/***************************************************************************** /*****************************************************************************
* aout_dummy.c : dummy audio output plugin * aout_dummy.c : dummy audio output plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* *
* Authors: * Authors: Samuel Hocevar <sam@zoy.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -94,8 +94,10 @@ static int aout_Open( aout_thread_t *p_aout ) ...@@ -94,8 +94,10 @@ static int aout_Open( aout_thread_t *p_aout )
{ {
/* Initialize some variables */ /* Initialize some variables */
p_aout->i_format = AOUT_FORMAT_DEFAULT; p_aout->i_format = AOUT_FORMAT_DEFAULT;
p_aout->i_channels = 1 + main_GetIntVariable( AOUT_STEREO_VAR, AOUT_STEREO_DEFAULT ); p_aout->i_channels = 1 + main_GetIntVariable( AOUT_STEREO_VAR,
p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR, AOUT_RATE_DEFAULT ); AOUT_STEREO_DEFAULT );
p_aout->l_rate = main_GetIntVariable( AOUT_RATE_VAR,
AOUT_RATE_DEFAULT );
return( 0 ); return( 0 );
} }
......
/***************************************************************************** /*****************************************************************************
* dummy.c : dummy plugin for vlc * dummy.c : dummy plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* *
* Authors: * Authors: Samuel Hocevar <sam@zoy.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -34,10 +34,11 @@ ...@@ -34,10 +34,11 @@
#include "threads.h" #include "threads.h"
#include "mtime.h" #include "mtime.h"
#include "tests.h" #include "tests.h"
#include "plugins.h"
#include "interface.h" #include "interface.h"
#include "audio_output.h" #include "audio_output.h"
#include "video.h" #include "video.h"
#include "video_output.h" #include "video_output.h"
...@@ -56,6 +57,8 @@ MODULE_CONFIG_END ...@@ -56,6 +57,8 @@ MODULE_CONFIG_END
* Capabilities defined in the other files. * Capabilities defined in the other files.
*****************************************************************************/ *****************************************************************************/
extern void aout_getfunctions( function_list_t * p_function_list ); extern void aout_getfunctions( function_list_t * p_function_list );
extern void vout_getfunctions( function_list_t * p_function_list );
extern void intf_getfunctions( function_list_t * p_function_list );
/***************************************************************************** /*****************************************************************************
* InitModule: get the module structure and configuration. * InitModule: get the module structure and configuration.
...@@ -72,7 +75,9 @@ int InitModule( module_t * p_module ) ...@@ -72,7 +75,9 @@ int InitModule( module_t * p_module )
p_module->psz_version = VERSION; p_module->psz_version = VERSION;
p_module->i_capabilities = MODULE_CAPABILITY_NULL p_module->i_capabilities = MODULE_CAPABILITY_NULL
| MODULE_CAPABILITY_AOUT; | MODULE_CAPABILITY_AOUT
| MODULE_CAPABILITY_VOUT
| MODULE_CAPABILITY_INTF;
return( 0 ); return( 0 );
} }
...@@ -94,6 +99,8 @@ int ActivateModule( module_t * p_module ) ...@@ -94,6 +99,8 @@ int ActivateModule( module_t * p_module )
} }
aout_getfunctions( &p_module->p_functions->aout ); aout_getfunctions( &p_module->p_functions->aout );
vout_getfunctions( &p_module->p_functions->vout );
intf_getfunctions( &p_module->p_functions->intf );
p_module->p_config = p_config; p_module->p_config = p_config;
...@@ -114,76 +121,3 @@ int DeactivateModule( module_t * p_module ) ...@@ -114,76 +121,3 @@ int DeactivateModule( module_t * p_module )
return( 0 ); return( 0 );
} }
/* OLD MODULE STRUCTURE -- soon to be removed */
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
static void vout_GetPlugin( p_vout_thread_t p_vout );
static void intf_GetPlugin( p_intf_thread_t p_intf );
/* Video output */
int vout_DummyCreate ( vout_thread_t *p_vout, char *psz_display,
int i_root_window, void *p_data );
int vout_DummyInit ( p_vout_thread_t p_vout );
void vout_DummyEnd ( p_vout_thread_t p_vout );
void vout_DummyDestroy ( p_vout_thread_t p_vout );
int vout_DummyManage ( p_vout_thread_t p_vout );
void vout_DummyDisplay ( p_vout_thread_t p_vout );
void vout_DummySetPalette ( p_vout_thread_t p_vout,
u16 *red, u16 *green, u16 *blue, u16 *transp );
/* Interface */
int intf_DummyCreate ( p_intf_thread_t p_intf );
void intf_DummyDestroy ( p_intf_thread_t p_intf );
void intf_DummyManage ( p_intf_thread_t p_intf );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
*****************************************************************************/
plugin_info_t * GetConfig( void )
{
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "Dummy";
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_info->aout_GetPlugin = NULL;
p_info->vout_GetPlugin = vout_GetPlugin;
p_info->intf_GetPlugin = intf_GetPlugin;
p_info->yuv_GetPlugin = NULL;
/* The dummy plugin always works, but should have low priority */
p_info->i_score = 0x1;
/* If this plugin was requested, score it higher */
if( TestMethod( VOUT_METHOD_VAR, "dummy" ) )
{
p_info->i_score += 0x200;
}
return( p_info );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
static void vout_GetPlugin( p_vout_thread_t p_vout )
{
p_vout->p_sys_create = vout_DummyCreate;
p_vout->p_sys_init = vout_DummyInit;
p_vout->p_sys_end = vout_DummyEnd;
p_vout->p_sys_destroy = vout_DummyDestroy;
p_vout->p_sys_manage = vout_DummyManage;
p_vout->p_sys_display = vout_DummyDisplay;
}
static void intf_GetPlugin( p_intf_thread_t p_intf )
{
p_intf->p_sys_create = intf_DummyCreate;
p_intf->p_sys_destroy = intf_DummyDestroy;
p_intf->p_sys_manage = intf_DummyManage;
}
/***************************************************************************** /*****************************************************************************
* intf_dummy.c: dummy interface plugin * intf_dummy.c: dummy interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* *
* Authors: * Authors: Samuel Hocevar <sam@zoy.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -31,13 +31,8 @@ ...@@ -31,13 +31,8 @@
#include "common.h" #include "common.h"
#include "threads.h" #include "threads.h"
#include "mtime.h" #include "mtime.h"
#include "plugins.h" #include "tests.h"
#include "modules.h"
#include "stream_control.h"
#include "input_ext-intf.h"
#include "video.h"
#include "video_output.h"
#include "intf_msg.h" #include "intf_msg.h"
#include "interface.h" #include "interface.h"
...@@ -53,9 +48,45 @@ typedef struct intf_sys_s ...@@ -53,9 +48,45 @@ typedef struct intf_sys_s
} intf_sys_t; } intf_sys_t;
/***************************************************************************** /*****************************************************************************
* intf_DummyCreate: initialize dummy interface * Local prototypes.
*****************************************************************************/
static int intf_Probe ( probedata_t *p_data );
static int intf_Open ( intf_thread_t *p_intf );
static void intf_Close ( intf_thread_t *p_intf );
static void intf_Run ( intf_thread_t *p_intf );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void intf_getfunctions( function_list_t * p_function_list )
{
p_function_list->pf_probe = intf_Probe;
p_function_list->functions.intf.pf_open = intf_Open;
p_function_list->functions.intf.pf_close = intf_Close;
p_function_list->functions.intf.pf_run = intf_Run;
}
/*****************************************************************************
* intf_Probe: probe the interface and return a score
*****************************************************************************
* This function tries to initialize Gnome and returns a score to the
* plugin manager so that it can select the best plugin.
*****************************************************************************/
static int intf_Probe( probedata_t *p_data )
{
if( TestMethod( INTF_METHOD_VAR, "dummy" ) )
{
return( 999 );
}
return( 1 );
}
/*****************************************************************************
* intf_Open: initialize dummy interface
*****************************************************************************/ *****************************************************************************/
int intf_DummyCreate( intf_thread_t *p_intf ) static int intf_Open( intf_thread_t *p_intf )
{ {
/* Allocate instance and initialize some members */ /* Allocate instance and initialize some members */
p_intf->p_sys = malloc( sizeof( intf_sys_t ) ); p_intf->p_sys = malloc( sizeof( intf_sys_t ) );
...@@ -64,46 +95,31 @@ int intf_DummyCreate( intf_thread_t *p_intf ) ...@@ -64,46 +95,31 @@ int intf_DummyCreate( intf_thread_t *p_intf )
return( 1 ); return( 1 );
}; };
/* Spawn video output thread */
if( p_main->b_video )
{
p_intf->p_vout = vout_CreateThread( NULL, 0, 0, 0, NULL, 0, NULL );
if( p_intf->p_vout == NULL ) /* error */
{
intf_ErrMsg("intf error: can't create output thread" );
return( 1 );
}
}
return( 0 ); return( 0 );
} }
/***************************************************************************** /*****************************************************************************
* intf_DummyDestroy: destroy dummy interface * intf_Close: destroy dummy interface
*****************************************************************************/ *****************************************************************************/
void intf_DummyDestroy( intf_thread_t *p_intf ) static void intf_Close( intf_thread_t *p_intf )
{ {
/* Close input thread, if any (blocking) */
if( p_intf->p_input )
{
input_DestroyThread( p_intf->p_input, NULL );
}
/* Close video output thread, if any (blocking) */
if( p_intf->p_vout )
{
vout_DestroyThread( p_intf->p_vout, NULL );
}
/* Destroy structure */ /* Destroy structure */
free( p_intf->p_sys ); free( p_intf->p_sys );
} }
/***************************************************************************** /*****************************************************************************
* intf_DummyManage: event loop * intf_Run: main loop
*****************************************************************************/ *****************************************************************************/
void intf_DummyManage( intf_thread_t *p_intf ) static void intf_Run( intf_thread_t *p_intf )
{ {
; while( !p_intf->b_die )
{
/* Manage core vlc functions through the callback */
p_intf->pf_manage( p_intf );
/* Wait a bit */
msleep( INTF_IDLE_SLEEP );
}
} }
/***************************************************************************** /*****************************************************************************
* vout_dummy.c: Dummy video output display method for testing purposes * vout_dummy.c: Dummy video output display method for testing purposes
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* *
* Authors: * Authors: Samuel Hocevar <sam@zoy.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -33,17 +33,18 @@ ...@@ -33,17 +33,18 @@
#include "common.h" #include "common.h"
#include "threads.h" #include "threads.h"
#include "mtime.h" #include "mtime.h"
#include "plugins.h" #include "tests.h"
#include "modules.h"
#include "video.h" #include "video.h"
#include "video_output.h" #include "video_output.h"
#include "intf_msg.h" #include "intf_msg.h"
#define WIDTH 16 #define DUMMY_WIDTH 16
#define HEIGHT 16 #define DUMMY_HEIGHT 16
#define BITS_PER_PLANE 16 #define DUMMY_BITS_PER_PLANE 16
#define BYTES_PER_PIXEL 2 #define DUMMY_BYTES_PER_PIXEL 2
/***************************************************************************** /*****************************************************************************
* vout_sys_t: dummy video output method descriptor * vout_sys_t: dummy video output method descriptor
...@@ -62,16 +63,49 @@ typedef struct vout_sys_s ...@@ -62,16 +63,49 @@ typedef struct vout_sys_s
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
static int DummyOpenDisplay ( vout_thread_t *p_vout ); static int vout_Probe ( probedata_t *p_data );
static void DummyCloseDisplay ( vout_thread_t *p_vout ); static int vout_Create ( struct vout_thread_s * );
static int vout_Init ( struct vout_thread_s * );
static void vout_End ( struct vout_thread_s * );
static void vout_Destroy ( struct vout_thread_s * );
static int vout_Manage ( struct vout_thread_s * );
static void vout_Display ( struct vout_thread_s * );
/***************************************************************************** /*****************************************************************************
* vout_DummyCreate: allocates dummy video thread output method * Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void vout_getfunctions( function_list_t * p_function_list )
{
p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_destroy = vout_Destroy;
p_function_list->functions.vout.pf_manage = vout_Manage;
p_function_list->functions.vout.pf_display = vout_Display;
p_function_list->functions.vout.pf_setpalette = NULL;
}
/*****************************************************************************
* intf_Probe: return a score
*****************************************************************************/
static int vout_Probe( probedata_t *p_data )
{
if( TestMethod( VOUT_METHOD_VAR, "dummy" ) )
{
return( 999 );
}
return( 1 );
}
/*****************************************************************************
* vout_Create: allocates dummy video thread output method
***************************************************************************** *****************************************************************************
* This function allocates and initializes a dummy vout method. * This function allocates and initializes a dummy vout method.
*****************************************************************************/ *****************************************************************************/
int vout_DummyCreate( vout_thread_t *p_vout, char *psz_display, static int vout_Create( vout_thread_t *p_vout )
int i_root_window, void *p_data )
{ {
/* Allocate structure */ /* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) ); p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
...@@ -81,109 +115,78 @@ int vout_DummyCreate( vout_thread_t *p_vout, char *psz_display, ...@@ -81,109 +115,78 @@ int vout_DummyCreate( vout_thread_t *p_vout, char *psz_display,
return( 1 ); return( 1 );
} }
/* Open and initialize device */ p_vout->i_width = DUMMY_WIDTH;
if( DummyOpenDisplay( p_vout ) ) p_vout->i_height = DUMMY_HEIGHT;
p_vout->i_screen_depth = DUMMY_BITS_PER_PLANE;
p_vout->i_bytes_per_pixel = DUMMY_BYTES_PER_PIXEL;
p_vout->i_bytes_per_line = DUMMY_WIDTH * DUMMY_BYTES_PER_PIXEL;
p_vout->p_sys->i_page_size = DUMMY_WIDTH * DUMMY_HEIGHT
* DUMMY_BYTES_PER_PIXEL;
/* Map two framebuffers a the very beginning of the fb */
p_vout->p_sys->p_video = malloc( 2 * p_vout->p_sys->i_page_size );
if( p_vout->p_sys->p_video == NULL )
{ {
intf_ErrMsg("vout error: can't open display"); intf_ErrMsg( "vout error: can't map video memory (%s)",
strerror(errno) );
free( p_vout->p_sys ); free( p_vout->p_sys );
return( 1 ); return( 1 );
} }
/* Set and initialize buffers */
vout_SetBuffers( p_vout, p_vout->p_sys->p_video,
p_vout->p_sys->p_video + p_vout->p_sys->i_page_size );
return( 0 ); return( 0 );
} }
/***************************************************************************** /*****************************************************************************
* vout_DummyInit: initialize dummy video thread output method * vout_Init: initialize dummy video thread output method
*****************************************************************************/ *****************************************************************************/
int vout_DummyInit( vout_thread_t *p_vout ) static int vout_Init( vout_thread_t *p_vout )
{ {
return( 0 ); return( 0 );
} }
/***************************************************************************** /*****************************************************************************
* vout_DummyEnd: terminate dummy video thread output method * vout_End: terminate dummy video thread output method
*****************************************************************************/ *****************************************************************************/
void vout_DummyEnd( vout_thread_t *p_vout ) static void vout_End( vout_thread_t *p_vout )
{ {
; ;
} }
/***************************************************************************** /*****************************************************************************
* vout_DummyDestroy: destroy dummy video thread output method * vout_Destroy: destroy dummy video thread output method
***************************************************************************** *****************************************************************************
* Terminate an output method created by DummyCreateOutputMethod * Terminate an output method created by DummyCreateOutputMethod
*****************************************************************************/ *****************************************************************************/
void vout_DummyDestroy( vout_thread_t *p_vout ) static void vout_Destroy( vout_thread_t *p_vout )
{ {
DummyCloseDisplay( p_vout ); free( p_vout->p_sys->p_video );
free( p_vout->p_sys ); free( p_vout->p_sys );
} }
/***************************************************************************** /*****************************************************************************
* vout_DummyManage: handle dummy events * vout_Manage: handle dummy events
***************************************************************************** *****************************************************************************
* This function should be called regularly by video output thread. It manages * This function should be called regularly by video output thread. It manages
* console events. It returns a non null value on error. * console events. It returns a non null value on error.
*****************************************************************************/ *****************************************************************************/
int vout_DummyManage( vout_thread_t *p_vout ) static int vout_Manage( vout_thread_t *p_vout )
{ {
return( 0 ); return( 0 );
} }
/***************************************************************************** /*****************************************************************************
* vout_DummyDisplay: displays previously rendered output * vout_Display: displays previously rendered output
***************************************************************************** *****************************************************************************
* This function send the currently rendered image to dummy image, waits until * This function send the currently rendered image to dummy image, waits until
* it is displayed and switch the two rendering buffers, preparing next frame. * it is displayed and switch the two rendering buffers, preparing next frame.
*****************************************************************************/ *****************************************************************************/
void vout_DummyDisplay( vout_thread_t *p_vout ) static void vout_Display( vout_thread_t *p_vout )
{ {
; ;
} }
/* following functions are local */
/*****************************************************************************
* DummyOpenDisplay: open and initialize dummy device
*****************************************************************************
* XXX?? The framebuffer mode is only provided as a fast and efficient way to
* display video, providing the card is configured and the mode ok. It is
* not portable, and is not supposed to work with many cards. Use at your
* own risk !
*****************************************************************************/
static int DummyOpenDisplay( vout_thread_t *p_vout )
{
p_vout->i_width = WIDTH;
p_vout->i_height = HEIGHT;
p_vout->i_screen_depth = BITS_PER_PLANE;
p_vout->i_bytes_per_pixel = BYTES_PER_PIXEL;
p_vout->i_bytes_per_line = WIDTH * BYTES_PER_PIXEL;
p_vout->p_sys->i_page_size = WIDTH * HEIGHT * BYTES_PER_PIXEL;
/* Map two framebuffers a the very beginning of the fb */
p_vout->p_sys->p_video = malloc( p_vout->p_sys->i_page_size * 2 );
if( (int)p_vout->p_sys->p_video == -1 )
{
intf_ErrMsg("vout error: can't map video memory (%s)", strerror(errno) );
return( 1 );
}
/* Set and initialize buffers */
vout_SetBuffers( p_vout, p_vout->p_sys->p_video,
p_vout->p_sys->p_video + p_vout->p_sys->i_page_size );
return( 0 );
}
/*****************************************************************************
* DummyCloseDisplay: close and reset dummy device
*****************************************************************************
* Returns all resources allocated by DummyOpenDisplay and restore the original
* state of the device.
*****************************************************************************/
static void DummyCloseDisplay( vout_thread_t *p_vout )
{
free( p_vout->p_sys->p_video );
}
...@@ -426,3 +426,43 @@ on_toolbar_fast_clicked (GtkButton *button, ...@@ -426,3 +426,43 @@ on_toolbar_fast_clicked (GtkButton *button,
} }
} }
gboolean
on_hscale_button_release_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
GtkAdjustment *p_adj = gtk_range_get_adjustment( GTK_RANGE(widget) );
off_t i_seek = (p_adj->value * p_intf->p_input->stream.i_size) / 100;
vlc_mutex_lock( &p_intf->p_sys->change_lock );
p_intf->p_sys->b_scale_isfree = 1;
if( p_intf->p_input != NULL )
{
input_Seek( p_intf->p_input, i_seek );
}
vlc_mutex_unlock( &p_intf->p_sys->change_lock );
return FALSE;
}
gboolean
on_hscale_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
vlc_mutex_lock( &p_intf->p_sys->change_lock );
p_intf->p_sys->b_scale_isfree = 0;
vlc_mutex_unlock( &p_intf->p_sys->change_lock );
return FALSE;
}
...@@ -144,3 +144,18 @@ on_toolbar_slow_clicked (GtkButton *button, ...@@ -144,3 +144,18 @@ on_toolbar_slow_clicked (GtkButton *button,
void void
on_toolbar_fast_clicked (GtkButton *button, on_toolbar_fast_clicked (GtkButton *button,
gpointer user_data); gpointer user_data);
gboolean
on_hscale_button_release_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
gboolean
on_hscale_button_release_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
gboolean
on_hscale_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
...@@ -29,14 +29,14 @@ static GnomeUIInfo menubar_view_menu_uiinfo[] = ...@@ -29,14 +29,14 @@ static GnomeUIInfo menubar_view_menu_uiinfo[] =
{ {
{ {
GNOME_APP_UI_ITEM, N_("P_laylist"), GNOME_APP_UI_ITEM, N_("P_laylist"),
NULL, N_("Open the playlist window"),
(gpointer) on_menubar_playlist_activate, NULL, NULL, (gpointer) on_menubar_playlist_activate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_INDEX, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_INDEX,
0, (GdkModifierType) 0, NULL 0, (GdkModifierType) 0, NULL
}, },
{ {
GNOME_APP_UI_ITEM, N_("_Plugins"), GNOME_APP_UI_ITEM, N_("_Plugins"),
NULL, N_("Open the plugin manager"),
(gpointer) on_menubar_plugins_activate, NULL, NULL, (gpointer) on_menubar_plugins_activate, NULL, NULL,
GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ATTACH, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ATTACH,
0, (GdkModifierType) 0, NULL 0, (GdkModifierType) 0, NULL
...@@ -69,7 +69,7 @@ GtkWidget* ...@@ -69,7 +69,7 @@ GtkWidget*
create_intf_window (void) create_intf_window (void)
{ {
GtkWidget *intf_window; GtkWidget *intf_window;
GtkWidget *dock1; GtkWidget *dockitem;
GtkWidget *toolbar; GtkWidget *toolbar;
GtkWidget *tmp_toolbar_icon; GtkWidget *tmp_toolbar_icon;
GtkWidget *toolbar_open; GtkWidget *toolbar_open;
...@@ -82,18 +82,20 @@ create_intf_window (void) ...@@ -82,18 +82,20 @@ create_intf_window (void)
GtkWidget *toolbar_playlist; GtkWidget *toolbar_playlist;
GtkWidget *toolbar_prev; GtkWidget *toolbar_prev;
GtkWidget *toolbar_next; GtkWidget *toolbar_next;
GtkWidget *scrolledwindow1; GtkWidget *vbox2;
GtkWidget *text1; GtkWidget *label6;
GtkWidget *label7;
GtkWidget *hscale;
GtkWidget *appbar; GtkWidget *appbar;
intf_window = gnome_app_new ("VideoLAN Client", _("VideoLAN Client")); intf_window = gnome_app_new ("VideoLAN Client", _("VideoLAN Client"));
gtk_object_set_data (GTK_OBJECT (intf_window), "intf_window", intf_window); gtk_object_set_data (GTK_OBJECT (intf_window), "intf_window", intf_window);
dock1 = GNOME_APP (intf_window)->dock; dockitem = GNOME_APP (intf_window)->dock;
gtk_widget_ref (dock1); gtk_widget_ref (dockitem);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "dock1", dock1, gtk_object_set_data_full (GTK_OBJECT (intf_window), "dockitem", dockitem,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (dock1); gtk_widget_show (dockitem);
gnome_app_create_menus (GNOME_APP (intf_window), menubar_uiinfo); gnome_app_create_menus (GNOME_APP (intf_window), menubar_uiinfo);
...@@ -289,22 +291,42 @@ create_intf_window (void) ...@@ -289,22 +291,42 @@ create_intf_window (void)
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_next); gtk_widget_show (toolbar_next);
scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); vbox2 = gtk_vbox_new (FALSE, 0);
gtk_widget_ref (scrolledwindow1); gtk_widget_ref (vbox2);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "scrolledwindow1", scrolledwindow1, gtk_object_set_data_full (GTK_OBJECT (intf_window), "vbox2", vbox2,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (vbox2);
gnome_app_set_contents (GNOME_APP (intf_window), vbox2);
label6 = gtk_label_new (_("File name: wazaa.mpeg"));
gtk_widget_ref (label6);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "label6", label6,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (scrolledwindow1); gtk_widget_show (label6);
gnome_app_set_contents (GNOME_APP (intf_window), scrolledwindow1); gtk_box_pack_start (GTK_BOX (vbox2), label6, FALSE, FALSE, 0);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_LEFT);
gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5);
gtk_misc_set_padding (GTK_MISC (label6), 5, 0);
text1 = gtk_text_new (NULL, NULL); label7 = gtk_label_new (_("File type: awesome movie"));
gtk_widget_ref (text1); gtk_widget_ref (label7);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "text1", text1, gtk_object_set_data_full (GTK_OBJECT (intf_window), "label7", label7,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (text1); gtk_widget_show (label7);
gtk_container_add (GTK_CONTAINER (scrolledwindow1), text1); gtk_box_pack_start (GTK_BOX (vbox2), label7, FALSE, FALSE, 0);
gtk_text_insert (GTK_TEXT (text1), NULL, NULL, NULL, gtk_label_set_justify (GTK_LABEL (label7), GTK_JUSTIFY_LEFT);
_("This is some random text. Nah. Eat at Sam's. Rent this place. Wazaaa."), 69); gtk_label_set_line_wrap (GTK_LABEL (label7), TRUE);
gtk_misc_set_alignment (GTK_MISC (label7), 0, 0.5);
gtk_misc_set_padding (GTK_MISC (label7), 5, 0);
hscale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 0, 0)));
gtk_widget_ref (hscale);
gtk_object_set_data_full (GTK_OBJECT (intf_window), "hscale", hscale,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (hscale);
gtk_box_pack_start (GTK_BOX (vbox2), hscale, FALSE, FALSE, 0);
gtk_scale_set_value_pos (GTK_SCALE (hscale), GTK_POS_BOTTOM);
gtk_range_set_update_policy (GTK_RANGE (hscale), GTK_UPDATE_DELAYED);
appbar = gnome_appbar_new (TRUE, TRUE, GNOME_PREFERENCES_NEVER); appbar = gnome_appbar_new (TRUE, TRUE, GNOME_PREFERENCES_NEVER);
gtk_widget_ref (appbar); gtk_widget_ref (appbar);
...@@ -347,6 +369,12 @@ create_intf_window (void) ...@@ -347,6 +369,12 @@ create_intf_window (void)
gtk_signal_connect (GTK_OBJECT (toolbar_next), "clicked", gtk_signal_connect (GTK_OBJECT (toolbar_next), "clicked",
GTK_SIGNAL_FUNC (on_toolbar_next_clicked), GTK_SIGNAL_FUNC (on_toolbar_next_clicked),
NULL); NULL);
gtk_signal_connect (GTK_OBJECT (hscale), "button_release_event",
GTK_SIGNAL_FUNC (on_hscale_button_release_event),
NULL);
gtk_signal_connect (GTK_OBJECT (hscale), "button_press_event",
GTK_SIGNAL_FUNC (on_hscale_button_press_event),
NULL);
return intf_window; return intf_window;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gnome_sys.h: private Gnome interface description * gnome_sys.h: private Gnome interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: gnome_sys.h,v 1.2 2001/02/12 00:20:37 sam Exp $ * $Id: gnome_sys.h,v 1.3 2001/02/13 04:29:46 sam Exp $
* *
* Authors: * Authors:
* *
...@@ -29,16 +29,10 @@ typedef struct intf_sys_s ...@@ -29,16 +29,10 @@ typedef struct intf_sys_s
/* special actions */ /* special actions */
vlc_mutex_t change_lock; /* the change lock */ vlc_mutex_t change_lock; /* the change lock */
boolean_t b_activity_changed; /* vout activity toggled ? */
boolean_t b_activity; /* vout activity */
boolean_t b_popup_changed; /* display menu ? */ boolean_t b_popup_changed; /* display menu ? */
boolean_t b_window_changed; /* window display toggled ? */ boolean_t b_window_changed; /* window display toggled ? */
boolean_t b_window; /* display window ? */
boolean_t b_playlist_changed; /* playlist display toggled ? */ boolean_t b_playlist_changed; /* playlist display toggled ? */
boolean_t b_playlist; /* display playlist ? */ boolean_t b_scale_isfree; /* user isn't dragging scale ? */
/* intf_Manage callback timeout */ /* intf_Manage callback timeout */
int i_timeout; int i_timeout;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_gnome.c: Gnome interface * intf_gnome.c: Gnome interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gnome.c,v 1.9 2001/02/12 00:20:37 sam Exp $ * $Id: intf_gnome.c,v 1.10 2001/02/13 04:29:46 sam Exp $
* *
* Authors: * Authors:
* *
...@@ -134,13 +134,12 @@ static int intf_Open( intf_thread_t *p_intf ) ...@@ -134,13 +134,12 @@ static int intf_Open( intf_thread_t *p_intf )
} }
/* Initialize Gnome thread */ /* Initialize Gnome thread */
p_intf->p_sys->b_window = 1;
p_intf->p_sys->b_playlist = 0;
p_intf->p_sys->b_popup_changed = 0; p_intf->p_sys->b_popup_changed = 0;
p_intf->p_sys->b_window_changed = 0; p_intf->p_sys->b_window_changed = 0;
p_intf->p_sys->b_playlist_changed = 0; p_intf->p_sys->b_playlist_changed = 0;
p_intf->p_sys->b_scale_isfree = 1;
p_intf->p_sys->pf_gtk_callback = NULL; p_intf->p_sys->pf_gtk_callback = NULL;
p_intf->p_sys->pf_gdk_callback = NULL; p_intf->p_sys->pf_gdk_callback = NULL;
...@@ -224,7 +223,9 @@ static gint GnomeManage( gpointer p_data ) ...@@ -224,7 +223,9 @@ static gint GnomeManage( gpointer p_data )
{ {
intf_thread_t *p_intf = (void *)p_data; intf_thread_t *p_intf = (void *)p_data;
/* if the "display popup" flag has changed */ vlc_mutex_lock( &p_intf->p_sys->change_lock );
/* If the "display popup" flag has changed */
if( p_intf->b_menu_change ) if( p_intf->b_menu_change )
{ {
gnome_popup_menu_do_popup( p_intf->p_sys->p_popup, gnome_popup_menu_do_popup( p_intf->p_sys->p_popup,
...@@ -232,16 +233,45 @@ static gint GnomeManage( gpointer p_data ) ...@@ -232,16 +233,45 @@ static gint GnomeManage( gpointer p_data )
p_intf->b_menu_change = 0; p_intf->b_menu_change = 0;
} }
/* Manage the slider */
if( p_intf->p_input != NULL && p_intf->p_sys->p_window != NULL
&& p_intf->p_sys->b_scale_isfree )
{
GtkWidget *p_scale;
GtkAdjustment *p_adj;
p_scale = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "hscale" ) );
p_adj = gtk_range_get_adjustment ( GTK_RANGE( p_scale ) );
/* Update the value */
p_adj->value = ( 100. * p_intf->p_input->stream.i_tell )
/ p_intf->p_input->stream.i_size;
/* Gtv does it this way. Why not. */
gtk_range_set_adjustment ( GTK_RANGE( p_scale ), p_adj );
gtk_range_slider_update ( GTK_RANGE( p_scale ) );
gtk_range_clear_background ( GTK_RANGE( p_scale ) );
gtk_range_draw_background ( GTK_RANGE( p_scale ) );
}
/* Manage core vlc functions through the callback */ /* Manage core vlc functions through the callback */
p_intf->pf_manage( p_intf ); p_intf->pf_manage( p_intf );
if( p_intf->b_die ) if( p_intf->b_die )
{ {
/* Make sure we won't be called again */
gtk_timeout_remove( p_intf->p_sys->i_timeout );
vlc_mutex_unlock( &p_intf->p_sys->change_lock );
/* prepare to die, young man */ /* prepare to die, young man */
gtk_main_quit(); gtk_main_quit();
return( FALSE ); return( FALSE );
} }
vlc_mutex_unlock( &p_intf->p_sys->change_lock );
return( TRUE ); return( TRUE );
} }
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<widget> <widget>
<class>GnomeDock</class> <class>GnomeDock</class>
<child_name>GnomeApp:dock</child_name> <child_name>GnomeApp:dock</child_name>
<name>dock1</name> <name>dockitem</name>
<allow_floating>True</allow_floating> <allow_floating>True</allow_floating>
<child> <child>
<padding>0</padding> <padding>0</padding>
...@@ -119,6 +119,7 @@ ...@@ -119,6 +119,7 @@
<widget> <widget>
<class>GtkPixmapMenuItem</class> <class>GtkPixmapMenuItem</class>
<name>menubar_playlist</name> <name>menubar_playlist</name>
<tooltip>Open the playlist window</tooltip>
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>on_menubar_playlist_activate</handler> <handler>on_menubar_playlist_activate</handler>
...@@ -132,6 +133,7 @@ ...@@ -132,6 +133,7 @@
<widget> <widget>
<class>GtkPixmapMenuItem</class> <class>GtkPixmapMenuItem</class>
<name>menubar_plugins</name> <name>menubar_plugins</name>
<tooltip>Open the plugin manager</tooltip>
<signal> <signal>
<name>activate</name> <name>activate</name>
<handler>on_menubar_plugins_activate</handler> <handler>on_menubar_plugins_activate</handler>
...@@ -365,20 +367,75 @@ ...@@ -365,20 +367,75 @@
</widget> </widget>
<widget> <widget>
<class>GtkScrolledWindow</class> <class>GtkVBox</class>
<child_name>GnomeDock:contents</child_name> <child_name>GnomeDock:contents</child_name>
<name>scrolledwindow1</name> <name>vbox2</name>
<hscrollbar_policy>GTK_POLICY_NEVER</hscrollbar_policy> <homogeneous>False</homogeneous>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy> <spacing>0</spacing>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy> <widget>
<class>GtkLabel</class>
<name>label6</name>
<label>File name: wazaa.mpeg</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget> <widget>
<class>GtkText</class> <class>GtkLabel</class>
<name>text1</name> <name>label7</name>
<label>File type: awesome movie</label>
<justify>GTK_JUSTIFY_LEFT</justify>
<wrap>True</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>5</xpad>
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget>
<widget>
<class>GtkHScale</class>
<name>hscale</name>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<editable>False</editable> <signal>
<text>This is some random text. Nah. Eat at Sam's. Rent this place. Wazaaa.</text> <name>button_release_event</name>
<handler>on_hscale_button_release_event</handler>
<last_modification_time>Tue, 13 Feb 2001 01:15:41 GMT</last_modification_time>
</signal>
<signal>
<name>button_press_event</name>
<handler>on_hscale_button_press_event</handler>
<last_modification_time>Tue, 13 Feb 2001 02:55:04 GMT</last_modification_time>
</signal>
<draw_value>True</draw_value>
<value_pos>GTK_POS_BOTTOM</value_pos>
<digits>1</digits>
<policy>GTK_UPDATE_DELAYED</policy>
<value>0</value>
<lower>0</lower>
<upper>100</upper>
<step>1</step>
<page>0</page>
<page_size>0</page_size>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
</child>
</widget> </widget>
</widget> </widget>
</widget> </widget>
......
...@@ -106,6 +106,7 @@ static int aout_Probe( probedata_t *p_data ) ...@@ -106,6 +106,7 @@ static int aout_Probe( probedata_t *p_data )
{ {
SDL_AudioSpec desired, obtained; SDL_AudioSpec desired, obtained;
return 0;
/* Start AudioSDL */ /* Start AudioSDL */
if( SDL_Init(SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE) != 0 ) if( SDL_Init(SDL_INIT_AUDIO | SDL_INIT_NOPARACHUTE) != 0 )
{ {
...@@ -116,7 +117,7 @@ static int aout_Probe( probedata_t *p_data ) ...@@ -116,7 +117,7 @@ static int aout_Probe( probedata_t *p_data )
desired.freq = 11025; /* frequency */ desired.freq = 11025; /* frequency */
desired.format = AUDIO_U8; /* unsigned 8 bits */ desired.format = AUDIO_U8; /* unsigned 8 bits */
desired.channels = 2; /* mono */ desired.channels = 2; /* mono */
desired.callback = aout_SDLCallback; /* no callback function yet */ desired.callback = NULL; /* no callback function yet */
desired.userdata = NULL; /* null parm for callback */ desired.userdata = NULL; /* null parm for callback */
desired.samples = 4096; desired.samples = 4096;
......
/***************************************************************************** /*****************************************************************************
* sdl.c : SDL plugin for vlc * sdl.c : SDL plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* *
* Authors: * Authors: Samuel Hocevar <sam@zoy.org>
* . Initial plugin code by Samuel Hocevar <sam@via.ecp.fr> * Pierre Baillet <oct@zoy.org>
* . Modified to use the SDL by Pierre Baillet <octplane@via.ecp.fr> * Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
......
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* *
* Authors: * Authors: Samuel Hocevar <sam@zoy.org>
* Pierre Baillet <oct@zoy.org>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -38,10 +40,6 @@ ...@@ -38,10 +40,6 @@
#include "tests.h" #include "tests.h"
#include "modules.h" #include "modules.h"
/* FIXME: it's up to the _interface_ to do this, not the video output */
#include "stream_control.h"
#include "input_ext-intf.h"
#include "video.h" #include "video.h"
#include "video_output.h" #include "video_output.h"
...@@ -113,7 +111,7 @@ void vout_getfunctions( function_list_t * p_function_list ) ...@@ -113,7 +111,7 @@ void vout_getfunctions( function_list_t * p_function_list )
} }
/***************************************************************************** /*****************************************************************************
* intf_Probe: probe the video driver and return a score * vout_Probe: probe the video driver and return a score
***************************************************************************** *****************************************************************************
* This function tries to initialize SDL and returns a score to the * This function tries to initialize SDL and returns a score to the
* plugin manager so that it can select the best plugin. * plugin manager so that it can select the best plugin.
...@@ -182,7 +180,6 @@ int vout_Create( vout_thread_t *p_vout ) ...@@ -182,7 +180,6 @@ int vout_Create( vout_thread_t *p_vout )
/* FIXME: get rid of this ASAP, it's FUCKING UGLY */ /* FIXME: get rid of this ASAP, it's FUCKING UGLY */
{ intf_thread_t * p_intf = p_main->p_intf; { intf_thread_t * p_intf = p_main->p_intf;
/* p_intf->p_intf_getKey = intf_getKey; */
intf_AssignKey(p_intf, SDLK_q, INTF_KEY_QUIT, 0); intf_AssignKey(p_intf, SDLK_q, INTF_KEY_QUIT, 0);
intf_AssignKey(p_intf, SDLK_ESCAPE, INTF_KEY_QUIT, 0); intf_AssignKey(p_intf, SDLK_ESCAPE, INTF_KEY_QUIT, 0);
/* intf_AssignKey(p_intf,3,'Q'); */ /* intf_AssignKey(p_intf,3,'Q'); */
...@@ -252,9 +249,6 @@ int vout_Manage( vout_thread_t *p_vout ) ...@@ -252,9 +249,6 @@ int vout_Manage( vout_thread_t *p_vout )
SDL_Event event; /* SDL event */ SDL_Event event; /* SDL event */
Uint8 i_key; Uint8 i_key;
/* FIXME: do this nicely */
input_thread_t * p_input = p_main->p_intf->p_input;
/* Process events */ /* Process events */
while( SDL_PollEvent(&event) ) while( SDL_PollEvent(&event) )
{ {
...@@ -316,47 +310,6 @@ int vout_Manage( vout_thread_t *p_vout ) ...@@ -316,47 +310,6 @@ int vout_Manage( vout_thread_t *p_vout )
p_vout->i_changes |= VOUT_INTF_CHANGE; p_vout->i_changes |= VOUT_INTF_CHANGE;
break; break;
/* FIXME : this is temporary */
case SDLK_p:
if( p_input != NULL )
{
input_SetRate( p_input, INPUT_RATE_PAUSE );
}
break;
case SDLK_a:
if( p_input != NULL )
{
input_SetRate( p_input, INPUT_RATE_FASTER );
}
break;
case SDLK_z:
if( p_input != NULL )
{
input_SetRate( p_input, INPUT_RATE_SLOWER );
}
break;
case SDLK_j:
if( p_input != NULL )
{
/* Jump forwards */
input_Seek( p_input, p_input->stream.i_tell
+ p_input->stream.i_size / 20 );
/* gabuzomeu */
}
break;
case SDLK_b:
if( p_input != NULL )
{
/* Jump backwards */
input_Seek( p_input, p_input->stream.i_tell
- p_input->stream.i_size / 20 );
}
break;
default: default:
if( intf_ProcessKey( p_main->p_intf, (char )i_key ) ) if( intf_ProcessKey( p_main->p_intf, (char )i_key ) )
{ {
......
...@@ -123,10 +123,12 @@ void input_SetRate( input_thread_t * p_input, int i_mode ) ...@@ -123,10 +123,12 @@ void input_SetRate( input_thread_t * p_input, int i_mode )
*****************************************************************************/ *****************************************************************************/
void input_Seek( input_thread_t * p_input, off_t i_position ) void input_Seek( input_thread_t * p_input, off_t i_position )
{ {
intf_Msg( "input: seeking position %lld/%lld", i_position,
p_input->stream.i_size );
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.i_seek = i_position; p_input->stream.i_seek = i_position;
intf_Msg( "input: seeking position %lld/%lld", i_position,
p_input->stream.i_size );
vlc_cond_signal( &p_input->stream.stream_wait ); vlc_cond_signal( &p_input->stream.stream_wait );
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
} }
......
...@@ -90,10 +90,11 @@ ...@@ -90,10 +90,11 @@
#define OPT_AOUT 180 #define OPT_AOUT 180
#define OPT_VOUT 181 #define OPT_VOUT 181
#define OPT_MOTION 182 #define OPT_INTF 182
#define OPT_IDCT 183 #define OPT_MOTION 183
#define OPT_YUV 184 #define OPT_IDCT 184
#define OPT_INPUT 185 #define OPT_YUV 185
#define OPT_INPUT 186
#define OPT_SYNCHRO 190 #define OPT_SYNCHRO 190
#define OPT_WARNING 191 #define OPT_WARNING 191
...@@ -114,6 +115,10 @@ static const struct option longopts[] = ...@@ -114,6 +115,10 @@ static const struct option longopts[] =
{ "longhelp", 0, 0, 'H' }, { "longhelp", 0, 0, 'H' },
{ "version", 0, 0, 'v' }, { "version", 0, 0, 'v' },
/* Interface options */
{ "intf", 1, 0, OPT_INTF },
{ "warning", 1, 0, OPT_WARNING },
/* Audio options */ /* Audio options */
{ "noaudio", 0, 0, OPT_NOAUDIO }, { "noaudio", 0, 0, OPT_NOAUDIO },
{ "aout", 1, 0, OPT_AOUT }, { "aout", 1, 0, OPT_AOUT },
...@@ -148,9 +153,6 @@ static const struct option longopts[] = ...@@ -148,9 +153,6 @@ static const struct option longopts[] =
/* Synchro options */ /* Synchro options */
{ "synchro", 1, 0, OPT_SYNCHRO }, { "synchro", 1, 0, OPT_SYNCHRO },
/* Interface messages */
{ "warning", 1, 0, OPT_WARNING },
{ 0, 0, 0, 0 } { 0, 0, 0, 0 }
}; };
...@@ -561,6 +563,14 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -561,6 +563,14 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
return( -1 ); return( -1 );
break; break;
/* Interface warning messages level */
case OPT_INTF: /* --intf */
main_PutPszVariable( INTF_METHOD_VAR, optarg );
break;
case OPT_WARNING: /* --warning */
main_PutIntVariable( INTF_WARNING_VAR, atoi(optarg) );
break;
/* Audio options */ /* Audio options */
case OPT_NOAUDIO: /* --noaudio */ case OPT_NOAUDIO: /* --noaudio */
p_main->b_audio = 0; p_main->b_audio = 0;
...@@ -653,11 +663,6 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -653,11 +663,6 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
main_PutPszVariable( VPAR_SYNCHRO_VAR, optarg ); main_PutPszVariable( VPAR_SYNCHRO_VAR, optarg );
break; break;
/* Interface warning messages level */
case OPT_WARNING: /* --warning */
main_PutIntVariable( INTF_WARNING_VAR, atoi(optarg) );
break;
/* Internal error: unknown option */ /* Internal error: unknown option */
case '?': case '?':
default: default:
...@@ -709,6 +714,9 @@ static void Usage( int i_fashion ) ...@@ -709,6 +714,9 @@ static void Usage( int i_fashion )
/* Options */ /* Options */
intf_MsgImm( "\nOptions:" intf_MsgImm( "\nOptions:"
"\n --intf <module> \tinterface method"
"\n --warning <level> \tdisplay warning messages"
"\n"
"\n --noaudio \tdisable audio" "\n --noaudio \tdisable audio"
"\n --aout <module> \taudio output method" "\n --aout <module> \taudio output method"
"\n --stereo, --mono \tstereo/mono audio" "\n --stereo, --mono \tstereo/mono audio"
...@@ -736,8 +744,6 @@ static void Usage( int i_fashion ) ...@@ -736,8 +744,6 @@ static void Usage( int i_fashion )
"\n --port <port> \tvideo server port" "\n --port <port> \tvideo server port"
"\n --broadcast \tlisten to a broadcast" "\n --broadcast \tlisten to a broadcast"
"\n" "\n"
"\n --warning <level> \tdisplay warning messages"
"\n"
"\n -h, --help \tprint help and exit" "\n -h, --help \tprint help and exit"
"\n -H, --longhelp \tprint long help and exit" "\n -H, --longhelp \tprint long help and exit"
"\n -v, --version \toutput version information and exit" ); "\n -v, --version \toutput version information and exit" );
...@@ -747,6 +753,7 @@ static void Usage( int i_fashion ) ...@@ -747,6 +753,7 @@ static void Usage( int i_fashion )
/* Interface parameters */ /* Interface parameters */
intf_MsgImm( "\nInterface parameters:\n" intf_MsgImm( "\nInterface parameters:\n"
"\n " INTF_METHOD_VAR "=<method name> \tinterface method"
"\n " INTF_INIT_SCRIPT_VAR "=<filename> \tinitialization script" "\n " INTF_INIT_SCRIPT_VAR "=<filename> \tinitialization script"
"\n " INTF_CHANNELS_VAR "=<filename> \tchannels list" "\n " INTF_CHANNELS_VAR "=<filename> \tchannels list"
"\n " INTF_WARNING_VAR "=<level> \twarning level" ); "\n " INTF_WARNING_VAR "=<level> \twarning level" );
......
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