1 /*****************************************************************************
2 * vcd.h: thread structure of the VCD plugin
3 *****************************************************************************
4 * Copyright (C) 1999-2001 VideoLAN
5 * $Id: vcd.h,v 1.4 2003/02/12 17:13:33 jobi Exp $
7 * Author: Johan Bilien <jobi@via.ecp.fr>
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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
24 /* where the data start on a VCD sector */
25 #define VCD_DATA_START 24
26 /* size of the availablr data on a VCD sector */
27 #define VCD_DATA_SIZE 2324
28 /* size of a VCD sector, header and tail included */
29 #define VCD_SECTOR_SIZE 2352
30 /* size of a CD sector */
31 #define CD_SECTOR_SIZE 2048
32 /* sector containing the entry points */
33 #define VCD_ENTRIES_SECTOR 151
35 /*****************************************************************************
37 *****************************************************************************/
38 /* LBA = msf.frame + 75 * ( msf.second + 60 * msf.minute ) */
39 #define MSF_TO_LBA(min, sec, frame) ((int)frame + 75 * (sec + 60 * min))
40 /* LBA = msf.frame + 75 * ( msf.second - 2 + 60 * msf.minute ) */
41 #define MSF_TO_LBA2(min, sec, frame) ((int)frame + 75 * (sec -2 + 60 * min))
42 /* Converts BCD to Binary data */
43 #define BCD_TO_BIN(i) \
44 (uint8_t)((uint8_t)(0xf & (uint8_t)i)+((uint8_t)10*((uint8_t)i >> 4)))
47 typedef struct vcddev_s vcddev_t;
50 /*****************************************************************************
51 * structure to store minute/second/frame locations
52 *****************************************************************************/
61 /*****************************************************************************
62 * entries_sect structure: the sector containing entry points
63 *****************************************************************************/
64 typedef struct entries_sect_s
66 uint8_t psz_id[8]; /* "ENTRYVCD" */
67 uint8_t i_version; /* 0x02 VCD2.0
69 uint8_t i_sys_prof_tag; /* 0x01 if VCD1.1
71 uint16_t i_entries_nb; /* entries number <= 500 */
75 uint8_t i_track; /* track number */
76 msf_t msf; /* msf location
79 uint8_t zeros[36]; /* should be 0x00 */
82 /*****************************************************************************
84 *****************************************************************************/
85 vcddev_t *ioctl_Open ( vlc_object_t *, const char * );
86 void ioctl_Close ( vlc_object_t *, vcddev_t * );
87 int ioctl_GetTracksMap ( vlc_object_t *, const vcddev_t *, int ** );
88 int ioctl_ReadSector ( vlc_object_t *, const vcddev_t *,