]> git.sesse.net Git - vlc/blob - modules/access/vcdx/vcdplayer.h
First attempt to libcdio VCD working under new regime. It is still
[vlc] / modules / access / vcdx / vcdplayer.h
1 /*****************************************************************************
2  * Copyright (C) 2003, 2004 Rocky Bernstein (for VideoLAN)
3  * $Id$
4  *
5  * Authors: Rocky Bernstein <rocky@panix.com> 
6  *
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.
11  *
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.
16  *
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  *****************************************************************************/
21
22 /* VCD Player header. More or less media-player independent */
23
24 #ifndef _VCDPLAYER_H_
25 #define _VCDPLAYER_H_
26
27 #include <libvcd/info.h>
28 #include "vlc_meta.h"
29
30 #define INPUT_DBG_META        1 /* Meta information */
31 #define INPUT_DBG_EVENT       2 /* input (keyboard/mouse) events */
32 #define INPUT_DBG_MRL         4 /* MRL parsing */
33 #define INPUT_DBG_EXT         8 /* Calls from external routines */
34 #define INPUT_DBG_CALL       16 /* all calls */
35 #define INPUT_DBG_LSN        32 /* LSN changes */
36 #define INPUT_DBG_PBC        64 /* Playback control */
37 #define INPUT_DBG_CDIO      128 /* Debugging from CDIO */
38 #define INPUT_DBG_SEEK      256 /* Seeks to set location */
39 #define INPUT_DBG_SEEK_CUR  512 /* Seeks to find current location */
40 #define INPUT_DBG_STILL    1024 /* Still-frame */
41 #define INPUT_DBG_VCDINFO  2048 /* Debugging from VCDINFO */
42
43 #define INPUT_DEBUG 1
44 #if INPUT_DEBUG
45 #define dbg_print(mask, s, args...) \
46    if (p_vcd && p_vcd->i_debug & mask) \
47      msg_Dbg(p_access, "%s: "s, __func__ , ##args)
48 #else
49 #define dbg_print(mask, s, args...) 
50 #endif
51
52 #define LOG_ERR(args...)  msg_Err( p_access, args )
53 #define LOG_WARN(args...) msg_Warn( p_access, args )
54
55 /* vcdplayer_read return status */
56 typedef enum {
57   READ_BLOCK,
58   READ_STILL_FRAME,
59   READ_ERROR,
60   READ_END,
61 } vcdplayer_read_status_t;
62
63 /*****************************************************************************
64  * access_vcd_data_t: VCD information
65  *****************************************************************************/
66 typedef struct thread_vcd_data_s
67 {
68   vcdinfo_obj_t *vcd;                   /* CD device descriptor */
69   vlc_bool_t   in_still;                /*  true if in still */
70   vlc_bool_t   b_svd;                   /*  true if we have SVD info */
71   track_t      i_tracks;                /* # of tracks */
72   unsigned int i_segments;              /* # of segments */
73   unsigned int i_entries;               /* # of entries */
74   unsigned int i_lids;                  /* # of List IDs */
75   unsigned int i_titles;                /* # of navigatable titles. */
76   vcdinfo_itemid_t play_item;           /* play-item, VCDPLAYER_BAD_ENTRY 
77                                            if none */
78   int          i_lid;                   /* LID that play item is in. Implies 
79                                            PBC is on. VCDPLAYER_BAD_ENTRY if 
80                                            not none or not in PBC */
81   PsdListDescriptor_t pxd;              /* If PBC is on, the relevant 
82                                             PSD/PLD */
83   int          pdi;                     /* current pld index of pxd. -1 if 
84                                            no index*/
85   vcdinfo_itemid_t loop_item;           /* Where do we loop back to? 
86                                            Meaningful only in a selection 
87                                            list */
88   int          loop_count;              /* # of times play-item has been 
89                                            played. Meaningful only in a 
90                                            selection list.              */
91   track_t      i_track;                 /* Current track number */
92   lsn_t        i_lsn;                   /* Current logical sector number */
93   lsn_t        end_lsn;                 /* LSN of end of current 
94                                            entry/segment/track. */
95   lsn_t        origin_lsn;              /* LSN of start of seek/slider */
96   lsn_t *      p_sectors;               /* Track sectors. This is 0 origin
97                                            so the first VCD track will be
98                                            at 0 and this is the ISO9660 
99                                            filesystem. The first Mode2 form2
100                                            MPEG track is probably track 2 or
101                                            p_sectors[1].
102                                          */
103   lsn_t *      p_entries;               /* Entry points */
104   lsn_t *      p_segments;              /* Segments */
105   vlc_bool_t   b_valid_ep;              /* Valid entry points flag */
106   vlc_bool_t   b_end_of_track;          /* If the end of track was reached */
107   int          i_debug;                 /* Debugging mask */
108
109   /* Information about CD */
110   vlc_meta_t    *p_meta;
111
112   input_title_t *p_title[CDIO_CD_MAX_TRACKS];
113
114   /* Probably gets moved into another structure...*/
115   intf_thread_t *p_intf;
116   int            i_audio_nb;
117   int            i_still_time;
118   vlc_bool_t     b_end_of_cell;
119   input_thread_t *p_input;
120   
121 } access_vcd_data_t;
122
123 /*!
124   Get the next play-item in the list given in the LIDs. Note play-item
125   here refers to list of play-items for a single LID It shouldn't be
126   confused with a user's list of favorite things to play or the 
127   "next" field of a LID which moves us to a different LID.
128  */
129 vlc_bool_t vcdplayer_inc_play_item( access_t *p_access );
130
131 /*!
132   Return true if playback control (PBC) is on
133 */
134 vlc_bool_t vcdplayer_pbc_is_on(const access_vcd_data_t *p_this);
135
136 /*!
137   Play item assocated with the "default" selection.
138
139   Return false if there was some problem.
140 */
141 vlc_bool_t vcdplayer_play_default( access_t * p_access );
142
143 /*!
144   Play item assocated with the "next" selection.
145
146   Return false if there was some problem.
147 */
148 vlc_bool_t vcdplayer_play_next( access_t * p_access );
149
150 /*!
151   Play item assocated with the "prev" selection.
152
153   Return false if there was some problem.
154 */
155 vlc_bool_t vcdplayer_play_prev( access_t * p_access );
156
157 /*!
158   Play item assocated with the "return" selection.
159
160   Return false if there was some problem.
161 */
162 vlc_bool_t
163 vcdplayer_play_return( access_t * p_access );
164
165 vcdplayer_read_status_t vcdplayer_pbc_nav     ( access_t * p_access );
166 vcdplayer_read_status_t vcdplayer_non_pbc_nav ( access_t * p_access );
167
168 #endif /* _VCDPLAYER_H_ */
169 /* 
170  * Local variables:
171  *  c-file-style: "gnu"
172  *  tab-width: 8
173  *  indent-tabs-mode: nil
174  * End:
175  */