[DVDnav-discuss] r1162 - in trunk/libdvdread: Makefile src/Makefile.am src/bitreader.c src/bitreader.h src/dvd_input.c src/dvd_reader.c src/dvd_reader.h src/dvd_udf.c src/dvd_udf.h src/dvdread src/dvdread/bitreader...

reimar subversion at mplayerhq.hu
Wed Dec 31 09:43:04 CET 2008


Author: reimar
Date: Wed Dec 31 09:43:03 2008
New Revision: 1162

Log:
Move installed headers into dvdread directory to make them easier to
use in a consistent way without installing.

Added:
   trunk/libdvdread/src/dvdread/
   trunk/libdvdread/src/dvdread/bitreader.h   (props changed)
      - copied unchanged from r1159, trunk/libdvdread/src/bitreader.h
   trunk/libdvdread/src/dvdread/dvd_reader.h   (props changed)
      - copied unchanged from r1159, trunk/libdvdread/src/dvd_reader.h
   trunk/libdvdread/src/dvdread/dvd_udf.h   (contents, props changed)
      - copied, changed from r1159, trunk/libdvdread/src/dvd_udf.h
   trunk/libdvdread/src/dvdread/ifo_print.h   (props changed)
      - copied unchanged from r1159, trunk/libdvdread/src/ifo_print.h
   trunk/libdvdread/src/dvdread/ifo_read.h   (contents, props changed)
      - copied, changed from r1159, trunk/libdvdread/src/ifo_read.h
   trunk/libdvdread/src/dvdread/ifo_types.h   (contents, props changed)
      - copied, changed from r1159, trunk/libdvdread/src/ifo_types.h
   trunk/libdvdread/src/dvdread/nav_print.h   (props changed)
      - copied unchanged from r1159, trunk/libdvdread/src/nav_print.h
   trunk/libdvdread/src/dvdread/nav_read.h   (props changed)
      - copied unchanged from r1159, trunk/libdvdread/src/nav_read.h
   trunk/libdvdread/src/dvdread/nav_types.h   (props changed)
      - copied unchanged from r1159, trunk/libdvdread/src/nav_types.h
Deleted:
   trunk/libdvdread/src/bitreader.h
   trunk/libdvdread/src/dvd_reader.h
   trunk/libdvdread/src/dvd_udf.h
   trunk/libdvdread/src/ifo_print.h
   trunk/libdvdread/src/ifo_read.h
   trunk/libdvdread/src/ifo_types.h
   trunk/libdvdread/src/nav_print.h
   trunk/libdvdread/src/nav_read.h
   trunk/libdvdread/src/nav_types.h
Modified:
   trunk/libdvdread/Makefile
   trunk/libdvdread/src/Makefile.am
   trunk/libdvdread/src/bitreader.c
   trunk/libdvdread/src/dvd_input.c
   trunk/libdvdread/src/dvd_reader.c
   trunk/libdvdread/src/dvd_udf.c
   trunk/libdvdread/src/ifo_print.c
   trunk/libdvdread/src/ifo_read.c
   trunk/libdvdread/src/nav_print.c
   trunk/libdvdread/src/nav_read.c

Modified: trunk/libdvdread/Makefile
==============================================================================
--- trunk/libdvdread/Makefile	Wed Dec 31 09:41:23 2008	(r1161)
+++ trunk/libdvdread/Makefile	Wed Dec 31 09:43:03 2008	(r1162)
@@ -18,15 +18,15 @@ DVDREAD_L=libdvdread
 DVDREAD_LIB = $(DVDREAD_L).a
 DVDREAD_SHLIB = $(DVDREAD_L).so
 VPATH+= $(SRC_PATH_BARE)/src
-DVDREAD_HEADERS = src/dvd_reader.h \
-	src/ifo_print.h \
-	src/ifo_read.h \
-	src/ifo_types.h \
-	src/nav_print.h \
-	src/nav_read.h \
-	src/dvd_udf.h \
-	src/nav_types.h \
-	src/bitreader.h
+DVDREAD_HEADERS = src/dvdread/dvd_reader.h \
+	src/dvdread/ifo_print.h \
+	src/dvdread/ifo_read.h \
+	src/dvdread/ifo_types.h \
+	src/dvdread/nav_print.h \
+	src/dvdread/nav_read.h \
+	src/dvdread/dvd_udf.h \
+	src/dvdread/nav_types.h \
+	src/dvdread/bitreader.h
 DVDREAD_SRCS = dvd_input.c dvd_reader.c dvd_udf.c ifo_print.c ifo_read.c \
 	md5.c nav_print.c nav_read.c bitreader.c
 CFLAGS += -I$(SRC_PATH)/src

Modified: trunk/libdvdread/src/Makefile.am
==============================================================================
--- trunk/libdvdread/src/Makefile.am	Wed Dec 31 09:41:23 2008	(r1161)
+++ trunk/libdvdread/src/Makefile.am	Wed Dec 31 09:43:03 2008	(r1162)
@@ -15,5 +15,5 @@ libdvdread_la_LIBADD = $(DYNAMIC_LD_LIBS
 libdvdread_la_LDFLAGS = -version-info $(DVDREAD_LT_CURRENT):$(DVDREAD_LT_REVISION):$(DVDREAD_LT_AGE) \
 	-export-symbols-regex "(^dvd.*|^nav.*|^ifo.*|^DVD.*|^UDF.*)"
 
-include_HEADERS = dvd_reader.h nav_read.h ifo_read.h \
-	nav_print.h ifo_print.h ifo_types.h nav_types.h dvd_udf.h bitreader.h
+include_HEADERS = dvdread/dvd_reader.h dvdread/nav_read.h dvdread/ifo_read.h \
+	dvdread/nav_print.h dvdread/ifo_print.h dvdread/ifo_types.h dvdread/nav_types.h dvdread/dvd_udf.h dvdread/bitreader.h

Modified: trunk/libdvdread/src/bitreader.c
==============================================================================
--- trunk/libdvdread/src/bitreader.c	Wed Dec 31 09:41:23 2008	(r1161)
+++ trunk/libdvdread/src/bitreader.c	Wed Dec 31 09:43:03 2008	(r1162)
@@ -25,7 +25,7 @@
 #include <string.h>
 #include <inttypes.h>
 
-#include "bitreader.h"
+#include "dvdread/bitreader.h"
 
 int dvdread_getbits_init(getbits_state_t *state, uint8_t *start) {
   if ((state == NULL) || (start == NULL)) return 0;

Modified: trunk/libdvdread/src/dvd_input.c
==============================================================================
--- trunk/libdvdread/src/dvd_input.c	Wed Dec 31 09:41:23 2008	(r1161)
+++ trunk/libdvdread/src/dvd_input.c	Wed Dec 31 09:43:03 2008	(r1162)
@@ -26,7 +26,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-#include "dvd_reader.h"
+#include "dvdread/dvd_reader.h"
 #include "dvd_input.h"
 
 

Modified: trunk/libdvdread/src/dvd_reader.c
==============================================================================
--- trunk/libdvdread/src/dvd_reader.c	Wed Dec 31 09:41:23 2008	(r1161)
+++ trunk/libdvdread/src/dvd_reader.c	Wed Dec 31 09:43:03 2008	(r1162)
@@ -65,9 +65,9 @@ static inline int _private_gettimeofday(
 #include <mntent.h>
 #endif
 
-#include "dvd_udf.h"
+#include "dvdread/dvd_udf.h"
 #include "dvd_input.h"
-#include "dvd_reader.h"
+#include "dvdread/dvd_reader.h"
 #include "md5.h"
 
 #define DEFAULT_UDF_CACHE_LEVEL 1

Modified: trunk/libdvdread/src/dvd_udf.c
==============================================================================
--- trunk/libdvdread/src/dvd_udf.c	Wed Dec 31 09:41:23 2008	(r1161)
+++ trunk/libdvdread/src/dvd_udf.c	Wed Dec 31 09:43:03 2008	(r1162)
@@ -39,8 +39,8 @@
 #include <unistd.h>
 #include <inttypes.h>
 
-#include "dvd_reader.h"
-#include "dvd_udf.h"
+#include "dvdread/dvd_reader.h"
+#include "dvdread/dvd_udf.h"
 
 /* Private but located in/shared with dvd_reader.c */
 extern int UDFReadBlocksRaw( dvd_reader_t *device, uint32_t lb_number,

Copied: trunk/libdvdread/src/dvdread/bitreader.h (from r1159, trunk/libdvdread/src/bitreader.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/libdvdread/src/dvdread/bitreader.h	Wed Dec 31 09:43:03 2008	(r1162, copy of r1159, trunk/libdvdread/src/bitreader.h)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2000, 2001, 2002 Håkan Hjort <d95hjort at dtek.chalmers.se>.
+ *
+ * This file is part of libdvdread.
+ *
+ * libdvdread 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.
+ *
+ * libdvdread 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 libdvdread; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef LIBDVDREAD_BITREADER_H
+#define LIBDVDREAD_BITREADER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+  uint8_t *start;
+  uint32_t byte_position;
+  uint32_t bit_position;
+  uint8_t byte;
+} getbits_state_t;
+
+int dvdread_getbits_init(getbits_state_t *state, uint8_t *start);
+uint32_t dvdread_getbits(getbits_state_t *state, uint32_t number_of_bits);
+
+#ifdef __cplusplus
+};
+#endif
+#endif /* LIBDVDREAD_BITREADER_H */

Copied: trunk/libdvdread/src/dvdread/dvd_reader.h (from r1159, trunk/libdvdread/src/dvd_reader.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/libdvdread/src/dvdread/dvd_reader.h	Wed Dec 31 09:43:03 2008	(r1162, copy of r1159, trunk/libdvdread/src/dvd_reader.h)
@@ -0,0 +1,277 @@
+/*
+ * Copyright (C) 2001, 2002 Billy Biggs <vektor at dumbterm.net>,
+ *                          Håkan Hjort <d95hjort at dtek.chalmers.se>,
+ *                          Björn Englund <d4bjorn at dtek.chalmers.se>
+ *
+ * This file is part of libdvdread.
+ *
+ * libdvdread 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.
+ *
+ * libdvdread 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 libdvdread; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef LIBDVDREAD_DVD_READER_H
+#define LIBDVDREAD_DVD_READER_H
+
+#ifdef _MSC_VER
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#endif
+
+#include <sys/types.h>
+#include <inttypes.h>
+
+/**
+ * The DVD access interface.
+ *
+ * This file contains the functions that form the interface to to
+ * reading files located on a DVD.
+ */
+
+/**
+ * The current version.
+ */
+#define DVDREAD_VERSION 904
+
+/**
+ * The length of one Logical Block of a DVD.
+ */
+#define DVD_VIDEO_LB_LEN 2048
+
+/**
+ * Maximum length of filenames allowed in UDF.
+ */
+#define MAX_UDF_FILE_NAME_LEN 2048
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Opaque type that is used as a handle for one instance of an opened DVD.
+ */
+typedef struct dvd_reader_s dvd_reader_t;
+
+/**
+ * Opaque type for a file read handle, much like a normal fd or FILE *.
+ */
+typedef struct dvd_file_s dvd_file_t;
+
+/**
+ * Opens a block device of a DVD-ROM file, or an image file, or a directory
+ * name for a mounted DVD or HD copy of a DVD.
+ *
+ * If the given file is a block device, or is the mountpoint for a block
+ * device, then that device is used for CSS authentication using libdvdcss.
+ * If no device is available, then no CSS authentication is performed,
+ * and we hope that the image is decrypted.
+ *
+ * If the path given is a directory, then the files in that directory may be
+ * in any one of these formats:
+ *
+ *   path/VIDEO_TS/VTS_01_1.VOB
+ *   path/video_ts/vts_01_1.vob
+ *   path/VTS_01_1.VOB
+ *   path/vts_01_1.vob
+ *
+ * @param path Specifies the the device, file or directory to be used.
+ * @return If successful a a read handle is returned. Otherwise 0 is returned.
+ *
+ * dvd = DVDOpen(path);
+ */
+dvd_reader_t *DVDOpen( const char * );
+
+/**
+ * Closes and cleans up the DVD reader object.
+ *
+ * You must close all open files before calling this function.
+ *
+ * @param dvd A read handle that should be closed.
+ *
+ * DVDClose(dvd);
+ */
+void DVDClose( dvd_reader_t * );
+
+/**
+ *
+ */
+typedef enum {
+  DVD_READ_INFO_FILE,        /**< VIDEO_TS.IFO  or VTS_XX_0.IFO (title) */
+  DVD_READ_INFO_BACKUP_FILE, /**< VIDEO_TS.BUP  or VTS_XX_0.BUP (title) */
+  DVD_READ_MENU_VOBS,        /**< VIDEO_TS.VOB  or VTS_XX_0.VOB (title) */
+  DVD_READ_TITLE_VOBS        /**< VTS_XX_[1-9].VOB (title).  All files in
+                                  the title set are opened and read as a
+                                  single file. */
+} dvd_read_domain_t;
+
+/**
+ * Opens a file on the DVD given the title number and domain.
+ *
+ * If the title number is 0, the video manager information is opened
+ * (VIDEO_TS.[IFO,BUP,VOB]).  Returns a file structure which may be
+ * used for reads, or 0 if the file was not found.
+ *
+ * @param dvd  A dvd read handle.
+ * @param titlenum Which Video Title Set should be used, VIDEO_TS is 0.
+ * @param domain Which domain.
+ * @return If successful a a file read handle is returned, otherwise 0.
+ *
+ * dvd_file = DVDOpenFile(dvd, titlenum, domain); */
+dvd_file_t *DVDOpenFile( dvd_reader_t *, int, dvd_read_domain_t );
+
+/**
+ * Closes a file and frees the associated structure.
+ *
+ * @param dvd_file  The file read handle to be closed.
+ *
+ * DVDCloseFile(dvd_file);
+ */
+void DVDCloseFile( dvd_file_t * );
+
+/**
+ * Reads block_count number of blocks from the file at the given block offset.
+ * Returns number of blocks read on success, -1 on error.  This call is only
+ * for reading VOB data, and should not be used when reading the IFO files.
+ * When reading from an encrypted drive, blocks are decrypted using libdvdcss
+ * where required.
+ *
+ * @param dvd_file  A file read handle.
+ * @param offset Block offset from the start of the file to start reading at.
+ * @param block_count Number of block to read.
+ * @param data Pointer to a buffer to write the data into.
+ * @return Returns number of blocks read on success, -1 on error.
+ *
+ * blocks_read = DVDReadBlocks(dvd_file, offset, block_count, data);
+ */
+ssize_t DVDReadBlocks( dvd_file_t *, int, size_t, unsigned char * );
+
+/**
+ * Seek to the given position in the file.  Returns the resulting position in
+ * bytes from the beginning of the file.  The seek position is only used for
+ * byte reads from the file, the block read call always reads from the given
+ * offset.
+ *
+ * @param dvd_file  A file read handle.
+ * @param seek_offset Byte offset from the start of the file to seek to.
+ * @return The resulting position in bytes from the beginning of the file.
+ *
+ * offset_set = DVDFileSeek(dvd_file, seek_offset);
+ */
+int32_t DVDFileSeek( dvd_file_t *, int32_t );
+
+/**
+ * Reads the given number of bytes from the file.  This call can only be used
+ * on the information files, and may not be used for reading from a VOB.  This
+ * reads from and increments the currrent seek position for the file.
+ *
+ * @param dvd_file  A file read handle.
+ * @param data Pointer to a buffer to write the data into.
+ * @param bytes Number of bytes to read.
+ * @return Returns number of bytes read on success, -1 on error.
+ *
+ * bytes_read = DVDReadBytes(dvd_file, data, bytes);
+ */
+ssize_t DVDReadBytes( dvd_file_t *, void *, size_t );
+
+/**
+ * Returns the file size in blocks.
+ *
+ * @param dvd_file  A file read handle.
+ * @return The size of the file in blocks, -1 on error.
+ *
+ * blocks = DVDFileSize(dvd_file);
+ */
+ssize_t DVDFileSize( dvd_file_t * );
+
+/**
+ * Get a unique 128 bit disc ID.
+ * This is the MD5 sum of VIDEO_TS.IFO and the VTS_0?_0.IFO files
+ * in title order (those that exist).
+ * If you need a 'text' representation of the id, print it as a
+ * hexadecimal number, using lowercase letters, discid[0] first.
+ * I.e. the same format as the command-line 'md5sum' program uses.
+ *
+ * @param dvd A read handle to get the disc ID from
+ * @param discid The buffer to put the disc ID into. The buffer must
+ *               have room for 128 bits (16 chars).
+ * @return 0 on success, -1 on error.
+ */
+int DVDDiscID( dvd_reader_t *, unsigned char * );
+
+/**
+ * Get the UDF VolumeIdentifier and VolumeSetIdentifier
+ * from the PrimaryVolumeDescriptor.
+ *
+ * @param dvd A read handle to get the disc ID from
+ * @param volid The buffer to put the VolumeIdentifier into.
+ *              The VolumeIdentifier is latin-1 encoded (8bit unicode)
+ *              null terminated and max 32 bytes (including '\0')
+ * @param volid_size No more than volid_size bytes will be copied to volid.
+ *                   If the VolumeIdentifier is truncated because of this
+ *                   it will still be null terminated.
+ * @param volsetid The buffer to put the VolumeSetIdentifier into.
+ *                 The VolumeIdentifier is 128 bytes as
+ *                 stored in the UDF PrimaryVolumeDescriptor.
+ *                 Note that this is not a null terminated string.
+ * @param volsetid_size At most volsetid_size bytes will be copied to volsetid.
+ * @return 0 on success, -1 on error.
+ */
+int DVDUDFVolumeInfo( dvd_reader_t *, char *, unsigned int,
+                      unsigned char *, unsigned int );
+
+int DVDFileSeekForce( dvd_file_t *, int offset, int force_size);
+
+/**
+ * Get the ISO9660 VolumeIdentifier and VolumeSetIdentifier
+ *
+ * * Only use this function as fallback if DVDUDFVolumeInfo returns 0   *
+ * * this will happen on a disc mastered only with a iso9660 filesystem *
+ * * All video DVD discs have UDF filesystem                            *
+ *
+ * @param dvd A read handle to get the disc ID from
+ * @param volid The buffer to put the VolumeIdentifier into.
+ *              The VolumeIdentifier is coded with '0-9','A-Z','_'
+ *              null terminated and max 33 bytes (including '\0')
+ * @param volid_size No more than volid_size bytes will be copied to volid.
+ *                   If the VolumeIdentifier is truncated because of this
+ *                   it will still be null terminated.
+ * @param volsetid The buffer to put the VolumeSetIdentifier into.
+ *                 The VolumeIdentifier is 128 bytes as
+ *                 stored in the ISO9660 PrimaryVolumeDescriptor.
+ *                 Note that this is not a null terminated string.
+ * @param volsetid_size At most volsetid_size bytes will be copied to volsetid.
+ * @return 0 on success, -1 on error.
+ */
+int DVDISOVolumeInfo( dvd_reader_t *, char *, unsigned int,
+                      unsigned char *, unsigned int );
+
+/**
+ * Sets the level of caching that is done when reading from a device
+ *
+ * @param dvd A read handle to get the disc ID from
+ * @param level The level of caching wanted.
+ *             -1 - returns the current setting.
+ *              0 - UDF Cache turned off.
+ *              1 - (default level) Pointers to IFO files and some data from
+ *                  PrimaryVolumeDescriptor are cached.
+ *
+ * @return The level of caching.
+ */
+int DVDUDFCacheLevel( dvd_reader_t *, int );
+
+#ifdef __cplusplus
+};
+#endif
+#endif /* LIBDVDREAD_DVD_READER_H */

Copied and modified: trunk/libdvdread/src/dvdread/dvd_udf.h (from r1159, trunk/libdvdread/src/dvd_udf.h)
==============================================================================
--- trunk/libdvdread/src/dvd_udf.h	Sat Dec 13 15:27:51 2008	(r1159, copy source)
+++ trunk/libdvdread/src/dvdread/dvd_udf.h	Wed Dec 31 09:43:03 2008	(r1162)
@@ -33,7 +33,7 @@
 
 #include <inttypes.h>
 
-#include "dvd_reader.h"
+#include "dvdread/dvd_reader.h"
 
 #ifdef __cplusplus
 extern "C" {

Copied: trunk/libdvdread/src/dvdread/ifo_print.h (from r1159, trunk/libdvdread/src/ifo_print.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/libdvdread/src/dvdread/ifo_print.h	Wed Dec 31 09:43:03 2008	(r1162, copy of r1159, trunk/libdvdread/src/ifo_print.h)
@@ -0,0 +1,28 @@
+/*
+ * This file is part of libdvdread.
+ *
+ * libdvdread 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.
+ *
+ * libdvdread 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 libdvdread; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef LIBDVDREAD_IFO_PRINT_H
+#define LIBDVDREAD_IFO_PRINT_H
+
+#include <inttypes.h>
+#include "ifo_types.h"
+
+void ifo_print(dvd_reader_t *dvd, int title);
+void dvdread_print_time(dvd_time_t *dtime);
+
+#endif /* LIBDVDREAD_IFO_PRINT_H */

Copied and modified: trunk/libdvdread/src/dvdread/ifo_read.h (from r1159, trunk/libdvdread/src/ifo_read.h)
==============================================================================
--- trunk/libdvdread/src/ifo_read.h	Sat Dec 13 15:27:51 2008	(r1159, copy source)
+++ trunk/libdvdread/src/dvdread/ifo_read.h	Wed Dec 31 09:43:03 2008	(r1162)
@@ -23,7 +23,7 @@
 #define LIBDVDREAD_IFO_READ_H
 
 #include "ifo_types.h"
-#include "dvd_reader.h"
+#include "dvdread/dvd_reader.h"
 
 #ifdef __cplusplus
 extern "C" {

Copied and modified: trunk/libdvdread/src/dvdread/ifo_types.h (from r1159, trunk/libdvdread/src/ifo_types.h)
==============================================================================
--- trunk/libdvdread/src/ifo_types.h	Sat Dec 13 15:27:51 2008	(r1159, copy source)
+++ trunk/libdvdread/src/dvdread/ifo_types.h	Wed Dec 31 09:43:03 2008	(r1162)
@@ -23,7 +23,7 @@
 #define LIBDVDREAD_IFO_TYPES_H
 
 #include <inttypes.h>
-#include "dvd_reader.h"
+#include "dvdread/dvd_reader.h"
 
 
 #undef ATTRIBUTE_PACKED

Copied: trunk/libdvdread/src/dvdread/nav_print.h (from r1159, trunk/libdvdread/src/nav_print.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/libdvdread/src/dvdread/nav_print.h	Wed Dec 31 09:43:03 2008	(r1162, copy of r1159, trunk/libdvdread/src/nav_print.h)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2001, 2002 Billy Biggs <vektor at dumbterm.net>,
+ *                          Håkan Hjort <d95hjort at dtek.chalmers.se>
+ *
+ * This file is part of libdvdread.
+ *
+ * libdvdread 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.
+ *
+ * libdvdread 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 libdvdread; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef LIBDVDREAD_NAV_PRINT_H
+#define LIBDVDREAD_NAV_PRINT_H
+
+#include "nav_types.h"
+
+/**
+ * Pretty printing of the NAV packets, PCI and DSI structs.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Prints information contained in the PCI to stdout.
+ *
+ * @param pci Pointer to the PCI data structure to be printed.
+ */
+void navPrint_PCI(pci_t *);
+
+/**
+ * Prints information contained in the DSI to stdout.
+ *
+ * @param dsi Pointer to the DSI data structure to be printed.
+ */
+void navPrint_DSI(dsi_t *);
+
+#ifdef __cplusplus
+};
+#endif
+#endif /* LIBDVDREAD_NAV_PRINT_H */

Copied: trunk/libdvdread/src/dvdread/nav_read.h (from r1159, trunk/libdvdread/src/nav_read.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/libdvdread/src/dvdread/nav_read.h	Wed Dec 31 09:43:03 2008	(r1162, copy of r1159, trunk/libdvdread/src/nav_read.h)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2000, 2001, 2002 Håkan Hjort <d95hjort at dtek.chalmers.se>.
+ *
+ * This file is part of libdvdread.
+ *
+ * libdvdread 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.
+ *
+ * libdvdread 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 libdvdread; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef LIBDVDREAD_NAV_READ_H
+#define LIBDVDREAD_NAV_READ_H
+
+#include "nav_types.h"
+
+/**
+ * Parsing of NAV data, PCI and DSI parts.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Reads the PCI packet data pointed to into th pci struct.
+ *
+ * @param pci Pointer to the PCI data structure to be filled in.
+ * @param bufffer Pointer to the buffer of the on disc PCI data.
+ */
+void navRead_PCI(pci_t *, unsigned char *);
+
+/**
+ * Reads the DSI packet data pointed to into dsi struct.
+ *
+ * @param dsi Pointer to the DSI data structure to be filled in.
+ * @param bufffer Pointer to the buffer of the on disc DSI data.
+ */
+void navRead_DSI(dsi_t *, unsigned char *);
+
+#ifdef __cplusplus
+};
+#endif
+#endif /* LIBDVDREAD_NAV_READ_H */

Copied: trunk/libdvdread/src/dvdread/nav_types.h (from r1159, trunk/libdvdread/src/nav_types.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/libdvdread/src/dvdread/nav_types.h	Wed Dec 31 09:43:03 2008	(r1162, copy of r1159, trunk/libdvdread/src/nav_types.h)
@@ -0,0 +1,248 @@
+/*
+ * Copyright (C) 2000, 2001, 2002 Håkan Hjort <d95hjort at dtek.chalmers.se>
+ *
+ * The data structures in this file should represent the layout of the
+ * pci and dsi packets as they are stored in the stream.  Information
+ * found by reading the source to VOBDUMP is the base for the structure
+ * and names of these data types.
+ *
+ * VOBDUMP: a program for examining DVD .VOB files.
+ * Copyright 1998, 1999 Eric Smith <eric at brouhaha.com>
+ *
+ * VOBDUMP is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.  Note that I am not
+ * granting permission to redistribute or modify VOBDUMP under the terms
+ * of any later version of the General Public License.
+ *
+ * This program is distributed in the hope that it will be useful (or at
+ * least amusing), 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef LIBDVDREAD_NAV_TYPES_H
+#define LIBDVDREAD_NAV_TYPES_H
+
+#include <inttypes.h>
+#include "ifo_types.h" /* only dvd_time_t, vm_cmd_t and user_ops_t */
+
+/* The length including the substream id byte. */
+#define PCI_BYTES 0x3d4
+#define DSI_BYTES 0x3fa
+
+#define PS2_PCI_SUBSTREAM_ID 0x00
+#define PS2_DSI_SUBSTREAM_ID 0x01
+
+/* Remove this */
+#define DSI_START_BYTE 1031
+
+/**
+ * PCI General Information
+ */
+typedef struct {
+  uint32_t nv_pck_lbn;      /**< sector address of this nav pack */
+  uint16_t vobu_cat;        /**< 'category' of vobu */
+  uint16_t zero1;           /**< reserved */
+  user_ops_t vobu_uop_ctl;  /**< UOP of vobu */
+  uint32_t vobu_s_ptm;      /**< start presentation time of vobu */
+  uint32_t vobu_e_ptm;      /**< end presentation time of vobu */
+  uint32_t vobu_se_e_ptm;   /**< end ptm of sequence end in vobu */
+  dvd_time_t e_eltm;        /**< Cell elapsed time */
+  char vobu_isrc[32];
+} ATTRIBUTE_PACKED pci_gi_t;
+
+/**
+ * Non Seamless Angle Information
+ */
+typedef struct {
+  uint32_t nsml_agl_dsta[9];  /**< address of destination vobu in AGL_C#n */
+} ATTRIBUTE_PACKED nsml_agli_t;
+
+/**
+ * Highlight General Information
+ *
+ * For btngrX_dsp_ty the bits have the following meaning:
+ * 000b: normal 4/3 only buttons
+ * XX1b: wide (16/9) buttons
+ * X1Xb: letterbox buttons
+ * 1XXb: pan&scan buttons
+ */
+typedef struct {
+  uint16_t hli_ss; /**< status, only low 2 bits 0: no buttons, 1: different 2: equal 3: eual except for button cmds */
+  uint32_t hli_s_ptm;              /**< start ptm of hli */
+  uint32_t hli_e_ptm;              /**< end ptm of hli */
+  uint32_t btn_se_e_ptm;           /**< end ptm of button select */
+  unsigned int zero1 : 2;          /**< reserved */
+  unsigned int btngr_ns : 2;       /**< number of button groups 1, 2 or 3 with 36/18/12 buttons */
+  unsigned int zero2 : 1;          /**< reserved */
+  unsigned int btngr1_dsp_ty : 3;  /**< display type of subpic stream for button group 1 */
+  unsigned int zero3 : 1;          /**< reserved */
+  unsigned int btngr2_dsp_ty : 3;  /**< display type of subpic stream for button group 2 */
+  unsigned int zero4 : 1;          /**< reserved */
+  unsigned int btngr3_dsp_ty : 3;  /**< display type of subpic stream for button group 3 */
+  uint8_t btn_ofn;     /**< button offset number range 0-255 */
+  uint8_t btn_ns;      /**< number of valid buttons  <= 36/18/12 (low 6 bits) */
+  uint8_t nsl_btn_ns;  /**< number of buttons selectable by U_BTNNi (low 6 bits)   nsl_btn_ns <= btn_ns */
+  uint8_t zero5;       /**< reserved */
+  uint8_t fosl_btnn;   /**< forcedly selected button  (low 6 bits) */
+  uint8_t foac_btnn;   /**< forcedly activated button (low 6 bits) */
+} ATTRIBUTE_PACKED hl_gi_t;
+
+
+/**
+ * Button Color Information Table
+ * Each entry beeing a 32bit word that contains the color indexs and alpha
+ * values to use.  They are all represented by 4 bit number and stored
+ * like this [Ci3, Ci2, Ci1, Ci0, A3, A2, A1, A0].   The actual palette
+ * that the indexes reference is in the PGC.
+ * @TODO split the uint32_t into a struct
+ */
+typedef struct {
+  uint32_t btn_coli[3][2];  /**< [button color number-1][select:0/action:1] */
+} ATTRIBUTE_PACKED btn_colit_t;
+
+/**
+ * Button Information
+ *
+ * NOTE: I've had to change the structure from the disk layout to get
+ * the packing to work with Sun's Forte C compiler.
+ * The 4 and 7 bytes are 'rotated' was: ABC DEF GHIJ  is: ABCG DEFH IJ
+ */
+typedef struct {
+  unsigned int btn_coln         : 2;  /**< button color number */
+  unsigned int x_start          : 10; /**< x start offset within the overlay */
+  unsigned int zero1            : 2;  /**< reserved */
+  unsigned int x_end            : 10; /**< x end offset within the overlay */
+
+  unsigned int auto_action_mode : 2;  /**< 0: no, 1: activated if selected */
+  unsigned int y_start          : 10; /**< y start offset within the overlay */
+  unsigned int zero2            : 2;  /**< reserved */
+  unsigned int y_end            : 10; /**< y end offset within the overlay */
+
+  unsigned int zero3            : 2;  /**< reserved */
+  unsigned int up               : 6;  /**< button index when pressing up */
+  unsigned int zero4            : 2;  /**< reserved */
+  unsigned int down             : 6;  /**< button index when pressing down */
+  unsigned int zero5            : 2;  /**< reserved */
+  unsigned int left             : 6;  /**< button index when pressing left */
+  unsigned int zero6            : 2;  /**< reserved */
+  unsigned int right            : 6;  /**< button index when pressing right */
+  vm_cmd_t cmd;
+} ATTRIBUTE_PACKED btni_t;
+
+/**
+ * Highlight Information
+ */
+typedef struct {
+  hl_gi_t     hl_gi;
+  btn_colit_t btn_colit;
+  btni_t      btnit[36];
+} ATTRIBUTE_PACKED hli_t;
+
+/**
+ * PCI packet
+ */
+typedef struct {
+  pci_gi_t    pci_gi;
+  nsml_agli_t nsml_agli;
+  hli_t       hli;
+  uint8_t     zero1[189];
+} ATTRIBUTE_PACKED pci_t;
+
+
+
+
+/**
+ * DSI General Information
+ */
+typedef struct {
+  uint32_t nv_pck_scr;
+  uint32_t nv_pck_lbn;      /**< sector address of this nav pack */
+  uint32_t vobu_ea;         /**< end address of this VOBU */
+  uint32_t vobu_1stref_ea;  /**< end address of the 1st reference image */
+  uint32_t vobu_2ndref_ea;  /**< end address of the 2nd reference image */
+  uint32_t vobu_3rdref_ea;  /**< end address of the 3rd reference image */
+  uint16_t vobu_vob_idn;    /**< VOB Id number that this VOBU is part of */
+  uint8_t  zero1;           /**< reserved */
+  uint8_t  vobu_c_idn;      /**< Cell Id number that this VOBU is part of */
+  dvd_time_t c_eltm;        /**< Cell elapsed time */
+} ATTRIBUTE_PACKED dsi_gi_t;
+
+/**
+ * Seamless Playback Information
+ */
+typedef struct {
+  uint16_t category;       /**< 'category' of seamless VOBU */
+  uint32_t ilvu_ea;        /**< end address of interleaved Unit */
+  uint32_t ilvu_sa;        /**< start address of next interleaved unit */
+  uint16_t size;           /**< size of next interleaved unit */
+  uint32_t vob_v_s_s_ptm;  /**< video start ptm in vob */
+  uint32_t vob_v_e_e_ptm;  /**< video end ptm in vob */
+  struct {
+    uint32_t stp_ptm1;
+    uint32_t stp_ptm2;
+    uint32_t gap_len1;
+    uint32_t gap_len2;
+  } vob_a[8];
+} ATTRIBUTE_PACKED sml_pbi_t;
+
+/**
+ * Seamless Angle Infromation for one angle
+ */
+typedef struct {
+  uint32_t address; /**< offset to next ILVU, high bit is before/after */
+  uint16_t size;    /**< byte size of the ILVU pointed to by address */
+} ATTRIBUTE_PACKED sml_agl_data_t;
+
+/**
+ * Seamless Angle Infromation
+ */
+typedef struct {
+  sml_agl_data_t data[9];
+} ATTRIBUTE_PACKED sml_agli_t;
+
+/**
+ * VOBU Search Information
+ */
+typedef struct {
+  uint32_t next_video; /**< Next vobu that contains video */
+  uint32_t fwda[19];   /**< Forwards, time */
+  uint32_t next_vobu;
+  uint32_t prev_vobu;
+  uint32_t bwda[19];   /**< Backwards, time */
+  uint32_t prev_video;
+} ATTRIBUTE_PACKED vobu_sri_t;
+
+#define SRI_END_OF_CELL 0x3fffffff
+
+/**
+ * Synchronous Information
+ */
+typedef struct {
+  uint16_t a_synca[8];   /**< offset to first audio packet for this VOBU */
+  uint32_t sp_synca[32]; /**< offset to first subpicture packet */
+} ATTRIBUTE_PACKED synci_t;
+
+/**
+ * DSI packet
+ */
+typedef struct {
+  dsi_gi_t   dsi_gi;
+  sml_pbi_t  sml_pbi;
+  sml_agli_t sml_agli;
+  vobu_sri_t vobu_sri;
+  synci_t    synci;
+  uint8_t    zero1[471];
+} ATTRIBUTE_PACKED dsi_t;
+
+
+#if PRAGMA_PACK
+#pragma pack()
+#endif
+
+#endif /* LIBDVDREAD_NAV_TYPES_H */

Modified: trunk/libdvdread/src/ifo_print.c
==============================================================================
--- trunk/libdvdread/src/ifo_print.c	Wed Dec 31 09:41:23 2008	(r1161)
+++ trunk/libdvdread/src/ifo_print.c	Wed Dec 31 09:43:03 2008	(r1162)
@@ -24,9 +24,9 @@
 #include <ctype.h>
 #include <assert.h>
 
-#include "ifo_types.h"
-#include "ifo_read.h"
-#include "ifo_print.h"
+#include "dvdread/ifo_types.h"
+#include "dvdread/ifo_read.h"
+#include "dvdread/ifo_print.h"
 
 /* Put this in some other file / package?  It's used in nav_print too. */
 static void ifo_print_time(int level, dvd_time_t *dtime) {

Modified: trunk/libdvdread/src/ifo_read.c
==============================================================================
--- trunk/libdvdread/src/ifo_read.c	Wed Dec 31 09:41:23 2008	(r1161)
+++ trunk/libdvdread/src/ifo_read.c	Wed Dec 31 09:43:03 2008	(r1162)
@@ -28,11 +28,11 @@
 #include <string.h>
 
 #include "bswap.h"
-#include "ifo_types.h"
-#include "ifo_read.h"
-#include "dvd_reader.h"
+#include "dvdread/ifo_types.h"
+#include "dvdread/ifo_read.h"
+#include "dvdread/dvd_reader.h"
 #include "dvdread_internal.h"
-#include "bitreader.h"
+#include "dvdread/bitreader.h"
 
 #ifndef DVD_BLOCK_LEN
 #define DVD_BLOCK_LEN 2048

Modified: trunk/libdvdread/src/nav_print.c
==============================================================================
--- trunk/libdvdread/src/nav_print.c	Wed Dec 31 09:41:23 2008	(r1161)
+++ trunk/libdvdread/src/nav_print.c	Wed Dec 31 09:43:03 2008	(r1162)
@@ -28,9 +28,9 @@
 #include <stdio.h>
 #include <inttypes.h>
 
-#include "nav_types.h"
-#include "nav_print.h"
-#include "ifo_print.h"
+#include "dvdread/nav_types.h"
+#include "dvdread/nav_print.h"
+#include "dvdread/ifo_print.h"
 
 static void navPrint_PCI_GI(pci_gi_t *pci_gi) {
   int i;

Modified: trunk/libdvdread/src/nav_read.c
==============================================================================
--- trunk/libdvdread/src/nav_read.c	Wed Dec 31 09:41:23 2008	(r1161)
+++ trunk/libdvdread/src/nav_read.c	Wed Dec 31 09:43:03 2008	(r1162)
@@ -26,10 +26,10 @@
 #include <inttypes.h>
 
 #include "bswap.h"
-#include "nav_types.h"
-#include "nav_read.h"
+#include "dvdread/nav_types.h"
+#include "dvdread/nav_read.h"
 #include "dvdread_internal.h"
-#include "bitreader.h"
+#include "dvdread/bitreader.h"
 
 #define getbits_init dvdread_getbits_init
 #define getbits dvdread_getbits



More information about the DVDnav-discuss mailing list