xine-lib 1.2.11
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. */
72typedef enum {
77
78typedef 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,
84
85typedef struct {
86 lsn_t start_LSN; /* LSN where play item starts */
87 size_t size; /* size in sector units of play item. */
89
90typedef 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
101typedef 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. */
199
200 /*--------------------------------------------------------------
201 Configuration variables
202 ---------------------------------------------------------------*/
203
204 /* What type to use on 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. */
210
211 /* Do next/prev wrap around? Only valid if PBC is off. */
213
214 /* Show and be able to select rejected LIDs? */
216
217 /* Whether GUI slider is track size or entry size. */
219
221
222/* vcdplayer_read return status */
223typedef enum {
229
230
231/* ----------------------------------------------------------------------
232 Function Prototypes
233 -----------------------------------------------------------------------*/
234
238bool vcdplayer_pbc_is_on(const vcdplayer_t *p_vcdplayer);
239
259char *
260vcdplayer_format_str(vcdplayer_t *p_vcdplayer, const char format_str[]);
261
265void
267
269void
271
273void
274vcdplayer_play(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid);
275
276bool
277vcdplayer_open(vcdplayer_t *p_vcdplayer, char *intended_vcd_device);
278
283vcdplayer_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
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 */
Definition: vcdplayer.h:85
size_t size
Definition: vcdplayer.h:87
lsn_t start_LSN
Definition: vcdplayer.h:86
Definition: vcdplayer.h:101
uint16_t default_entry
Definition: vcdplayer.h:164
lsn_t track_end_lsn
Definition: vcdplayer.h:173
vcdinfo_itemid_t loop_item
Definition: vcdplayer.h:149
void * user_data
Definition: vcdplayer.h:102
vcdplayer_play_item_info_t * track
Definition: vcdplayer.h:196
vcdinfo_itemid_t play_item
Definition: vcdplayer.h:148
lsn_t i_lsn
Definition: vcdplayer.h:166
segnum_t i_segments
Definition: vcdplayer.h:190
vcdplayer_slider_length_t slider_length
Definition: vcdplayer.h:218
track_t i_tracks
Definition: vcdplayer.h:185
uint16_t max_x
Definition: vcdplayer.h:175
debug_fn log_err
Definition: vcdplayer.h:118
void(* update_title)(void *user_data)
Definition: vcdplayer.h:131
void(* set_aspect_ratio)(void *user_data, int ratio)
Definition: vcdplayer.h:128
void(* force_redisplay)(void *user_data)
Definition: vcdplayer.h:125
lsn_t end_lsn
Definition: vcdplayer.h:167
int i_loop
Definition: vcdplayer.h:151
uint16_t max_y
Definition: vcdplayer.h:176
int i_lid
Definition: vcdplayer.h:141
int i_still
Definition: vcdplayer.h:136
lsn_t track_lsn
Definition: vcdplayer.h:172
uint16_t next_entry
Definition: vcdplayer.h:159
debug_fn log_msg
Definition: vcdplayer.h:117
bool b_opened
Definition: vcdplayer.h:182
bool wrap_next_prev
Definition: vcdplayer.h:212
bool show_rejected
Definition: vcdplayer.h:215
lsn_t origin_lsn
Definition: vcdplayer.h:171
char * psz_source
Definition: vcdplayer.h:181
unsigned int i_debug
Definition: vcdplayer.h:108
uint16_t return_entry
Definition: vcdplayer.h:163
void(* flush_buffers)(void *user_data)
Definition: vcdplayer.h:122
unsigned int i_entries
Definition: vcdplayer.h:191
bool autoadvance
Definition: vcdplayer.h:209
vcdplayer_autoplay_t default_autoplay
Definition: vcdplayer.h:205
vcdplayer_play_item_info_t * entry
Definition: vcdplayer.h:198
uint16_t prev_entry
Definition: vcdplayer.h:161
vcd_type_t vcd_format
Definition: vcdplayer.h:183
lid_t i_lids
Definition: vcdplayer.h:192
vcdplayer_play_item_info_t * segment
Definition: vcdplayer.h:197
int pdi
Definition: vcdplayer.h:145
PsdListDescriptor pxd
Definition: vcdplayer.h:144
track_t i_track
Definition: vcdplayer.h:154
unsigned int i_blocks_per_read
Definition: vcdplayer.h:109
vcdinfo_obj_t * vcd
Definition: vcdplayer.h:103
vcdplayer_autoplay_t
Definition: vcdplayer.h:78
@ VCDPLAYER_AUTOPLAY_PBC
Definition: vcdplayer.h:82
@ VCDPLAYER_AUTOPLAY_TRACK
Definition: vcdplayer.h:79
@ VCDPLAYER_AUTOPLAY_SEGMENT
Definition: vcdplayer.h:81
@ VCDPLAYER_AUTOPLAY_ENTRY
Definition: vcdplayer.h:80
bool vcdplayer_open(vcdplayer_t *p_vcdplayer, char *intended_vcd_device)
vcdplayer_read_status_t
Definition: vcdplayer.h:223
@ READ_ERROR
Definition: vcdplayer.h:226
@ READ_END
Definition: vcdplayer.h:227
@ READ_BLOCK
Definition: vcdplayer.h:224
@ READ_STILL_FRAME
Definition: vcdplayer.h:225
vcdplayer_read_status_t vcdplayer_read(vcdplayer_t *p_vcdplayer, uint8_t *p_buf, const off_t nlen)
Definition: vcdplayer.c:901
void vcdplayer_send_button_update(vcdplayer_t *p_vcdplayer, int mode)
Definition: vcdplayer.c:979
char * vcdplayer_format_str(vcdplayer_t *p_vcdplayer, const char format_str[])
Definition: vcdplayer.c:150
void vcdplayer_play(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid)
Definition: vcdplayer.c:657
struct vcdplayer_s vcdplayer_t
int(* debug_fn)(void *user_data, unsigned int mask, const char *fmt,...)
Definition: vcdplayer.h:90
void vcdplayer_update_title_display(vcdplayer_t *p_vcdplayer)
void vcdplayer_update_nav(vcdplayer_t *p_vcdplayer)
Definition: vcdplayer.c:304
vcdplayer_slider_length_t
Definition: vcdplayer.h:72
@ VCDPLAYER_SLIDER_LENGTH_AUTO
Definition: vcdplayer.h:73
@ VCDPLAYER_SLIDER_LENGTH_TRACK
Definition: vcdplayer.h:74
@ VCDPLAYER_SLIDER_LENGTH_ENTRY
Definition: vcdplayer.h:75
bool vcdplayer_pbc_is_on(const vcdplayer_t *p_vcdplayer)
Definition: vcdplayer.c:69
off_t vcdplayer_seek(vcdplayer_t *p_vcdplayer, off_t offset, int origin)
static void user_data(vdpau_mpeg4_decoder_t *this_gen, uint8_t *buffer, int len)
Definition: vdpau_mpeg4.c:695
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