Commit 79053042 authored by Rocky Bernstein's avatar Rocky Bernstein

Some cleanup and unification with xine vcd plugin.

parent 8b492795
This diff is collapsed.
This diff is collapsed.
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
void VCDMetaInfo( access_t *p_access, /*const*/ char *psz_mrl ); void VCDMetaInfo( access_t *p_access, /*const*/ char *psz_mrl );
char * VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcd, char * VCDFormatStr(const access_t *p_access, vcdplayer_t *p_vcdplayer,
const char format_str[], const char *mrl, const char format_str[], const char *mrl,
const vcdinfo_itemid_t *itemid); const vcdinfo_itemid_t *itemid);
......
...@@ -93,7 +93,7 @@ RunIntf( intf_thread_t *p_intf ) ...@@ -93,7 +93,7 @@ RunIntf( intf_thread_t *p_intf )
vlc_object_t * p_vout = NULL; vlc_object_t * p_vout = NULL;
mtime_t mtime = 0; mtime_t mtime = 0;
mtime_t mlast = 0; mtime_t mlast = 0;
vcdplayer_t * p_vcd; vcdplayer_t * p_vcdplayer;
input_thread_t * p_input; input_thread_t * p_input;
access_t * p_access; access_t * p_access;
...@@ -109,13 +109,13 @@ RunIntf( intf_thread_t *p_intf ) ...@@ -109,13 +109,13 @@ RunIntf( intf_thread_t *p_intf )
p_input = p_intf->p_sys->p_input; p_input = p_intf->p_sys->p_input;
while ( !p_intf->p_sys->p_vcd ) while ( !p_intf->p_sys->p_vcdplayer )
{ {
msleep( INTF_IDLE_SLEEP ); msleep( INTF_IDLE_SLEEP );
} }
p_vcd = p_intf->p_sys->p_vcd; p_vcdplayer = p_intf->p_sys->p_vcdplayer;
p_access = p_vcd->p_access; p_access = p_vcdplayer->p_access;
dbg_print( INPUT_DBG_CALL, "intf initialized" ); dbg_print( INPUT_DBG_CALL, "intf initialized" );
...@@ -210,13 +210,14 @@ RunIntf( intf_thread_t *p_intf ) ...@@ -210,13 +210,14 @@ RunIntf( intf_thread_t *p_intf )
case ACTIONID_NAV_ACTIVATE: case ACTIONID_NAV_ACTIVATE:
{ {
vcdinfo_itemid_t itemid; vcdinfo_itemid_t itemid;
itemid.type=p_vcd->play_item.type; itemid.type=p_vcdplayer->play_item.type;
dbg_print( INPUT_DBG_EVENT, "ACTIONID_NAV_ACTIVATE" ); dbg_print( INPUT_DBG_EVENT, "ACTIONID_NAV_ACTIVATE" );
if ( vcdplayer_pbc_is_on( p_vcd ) && number_addend != 0 ) { if ( vcdplayer_pbc_is_on( p_vcdplayer )
lid_t next_num=vcdinfo_selection_get_lid(p_vcd->vcd, && number_addend != 0 ) {
p_vcd->i_lid, lid_t next_num=vcdinfo_selection_get_lid(p_vcdplayer->vcd,
p_vcdplayer->i_lid,
number_addend); number_addend);
if (VCDINFO_INVALID_LID != next_num) { if (VCDINFO_INVALID_LID != next_num) {
itemid.num = next_num; itemid.num = next_num;
...@@ -326,8 +327,8 @@ static int InitThread( intf_thread_t * p_intf ) ...@@ -326,8 +327,8 @@ static int InitThread( intf_thread_t * p_intf )
vlc_mutex_lock( &p_intf->change_lock ); vlc_mutex_lock( &p_intf->change_lock );
p_intf->p_sys->p_input = p_input; p_intf->p_sys->p_input = p_input;
p_intf->p_sys->p_vcd = NULL; p_intf->p_sys->p_vcdplayer = NULL;
p_intf->p_sys->b_move = VLC_FALSE; p_intf->p_sys->b_move = VLC_FALSE;
p_intf->p_sys->b_click = VLC_FALSE; p_intf->p_sys->b_click = VLC_FALSE;
......
...@@ -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;
vcdplayer_t *p_vcd; vcdplayer_t *p_vcdplayer;
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_infinite_still; /* True if still wait time is infinite */ vlc_bool_t b_infinite_still; /* True if still wait time is infinite */
......
This diff is collapsed.
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#define INPUT_DBG_EVENT 2 /* input (keyboard/mouse) events */ #define INPUT_DBG_EVENT 2 /* input (keyboard/mouse) events */
#define INPUT_DBG_MRL 4 /* MRL parsing */ #define INPUT_DBG_MRL 4 /* MRL parsing */
#define INPUT_DBG_EXT 8 /* Calls from external routines */ #define INPUT_DBG_EXT 8 /* Calls from external routines */
#define INPUT_DBG_CALL 16 /* all calls */ #define INPUT_DBG_CALL 16 /* routine calls */
#define INPUT_DBG_LSN 32 /* LSN changes */ #define INPUT_DBG_LSN 32 /* LSN changes */
#define INPUT_DBG_PBC 64 /* Playback control */ #define INPUT_DBG_PBC 64 /* Playback control */
#define INPUT_DBG_CDIO 128 /* Debugging from CDIO */ #define INPUT_DBG_CDIO 128 /* Debugging from CDIO */
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#define INPUT_DEBUG 1 #define INPUT_DEBUG 1
#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_vcdplayer && p_vcdplayer->i_debug & mask) \
msg_Dbg(p_access, "%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...)
...@@ -65,26 +65,22 @@ typedef struct { ...@@ -65,26 +65,22 @@ typedef struct {
size_t size; /* size in sector units of play item. */ size_t size; /* size in sector units of play item. */
} vcdplayer_play_item_info_t; } vcdplayer_play_item_info_t;
/* vcdplayer_read return status */
typedef enum {
READ_BLOCK,
READ_STILL_FRAME,
READ_ERROR,
READ_END,
} vcdplayer_read_status_t;
/***************************************************************************** /*****************************************************************************
* vcdplayer_t: VCD information * vcdplayer_t: VCD information
*****************************************************************************/ *****************************************************************************/
typedef struct thread_vcd_data_s typedef struct vcdplayer_input_s
{ {
vcdinfo_obj_t *vcd; /* CD device descriptor */ vcdinfo_obj_t *vcd; /* CD device descriptor */
/* User-settable options */ /*------------------------------------------------------------------
User-settable options
--------------------------------------------------------------*/
unsigned int i_debug; /* Debugging mask */ unsigned int i_debug; /* Debugging mask */
unsigned int i_blocks_per_read; /* number of blocks per read */ unsigned int i_blocks_per_read; /* number of blocks per read */
/* Current State: position */ /*-------------------------------------------------------------
Playback control fields
--------------------------------------------------------------*/
bool in_still; /* true if in still */ bool in_still; /* true if in still */
int i_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
...@@ -98,11 +94,15 @@ typedef struct thread_vcd_data_s ...@@ -98,11 +94,15 @@ typedef struct thread_vcd_data_s
vcdinfo_itemid_t loop_item; /* Where do we loop back to? vcdinfo_itemid_t loop_item; /* Where do we loop back to?
Meaningful only in a selection Meaningful only in a selection
list */ list */
int loop_count; /* # of times play-item has been int i_loop; /* # of times play-item has been
played. Meaningful only in a played. Meaningful only in a
selection list. */ selection list. */
track_t i_track; /* Current track number */ track_t i_track; /* current track number */
lsn_t i_lsn; /* Current logical sector number */
/*-----------------------------------
location fields
------------------------------------*/
lsn_t i_lsn; /* LSN of where we are right now */
lsn_t end_lsn; /* LSN of end of current lsn_t end_lsn; /* LSN of end of current
entry/segment/track. This block entry/segment/track. This block
can be read (and is not one after can be read (and is not one after
...@@ -118,8 +118,11 @@ typedef struct thread_vcd_data_s ...@@ -118,8 +118,11 @@ typedef struct thread_vcd_data_s
bool b_valid_ep; /* Valid entry points flag */ bool b_valid_ep; /* Valid entry points flag */
bool b_end_of_track; /* If the end of track was reached */ bool b_end_of_track; /* If the end of track was reached */
/* Information about (S)VCD */ /*--------------------------------------------------------------
char * psz_source; /* (S)VCD drive or image filename */ (S)VCD Medium information
---------------------------------------------------------------*/
char *psz_source; /* (S)VCD drive or image filename */
bool b_svd; /* true if we have SVD info */ bool b_svd; /* true if we have SVD info */
vlc_meta_t *p_meta; vlc_meta_t *p_meta;
track_t i_tracks; /* # of playable MPEG tracks. This is track_t i_tracks; /* # of playable MPEG tracks. This is
...@@ -133,7 +136,7 @@ typedef struct thread_vcd_data_s ...@@ -133,7 +136,7 @@ typedef struct thread_vcd_data_s
unsigned int i_lids; /* # of List IDs */ unsigned int i_lids; /* # of List IDs */
/* Tracks, segment, and entry information. The number of entries for /* Tracks, segment, and entry information. The number of entries for
each is given by the corresponding num_* field above. */ each is given by the corresponding i_* field above. */
vcdplayer_play_item_info_t *track; vcdplayer_play_item_info_t *track;
vcdplayer_play_item_info_t *segment; vcdplayer_play_item_info_t *segment;
vcdplayer_play_item_info_t *entry; vcdplayer_play_item_info_t *entry;
...@@ -156,18 +159,23 @@ typedef struct thread_vcd_data_s ...@@ -156,18 +159,23 @@ typedef struct thread_vcd_data_s
} vcdplayer_t; } vcdplayer_t;
/*! /* vcdplayer_read return status */
Get the next play-item in the list given in the LIDs. Note play-item typedef enum {
here refers to list of play-items for a single LID It shouldn't be READ_BLOCK,
confused with a user's list of favorite things to play or the READ_STILL_FRAME,
"next" field of a LID which moves us to a different LID. READ_ERROR,
*/ READ_END,
bool vcdplayer_inc_play_item( access_t *p_access ); } vcdplayer_read_status_t;
/* ----------------------------------------------------------------------
Function Prototypes
-----------------------------------------------------------------------*/
/*! /*!
Return true if playback control (PBC) is on Return true if playback control (PBC) is on
*/ */
bool vcdplayer_pbc_is_on(const vcdplayer_t *p_this); bool vcdplayer_pbc_is_on(const vcdplayer_t *p_vcdplayer);
/*! /*!
Play item assocated with the "default" selection. Play item assocated with the "default" selection.
...@@ -207,11 +215,6 @@ void vcdplayer_set_origin(access_t *p_access, lsn_t i_lsn, track_t i_track, ...@@ -207,11 +215,6 @@ void vcdplayer_set_origin(access_t *p_access, lsn_t i_lsn, track_t i_track,
void vcdplayer_play(access_t *p_access, vcdinfo_itemid_t itemid); void vcdplayer_play(access_t *p_access, vcdinfo_itemid_t itemid);
vcdplayer_read_status_t vcdplayer_pbc_nav ( access_t * p_access,
uint8_t *wait_time );
vcdplayer_read_status_t vcdplayer_non_pbc_nav ( access_t * p_access,
uint8_t *wait_time );
vcdplayer_read_status_t vcdplayer_read (access_t * p_access_t, uint8_t *p_buf); vcdplayer_read_status_t vcdplayer_read (access_t * p_access_t, uint8_t *p_buf);
#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