1 /*****************************************************************************
2 * Copyright (C) 2003, 2004 Rocky Bernstein (for VideoLAN)
5 * Authors: Rocky Bernstein <rocky@panix.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
20 *****************************************************************************/
22 /* VCD Player header. More or less media-player independent. Or at least
23 that is the goal. So we prefer bool to vlc_bool.
29 #include <libvcd/info.h>
32 #define INPUT_DBG_META 1 /* Meta information */
33 #define INPUT_DBG_EVENT 2 /* input (keyboard/mouse) events */
34 #define INPUT_DBG_MRL 4 /* MRL parsing */
35 #define INPUT_DBG_EXT 8 /* Calls from external routines */
36 #define INPUT_DBG_CALL 16 /* routine calls */
37 #define INPUT_DBG_LSN 32 /* LSN changes */
38 #define INPUT_DBG_PBC 64 /* Playback control */
39 #define INPUT_DBG_CDIO 128 /* Debugging from CDIO */
40 #define INPUT_DBG_SEEK 256 /* Seeks to set location */
41 #define INPUT_DBG_SEEK_CUR 512 /* Seeks to find current location */
42 #define INPUT_DBG_STILL 1024 /* Still-frame */
43 #define INPUT_DBG_VCDINFO 2048 /* Debugging from VCDINFO */
47 #define dbg_print(mask, s, args...) \
48 if (p_vcdplayer && p_vcdplayer->i_debug & mask) \
49 msg_Dbg(p_access, "%s: "s, __func__ , ##args)
51 #define dbg_print(mask, s, args...)
54 #define LOG_ERR(args...) msg_Err( p_access, args )
55 #define LOG_WARN(args...) msg_Warn( p_access, args )
57 /*------------------------------------------------------------------
58 General definitions and structures.
59 ---------------------------------------------------------------------*/
61 #define VCDPLAYER_IN_STILL 65535
64 lsn_t start_LSN; /* LSN where play item starts */
65 size_t size; /* size in sector units of play item. */
66 } vcdplayer_play_item_info_t;
68 /*****************************************************************************
69 * vcdplayer_t: VCD information
70 *****************************************************************************/
71 typedef struct vcdplayer_input_s
73 vcdinfo_obj_t *vcd; /* CD device descriptor */
75 /*------------------------------------------------------------------
77 --------------------------------------------------------------*/
78 unsigned int i_debug; /* Debugging mask */
79 unsigned int i_blocks_per_read; /* number of blocks per read */
81 /*-------------------------------------------------------------
82 Playback control fields
83 --------------------------------------------------------------*/
84 bool in_still; /* true if in still */
85 int i_lid; /* LID that play item is in. Implies
86 PBC is on. VCDPLAYER_BAD_ENTRY if
87 not none or not in PBC */
88 PsdListDescriptor_t pxd; /* If PBC is on, the relevant
90 int pdi; /* current pld index of pxd. -1 if
92 vcdinfo_itemid_t play_item; /* play-item, VCDPLAYER_BAD_ENTRY
94 vcdinfo_itemid_t loop_item; /* Where do we loop back to?
95 Meaningful only in a selection
97 int i_loop; /* # of times play-item has been
98 played. Meaningful only in a
100 track_t i_track; /* current track number */
102 /*-----------------------------------
104 ------------------------------------*/
105 lsn_t i_lsn; /* LSN of where we are right now */
106 lsn_t end_lsn; /* LSN of end of current
107 entry/segment/track. This block
108 can be read (and is not one after
111 lsn_t origin_lsn; /* LSN of start of seek/slider */
112 lsn_t track_lsn; /* LSN of start track origin of track
114 lsn_t track_end_lsn; /* LSN of end of current track (if
116 lsn_t * p_entries; /* Entry points */
117 lsn_t * p_segments; /* Segments */
118 bool b_valid_ep; /* Valid entry points flag */
119 bool b_end_of_track; /* If the end of track was reached */
121 /*--------------------------------------------------------------
122 (S)VCD Medium information
123 ---------------------------------------------------------------*/
125 char *psz_source; /* (S)VCD drive or image filename */
126 bool b_svd; /* true if we have SVD info */
128 track_t i_tracks; /* # of playable MPEG tracks. This is
129 generally one less than the number
130 of CD tracks as the first CD track
131 is an ISO-9660 track and is not
134 unsigned int i_segments; /* # of segments */
135 unsigned int i_entries; /* # of entries */
136 unsigned int i_lids; /* # of List IDs */
138 /* Tracks, segment, and entry information. The number of entries for
139 each is given by the corresponding i_* field above. */
140 vcdplayer_play_item_info_t *track;
141 vcdplayer_play_item_info_t *segment;
142 vcdplayer_play_item_info_t *entry;
144 unsigned int i_titles; /* # of navigatable titles. */
147 # tracks + menu for segments + menu for LIDs
149 input_title_t *p_title[CDIO_CD_MAX_TRACKS+2];
151 /* Probably gets moved into another structure...*/
152 intf_thread_t *p_intf;
156 input_thread_t *p_input;
162 /* vcdplayer_read return status */
168 } vcdplayer_read_status_t;
171 /* ----------------------------------------------------------------------
173 -----------------------------------------------------------------------*/
176 Return true if playback control (PBC) is on
178 bool vcdplayer_pbc_is_on(const vcdplayer_t *p_vcdplayer);
181 Play item assocated with the "default" selection.
183 Return false if there was some problem.
185 bool vcdplayer_play_default( access_t * p_access );
188 Play item assocated with the "next" selection.
190 Return false if there was some problem.
192 bool vcdplayer_play_next( access_t * p_access );
195 Play item assocated with the "prev" selection.
197 Return false if there was some problem.
199 bool vcdplayer_play_prev( access_t * p_access );
202 Play item assocated with the "return" selection.
204 Return false if there was some problem.
206 bool vcdplayer_play_return( access_t * p_access );
209 Set's start origin and size for subsequent seeks.
210 input: p_vcd->i_lsn, p_vcd->play_item
211 changed: p_vcd->origin_lsn, p_vcd->end_lsn
213 void vcdplayer_set_origin(access_t *p_access, lsn_t i_lsn, track_t i_track,
214 const vcdinfo_itemid_t *p_itemid);
216 void vcdplayer_play(access_t *p_access, vcdinfo_itemid_t itemid);
218 vcdplayer_read_status_t vcdplayer_read (access_t * p_access_t, uint8_t *p_buf);
220 #endif /* _VCDPLAYER_H_ */
223 * c-file-style: "gnu"
225 * indent-tabs-mode: nil