xine-lib: xine-lib-1.2.12/src/input/vcd/vcdplayer.h Source File

xine-lib 1.2.12

vcdplayer.h
Go to the documentation of this file.
1/*
2 $Id: vcdplayer.h,v 1.12 2006/06/10 17:38:47 dgp85 Exp $
3
4 Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19
20*/
21
22#ifndef _VCDPLAYER_H_
23#define _VCDPLAYER_H_
24
25#ifdef HAVE_VCDNAV
26#include <libvcd/info.h>
27#include <libvcd/version.h>
28#else
29#include "libvcd/info.h"
30#endif
31
32#ifndef _
33#ifdef ENABLE_NLS
34#include <locale.h>
35# include <libintl.h>
36# define _(String) dgettext (XINE_TEXTDOMAIN, String)
37#else
38/* Stubs that do something close enough. */
39# define _(String) (String)
40#endif
41#endif
42
43/*------------------------------------------------------------------
44 DEBUGGING
45---------------------------------------------------------------------*/
46
47/* Print *any* debug messages? */
48#define INPUT_DEBUG 1
49
50/* Debugging masks */
51
52#define INPUT_DBG_META 1 /* Meta information */
53#define INPUT_DBG_EVENT 2 /* input (keyboard/mouse) events */
54#define INPUT_DBG_MRL 4 /* MRL parsing */
55#define INPUT_DBG_EXT 8 /* Calls from external routines */
56#define INPUT_DBG_CALL 16 /* routine calls */
57#define INPUT_DBG_LSN 32 /* LSN changes */
58#define INPUT_DBG_PBC 64 /* Playback control */
59#define INPUT_DBG_CDIO 128 /* Debugging from CDIO */
60#define INPUT_DBG_SEEK_SET 256 /* Seeks to set location */
61#define INPUT_DBG_SEEK_CUR 512 /* Seeks to find current location */
62#define INPUT_DBG_STILL 1024 /* Still-frame */
63#define INPUT_DBG_VCDINFO 2048 /* Debugging from VCDINFO */
64
65/*------------------------------------------------------------------
66 General definitions and structures.
67---------------------------------------------------------------------*/
68
69#define VCDPLAYER_IN_STILL 65535
70
71/* Some configuration enumerations. */
72 typedef enum {
73 VCDPLAYER_SLIDER_LENGTH_AUTO,
74 VCDPLAYER_SLIDER_LENGTH_TRACK,
75 VCDPLAYER_SLIDER_LENGTH_ENTRY,
76} vcdplayer_slider_length_t;
77
78 typedef enum {
79 VCDPLAYER_AUTOPLAY_TRACK = VCDINFO_ITEM_TYPE_TRACK,
80 VCDPLAYER_AUTOPLAY_ENTRY = VCDINFO_ITEM_TYPE_ENTRY,
81 VCDPLAYER_AUTOPLAY_SEGMENT = VCDINFO_ITEM_TYPE_SEGMENT,
82 VCDPLAYER_AUTOPLAY_PBC = VCDINFO_ITEM_TYPE_LID,
83} vcdplayer_autoplay_t;
84
85 typedef struct {
86 lsn_t start_LSN; /* LSN where play item starts */
87 size_t size; /* size in sector units of play item. */
88} vcdplayer_play_item_info_t;
89
90 typedef int (*debug_fn) (void *user_data, unsigned int mask, const char *fmt, ...);
91
92/* The maximim wait time that can be encoded in a VCD still frame is
93 2,000 seconds (33.33 minutes). We'll use a number larger than this
94 to signal indefinite wait.
95*/
96#define STILL_INDEFINITE_WAIT 3000
97
98/* Value when we have yet to finish reading blocks of a frame. */
99#define STILL_READING -5
100
101 typedef struct vcdplayer_s {
102 void *user_data; /* environment. Passed to called routines. */
103 vcdinfo_obj_t *vcd; /* Pointer to libvcd structures. */
104
105 /*------------------------------------------------------------------
106 User-settable options
107 --------------------------------------------------------------*/
108 unsigned int i_debug; /* Debugging mask */
109 unsigned int i_blocks_per_read; /* number of blocks per read */
110
111 /*------------------------------------------------------------------
112 Callback functions - players and higher-level routines can use
113 this to customize their behavior when using this player-independent
114 code.
115 ---------------------------------------------------------------------*/
116
117 debug_fn log_msg; /* function to log a message in the player */
118 debug_fn log_err; /* function to log an error in the player */
119
120
121 /* Function to flush any audio or video buffers */
122 void (*flush_buffers) (void *user_data);
123
124 /* Function to force a redisplay. */
125 void (*force_redisplay) (void *user_data);
126
127 /* Function to set aspect ratio. */
128 void (*set_aspect_ratio) (void *user_data, int ratio);
129
130 /* Function to update title of selection. */
131 void (*update_title) (void *user_data);
132
133 /*-------------------------------------------------------------
134 Playback control fields
135 --------------------------------------------------------------*/
136 int i_still; /* 0 if not in still,
137 STILL_INDEFINITE_WAIT if indefinite time,
138 STILL_READING if don't have full picture,
139 else number of seconds yet to wait */
140
141 int i_lid; /* LID that play item is in. Implies PBC is.
142 on. VCDPLAYER_BAD_ENTRY if not none or
143 not in PBC */
144 PsdListDescriptor pxd; /* If PBC is on, the relevant PSD/PLD */
145 int pdi; /* current pld index of pxd. -1 if
146 no index*/
147
148 vcdinfo_itemid_t play_item; /* play-item, VCDPLAYER_BAD_ENTRY if none */
149 vcdinfo_itemid_t loop_item; /* Where do we loop back to? Meaningful only
150 in a selection list */
151 int i_loop; /* # of times play-item has been played.
152 Meaningful only in a selection list.
153 */
154 track_t i_track; /* current track number */
155
156 /*-----------------------------------
157 Navigation and location fields
158 ------------------------------------*/
159 uint16_t next_entry; /* where to go if next is pressed,
160 VCDPLAYER_BAD_ENTRY if none */
161 uint16_t prev_entry; /* where to fo if prev is pressed,
162 VCDPLAYER_BAD_ENTRY if none */
163 uint16_t return_entry; /* Entry index to use if return is pressed */
164 uint16_t default_entry; /* Default selection entry. */
165
166 lsn_t i_lsn; /* LSN of where we are right now */
167 lsn_t end_lsn; /* LSN of end of current entry/segment/track.
168 entry/segment/track. This block can be read
169 (and is not one after the "end"). */
170
171 lsn_t origin_lsn; /* LSN of start of seek/slider position. */
172 lsn_t track_lsn; /* LSN of start track origin of track we are in. */
173 lsn_t track_end_lsn; /* LSN of end of current track (if entry). */
174
175 uint16_t max_x; /* Largest screen x coordinate */
176 uint16_t max_y; /* Largest screen y coordinate */
177
178 /*--------------------------------------------------------------
179 (S)VCD Medium information
180 ---------------------------------------------------------------*/
181 char *psz_source; /* VCD device currently open */
182 bool b_opened; /* true if initialized */
183 vcd_type_t vcd_format; /* VCD 2.0, 1,1, SVCD, HQVCD? */
184
185 track_t i_tracks; /* # of playable MPEG tracks. This is
186 generally one less than the number
187 of CD tracks as the first CD track
188 is an ISO-9660 track and is not
189 playable. */
190 segnum_t i_segments; /* Number of segments in medium */
191 unsigned int i_entries; /* Number of entries in medium */
192 lid_t i_lids; /* Number of LIDs in medium */
193
194 /* Tracks, segment, and entry information. The number of entries for
195 each is given by the corresponding i_* field above. */
196 vcdplayer_play_item_info_t *track;
197 vcdplayer_play_item_info_t *segment;
198 vcdplayer_play_item_info_t *entry;
199
200 /*--------------------------------------------------------------
201 Configuration variables
202 ---------------------------------------------------------------*/
203
204 /* What type to use on autoplay */
205 vcdplayer_autoplay_t default_autoplay;
206
207 /* When hitting end of entry or track do we advance automatically
208 to next entry/track or stop? Only valid if PBC is off. */
209 bool autoadvance;
210
211 /* Do next/prev wrap around? Only valid if PBC is off. */
212 bool wrap_next_prev;
213
214 /* Show and be able to select rejected LIDs? */
215 bool show_rejected;
216
217 /* Whether GUI slider is track size or entry size. */
218 vcdplayer_slider_length_t slider_length;
219
220} vcdplayer_t;
221
222/* vcdplayer_read return status */
223 typedef enum {
224 READ_BLOCK,
225 READ_STILL_FRAME,
226 READ_ERROR,
227 READ_END,
228} vcdplayer_read_status_t;
229
230
231/* ----------------------------------------------------------------------
232 Function Prototypes
233 -----------------------------------------------------------------------*/
234
238bool vcdplayer_pbc_is_on(const vcdplayer_t *p_vcdplayer);
239
259char *
260 vcdplayer_format_str(vcdplayer_t *p_vcdplayer, const char format_str[]);
261
265void
266 vcdplayer_update_nav(vcdplayer_t *p_vcdplayer);
267
269void
270vcdplayer_update_title_display(vcdplayer_t *p_vcdplayer);
271
273void
274 vcdplayer_play(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid);
275
276bool
277vcdplayer_open(vcdplayer_t *p_vcdplayer, char *intended_vcd_device);
278
282 vcdplayer_read_status_t
283 vcdplayer_read (vcdplayer_t *p_vcdplayer, uint8_t *p_buf, const off_t nlen);
284
290off_t
291vcdplayer_seek (vcdplayer_t *p_vcdplayer, off_t offset, int origin);
292
297void
298 vcdplayer_send_button_update(vcdplayer_t *p_vcdplayer, int mode);
299
300#endif /* _VCDPLAYER_H_ */
301/*
302 * Local variables:
303 * c-file-style: "gnu"
304 * tab-width: 8
305 * indent-tabs-mode: nil
306 * End:
307 */
vcdplayer_play_item_info_t
Definition: vcdplayer.h:85
vcdplayer_play_item_info_t::size
size_t size
Definition: vcdplayer.h:87
vcdplayer_play_item_info_t::start_LSN
lsn_t start_LSN
Definition: vcdplayer.h:86
vcdplayer_s
Definition: vcdplayer.h:101
vcdplayer_s::default_entry
uint16_t default_entry
Definition: vcdplayer.h:164
vcdplayer_s::track_end_lsn
lsn_t track_end_lsn
Definition: vcdplayer.h:173
vcdplayer_s::loop_item
vcdinfo_itemid_t loop_item
Definition: vcdplayer.h:149
vcdplayer_s::user_data
void * user_data
Definition: vcdplayer.h:102
vcdplayer_s::track
vcdplayer_play_item_info_t * track
Definition: vcdplayer.h:196
vcdplayer_s::play_item
vcdinfo_itemid_t play_item
Definition: vcdplayer.h:148
vcdplayer_s::i_lsn
lsn_t i_lsn
Definition: vcdplayer.h:166
vcdplayer_s::i_segments
segnum_t i_segments
Definition: vcdplayer.h:190
vcdplayer_s::slider_length
vcdplayer_slider_length_t slider_length
Definition: vcdplayer.h:218
vcdplayer_s::i_tracks
track_t i_tracks
Definition: vcdplayer.h:185
vcdplayer_s::max_x
uint16_t max_x
Definition: vcdplayer.h:175
vcdplayer_s::log_err
debug_fn log_err
Definition: vcdplayer.h:118
vcdplayer_s::update_title
void(* update_title)(void *user_data)
Definition: vcdplayer.h:131
vcdplayer_s::set_aspect_ratio
void(* set_aspect_ratio)(void *user_data, int ratio)
Definition: vcdplayer.h:128
vcdplayer_s::force_redisplay
void(* force_redisplay)(void *user_data)
Definition: vcdplayer.h:125
vcdplayer_s::end_lsn
lsn_t end_lsn
Definition: vcdplayer.h:167
vcdplayer_s::i_loop
int i_loop
Definition: vcdplayer.h:151
vcdplayer_s::max_y
uint16_t max_y
Definition: vcdplayer.h:176
vcdplayer_s::i_lid
int i_lid
Definition: vcdplayer.h:141
vcdplayer_s::i_still
int i_still
Definition: vcdplayer.h:136
vcdplayer_s::track_lsn
lsn_t track_lsn
Definition: vcdplayer.h:172
vcdplayer_s::next_entry
uint16_t next_entry
Definition: vcdplayer.h:159
vcdplayer_s::log_msg
debug_fn log_msg
Definition: vcdplayer.h:117
vcdplayer_s::b_opened
bool b_opened
Definition: vcdplayer.h:182
vcdplayer_s::wrap_next_prev
bool wrap_next_prev
Definition: vcdplayer.h:212
vcdplayer_s::show_rejected
bool show_rejected
Definition: vcdplayer.h:215
vcdplayer_s::origin_lsn
lsn_t origin_lsn
Definition: vcdplayer.h:171
vcdplayer_s::psz_source
char * psz_source
Definition: vcdplayer.h:181
vcdplayer_s::i_debug
unsigned int i_debug
Definition: vcdplayer.h:108
vcdplayer_s::return_entry
uint16_t return_entry
Definition: vcdplayer.h:163
vcdplayer_s::flush_buffers
void(* flush_buffers)(void *user_data)
Definition: vcdplayer.h:122
vcdplayer_s::i_entries
unsigned int i_entries
Definition: vcdplayer.h:191
vcdplayer_s::autoadvance
bool autoadvance
Definition: vcdplayer.h:209
vcdplayer_s::default_autoplay
vcdplayer_autoplay_t default_autoplay
Definition: vcdplayer.h:205
vcdplayer_s::entry
vcdplayer_play_item_info_t * entry
Definition: vcdplayer.h:198
vcdplayer_s::prev_entry
uint16_t prev_entry
Definition: vcdplayer.h:161
vcdplayer_s::vcd_format
vcd_type_t vcd_format
Definition: vcdplayer.h:183
vcdplayer_s::i_lids
lid_t i_lids
Definition: vcdplayer.h:192
vcdplayer_s::segment
vcdplayer_play_item_info_t * segment
Definition: vcdplayer.h:197
vcdplayer_s::pdi
int pdi
Definition: vcdplayer.h:145
vcdplayer_s::pxd
PsdListDescriptor pxd
Definition: vcdplayer.h:144
vcdplayer_s::i_track
track_t i_track
Definition: vcdplayer.h:154
vcdplayer_s::i_blocks_per_read
unsigned int i_blocks_per_read
Definition: vcdplayer.h:109
vcdplayer_s::vcd
vcdinfo_obj_t * vcd
Definition: vcdplayer.h:103
vcdplayer_autoplay_t
vcdplayer_autoplay_t
Definition: vcdplayer.h:78
VCDPLAYER_AUTOPLAY_PBC
@ VCDPLAYER_AUTOPLAY_PBC
Definition: vcdplayer.h:82
VCDPLAYER_AUTOPLAY_TRACK
@ VCDPLAYER_AUTOPLAY_TRACK
Definition: vcdplayer.h:79
VCDPLAYER_AUTOPLAY_SEGMENT
@ VCDPLAYER_AUTOPLAY_SEGMENT
Definition: vcdplayer.h:81
VCDPLAYER_AUTOPLAY_ENTRY
@ VCDPLAYER_AUTOPLAY_ENTRY
Definition: vcdplayer.h:80
vcdplayer_open
bool vcdplayer_open(vcdplayer_t *p_vcdplayer, char *intended_vcd_device)
vcdplayer_read_status_t
vcdplayer_read_status_t
Definition: vcdplayer.h:223
READ_ERROR
@ READ_ERROR
Definition: vcdplayer.h:226
READ_END
@ READ_END
Definition: vcdplayer.h:227
READ_BLOCK
@ READ_BLOCK
Definition: vcdplayer.h:224
READ_STILL_FRAME
@ READ_STILL_FRAME
Definition: vcdplayer.h:225
vcdplayer_read
vcdplayer_read_status_t vcdplayer_read(vcdplayer_t *p_vcdplayer, uint8_t *p_buf, const off_t nlen)
Definition: vcdplayer.c:901
vcdplayer_send_button_update
void vcdplayer_send_button_update(vcdplayer_t *p_vcdplayer, int mode)
Definition: vcdplayer.c:979
vcdplayer_format_str
char * vcdplayer_format_str(vcdplayer_t *p_vcdplayer, const char format_str[])
Definition: vcdplayer.c:150
vcdplayer_play
void vcdplayer_play(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid)
Definition: vcdplayer.c:657
vcdplayer_t
struct vcdplayer_s vcdplayer_t
debug_fn
int(* debug_fn)(void *user_data, unsigned int mask, const char *fmt,...)
Definition: vcdplayer.h:90
vcdplayer_update_title_display
void vcdplayer_update_title_display(vcdplayer_t *p_vcdplayer)
vcdplayer_update_nav
void vcdplayer_update_nav(vcdplayer_t *p_vcdplayer)
Definition: vcdplayer.c:304
vcdplayer_slider_length_t
vcdplayer_slider_length_t
Definition: vcdplayer.h:72
VCDPLAYER_SLIDER_LENGTH_AUTO
@ VCDPLAYER_SLIDER_LENGTH_AUTO
Definition: vcdplayer.h:73
VCDPLAYER_SLIDER_LENGTH_TRACK
@ VCDPLAYER_SLIDER_LENGTH_TRACK
Definition: vcdplayer.h:74
VCDPLAYER_SLIDER_LENGTH_ENTRY
@ VCDPLAYER_SLIDER_LENGTH_ENTRY
Definition: vcdplayer.h:75
vcdplayer_pbc_is_on
bool vcdplayer_pbc_is_on(const vcdplayer_t *p_vcdplayer)
Definition: vcdplayer.c:69
vcdplayer_seek
off_t vcdplayer_seek(vcdplayer_t *p_vcdplayer, off_t offset, int origin)
user_data
static void user_data(vdpau_mpeg4_decoder_t *this_gen, uint8_t *buffer, int len)
Definition: vdpau_mpeg4.c:695
mode
enable disable number of frames of telecine pattern sync required before mode change make frames evenly spaced for film mode(24 fps)" ) PARAM_ITEM( POST_PARAM_TYPE_BOOL