Commit 27fdfcfd authored by Rocky Bernstein's avatar Rocky Bernstein

First attempt to libcdio VCD working under new regime. It is still

mostly disabled or broken.
parent 2cbb6002
...@@ -2,11 +2,11 @@ SOURCES_vcdx = \ ...@@ -2,11 +2,11 @@ SOURCES_vcdx = \
access.c \ access.c \
cdrom.c \ cdrom.c \
cdrom.h \ cdrom.h \
demux.c \
intf.c \
intf.h \ intf.h \
vcd.c \ vcd.c \
vcd.h \ vcd.h \
vcdplayer.h \ vcdplayer.h \
vcdplayer.c \ vcdplayer.c \
info.c \
info.h \
$(NULL) $(NULL)
This diff is collapsed.
...@@ -95,13 +95,15 @@ void ioctl_Close( cddev_t *p_cddev ) ...@@ -95,13 +95,15 @@ void ioctl_Close( cddev_t *p_cddev )
* This makes finding the end of the last track uniform * This makes finding the end of the last track uniform
* how it is done for other tracks. * how it is done for other tracks.
*****************************************************************************/ *****************************************************************************/
track_t ioctl_GetTracksMap( vlc_object_t *p_this, const CdIo *cdio, track_t ioctl_GetTracksMap( vlc_object_t *p_this, const CdIo *p_cdio,
lsn_t **pp_sectors ) lsn_t **pp_sectors )
{ {
track_t i_tracks = cdio_get_num_tracks(cdio); track_t i_tracks = cdio_get_num_tracks(p_cdio);
track_t first_track = cdio_get_first_track_num(cdio); track_t first_track = cdio_get_first_track_num(p_cdio);
track_t i; track_t i;
if (CDIO_INVALID_TRACK == i_tracks)
return 0;
*pp_sectors = malloc( (i_tracks + 1) * sizeof(lsn_t) ); *pp_sectors = malloc( (i_tracks + 1) * sizeof(lsn_t) );
if( *pp_sectors == NULL ) if( *pp_sectors == NULL )
...@@ -116,7 +118,7 @@ track_t ioctl_GetTracksMap( vlc_object_t *p_this, const CdIo *cdio, ...@@ -116,7 +118,7 @@ track_t ioctl_GetTracksMap( vlc_object_t *p_this, const CdIo *cdio,
*/ */
for( i = 0 ; i <= i_tracks ; i++ ) for( i = 0 ; i <= i_tracks ; i++ )
{ {
(*pp_sectors)[ i ] = cdio_get_track_lsn(cdio, first_track+i); (*pp_sectors)[ i ] = cdio_get_track_lsn(p_cdio, first_track+i);
} }
return i_tracks; return i_tracks;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* cdrom.h: cdrom tools header * cdrom.h: cdrom tools header
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: cdrom.h,v 1.2 2003/11/26 03:34:22 rocky Exp $ * $Id$
* *
* Authors: Johan Bilien <jobi@via.ecp.fr> * Authors: Johan Bilien <jobi@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com> * Gildas Bazin <gbazin@netcourrier.com>
......
...@@ -32,8 +32,6 @@ ...@@ -32,8 +32,6 @@
#include <vlc/input.h> #include <vlc/input.h>
#include <vlc/intf.h> #include <vlc/intf.h>
#include "../../demux/mpeg/system.h"
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> # include <unistd.h>
#endif #endif
...@@ -72,15 +70,15 @@ struct demux_sys_t ...@@ -72,15 +70,15 @@ struct demux_sys_t
}; };
/***************************************************************************** /*****************************************************************************
* InitVCD: initializes structures * VCDInit: initializes structures
*****************************************************************************/ *****************************************************************************/
int E_(InitVCD) ( vlc_object_t *p_this ) int E_(VCDInit) ( vlc_object_t *p_this )
{ {
input_thread_t *p_input = (input_thread_t *)p_this; input_thread_t *p_input = (input_thread_t *)p_this;
vcd_data_t * p_vcd = (vcd_data_t *)p_input->p_access_data; vcd_data_t * p_vcd = (vcd_data_t *)p_input->p_sys;
demux_sys_t * p_demux; demux_sys_t * p_demux;
printf("++++ InitVCD CALLED\n"); printf("++++ VCDInit CALLED\n");
if( p_input->stream.i_method != INPUT_METHOD_VCD ) if( p_input->stream.i_method != INPUT_METHOD_VCD )
...@@ -115,9 +113,9 @@ int E_(InitVCD) ( vlc_object_t *p_this ) ...@@ -115,9 +113,9 @@ int E_(InitVCD) ( vlc_object_t *p_this )
} }
/***************************************************************************** /*****************************************************************************
* EndVCD: frees unused data * VCDEnd: frees unused data
*****************************************************************************/ *****************************************************************************/
void E_(EndVCD) ( vlc_object_t *p_this ) void E_(VCDEnd) ( vlc_object_t *p_this )
{ {
input_thread_t *p_input = (input_thread_t *)p_this; input_thread_t *p_input = (input_thread_t *)p_this;
vcd_data_t * p_vcd = p_input->p_demux_data->p_vcd; vcd_data_t * p_vcd = p_input->p_demux_data->p_vcd;
......
This diff is collapsed.
/*****************************************************************************
* info.h : VCD information routine headers
*****************************************************************************
* Copyright (C) 2004 VideoLAN
* $Id: info.h 8606 2004-08-31 18:32:54Z rocky $
*
* Authors: Rocky Bernstein <rocky@panix.com>
*
* 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.
*****************************************************************************/
/*
Fills out playlist information.
*/
int VCDFixupPlayList( access_t *p_access, access_vcd_data_t *p_vcd,
const char *psz_source, vcdinfo_itemid_t *itemid,
vlc_bool_t b_single_track );
/*
Sets VCD meta information and navigation/playlist entries.
*/
void VCDMetaInfo( access_t *p_access );
char *
VCDFormatStr(const access_t *p_access, access_vcd_data_t *p_vcd,
const char format_str[], const char *mrl,
const vcdinfo_itemid_t *itemid);
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf.h: send info to intf. * intf.h: send info to intf.
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: intf.h,v 1.4 2003/12/22 14:32:55 sam Exp $ * $Id$
* *
* Author: Stéphane Borel <stef@via.ecp.fr> * Author: Stéphane Borel <stef@via.ecp.fr>
* *
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
struct intf_sys_t struct intf_sys_t
{ {
input_thread_t * p_input; input_thread_t * p_input;
thread_vcd_data_t * p_vcd; access_vcd_data_t * p_vcd;
vlc_bool_t b_still; /* True if we are in a still frame */ vlc_bool_t b_still; /* True if we are in a still frame */
vlc_bool_t b_inf_still; /* True if still wait time is infinite */ vlc_bool_t b_inf_still; /* True if still wait time is infinite */
......
/***************************************************************************** /*****************************************************************************
* vcd.c : VCD input module for vlc * vcd.c : VCD input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000,2003 VideoLAN * Copyright (C) 2000, 2003, 2004 VideoLAN
* $Id$ * $Id$
* *
* Authors: Rocky Bernstein <rocky@panix.com> * Authors: Rocky Bernstein <rocky@panix.com>
...@@ -34,12 +34,12 @@ ...@@ -34,12 +34,12 @@
/***************************************************************************** /*****************************************************************************
* Exported prototypes * Exported prototypes
*****************************************************************************/ *****************************************************************************/
int E_(Open) ( vlc_object_t * ); int E_(VCDOpen) ( vlc_object_t * );
void E_(Close) ( vlc_object_t * ); void E_(VCDClose) ( vlc_object_t * );
int E_(OpenIntf) ( vlc_object_t * ); int E_(OpenIntf) ( vlc_object_t * );
void E_(CloseIntf) ( vlc_object_t * ); void E_(CloseIntf) ( vlc_object_t * );
int E_(InitVCD) ( vlc_object_t * ); int E_(VCDInit) ( vlc_object_t * );
void E_(EndVCD) ( vlc_object_t * ); void E_(VCDEnd) ( vlc_object_t * );
int E_(DebugCallback) ( vlc_object_t *p_this, const char *psz_name, int E_(DebugCallback) ( vlc_object_t *p_this, const char *psz_name,
vlc_value_t oldval, vlc_value_t val, vlc_value_t oldval, vlc_value_t val,
...@@ -90,12 +90,9 @@ int E_(DebugCallback) ( vlc_object_t *p_this, const char *psz_name, ...@@ -90,12 +90,9 @@ int E_(DebugCallback) ( vlc_object_t *p_this, const char *psz_name,
vlc_module_begin(); vlc_module_begin();
add_usage_hint( N_("vcdx://[device-or-file][@{P,S,T}num]") ); add_usage_hint( N_("vcdx://[device-or-file][@{P,S,T}num]") );
set_description( _("Video CD (VCD 1.0, 1.1, 2.0, SVCD, HQVCD) input") ); set_description( _("Video CD (VCD 1.0, 1.1, 2.0, SVCD, HQVCD) input") );
set_capability( "access", 85 /* slightly higher than vcd */ ); set_capability( "access2", 55 /* slightly lower than vcd */ );
set_callbacks( E_(Open), E_(Close) ); set_callbacks( E_(VCDOpen), E_(VCDClose) );
add_shortcut( "vcd" );
add_shortcut( "vcdx" ); add_shortcut( "vcdx" );
set_category( CAT_INPUT );
set_subcategory( SUBCAT_INPUT_ACCESS );
/* Configuration options */ /* Configuration options */
add_integer ( MODULE_STRING "-debug", 0, E_(DebugCallback), add_integer ( MODULE_STRING "-debug", 0, E_(DebugCallback),
...@@ -123,11 +120,11 @@ vlc_module_begin(); ...@@ -123,11 +120,11 @@ vlc_module_begin();
#ifdef FIXED #ifdef FIXED
add_submodule(); add_submodule();
set_capability( "demux", 0 ); set_capability( "demux", 0 );
set_callbacks( E_(InitVCD), E_(EndVCD) ); set_callbacks( E_(VCDInit), E_(VCDEnd) );
#endif
add_submodule(); add_submodule();
set_capability( "interface", 0 ); set_capability( "interface", 0 );
set_callbacks( E_(OpenIntf), E_(CloseIntf) ); set_callbacks( E_(OpenIntf), E_(CloseIntf) );
#endif
vlc_module_end(); vlc_module_end();
/***************************************************************************** /*****************************************************************************
* vcd.h : VCD input module header for vlc * vcd.h : VCD input module header for vlc
* using libcdio, libvcd and libvcdinfo * using libcdio, libvcd and libvcdinfo
***************************************************************************** *****************************************************************************
* Copyright (C) 2003 VideoLAN * Copyright (C) 2003, 2004 VideoLAN
* $Id$ * $Id$
* *
* Authors: Rocky Bernstein <rocky@panix.com> * Authors: Rocky Bernstein <rocky@panix.com>
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include <libvcd/info.h> #include <libvcd/info.h>
#define VCD_MRL_PREFIX "vcdx://"
/***************************************************************************** /*****************************************************************************
* vcd_data_t: structure for communication between access and intf. * vcd_data_t: structure for communication between access and intf.
*****************************************************************************/ *****************************************************************************/
...@@ -40,7 +42,7 @@ typedef struct ...@@ -40,7 +42,7 @@ typedef struct
#endif #endif
int i_still_time; int i_still_time;
vlc_bool_t b_end_of_cell; vlc_bool_t b_end_of_cell;
#if FINISHED #if FINISHED
vcdplay_event_t event; vcdplay_event_t event;
...@@ -50,6 +52,6 @@ typedef struct ...@@ -50,6 +52,6 @@ typedef struct
} vcd_data_t; } vcd_data_t;
int VCDSetArea ( input_thread_t *, input_area_t * ); int VCDSetArea ( access_t * );
void VCDSeek ( input_thread_t *, off_t ); int VCDSeek ( access_t *, off_t );
int VCDPlay ( input_thread_t *, vcdinfo_itemid_t ); int VCDPlay ( access_t *, vcdinfo_itemid_t );
This diff is collapsed.
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#define _VCDPLAYER_H_ #define _VCDPLAYER_H_
#include <libvcd/info.h> #include <libvcd/info.h>
#include "vlc_meta.h"
#define INPUT_DBG_META 1 /* Meta information */ #define INPUT_DBG_META 1 /* Meta information */
#define INPUT_DBG_EVENT 2 /* input (keyboard/mouse) events */ #define INPUT_DBG_EVENT 2 /* input (keyboard/mouse) events */
...@@ -43,13 +44,13 @@ ...@@ -43,13 +44,13 @@
#if INPUT_DEBUG #if INPUT_DEBUG
#define dbg_print(mask, s, args...) \ #define dbg_print(mask, s, args...) \
if (p_vcd && p_vcd->i_debug & mask) \ if (p_vcd && p_vcd->i_debug & mask) \
msg_Dbg(p_input, "%s: "s, __func__ , ##args) msg_Dbg(p_access, "%s: "s, __func__ , ##args)
#else #else
#define dbg_print(mask, s, args...) #define dbg_print(mask, s, args...)
#endif #endif
#define LOG_ERR(args...) msg_Err( p_input, args ) #define LOG_ERR(args...) msg_Err( p_access, args )
#define LOG_WARN(args...) msg_Warn( p_input, args ) #define LOG_WARN(args...) msg_Warn( p_access, args )
/* vcdplayer_read return status */ /* vcdplayer_read return status */
typedef enum { typedef enum {
...@@ -60,29 +61,25 @@ typedef enum { ...@@ -60,29 +61,25 @@ typedef enum {
} vcdplayer_read_status_t; } vcdplayer_read_status_t;
/***************************************************************************** /*****************************************************************************
* thread_vcd_data_t: VCD information * access_vcd_data_t: VCD information
*****************************************************************************/ *****************************************************************************/
typedef struct thread_vcd_data_s typedef struct thread_vcd_data_s
{ {
vcdinfo_obj_t *vcd; /* CD device descriptor */ vcdinfo_obj_t *vcd; /* CD device descriptor */
vlc_bool_t in_still; /* true if in still */ vlc_bool_t in_still; /* true if in still */
vlc_bool_t b_svd; /* true if we have SVD info */ vlc_bool_t b_svd; /* true if we have SVD info */
unsigned int num_tracks; /* Nb of tracks (titles) */ track_t i_tracks; /* # of tracks */
unsigned int num_segments; /* Nb of segments */ unsigned int i_segments; /* # of segments */
unsigned int num_entries; /* Nb of entries */ unsigned int i_entries; /* # of entries */
unsigned int num_lids; /* Nb of List IDs */ unsigned int i_lids; /* # of List IDs */
unsigned int i_titles; /* # of navigatable titles. */
vcdinfo_itemid_t play_item; /* play-item, VCDPLAYER_BAD_ENTRY vcdinfo_itemid_t play_item; /* play-item, VCDPLAYER_BAD_ENTRY
if none */ if none */
int cur_lid; /* LID that play item is in. Implies int i_lid; /* LID that play item is in. Implies
PBC is on. VCDPLAYER_BAD_ENTRY if PBC is on. VCDPLAYER_BAD_ENTRY if
not none or not in PBC */ not none or not in PBC */
#if (defined LIBVCD_VERSION_NUM) && (LIBVCD_VERSION_NUM >= 21)
PsdListDescriptor_t pxd; /* If PBC is on, the relevant PsdListDescriptor_t pxd; /* If PBC is on, the relevant
PSD/PLD */ PSD/PLD */
#else
PsdListDescriptor pxd; /* If PBC is on, the relevant
PSD/PLD */
#endif
int pdi; /* current pld index of pxd. -1 if int pdi; /* current pld index of pxd. -1 if
no index*/ no index*/
vcdinfo_itemid_t loop_item; /* Where do we loop back to? vcdinfo_itemid_t loop_item; /* Where do we loop back to?
...@@ -91,25 +88,37 @@ typedef struct thread_vcd_data_s ...@@ -91,25 +88,37 @@ typedef struct thread_vcd_data_s
int loop_count; /* # of times play-item has been int loop_count; /* # of times play-item has been
played. Meaningful only in a played. Meaningful only in a
selection list. */ selection list. */
track_t cur_track; /* Current track number */ track_t i_track; /* Current track number */
lsn_t cur_lsn; /* Current logical sector number */ lsn_t i_lsn; /* Current logical sector number */
lsn_t end_lsn; /* LSN of end of current lsn_t end_lsn; /* LSN of end of current
entry/segment/track. */ entry/segment/track. */
lsn_t origin_lsn; /* LSN of start of seek/slider */ lsn_t origin_lsn; /* LSN of start of seek/slider */
lsn_t * p_sectors; /* Track sectors */ lsn_t * p_sectors; /* Track sectors. This is 0 origin
so the first VCD track will be
at 0 and this is the ISO9660
filesystem. The first Mode2 form2
MPEG track is probably track 2 or
p_sectors[1].
*/
lsn_t * p_entries; /* Entry points */ lsn_t * p_entries; /* Entry points */
lsn_t * p_segments; /* Segments */ lsn_t * p_segments; /* Segments */
vlc_bool_t b_valid_ep; /* Valid entry points flag */ vlc_bool_t b_valid_ep; /* Valid entry points flag */
vlc_bool_t b_end_of_track; /* If the end of track was reached */ vlc_bool_t b_end_of_track; /* If the end of track was reached */
int i_debug; /* Debugging mask */ int i_debug; /* Debugging mask */
/* Information about CD */
vlc_meta_t *p_meta;
input_title_t *p_title[CDIO_CD_MAX_TRACKS];
/* Probably gets moved into another structure...*/ /* Probably gets moved into another structure...*/
intf_thread_t * p_intf; intf_thread_t *p_intf;
int i_audio_nb; int i_audio_nb;
int i_still_time; int i_still_time;
vlc_bool_t b_end_of_cell; vlc_bool_t b_end_of_cell;
input_thread_t *p_input;
} thread_vcd_data_t; } access_vcd_data_t;
/*! /*!
Get the next play-item in the list given in the LIDs. Note play-item Get the next play-item in the list given in the LIDs. Note play-item
...@@ -117,33 +126,33 @@ typedef struct thread_vcd_data_s ...@@ -117,33 +126,33 @@ typedef struct thread_vcd_data_s
confused with a user's list of favorite things to play or the confused with a user's list of favorite things to play or the
"next" field of a LID which moves us to a different LID. "next" field of a LID which moves us to a different LID.
*/ */
vlc_bool_t vcdplayer_inc_play_item( input_thread_t *p_input ); vlc_bool_t vcdplayer_inc_play_item( access_t *p_access );
/*! /*!
Return true if playback control (PBC) is on Return true if playback control (PBC) is on
*/ */
vlc_bool_t vcdplayer_pbc_is_on(const thread_vcd_data_t *p_this); vlc_bool_t vcdplayer_pbc_is_on(const access_vcd_data_t *p_this);
/*! /*!
Play item assocated with the "default" selection. Play item assocated with the "default" selection.
Return false if there was some problem. Return false if there was some problem.
*/ */
vlc_bool_t vcdplayer_play_default( input_thread_t * p_input ); vlc_bool_t vcdplayer_play_default( access_t * p_access );
/*! /*!
Play item assocated with the "next" selection. Play item assocated with the "next" selection.
Return false if there was some problem. Return false if there was some problem.
*/ */
vlc_bool_t vcdplayer_play_next( input_thread_t * p_input ); vlc_bool_t vcdplayer_play_next( access_t * p_access );
/*! /*!
Play item assocated with the "prev" selection. Play item assocated with the "prev" selection.
Return false if there was some problem. Return false if there was some problem.
*/ */
vlc_bool_t vcdplayer_play_prev( input_thread_t * p_input ); vlc_bool_t vcdplayer_play_prev( access_t * p_access );
/*! /*!
Play item assocated with the "return" selection. Play item assocated with the "return" selection.
...@@ -151,10 +160,10 @@ vlc_bool_t vcdplayer_play_prev( input_thread_t * p_input ); ...@@ -151,10 +160,10 @@ vlc_bool_t vcdplayer_play_prev( input_thread_t * p_input );
Return false if there was some problem. Return false if there was some problem.
*/ */
vlc_bool_t vlc_bool_t
vcdplayer_play_return( input_thread_t * p_input ); vcdplayer_play_return( access_t * p_access );
vcdplayer_read_status_t vcdplayer_pbc_nav ( input_thread_t * p_input ); vcdplayer_read_status_t vcdplayer_pbc_nav ( access_t * p_access );
vcdplayer_read_status_t vcdplayer_non_pbc_nav ( input_thread_t * p_input ); vcdplayer_read_status_t vcdplayer_non_pbc_nav ( access_t * p_access );
#endif /* _VCDPLAYER_H_ */ #endif /* _VCDPLAYER_H_ */
/* /*
......
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