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

*Added udf fix by Billy Biggs

*Added checks in dvd_ifo

*Cleanings in gnome interface : the interface should be dependant on the
input method.
parent c7df0042
......@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.32 2001/04/12 03:26:53 stef Exp $
* $Id: input_ext-intf.h,v 1.33 2001/04/13 05:36:12 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -187,6 +187,8 @@ typedef struct stream_descriptor_s
* or modify stream, pgrm or es */
/* Input method data */
int i_method; /* input method for stream: file,
disc or network */
boolean_t b_pace_control; /* can we read when we want ? */
boolean_t b_seekable; /* can we do lseek() ? */
......@@ -312,35 +314,20 @@ typedef struct input_thread_s
#endif
} input_thread_t;
/*
* Communication interface -> input
*/
/*****************************************************************************
* input_config_t
*****************************************************************************
* This structure is given by the interface to an input thread
*****************************************************************************/
typedef struct input_config_s
{
/* Input method description */
int i_method; /* input method */
char * p_source; /* source */
/* For auto-launch of decoders */
struct aout_thread_s * p_default_aout;
struct vout_thread_s * p_default_vout;
} input_config_t;
/* 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 */
#define INPUT_METHOD_VLAN_BCAST 32 /* UDP broadcast with VLANs */
/* The first figure is a general method that can be used in interface plugins ;
* The second figure is a detailed sub-method */
#define INPUT_METHOD_NONE 0x0 /* input thread is inactive */
#define INPUT_METHOD_FILE 0x10 /* stream is read from file p_source */
#define INPUT_METHOD_DISC 0x20 /* stream is read directly from disc */
#define INPUT_METHOD_DVD 0x21 /* stream is read from DVD */
#define INPUT_METHOD_VCD 0x22 /* stream is read from VCD */
#define INPUT_METHOD_NETWORK 0x30 /* stream is read from network */
#define INPUT_METHOD_UCAST 0x31 /* UDP unicast */
#define INPUT_METHOD_MCAST 0x32 /* UDP multicast */
#define INPUT_METHOD_BCAST 0x33 /* UDP broadcast */
#define INPUT_METHOD_VLAN_BCAST 0x34 /* UDP broadcast with VLANs */
/* Status changing methods */
#define INPUT_STATUS_END 0
......
This diff is collapsed.
......@@ -5,12 +5,13 @@
* contains the basic udf handling functions
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: dvd_udf.c,v 1.3 2001/02/20 07:49:12 sam Exp $
* $Id: dvd_udf.c,v 1.4 2001/04/13 05:36:12 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
* based on:
* - dvdudf by Christian Wolff <scarabaeus@convergence.de>
* - fixes by Billy Biggs <vektor@dumbterm.net>
*
* 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
......@@ -401,7 +402,7 @@ static int UDFMapICB( struct ad_s icb, u8 * pi_file_type, struct ad_s * p_file,
static int UDFScanDir( struct ad_s dir, char * psz_filename,
struct ad_s * p_file_icb, struct partition_s partition )
{
u8 pi_lb[DVD_LB_SIZE];
u8 pi_lb[2*DVD_LB_SIZE];
u32 i_lba;
u16 i_tag_id;
u8 i_file_char;
......@@ -410,7 +411,7 @@ static int UDFScanDir( struct ad_s dir, char * psz_filename,
/* Scan dir for ICB of file */
i_lba = partition.i_start + dir.i_location;
#if 0
do
{
if( !UDFReadLB( partition.i_fd, i_lba++, 1, pi_lb ) )
......@@ -443,6 +444,44 @@ static int UDFScanDir( struct ad_s dir, char * psz_filename,
} while( i_lba <=
partition.i_start + dir.i_location + ( dir.i_length - 1 ) / DVD_LB_SIZE );
#else
if( UDFReadLB( partition.i_fd, i_lba, 2, pi_lb ) <= 0 ) {
return 0;
}
p = 0;
while( p < dir.i_length )
{
if( p > DVD_LB_SIZE )
{
++i_lba;
p -= DVD_LB_SIZE;
dir.i_length -= DVD_LB_SIZE;
if( UDFReadLB( partition.i_fd, i_lba, 2, pi_lb ) <= 0 )
{
return 0;
}
}
UDFDescriptor( &pi_lb[p], &i_tag_id );
if( i_tag_id == 257 )
{
p += UDFFileIdentifier( &pi_lb[p], &i_file_char,
psz_temp, p_file_icb, partition );
if( !strcasecmp( psz_filename, psz_temp ) )
{
return 1;
}
}
else
{
return 0;
}
}
#endif
return 0;
}
......
......@@ -10,7 +10,7 @@
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: input_dvd.c,v 1.44 2001/04/13 01:49:22 henri Exp $
* $Id: input_dvd.c,v 1.45 2001/04/13 05:36:12 stef Exp $
*
* Author: Stphane Borel <stef@via.ecp.fr>
*
......@@ -902,6 +902,9 @@ static void DVDInit( input_thread_t * p_input )
/* Initialize ES structures */
input_InitStream( p_input, sizeof( stream_ps_data_t ) );
/* disc input method */
p_input->stream.i_method = INPUT_METHOD_DVD;
#define title_inf p_dvd->p_ifo->vmg.title_inf
intf_WarnMsg( 2, "dvd info: number of titles: %d", title_inf.i_title_nb );
......
......@@ -468,7 +468,7 @@ create_intf_window (void)
gtk_object_set_data_full (GTK_OBJECT (intf_window), "label_status", label_status,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (label_status);
gtk_box_pack_start (GTK_BOX (hbox4), label_status, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox4), label_status, TRUE, TRUE, 0);
label_bar = gtk_label_new (_("Bar: baz"));
gtk_widget_ref (label_bar);
......
......@@ -2,7 +2,7 @@
* intf_gnome.c: Gnome interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_gnome.c,v 1.29 2001/04/13 01:49:22 henri Exp $
* $Id: intf_gnome.c,v 1.30 2001/04/13 05:36:12 stef Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr>
......@@ -75,7 +75,7 @@ static gint GnomeTitleMenu ( gpointer, GtkWidget *,
void (*pf_toggle)(GtkCheckMenuItem *, gpointer) );
static gint GnomeSetupMenu ( intf_thread_t * p_intf );
static void GnomeDisplayDate ( GtkAdjustment *p_adj );
static gint GnomeDVDModeManage( intf_thread_t * p_intf );
static gint GnomeDiscModeManage( intf_thread_t * p_intf );
static gint GnomeFileModeManage( intf_thread_t * p_intf );
static gint GnomeNetworkModeManage( intf_thread_t * p_intf );
......@@ -311,49 +311,66 @@ static gint GnomeManage( gpointer p_data )
p_intf->b_menu_change = 0;
}
if( p_intf->p_sys->b_mode_changed )
{
/* Sets the interface mode according to playlist item */
if( p_main->p_playlist->p_item != NULL )
{
if( !strncmp( p_main->p_playlist->p_item->psz_name, "dvd:", 4 ) )
{
p_intf->p_sys->i_intf_mode = DVD_MODE;
}
else if( !strncmp(
p_main->p_playlist->p_item->psz_name, "ts:", 4 ) )
{
p_intf->p_sys->i_intf_mode = NET_MODE;
}
}
switch( p_intf->p_sys->i_intf_mode )
{
case DVD_MODE:
GnomeDVDModeManage( p_intf );
break;
case NET_MODE:
GnomeNetworkModeManage( p_intf );
break;
case FILE_MODE:
default:
GnomeFileModeManage( p_intf );
break;
}
p_intf->p_sys->b_mode_changed = 0;
}
if( p_intf->p_input != NULL )
{
float newvalue;
char psz_title[3];
char psz_chapter[3];
/* Used by TS input when PMT changes */
/* New input or stream map change */
if( p_intf->p_input->stream.b_changed )
{
/* input method */
if( p_intf->p_sys->b_mode_changed )
{
#if 0
/* Sets the interface mode according to playlist item */
if( p_main->p_playlist->p_item != NULL )
{
if( !strncmp( p_main->p_playlist->p_item->psz_name, "dvd:", 4 ) )
{
p_intf->p_sys->i_intf_mode = DVD_MODE;
}
else if( !strncmp(
p_main->p_playlist->p_item->psz_name, "ts:", 4 ) )
{
p_intf->p_sys->i_intf_mode = NET_MODE;
}
}
switch( p_intf->p_sys->i_intf_mode )
{
case DVD_MODE:
GnomeDVDModeManage( p_intf );
break;
case NET_MODE:
GnomeNetworkModeManage( p_intf );
break;
case FILE_MODE:
default:
GnomeFileModeManage( p_intf );
break;
}
#else
switch( p_intf->p_input->stream.i_method & 0xf0 )
{
case INPUT_METHOD_FILE:
GnomeFileModeManage( p_intf );
break;
case INPUT_METHOD_DISC:
GnomeDiscModeManage( p_intf );
break;
case INPUT_METHOD_NETWORK:
GnomeNetworkModeManage( p_intf );
break;
default:
intf_ErrMsg( "intf error: can't determine input method" );
break;
}
#endif
p_intf->p_sys->b_mode_changed = 0;
}
p_intf->p_sys->b_menus_update = 1;
p_intf->p_input->stream.b_changed = 0;
intf_WarnMsg( 2,
......@@ -961,9 +978,9 @@ void GnomeDisplayDate( GtkAdjustment *p_adj )
/*****************************************************************************
* GnomeDVDModeManage
* GnomeDiscModeManage
*****************************************************************************/
static gint GnomeDVDModeManage( intf_thread_t * p_intf )
static gint GnomeDiscModeManage( intf_thread_t * p_intf )
{
GtkWidget * p_dvd_box;
GtkWidget * p_file_box;
......@@ -995,6 +1012,7 @@ static gint GnomeFileModeManage( intf_thread_t * p_intf )
GtkWidget * p_dvd_box;
GtkWidget * p_file_box;
GtkWidget * p_network_box;
// char * psz_name;
p_network_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "network_box" ) );
......@@ -1007,10 +1025,17 @@ static gint GnomeFileModeManage( intf_thread_t * p_intf )
p_file_box = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT(
p_intf->p_sys->p_window ), "file_box" ) );
gtk_widget_show( GTK_WIDGET( p_file_box ) );
#if 0
psz_name = malloc( 16 + strlen( p_intf->p_input->p_source ) );
sprintf( psz_name, "Status: playing %s", p_intf->p_input->p_source );
gtk_label_set_text( p_intf->p_sys->p_label_status, psz_name );
free( psz_name );
#else
gtk_label_set_text( p_intf->p_sys->p_label_status,
"Status: foo" );
#endif
return TRUE;
}
......
......@@ -528,8 +528,8 @@
<ypad>0</ypad>
<child>
<padding>0</padding>
<expand>False</expand>
<fill>False</fill>
<expand>True</expand>
<fill>True</fill>
</child>
</widget>
......
......@@ -2,7 +2,7 @@
* input_ps.c: PS demux and packet management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ps.c,v 1.13 2001/04/05 16:37:15 asmax Exp $
* $Id: input_ps.c,v 1.14 2001/04/13 05:36:12 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
......@@ -214,6 +214,10 @@ static void PSInit( input_thread_t * p_input )
}
rewind( p_method->stream );
vlc_mutex_lock( &p_input->stream.stream_lock );
/* file input method */
p_input->stream.i_method = INPUT_METHOD_FILE;
p_input->stream.p_selected_area->i_tell = 0;
if( p_demux_data->b_has_PSM )
{
......@@ -292,6 +296,10 @@ static void PSInit( input_thread_t * p_input )
{
/* The programs will be added when we read them. */
vlc_mutex_lock( &p_input->stream.stream_lock );
/* file input method */
p_input->stream.i_method = INPUT_METHOD_FILE;
p_input->stream.pp_programs[0]->b_is_ok = 0;
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
......
......@@ -2,7 +2,7 @@
* input_ts.c: TS demux and netlist management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ts.c,v 1.13 2001/03/19 22:16:31 henri Exp $
* $Id: input_ts.c,v 1.14 2001/04/13 05:36:12 stef Exp $
*
* Authors: Henri Fallon <henri@videolan.org>
*
......@@ -167,6 +167,10 @@ static void TSInit( input_thread_t * p_input )
/* Initialize the stream */
input_InitStream( p_input, sizeof( stream_ts_data_t ) );
/* input method type */
/* FIXME: should test if you have network or file here */
p_input->stream.i_method = INPUT_METHOD_NETWORK;
/* Init */
p_stream_data = (stream_ts_data_t *)p_input->stream.p_demux_data;
p_stream_data->i_pat_version = PAT_UNINITIALIZED ;
......
......@@ -2,7 +2,7 @@
* input_programs.c: es_descriptor_t, pgrm_descriptor_t management
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_programs.c,v 1.48 2001/04/12 03:26:53 stef Exp $
* $Id: input_programs.c,v 1.49 2001/04/13 05:36:12 stef Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -54,8 +54,10 @@
*****************************************************************************/
int input_InitStream( input_thread_t * p_input, size_t i_data_len )
{
p_input->stream.i_method = INPUT_METHOD_NONE;
p_input->stream.i_stream_id = 0;
p_input->stream.b_changed = 0;
p_input->stream.b_changed = 1;
p_input->stream.pp_es = NULL;
p_input->stream.pp_selected_es = NULL;
p_input->stream.pp_programs = 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