1 /*****************************************************************************
2 * vcd.c : VCD input module for vlc
3 *****************************************************************************
4 * Copyright (C) 2000, 2003, 2004, 2005 the VideoLAN team
7 * Authors: Rocky Bernstein <rocky@panix.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 /*****************************************************************************
25 * top-level module code - handles options, shortcuts, loads sub-modules.
26 *****************************************************************************/
28 /*****************************************************************************
30 *****************************************************************************/
36 #include <vlc_common.h>
37 #include <vlc_plugin.h>
38 #include <vlc_charset.h>
40 /*****************************************************************************
42 *****************************************************************************/
43 int VCDOpen ( vlc_object_t * );
44 void VCDClose ( vlc_object_t * );
45 int VCDOpenIntf ( vlc_object_t * );
46 void VCDCloseIntf ( vlc_object_t * );
47 int VCDInit ( vlc_object_t * );
48 void VCDEnd ( vlc_object_t * );
50 int DebugCallback ( vlc_object_t *p_this, const char *psz_name,
51 vlc_value_t oldval, vlc_value_t val,
54 int BlocksPerReadCallback ( vlc_object_t *p_this, const char *psz_name,
55 vlc_value_t oldval, vlc_value_t val,
58 /*****************************************************************************
60 *****************************************************************************/
62 #define DEBUG_LONGTEXT \
63 "This integer when viewed in binary is a debugging mask\n" \
68 "all calls (10) 16\n" \
71 "libcdio (80) 128\n" \
72 "seek-set (100) 256\n" \
73 "seek-cur (200) 512\n" \
74 "still (400) 1024\n" \
75 "vcdinfo (800) 2048\n"
77 #define VCD_TITLE_FMT_LONGTEXT \
78 "Format used in the GUI Playlist Title. Similar to the Unix date \n" \
79 "Format specifiers that start with a percent sign. Specifiers are: \n" \
80 " %A : The album information\n" \
81 " %C : The VCD volume count - the number of CDs in the collection\n" \
82 " %c : The VCD volume num - the number of the CD in the collection.\n" \
83 " %F : The VCD Format, e.g. VCD 1.0, VCD 1.1, VCD 2.0, or SVCD\n" \
84 " %I : The current entry/segment/playback type, e.g. ENTRY, TRACK, SEGMENT...\n" \
85 " %L : The playlist ID prefixed with \" LID\" if it exists\n" \
86 " %N : The current number of the %I - a decimal number\n" \
87 " %P : The publisher ID\n" \
88 " %p : The preparer ID\n" \
89 " %S : If we are in a segment (menu), the kind of segment\n" \
90 " %T : The MPEG track number (starts at 1)\n" \
91 " %V : The volume set ID\n" \
92 " %v : The volume ID\n" \
93 " A number between 1 and the volume count.\n" \
96 /*****************************************************************************
98 *****************************************************************************/
101 set_shortname( N_("(Super) Video CD"));
102 set_description( N_("Video CD (VCD 1.0, 1.1, 2.0, SVCD, HQVCD) input") );
103 add_usage_hint( N_("vcdx://[device-or-file][@{P,S,T}num]") );
104 add_shortcut( "vcdx" );
105 set_category( CAT_INPUT );
106 set_subcategory( SUBCAT_INPUT_ACCESS );
107 set_capability( "access", 55 /* slightly lower than vcd */ );
108 set_callbacks( VCDOpen, VCDClose );
110 /* Configuration options */
111 add_integer ( MODULE_STRING "-debug", 0, NULL,
112 N_("If nonzero, this gives additional debug information."),
113 DEBUG_LONGTEXT, true );
115 add_integer ( MODULE_STRING "-blocks-per-read", 20,
117 N_("Number of CD blocks to get in a single read."),
118 N_("Number of CD blocks to get in a single read."),
121 add_bool( MODULE_STRING "-PBC", 0, NULL,
122 N_("Use playback control?"),
123 N_("If VCD is authored with playback control, use it. "
124 "Otherwise we play by tracks."),
127 add_bool( MODULE_STRING "-track-length", true,
129 N_("Use track length as maximum unit in seek?"),
130 N_("If set, the length of the seek bar is the track rather than "
131 "the length of an entry."),
134 add_bool( MODULE_STRING "-extended-info", 0, NULL,
135 N_("Show extended VCD info?"),
136 N_("Show the maximum amount of information under Stream and "
137 "Media Info. Shows for example playback control navigation."),
140 add_string( MODULE_STRING "-author-format",
141 "%v - %F disc %c of %C",
143 N_("Format to use in the playlist's \"author\" field."),
144 VCD_TITLE_FMT_LONGTEXT, true );
146 add_string( MODULE_STRING "-title-format",
147 "%I %N %L%S - %M %A %v - disc %c of %C %F",
149 N_("Format to use in the playlist's \"title\" field."),
150 VCD_TITLE_FMT_LONGTEXT, false );