Commit a9729877 authored by Stéphane Borel's avatar Stéphane Borel

. Beginning of dvd_input.

. Parsing of ifo file almost completed.
. Still does not work well.
parent e360e2a4
......@@ -186,6 +186,8 @@ INTERFACE = src/interface/main.o \
INPUT = src/input/input_ps.o \
src/input/input_ts.o \
src/input/dvd_ifo.o \
src/input/input_dvd.o \
src/input/mpeg_system.o \
src/input/input_ext-dec.o \
src/input/input_dec.o \
......
......@@ -211,6 +211,8 @@
* mark it to be presented */
#define DEFAULT_PTS_DELAY (.2*CLOCK_FREQ)
#define INPUT_DVD_DEVICE_VAR "vlc_dvd_device"
#define INPUT_DVD_DEVICE_DEFAULT "/dev/dvd"
#define INPUT_DVD_AUDIO_VAR "vlc_dvd_audio"
#define INPUT_DVD_CHANNEL_VAR "vlc_dvd_channel"
#define INPUT_DVD_SUBTITLE_VAR "vlc_dvd_subtitle"
......@@ -243,9 +245,9 @@
#define AOUT_STEREO_DEFAULT 1
/* Volume */
#define VOLUME_DEFAULT 256
#define VOLUME_STEP 5
#define VOLUME_MAX 765
#define VOLUME_DEFAULT 512
#define VOLUME_STEP 128
#define VOLUME_MAX 1024
/* Environment variable for output rate, and default value */
#define AOUT_RATE_VAR "vlc_audio_rate"
......
......@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.8 2000/12/21 19:24:26 massiot Exp $
* $Id: input_ext-intf.h,v 1.9 2001/01/14 07:08:00 stef Exp $
*
* Authors:
*
......@@ -255,6 +255,7 @@ typedef struct input_config_s
/* Input methods */
#define INPUT_METHOD_NONE 0 /* input thread is inactive */
#define INPUT_METHOD_FILE 10 /* stream is read from file p_source */
#define INPUT_METHOD_DVD 11 /* stream is read from dvd device */
#define INPUT_METHOD_UCAST 20 /* UDP unicast */
#define INPUT_METHOD_MCAST 21 /* UDP multicast */
#define INPUT_METHOD_BCAST 22 /* UDP broadcast */
......
......@@ -44,6 +44,7 @@ typedef struct
boolean_t b_audio; /* is audio output allowed ? */
boolean_t b_video; /* is video output allowed ? */
boolean_t b_vlans; /* are vlans supported ? */
boolean_t b_dvd; /* DVD mode ? */
/* Unique threads */
p_aout_thread_t p_aout; /* audio output thread */
......
This diff is collapsed.
This diff is collapsed.
......@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.67 2001/01/07 04:31:18 henri Exp $
* $Id: input.c,v 1.68 2001/01/14 07:08:00 stef Exp $
*
* Authors:
*
......@@ -62,6 +62,7 @@ static void ErrorThread ( input_thread_t *p_input );
static void EndThread ( input_thread_t *p_input );
static void NetworkOpen ( input_thread_t *p_input );
static void FileOpen ( input_thread_t *p_input );
static void DvdOpen ( input_thread_t *p_input );
/*****************************************************************************
* input_CreateThread: creates a new input thread
......@@ -223,6 +224,7 @@ static void RunThread( input_thread_t *p_input )
* InitThread: init the input thread
*****************************************************************************/
input_capabilities_t * PSKludge( void );
input_capabilities_t * DVDKludge( void );
static void InitThread( input_thread_t * p_input )
{
/* Initialize default settings for spawned decoders */
......@@ -243,6 +245,13 @@ static void InitThread( input_thread_t * p_input )
{
case INPUT_METHOD_FILE: /* file methods */
FileOpen( p_input );
/* Probe plugin (FIXME: load plugins before & write this) */
p_input->p_plugin = PSKludge();
break;
case INPUT_METHOD_DVD: /* DVD method */
DvdOpen( p_input );
/* DVD plugin */
p_input->p_plugin = DVDKludge();
break;
case INPUT_METHOD_VLAN_BCAST: /* vlan network method */
/* if( !p_main->b_vlans )
......@@ -269,8 +278,6 @@ static void InitThread( input_thread_t * p_input )
free( p_input->p_config );
/* Probe plugin (FIXME: load plugins before & write this) */
p_input->p_plugin = PSKludge();
p_input->p_plugin->pf_init( p_input );
*p_input->pi_status = THREAD_READY;
......@@ -398,3 +405,27 @@ static void FileOpen( input_thread_t * p_input )
#undef p_config
}
/*****************************************************************************
* DvdOpen : open the dvd device
*****************************************************************************/
static void DvdOpen( input_thread_t * p_input )
{
intf_Msg( "Opening DVD %s", p_input->p_config->p_source );
if( (p_input->i_handle = open( p_input->p_config->p_source,
O_RDONLY|O_LARGEFILE )) == (-1) )
{
intf_ErrMsg( "input error: cannot open device %s", strerror(errno) );
p_input->b_error = 1;
return;
}
vlc_mutex_lock( &p_input->stream.stream_lock );
p_input->stream.b_pace_control = 1;
p_input->stream.b_seekable = 1;
p_input->stream.i_size = 0;
p_input->stream.i_tell = 0;
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
This diff is collapsed.
/*****************************************************************************
* input_dvd.h: thread structure of the DVD plugin
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
* 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
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* thread_dvd_data_t: extension of input_thread_t for DVD specificity
*****************************************************************************/
typedef struct thread_dvd_data_s
{
/* Structure that contains all information of the DVD */
struct ifo_s ifo;
} thread_dvd_data_t;
......@@ -202,6 +202,23 @@ void intf_Run( intf_thread_t *p_intf )
p_intf->p_input = input_CreateThread( p_input_config, NULL );
}
}
/* DVD mode */
else if( p_main->b_dvd )
{
if( (p_input_config =
(input_config_t *)malloc( sizeof(input_config_t) )) == NULL )
{
intf_ErrMsg( "intf error: cannot create input_config_t" );
}
else
{
p_input_config->i_method = INPUT_METHOD_DVD;
p_input_config->p_source = main_GetPszVariable( INPUT_DVD_DEVICE_VAR, INPUT_DVD_DEVICE_DEFAULT );
p_input_config->p_default_aout = p_main->p_aout;
p_input_config->p_default_vout = p_intf->p_vout;
p_intf->p_input = input_CreateThread( p_input_config, NULL );
}
}
/* Or if a file was specified */
else if( p_main->p_playlist->p_list != NULL )
{
......@@ -452,15 +469,15 @@ int intf_ProcessKey( intf_thread_t *p_intf, int g_key )
* its own error messages */
intf_SelectChannel( p_intf, k_reply.param );
break;
case INTF_KEY_INC_VOLUME: /* volume + */
case INTF_KEY_INC_VOLUME: /* volume + */
if( (p_main->p_aout != NULL) && (p_main->p_aout->vol < VOLUME_MAX) )
p_main->p_aout->vol += VOLUME_STEP;
break;
case INTF_KEY_DEC_VOLUME: /* volume - */
case INTF_KEY_DEC_VOLUME: /* volume - */
if( (p_main->p_aout != NULL) && (p_main->p_aout->vol > VOLUME_STEP) )
p_main->p_aout->vol -= VOLUME_STEP;
break;
case INTF_KEY_TOGGLE_VOLUME: /* toggle mute */
case INTF_KEY_TOGGLE_VOLUME: /* toggle mute */
if( (p_main->p_aout != NULL) && (p_main->p_aout->vol))
{
i_volbackup = p_main->p_aout->vol;
......@@ -469,7 +486,7 @@ int intf_ProcessKey( intf_thread_t *p_intf, int g_key )
else if( (p_main->p_aout != NULL) && (!p_main->p_aout->vol))
p_main->p_aout->vol = i_volbackup;
break;
case INTF_KEY_DEC_GAMMA: /* gamma - */
case INTF_KEY_DEC_GAMMA: /* gamma - */
if( (p_intf->p_vout != NULL) && (p_intf->p_vout->f_gamma > -INTF_GAMMA_LIMIT) )
{
vlc_mutex_lock( &p_intf->p_vout->change_lock );
......@@ -478,7 +495,7 @@ int intf_ProcessKey( intf_thread_t *p_intf, int g_key )
vlc_mutex_unlock( &p_intf->p_vout->change_lock );
}
break;
case INTF_KEY_INC_GAMMA: /* gamma + */
case INTF_KEY_INC_GAMMA: /* gamma + */
if( (p_intf->p_vout != NULL) && (p_intf->p_vout->f_gamma < INTF_GAMMA_LIMIT) )
{
vlc_mutex_lock( &p_intf->p_vout->change_lock );
......@@ -487,7 +504,7 @@ int intf_ProcessKey( intf_thread_t *p_intf, int g_key )
vlc_mutex_unlock( &p_intf->p_vout->change_lock );
}
break;
case INTF_KEY_TOGGLE_GRAYSCALE: /* toggle grayscale */
case INTF_KEY_TOGGLE_GRAYSCALE: /* toggle grayscale */
if( p_intf->p_vout != NULL )
{
vlc_mutex_lock( &p_intf->p_vout->change_lock );
......@@ -496,7 +513,7 @@ int intf_ProcessKey( intf_thread_t *p_intf, int g_key )
vlc_mutex_unlock( &p_intf->p_vout->change_lock );
}
break;
case INTF_KEY_TOGGLE_INTERFACE: /* toggle interface */
case INTF_KEY_TOGGLE_INTERFACE: /* toggle interface */
if( p_intf->p_vout != NULL )
{
vlc_mutex_lock( &p_intf->p_vout->change_lock );
......@@ -505,7 +522,7 @@ int intf_ProcessKey( intf_thread_t *p_intf, int g_key )
vlc_mutex_unlock( &p_intf->p_vout->change_lock );
}
break;
case INTF_KEY_TOGGLE_INFO: /* toggle info */
case INTF_KEY_TOGGLE_INFO: /* toggle info */
if( p_intf->p_vout != NULL )
{
vlc_mutex_lock( &p_intf->p_vout->change_lock );
......@@ -514,7 +531,7 @@ int intf_ProcessKey( intf_thread_t *p_intf, int g_key )
vlc_mutex_unlock( &p_intf->p_vout->change_lock );
}
break;
case INTF_KEY_TOGGLE_SCALING: /* toggle scaling */
case INTF_KEY_TOGGLE_SCALING: /* toggle scaling */
if( p_intf->p_vout != NULL )
{
vlc_mutex_lock( &p_intf->p_vout->change_lock );
......
......@@ -85,6 +85,7 @@
#define OPT_SERVER 171
#define OPT_PORT 172
#define OPT_BROADCAST 173
#define OPT_DVD 174
#define OPT_SYNCHRO 180
......@@ -132,6 +133,7 @@ static const struct option longopts[] =
{ "server", 1, 0, OPT_SERVER },
{ "port", 1, 0, OPT_PORT },
{ "broadcast", 0, 0, OPT_BROADCAST },
{ "dvd", 0, 0, OPT_DVD },
/* Synchro options */
{ "synchro", 1, 0, OPT_SYNCHRO },
......@@ -458,6 +460,7 @@ static void SetDefaultConfiguration( void )
p_main->b_audio = 1;
p_main->b_video = 1;
p_main->b_vlans = 0;
p_main->b_dvd = 0;
}
/*****************************************************************************
......@@ -589,6 +592,9 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
case OPT_BROADCAST: /* --broadcast */
main_PutIntVariable( INPUT_BROADCAST_VAR, 1 );
break;
case OPT_DVD: /* --dvd */
p_main->b_dvd = 1;
break;
/* Synchro options */
case OPT_SYNCHRO:
......@@ -658,6 +664,7 @@ static void Usage( int i_fashion )
"\n --server <host> \tvideo server address"
"\n --port <port> \tvideo server port"
"\n --broadcast \tlisten to a broadcast"
"\n --dvd \tread dvd"
"\n"
"\n --synchro <type> \tforce synchro algorithm"
"\n"
......@@ -705,7 +712,9 @@ static void Usage( int i_fashion )
"\n " INPUT_IFACE_VAR "=<interface> \tnetwork interface"
"\n " INPUT_BROADCAST_VAR "={1|0} \tbroadcast mode"
"\n " INPUT_VLAN_SERVER_VAR "=<hostname> \tvlan server"
"\n " INPUT_VLAN_PORT_VAR "=<port> \tvlan server port" );
"\n " INPUT_VLAN_PORT_VAR "=<port> \tvlan server port"
"\n " INPUT_DVD_DEVICE_VAR "=<device> \tDVD device"
);
/* Synchro parameters */
intf_Msg( "\nSynchro parameters:"
......
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