I think I have the XA encapsulation down so that it will work in vcdimager

(and others).
This commit is contained in:
rocky
2003-08-31 08:32:40 +00:00
parent 3a034845e9
commit cccaa2a036
12 changed files with 130 additions and 130 deletions

View File

@@ -1,5 +1,5 @@
/* /*
$Id: iso9660.h,v 1.9 2003/08/31 07:39:45 rocky Exp $ $Id: iso9660.h,v 1.10 2003/08/31 08:32:40 rocky Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
@@ -23,7 +23,6 @@
#define __CDIO_ISO9660_H__ #define __CDIO_ISO9660_H__
/* Will eventually need/use glib.h */ /* Will eventually need/use glib.h */
#include <cdio/types.h>
#include <cdio/cdio.h> #include <cdio/cdio.h>
#include <cdio/xa.h> #include <cdio/xa.h>
@@ -256,6 +255,11 @@ iso9660_pathtable_m_add_entry (void *pt, const char name[], uint32_t extent,
const char * const char *
iso9660_get_xa_attr_str (uint16_t xa_attr); iso9660_get_xa_attr_str (uint16_t xa_attr);
iso9660_xa_t *
iso9660_xa_init (iso9660_xa_t *_xa, uint16_t uid, uint16_t gid, uint16_t attr,
uint8_t filenum);
#endif /* __CDIO_ISO9660_H__ */ #endif /* __CDIO_ISO9660_H__ */

View File

@@ -1,5 +1,5 @@
/* /*
$Id: xa.h,v 1.1 2003/08/31 07:39:45 rocky Exp $ $Id: xa.h,v 1.2 2003/08/31 08:32:40 rocky Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
@@ -43,6 +43,10 @@
#define XA_PERM_ALL_EXEC (XA_ATTR_U_EXEC | XA_ATTR_G_EXEC | XA_ATTR_O_EXEC) #define XA_PERM_ALL_EXEC (XA_ATTR_U_EXEC | XA_ATTR_G_EXEC | XA_ATTR_O_EXEC)
#define XA_PERM_ALL_ALL (XA_PERM_ALL_READ | XA_PERM_ALL_EXEC) #define XA_PERM_ALL_ALL (XA_PERM_ALL_READ | XA_PERM_ALL_EXEC)
#define XA_FORM1_DIR (XA_ATTR_DIRECTORY | XA_ATTR_MODE2FORM1 | XA_PERM_ALL_ALL)
#define XA_FORM1_FILE (XA_ATTR_MODE2FORM1 | XA_PERM_ALL_ALL)
#define XA_FORM2_FILE (XA_ATTR_MODE2FORM2 | XA_PERM_ALL_ALL)
typedef struct iso9660_xa iso9660_xa_t; typedef struct iso9660_xa iso9660_xa_t;
struct iso9660_xa /* big endian!! */ struct iso9660_xa /* big endian!! */
@@ -55,3 +59,8 @@ struct iso9660_xa /* big endian!! */
uint8_t reserved[5]; /* zero */ uint8_t reserved[5]; /* zero */
} GNUC_PACKED; } GNUC_PACKED;
iso9660_xa_t *
iso9660_xa_init (iso9660_xa_t *_xa, uint16_t uid, uint16_t gid, uint16_t attr,
uint8_t filenum);

View File

@@ -1,4 +1,4 @@
# $Id: Makefile.am,v 1.10 2003/08/31 06:59:23 rocky Exp $ # $Id: Makefile.am,v 1.11 2003/08/31 08:32:40 rocky Exp $
# #
# Copyright (C) 2003 Rocky Bernstein <rocky@panix.com> # Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
# #
@@ -52,7 +52,6 @@ libiso9660_la_SOURCES = \
iso9660.c \ iso9660.c \
iso9660_private.h \ iso9660_private.h \
iso9660_fs.c \ iso9660_fs.c \
iso9660_fs.h \ xa.c
xa.h
INCLUDES = -I$(LIBCDIO_CFLAGS) INCLUDES = -I$(LIBCDIO_CFLAGS)

View File

@@ -1,5 +1,5 @@
/* /*
$Id: iso9660_fs.c,v 1.1 2003/08/31 06:59:23 rocky Exp $ $Id: iso9660_fs.c,v 1.2 2003/08/31 08:32:40 rocky Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org> Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
@@ -27,11 +27,14 @@
#include <cdio/cdio.h> #include <cdio/cdio.h>
#include <cdio/iso9660.h> #include <cdio/iso9660.h>
#include <cdio/util.h>
/* Private headers */ /* Private headers */
#include "iso9660_fs.h" #include "cdio_assert.h"
#include "bytesex.h"
#include "ds.h"
static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.1 2003/08/31 06:59:23 rocky Exp $"; static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.2 2003/08/31 08:32:40 rocky Exp $";
#define BUF_COUNT 16 #define BUF_COUNT 16
#define BUF_SIZE 80 #define BUF_SIZE 80

59
lib/xa.c Normal file
View File

@@ -0,0 +1,59 @@
/*
$Id: xa.c,v 1.1 2003/08/31 08:32:40 rocky Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003 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
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
/* Public headers */
#include <cdio/iso9660.h>
#include <cdio/util.h>
/* Private headers */
#include "cdio_assert.h"
#include "bytesex.h"
#define iso9660_xa_t_SIZEOF 14
iso9660_xa_t *
iso9660_xa_init (iso9660_xa_t *_xa, uint16_t uid, uint16_t gid, uint16_t attr,
uint8_t filenum)
{
cdio_assert (_xa != NULL);
_xa->user_id = uint16_to_be (uid);
_xa->group_id = uint16_to_be (gid);
_xa->attributes = uint16_to_be (attr);
_xa->signature[0] = 'X';
_xa->signature[1] = 'A';
_xa->filenum = filenum;
_xa->reserved[0]
= _xa->reserved[1]
= _xa->reserved[2]
= _xa->reserved[3]
= _xa->reserved[4] = 0x00;
return _xa;
}

114
lib/xa.h
View File

@@ -1,114 +0,0 @@
/*
$Id: xa.h,v 1.1 2003/08/31 06:59:23 rocky Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003 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
*/
#ifndef __CDIO_XA_H__
#define __CDIO_XA_H__
/* Public headers */
#include <cdio/types.h>
#include <cdio/util.h>
#include <cdio/iso9660.h>
/* Private headers */
#include "cdio_assert.h"
#include "bytesex.h"
/* XA attribute definitions */
#define XA_ATTR_U_READ (1 << 0)
/* reserved */
#define XA_ATTR_U_EXEC (1 << 2)
/* reserved */
#define XA_ATTR_G_READ (1 << 4)
/* reserved */
#define XA_ATTR_G_EXEC (1 << 6)
/* reserved */
#define XA_ATTR_O_READ (1 << 8)
/* reserved */
#define XA_ATTR_O_EXEC (1 << 10)
#define XA_ATTR_MODE2FORM1 (1 << 11)
#define XA_ATTR_MODE2FORM2 (1 << 12)
#define XA_ATTR_INTERLEAVED (1 << 13)
#define XA_ATTR_CDDA (1 << 14)
#define XA_ATTR_DIRECTORY (1 << 15)
/* some aggregations */
#define XA_PERM_ALL_READ (XA_ATTR_U_READ | XA_ATTR_G_READ | XA_ATTR_O_READ)
#define XA_PERM_ALL_EXEC (XA_ATTR_U_EXEC | XA_ATTR_G_EXEC | XA_ATTR_O_EXEC)
#define XA_PERM_ALL_ALL (XA_PERM_ALL_READ | XA_PERM_ALL_EXEC)
/* the struct */
PRAGMA_BEGIN_PACKED
typedef struct /* big endian!! */
{
uint16_t user_id; /* 0 */
uint16_t group_id; /* 0 */
uint16_t attributes; /* XA_ATTR_ */
uint8_t signature[2]; /* { 'X', 'A' } */
uint8_t filenum; /* file number, see also XA subheader */
uint8_t reserved[5]; /* zero */
} GNUC_PACKED iso9660_xa_t;
PRAGMA_END_PACKED
struct iso9660_stat {
enum { _STAT_FILE = 1, _STAT_DIR = 2 } type;
lsn_t lsn; /* start logical sector number */
uint32_t size; /* total size in bytes */
uint32_t secsize; /* number of sectors allocated */
iso9660_xa_t xa; /* XA attributes */
};
#define iso9660_xa_t_SIZEOF 14
static inline iso9660_xa_t *
iso9660_xa_new (void)
{
return _cdio_malloc (sizeof (iso9660_xa_t));
}
static inline iso9660_xa_t *
iso9660_xa_init (iso9660_xa_t *_xa, uint16_t uid, uint16_t gid, uint16_t attr,
uint8_t filenum)
{
cdio_assert (_xa != NULL);
_xa->user_id = uint16_to_be (uid);
_xa->group_id = uint16_to_be (gid);
_xa->attributes = uint16_to_be (attr);
_xa->signature[0] = 'X';
_xa->signature[1] = 'A';
_xa->filenum = filenum;
_xa->reserved[0]
= _xa->reserved[1]
= _xa->reserved[2]
= _xa->reserved[3]
= _xa->reserved[4] = 0x00;
return _xa;
}
#endif /* __VCD_XA_H__ */

View File

@@ -1,5 +1,5 @@
/* /*
$Id: cd-info.c,v 1.25 2003/08/31 06:59:23 rocky Exp $ $Id: cd-info.c,v 1.26 2003/08/31 08:32:40 rocky Exp $
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com> Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
Copyright (C) 1996,1997,1998 Gerd Knorr <kraxel@bytesex.org> Copyright (C) 1996,1997,1998 Gerd Knorr <kraxel@bytesex.org>
@@ -55,8 +55,9 @@
#include <cdio/cd_types.h> #include <cdio/cd_types.h>
#include <cdio/iso9660.h> #include <cdio/iso9660.h>
#include "cdio_assert.h"
#include "bytesex.h"
#include "ds.h" #include "ds.h"
#include "xa.h"
#include "iso9660_private.h" #include "iso9660_private.h"
#include <fcntl.h> #include <fcntl.h>

View File

@@ -9,3 +9,20 @@ CD-ROM Track List (1 - 1)
__________________________________ __________________________________
CD Analysis Report CD Analysis Report
Audio CD, CDDB disc ID is 02000401 Audio CD, CDDB disc ID is 02000401
lt-cd-info: Found 1 matches in CDDB
Disc ID: 02000401
CDDB category: blues (6)
Music genre: 'Rock'
Year: 0
Artist: 'White Zombie'
Title: 'Living Dead Girl'
Extended data: ' ID3G: 17'
Length: 6 seconds
Number of tracks: 1
Track 1
number: 1
frame offset: 150
length: 4 seconds
artist: 'White Zombie'
title: 'hit mania dance champions 2001'
extended data: ''

View File

@@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
#$Id: check_cue.sh.in,v 1.5 2003/08/31 06:59:23 rocky Exp $ #$Id: check_cue.sh.in,v 1.6 2003/08/31 08:32:40 rocky Exp $
if test -n "@CDDB_LIB@" ; then if test -z "@CDDB_LIB@" ; then
cddb_opt='--no-cddb' cddb_opt='--no-cddb'
fi fi
if test -n "@VCDINFO_LIBS@" ; then if test -z "@VCDINFO_LIBS@" ; then
vcd_opt='--no-vcd' vcd_opt='--no-vcd'
else else
vcd_opt='--iso9660' vcd_opt='--iso9660'

View File

@@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
#$Id: check_nrg.sh.in,v 1.4 2003/08/31 06:59:23 rocky Exp $ #$Id: check_nrg.sh.in,v 1.5 2003/08/31 08:32:40 rocky Exp $
if test -n "@VCDINFO_LIBS@" ; then if test -z "@VCDINFO_LIBS@" ; then
vcd_opt='--no-vcd' vcd_opt='--no-vcd'
else else
vcd_opt='--iso9660' vcd_opt='--iso9660'

View File

@@ -56,5 +56,16 @@ ISO9660 filesystem
- ----1xrxrxr 0 0 [fn 00] [LSN 184] 24 PSD.VCD;1 - ----1xrxrxr 0 0 [fn 00] [LSN 184] 24 PSD.VCD;1
XA sectors Video CD XA sectors Video CD
format: VCD 2.0
album id: `'
volume count: 1
volume number: 1
system id: `CD-RTOS CD-BRIDGE'
volume id: `MONVOISIN'
volumeset id: `'
publisher id: `'
preparer id: `'
application id: `CDI/CDI_VCD.APP;1'
session #2 starts at track 2, LSN: 1251, ISO 9660 blocks: 1101 session #2 starts at track 2, LSN: 1251, ISO 9660 blocks: 1101
ISO 9660: 1101 blocks, label `MONVOISIN ' ISO 9660: 1101 blocks, label `MONVOISIN '

View File

@@ -81,5 +81,16 @@ ISO9660 filesystem
- ----1xrxrxr 0 0 [fn 00] [LSN 184] 72 PSD.VCD;1 - ----1xrxrxr 0 0 [fn 00] [LSN 184] 72 PSD.VCD;1
XA sectors Video CD XA sectors Video CD
format: VCD 2.0
album id: `LOEKI'
volume count: 1
volume number: 1
system id: `CD-RTOS CD-BRIDGE'
volume id: `V0469'
volumeset id: `'
publisher id: `LAURENS KOEHOORN'
preparer id: `LKVCDIMAGER 5.0.7.10(WIN32)'
application id: `'
session #2 starts at track 2, LSN: 1182, ISO 9660 blocks: 1032 session #2 starts at track 2, LSN: 1182, ISO 9660 blocks: 1032
ISO 9660: 1032 blocks, label `V0469 ' ISO 9660: 1032 blocks, label `V0469 '