diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-05-31 22:24:29 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-05-31 22:24:29 +0200 |
commit | b535c2d4f8d84adb22c741170e6fd11b3cfc4478 (patch) | |
tree | 5407f0612431d38a40d3aae1919010a76175d10c /contrib/libcdio/cdio_private.h | |
parent | 5fbadac433d89261d4d00830d7d3ed55503285d5 (diff) | |
download | xine-lib-b535c2d4f8d84adb22c741170e6fd11b3cfc4478.tar.gz xine-lib-b535c2d4f8d84adb22c741170e6fd11b3cfc4478.tar.bz2 |
Move libcdio and libvcd into contrib/
--HG--
rename : src/input/vcd/libcdio/FreeBSD/freebsd.c => contrib/libcdio/FreeBSD/freebsd.c
rename : src/input/vcd/libcdio/FreeBSD/freebsd.h => contrib/libcdio/FreeBSD/freebsd.h
rename : src/input/vcd/libcdio/FreeBSD/freebsd_cam.c => contrib/libcdio/FreeBSD/freebsd_cam.c
rename : src/input/vcd/libcdio/FreeBSD/freebsd_ioctl.c => contrib/libcdio/FreeBSD/freebsd_ioctl.c
rename : src/input/vcd/libcdio/MSWindows/Makefile.am => contrib/libcdio/MSWindows/Makefile.am
rename : src/input/vcd/libcdio/MSWindows/aspi32.c => contrib/libcdio/MSWindows/aspi32.c
rename : src/input/vcd/libcdio/MSWindows/aspi32.h => contrib/libcdio/MSWindows/aspi32.h
rename : src/input/vcd/libcdio/MSWindows/win32.c => contrib/libcdio/MSWindows/win32.c
rename : src/input/vcd/libcdio/MSWindows/win32.h => contrib/libcdio/MSWindows/win32.h
rename : src/input/vcd/libcdio/MSWindows/win32_ioctl.c => contrib/libcdio/MSWindows/win32_ioctl.c
rename : src/input/vcd/libcdio/Makefile.am => contrib/libcdio/Makefile.am
rename : src/input/vcd/libcdio/_cdio_bsdi.c => contrib/libcdio/_cdio_bsdi.c
rename : src/input/vcd/libcdio/_cdio_generic.c => contrib/libcdio/_cdio_generic.c
rename : src/input/vcd/libcdio/_cdio_linux.c => contrib/libcdio/_cdio_linux.c
rename : src/input/vcd/libcdio/_cdio_osx.c => contrib/libcdio/_cdio_osx.c
rename : src/input/vcd/libcdio/_cdio_stdio.c => contrib/libcdio/_cdio_stdio.c
rename : src/input/vcd/libcdio/_cdio_stdio.h => contrib/libcdio/_cdio_stdio.h
rename : src/input/vcd/libcdio/_cdio_stream.c => contrib/libcdio/_cdio_stream.c
rename : src/input/vcd/libcdio/_cdio_stream.h => contrib/libcdio/_cdio_stream.h
rename : src/input/vcd/libcdio/_cdio_sunos.c => contrib/libcdio/_cdio_sunos.c
rename : src/input/vcd/libcdio/cd_types.c => contrib/libcdio/cd_types.c
rename : src/input/vcd/libcdio/cdio.c => contrib/libcdio/cdio.c
rename : src/input/vcd/libcdio/cdio/Makefile.am => contrib/libcdio/cdio/Makefile.am
rename : src/input/vcd/libcdio/cdio/bytesex.h => contrib/libcdio/cdio/bytesex.h
rename : src/input/vcd/libcdio/cdio/bytesex_asm.h => contrib/libcdio/cdio/bytesex_asm.h
rename : src/input/vcd/libcdio/cdio/cd_types.h => contrib/libcdio/cdio/cd_types.h
rename : src/input/vcd/libcdio/cdio/cdio.h => contrib/libcdio/cdio/cdio.h
rename : src/input/vcd/libcdio/cdio/cdtext.h => contrib/libcdio/cdio/cdtext.h
rename : src/input/vcd/libcdio/cdio/ds.h => contrib/libcdio/cdio/ds.h
rename : src/input/vcd/libcdio/cdio/dvd.h => contrib/libcdio/cdio/dvd.h
rename : src/input/vcd/libcdio/cdio/iso9660.h => contrib/libcdio/cdio/iso9660.h
rename : src/input/vcd/libcdio/cdio/logging.h => contrib/libcdio/cdio/logging.h
rename : src/input/vcd/libcdio/cdio/scsi_mmc.h => contrib/libcdio/cdio/scsi_mmc.h
rename : src/input/vcd/libcdio/cdio/sector.h => contrib/libcdio/cdio/sector.h
rename : src/input/vcd/libcdio/cdio/types.h => contrib/libcdio/cdio/types.h
rename : src/input/vcd/libcdio/cdio/util.h => contrib/libcdio/cdio/util.h
rename : src/input/vcd/libcdio/cdio/version.h => contrib/libcdio/cdio/version.h
rename : src/input/vcd/libcdio/cdio/xa.h => contrib/libcdio/cdio/xa.h
rename : src/input/vcd/libcdio/cdio_assert.h => contrib/libcdio/cdio_assert.h
rename : src/input/vcd/libcdio/cdio_private.h => contrib/libcdio/cdio_private.h
rename : src/input/vcd/libcdio/cdtext.c => contrib/libcdio/cdtext.c
rename : src/input/vcd/libcdio/cdtext_private.h => contrib/libcdio/cdtext_private.h
rename : src/input/vcd/libcdio/ds.c => contrib/libcdio/ds.c
rename : src/input/vcd/libcdio/generic.h => contrib/libcdio/generic.h
rename : src/input/vcd/libcdio/image.h => contrib/libcdio/image.h
rename : src/input/vcd/libcdio/image/Makefile.am => contrib/libcdio/image/Makefile.am
rename : src/input/vcd/libcdio/image/bincue.c => contrib/libcdio/image/bincue.c
rename : src/input/vcd/libcdio/image/cdrdao.c => contrib/libcdio/image/cdrdao.c
rename : src/input/vcd/libcdio/image/nrg.c => contrib/libcdio/image/nrg.c
rename : src/input/vcd/libcdio/image/nrg.h => contrib/libcdio/image/nrg.h
rename : src/input/vcd/libcdio/image_common.h => contrib/libcdio/image_common.h
rename : src/input/vcd/libcdio/iso9660.c => contrib/libcdio/iso9660.c
rename : src/input/vcd/libcdio/iso9660_fs.c => contrib/libcdio/iso9660_fs.c
rename : src/input/vcd/libcdio/iso9660_private.h => contrib/libcdio/iso9660_private.h
rename : src/input/vcd/libcdio/logging.c => contrib/libcdio/logging.c
rename : src/input/vcd/libcdio/portable.h => contrib/libcdio/portable.h
rename : src/input/vcd/libcdio/scsi_mmc.c => contrib/libcdio/scsi_mmc.c
rename : src/input/vcd/libcdio/scsi_mmc.h => contrib/libcdio/scsi_mmc.h
rename : src/input/vcd/libcdio/scsi_mmc_private.h => contrib/libcdio/scsi_mmc_private.h
rename : src/input/vcd/libcdio/sector.c => contrib/libcdio/sector.c
rename : src/input/vcd/libcdio/util.c => contrib/libcdio/util.c
rename : src/input/vcd/libcdio/xa.c => contrib/libcdio/xa.c
rename : src/input/vcd/libvcd/Makefile.am => contrib/libvcd/Makefile.am
rename : src/input/vcd/libvcd/bitvec.h => contrib/libvcd/bitvec.h
rename : src/input/vcd/libvcd/bytesex.h => contrib/libvcd/bytesex.h
rename : src/input/vcd/libvcd/bytesex_asm.h => contrib/libvcd/bytesex_asm.h
rename : src/input/vcd/libvcd/data_structures.c => contrib/libvcd/data_structures.c
rename : src/input/vcd/libvcd/data_structures.h => contrib/libvcd/data_structures.h
rename : src/input/vcd/libvcd/dict.h => contrib/libvcd/dict.h
rename : src/input/vcd/libvcd/directory.c => contrib/libvcd/directory.c
rename : src/input/vcd/libvcd/directory.h => contrib/libvcd/directory.h
rename : src/input/vcd/libvcd/files.c => contrib/libvcd/files.c
rename : src/input/vcd/libvcd/image.c => contrib/libvcd/image.c
rename : src/input/vcd/libvcd/image_bincue.c => contrib/libvcd/image_bincue.c
rename : src/input/vcd/libvcd/image_cdrdao.c => contrib/libvcd/image_cdrdao.c
rename : src/input/vcd/libvcd/image_nrg.c => contrib/libvcd/image_nrg.c
rename : src/input/vcd/libvcd/image_sink.h => contrib/libvcd/image_sink.h
rename : src/input/vcd/libvcd/inf.c => contrib/libvcd/inf.c
rename : src/input/vcd/libvcd/info.c => contrib/libvcd/info.c
rename : src/input/vcd/libvcd/info_private.c => contrib/libvcd/info_private.c
rename : src/input/vcd/libvcd/info_private.h => contrib/libvcd/info_private.h
rename : src/input/vcd/libvcd/libvcd/Makefile.am => contrib/libvcd/libvcd/Makefile.am
rename : src/input/vcd/libvcd/libvcd/files.h => contrib/libvcd/libvcd/files.h
rename : src/input/vcd/libvcd/libvcd/files_private.h => contrib/libvcd/libvcd/files_private.h
rename : src/input/vcd/libvcd/libvcd/inf.h => contrib/libvcd/libvcd/inf.h
rename : src/input/vcd/libvcd/libvcd/info.h => contrib/libvcd/libvcd/info.h
rename : src/input/vcd/libvcd/libvcd/logging.h => contrib/libvcd/libvcd/logging.h
rename : src/input/vcd/libvcd/libvcd/sector.h => contrib/libvcd/libvcd/sector.h
rename : src/input/vcd/libvcd/libvcd/types.h => contrib/libvcd/libvcd/types.h
rename : src/input/vcd/libvcd/libvcd/version.h => contrib/libvcd/libvcd/version.h
rename : src/input/vcd/libvcd/logging.c => contrib/libvcd/logging.c
rename : src/input/vcd/libvcd/mpeg.c => contrib/libvcd/mpeg.c
rename : src/input/vcd/libvcd/mpeg.h => contrib/libvcd/mpeg.h
rename : src/input/vcd/libvcd/mpeg_stream.c => contrib/libvcd/mpeg_stream.c
rename : src/input/vcd/libvcd/mpeg_stream.h => contrib/libvcd/mpeg_stream.h
rename : src/input/vcd/libvcd/obj.h => contrib/libvcd/obj.h
rename : src/input/vcd/libvcd/pbc.c => contrib/libvcd/pbc.c
rename : src/input/vcd/libvcd/pbc.h => contrib/libvcd/pbc.h
rename : src/input/vcd/libvcd/salloc.c => contrib/libvcd/salloc.c
rename : src/input/vcd/libvcd/salloc.h => contrib/libvcd/salloc.h
rename : src/input/vcd/libvcd/sector.c => contrib/libvcd/sector.c
rename : src/input/vcd/libvcd/sector_private.h => contrib/libvcd/sector_private.h
rename : src/input/vcd/libvcd/stream.c => contrib/libvcd/stream.c
rename : src/input/vcd/libvcd/stream.h => contrib/libvcd/stream.h
rename : src/input/vcd/libvcd/stream_stdio.c => contrib/libvcd/stream_stdio.c
rename : src/input/vcd/libvcd/stream_stdio.h => contrib/libvcd/stream_stdio.h
rename : src/input/vcd/libvcd/util.c => contrib/libvcd/util.c
rename : src/input/vcd/libvcd/util.h => contrib/libvcd/util.h
rename : src/input/vcd/libvcd/vcd.c => contrib/libvcd/vcd.c
rename : src/input/vcd/libvcd/vcd.h => contrib/libvcd/vcd.h
rename : src/input/vcd/libvcd/vcd_assert.h => contrib/libvcd/vcd_assert.h
rename : src/input/vcd/libvcd/vcd_read.c => contrib/libvcd/vcd_read.c
rename : src/input/vcd/libvcd/vcd_read.h => contrib/libvcd/vcd_read.h
Diffstat (limited to 'contrib/libcdio/cdio_private.h')
-rw-r--r-- | contrib/libcdio/cdio_private.h | 315 |
1 files changed, 315 insertions, 0 deletions
diff --git a/contrib/libcdio/cdio_private.h b/contrib/libcdio/cdio_private.h new file mode 100644 index 000000000..b1e2777ed --- /dev/null +++ b/contrib/libcdio/cdio_private.h @@ -0,0 +1,315 @@ +/* + $Id: cdio_private.h,v 1.3 2005/01/01 02:43:57 rockyb Exp $ + + Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* Internal routines for CD I/O drivers. */ + + +#ifndef __CDIO_PRIVATE_H__ +#define __CDIO_PRIVATE_H__ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include <cdio/cdio.h> +#include <cdio/cdtext.h> +#include "scsi_mmc_private.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + /* Opaque type */ + typedef struct _CdioDataSource CdioDataSource; + +#ifdef __cplusplus +} + +#endif /* __cplusplus */ + +#include "generic.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + + + typedef struct { + + /*! + Eject media in CD drive. If successful, as a side effect we + also free obj. Return 0 if success and 1 for failure. + */ + int (*eject_media) (void *env); + + /*! + Release and free resources associated with cd. + */ + void (*free) (void *env); + + /*! + Return the value associated with the key "arg". + */ + const char * (*get_arg) (void *env, const char key[]); + + /*! + Get cdtext information for a CdIo object. + + @param obj the CD object that may contain CD-TEXT information. + @return the CD-TEXT object or NULL if obj is NULL + or CD-TEXT information does not exist. + + If i_track is 0 or CDIO_CDROM_LEADOUT_TRACK the track returned + is the information assocated with the CD. + */ + const cdtext_t * (*get_cdtext) (void *env, track_t i_track); + + /*! + Return an array of device names. if CdIo is NULL (we haven't + initialized a specific device driver), then find a suitable device + driver. + + NULL is returned if we couldn't return a list of devices. + */ + char ** (*get_devices) (void); + + /*! + Return a string containing the default CD device if none is specified. + */ + char * (*get_default_device)(void); + + /*! + Get disc mode associated with cd_obj. + */ + discmode_t (*get_discmode) (void *p_env); + + /*! + Return the what kind of device we've got. + + See cd_types.h for a list of bitmasks for the drive type; + */ + void (*get_drive_cap) (const void *env, + cdio_drive_read_cap_t *p_read_cap, + cdio_drive_write_cap_t *p_write_cap, + cdio_drive_misc_cap_t *p_misc_cap); + /*! + Return the number of of the first track. + CDIO_INVALID_TRACK is returned on error. + */ + track_t (*get_first_track_num) (void *p_env); + + /*! + Get the CD-ROM hardware info via a SCSI MMC INQUIRY command. + False is returned if we had an error getting the information. + */ + bool (*get_hwinfo) ( const CdIo *p_cdio, + /* out*/ cdio_hwinfo_t *p_hw_info ); + + /*! + Return the media catalog number MCN from the CD or NULL if + there is none or we don't have the ability to get it. + */ + char * (*get_mcn) (const void *env); + + /*! + Return the number of tracks in the current medium. + CDIO_INVALID_TRACK is returned on error. + */ + track_t (*get_num_tracks) (void *env); + + /*! + Return the starting LBA for track number + track_num in obj. Tracks numbers start at 1. + The "leadout" track is specified either by + using track_num LEADOUT_TRACK or the total tracks+1. + CDIO_INVALID_LBA is returned on error. + */ + lba_t (*get_track_lba) (void *env, track_t track_num); + + /*! + Get format of track. + */ + track_format_t (*get_track_format) (void *env, track_t track_num); + + /*! + Return true if we have XA data (green, mode2 form1) or + XA data (green, mode2 form2). That is track begins: + sync - header - subheader + 12 4 - 8 + + FIXME: there's gotta be a better design for this and get_track_format? + */ + bool (*get_track_green) (void *env, track_t track_num); + + /*! + Return the starting MSF (minutes/secs/frames) for track number + track_num in obj. Tracks numbers start at 1. + The "leadout" track is specified either by + using track_num LEADOUT_TRACK or the total tracks+1. + False is returned on error. + */ + bool (*get_track_msf) (void *env, track_t track_num, msf_t *msf); + + /*! + lseek - reposition read/write file offset + Returns (off_t) -1 on error. + Similar to libc's lseek() + */ + off_t (*lseek) (void *env, off_t offset, int whence); + + /*! + Reads into buf the next size bytes. + Returns -1 on error. + Similar to libc's read() + */ + ssize_t (*read) (void *env, void *buf, size_t size); + + /*! + Reads a single mode2 sector from cd device into buf starting + from lsn. Returns 0 if no error. + */ + int (*read_audio_sectors) (void *env, void *buf, lsn_t lsn, + unsigned int nblocks); + + /*! + Reads a single mode2 sector from cd device into buf starting + from lsn. Returns 0 if no error. + */ + int (*read_mode2_sector) (void *env, void *buf, lsn_t lsn, + bool mode2_form2); + + /*! + Reads nblocks of mode2 sectors from cd device into data starting + from lsn. + Returns 0 if no error. + */ + int (*read_mode2_sectors) (void *p_env, void *p_buf, lsn_t lsn, + bool mode2_form2, unsigned int nblocks); + + /*! + Reads a single mode1 sector from cd device into buf starting + from lsn. Returns 0 if no error. + */ + int (*read_mode1_sector) (void *p_env, void *p_buf, lsn_t lsn, + bool mode1_form2); + + /*! + Reads nblocks of mode1 sectors from cd device into data starting + from lsn. + Returns 0 if no error. + */ + int (*read_mode1_sectors) (void *p_env, void *p_buf, lsn_t lsn, + bool mode1_form2, unsigned int nblocks); + + bool (*read_toc) ( void *p_env ) ; + + /*! + Run a SCSI MMC command. + + cdio CD structure set by cdio_open(). + i_timeout_ms time in milliseconds we will wait for the command + to complete. + cdb_len number of bytes in cdb (6, 10, or 12). + cdb CDB bytes. All values that are needed should be set on + input. + b_return_data TRUE if the command expects data to be returned in + the buffer + len Size of buffer + buf Buffer for data, both sending and receiving + + Returns 0 if command completed successfully. + */ + scsi_mmc_run_cmd_fn_t run_scsi_mmc_cmd; + + /*! + Set the arg "key" with "value" in the source device. + */ + int (*set_arg) (void *env, const char key[], const char value[]); + + /*! + Return the size of the CD in logical block address (LBA) units. + */ + uint32_t (*stat_size) (void *env); + + } cdio_funcs; + + + /*! Implementation of CdIo type */ + struct _CdIo { + driver_id_t driver_id; /**< Particular driver opened. */ + cdio_funcs op; /**< driver-specific routines handling + implementation*/ + void *env; /**< environment. Passed to routine above. */ + }; + + /* This is used in drivers that must keep their own internal + position pointer for doing seeks. Stream-based drivers (like bincue, + nrg, toc, network) would use this. + */ + typedef struct + { + off_t buff_offset; /* buffer offset in disk-image seeks. */ + track_t index; /* Current track index in tocent. */ + lba_t lba; /* Current LBA */ + } internal_position_t; + + CdIo * cdio_new (generic_img_private_t *p_env, cdio_funcs *funcs); + + /* The below structure describes a specific CD Input driver */ + typedef struct + { + driver_id_t id; + unsigned int flags; + const char *name; + const char *describe; + bool (*have_driver) (void); + CdIo *(*driver_open) (const char *psz_source_name); + CdIo *(*driver_open_am) (const char *psz_source_name, + const char *psz_access_mode); + char *(*get_default_device) (void); + bool (*is_device) (const char *psz_source_name); + char **(*get_devices) (void); + } CdIo_driver_t; + + /* The below array gives of the drivers that are currently available for + on a particular host. */ + extern CdIo_driver_t CdIo_driver[CDIO_MAX_DRIVER]; + + /* The last valid entry of Cdio_driver. -1 means uninitialzed. -2 + means some sort of error. + */ + extern int CdIo_last_driver; + + /* The below array gives all drivers that can possibly appear. + on a particular host. */ + extern CdIo_driver_t CdIo_all_drivers[CDIO_MAX_DRIVER+1]; + + /*! + Add/allocate a drive to the end of drives. + Use cdio_free_device_list() to free this device_list. + */ + void cdio_add_device_list(char **device_list[], const char *drive, + unsigned int *i_drives); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __CDIO_PRIVATE_H__ */ |