📄 files_private.h
字号:
/* $Id: files_private.h,v 1.3 2006/09/26 21:16:59 dgp85 Exp $ Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org> (C) 2000 Jens B. Jorgensen <jbj1@ultraemail.net> 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 __VCD_FILES_PRIVATE_H__#define __VCD_FILES_PRIVATE_H__#include <libvcd/files.h>#include <libvcd/types.h>/* random note: most stuff is big endian here */#define ENTRIES_ID_VCD "ENTRYVCD"#define ENTRIES_ID_VCD3 "ENTRYSVD"#define ENTRIES_ID_SVCD "ENTRYVCD" /* not ENTRYSVD! */#define ENTRIES_VERSION_VCD 0x01#define ENTRIES_SPTAG_VCD 0x00 #define ENTRIES_VERSION_VCD11 0x01#define ENTRIES_SPTAG_VCD11 0x00 #define ENTRIES_VERSION_VCD2 0x02#define ENTRIES_SPTAG_VCD2 0x00#define ENTRIES_VERSION_SVCD 0x01#define ENTRIES_SPTAG_SVCD 0x00#define ENTRIES_VERSION_HQVCD 0x01#define ENTRIES_SPTAG_HQVCD 0x00PRAGMA_BEGIN_PACKEDtypedef struct _EntriesVcd_tag { char ID[8]; /* "ENTRYVCD" */ uint8_t version; /* 0x02 --- VCD2.0 0x01 --- SVCD, should be same as version in INFO.SVD */ uint8_t sys_prof_tag; /* 0x01 if VCD1.1 0x00 else */ uint16_t entry_count; /* 1 <= tracks <= 500 */ struct { /* all fields are BCD */ uint8_t n; /* cd track no 2 <= n <= 99 */ msf_t msf; } GNUC_PACKED entry[MAX_ENTRIES]; uint8_t reserved2[36]; /* RESERVED, must be 0x00 */} GNUC_PACKED _EntriesVcd; /* sector 00:04:01 */#define EntriesVcd_SIZEOF ISO_BLOCKSIZE#define INFO_ID_VCD "VIDEO_CD"#define INFO_ID_SVCD "SUPERVCD"#define INFO_ID_HQVCD "HQ-VCD "#define INFO_VERSION_VCD 0x01#define INFO_SPTAG_VCD 0x00 #define INFO_VERSION_VCD11 0x01#define INFO_SPTAG_VCD11 0x01 #define INFO_VERSION_VCD2 0x02#define INFO_SPTAG_VCD2 0x00 #define INFO_VERSION_SVCD 0x01#define INFO_SPTAG_SVCD 0x00#define INFO_VERSION_HQVCD 0x01#define INFO_SPTAG_HQVCD 0x01#define INFO_OFFSET_MULT 0x08/* This one-byte field describes certain characteristics of the disc */typedef struct {#if defined(BITFIELD_LSBF) bool reserved1 : 1; /* Reserved, must be zero */ bitfield_t restriction : 2; /* restriction, eg. "unsuitable for kids": 0x0 ==> unrestricted, 0x1 ==> restricted category 1, 0x2 ==> restricted category 2, 0x3 ==> restricted category 3 */ bool special_info : 1; /* Special Information is encoded in the pictures */ bool user_data_cc : 1; /* MPEG User Data is used for Closed Caption */ bool use_lid2 : 1; /* If == 1 and the PSD is interpreted and the next disc has the same album id then start the next disc at List ID #2, otherwise List ID #1 */ bool use_track3 : 1; /* If == 1 and the PSD is not interpreted and next disc has same album id, then start next disc with track 3, otherwise start with track 2 */ bool pbc_x : 1; /* extended PBC available */#else bool pbc_x : 1; bool use_track3 : 1; bool use_lid2 : 1; bool user_data_cc : 1; bool special_info : 1; bitfield_t restriction : 2; bool reserved1 : 1;#endif} GNUC_PACKED InfoStatusFlags;#define InfoStatusFlags_SIZEOF 1enum { VCD_FILES_VIDEO_NOSTREAM = 0, VCD_FILES_VIDEO_NTSC_STILL = 1, VCD_FILES_VIDEO_NTSC_STILL2 = 2, VCD_FILES_VIDEO_NTSC_MOTION = 3, VCD_FILES_VIDEO_PAL_STILL = 5, VCD_FILES_VIDEO_PAL_STILL2 = 6, VCD_FILES_VIDEO_PAL_MOTION = 7};typedef struct {#if defined(BITFIELD_LSBF) bitfield_t audio_type : 2; /* Audio characteristics: 0x0 - No MPEG audio stream 0x1 - One MPEG1 or MPEG2 audio stream without extension 0x2 - Two MPEG1 or MPEG2 audio streams without extension 0x3 - One MPEG2 multi-channel audio stream w/ extension*/ bitfield_t video_type : 3; /* Video characteristics: 0x0 - No MPEG video data 0x1 - NTSC still picture 0x2 - Reserved (NTSC hires?) 0x3 - NTSC motion picture 0x4 - Reserved 0x5 - PAL still picture 0x6 - Reserved (PAL hires?) 0x7 - PAL motion picture */ bool item_cont : 1; /* Indicates segment is continuation 0x0 - 1st or only segment of item 0x1 - 2nd or later segment of item */ bitfield_t ogt : 2; /* 0x0 - no OGT substream 0x1 - sub-stream 0 available 0x2 - sub-stream 0 & 1 available 0x3 - all OGT sub-substreams available */#else bitfield_t ogt : 2; bool item_cont : 1; bitfield_t video_type : 3; bitfield_t audio_type : 2;#endif} GNUC_PACKED InfoSpiContents;#define InfoSpiContents_SIZEOF 1typedef struct _InfoVcd_tag { char ID[8]; /* const "VIDEO_CD" for VCD, "SUPERVCD" or "HQ-VCD " for SVCD */ uint8_t version; /* 0x02 -- VCD2.0, 0x01 for SVCD and VCD1.x */ uint8_t sys_prof_tag; /* System Profile Tag, used to define the set of mandatory parts to be applied for compatibility; 0x00 for "SUPERVCD", 0x01 for "HQ-VCD ", 0x0n for VCDx.n */ char album_desc[16]; /* album identification/desc. */ uint16_t vol_count; /* number of volumes in album */ uint16_t vol_id; /* number id of this volume in album */ uint8_t pal_flags[13]; /* bitset of 98 PAL(=set)/NTSC flags */ InfoStatusFlags flags; /* status flags bit field */ uint32_t psd_size; /* size of PSD.VCD file */ msf_t first_seg_addr; /* first segment addresses, coded BCD The location of the first sector of the Segment Play Item Area, in the form mm:ss:00. Must be 00:00:00 if the PSD size is 0. */ uint8_t offset_mult; /* offset multiplier, must be 8 */ uint16_t lot_entries; /* offsets in lot */ uint16_t item_count; /* segments used for segmentitems */ InfoSpiContents spi_contents[MAX_SEGMENTS]; /* The next 1980 bytes contain one byte for each possible segment play item. Each byte indicates contents. */ uint16_t playing_time[5]; /* in seconds */ char reserved[2]; /* Reserved, must be zero */} GNUC_PACKED _InfoVcd;#define InfoVcd_SIZEOF ISO_BLOCKSIZE/* LOT.VCD This optional file is only necessary if the PSD size is not zero. This List ID Offset Table allows you to start playing the PSD from lists other than the default List ID number. This table has a fixed length of 32 sectors and maps List ID numbers into List Offsets. It's got an entry for each List ID Number with the 16-bit offset. Note that List ID 1 has an offset of 0x0000. All unused or non-user-accessible entries must be 0xffff. */#define LOT_VCD_OFFSETS ((1 << 15)-1)typedef struct _LotVcd_tag { uint16_t reserved; /* Reserved, must be zero */ uint16_t offset[LOT_VCD_OFFSETS]; /* offset given in 8 byte units */} GNUC_PACKED _LotVcd;#define LotVcd_SIZEOF (32*ISO_BLOCKSIZE)/* PSD.VCD The PSD controls the "user interaction" mode which can be used to make menus, etc. The PSD contains a set of Lists. Each List defines a set of Items which are played in sequence. An Item can be an mpeg track (in whole or part) or a Segment Play Item which can subsequently be mpeg video with or without audio, one more more mpeg still pictures (with or without audio) or mpeg audio only. The Selection List defines the action to be taken in response to a set of defined user actions: Next, Previous, Default Select, Numeric, Return. The End List terminates the control flow or switches to the next disc volume. Each list has a unique list id number. The first must be 1, the others can be anything (up to 32767). References to PSD list addresses are expressed as an offset into the PSD file. The offset indicated in the file must be multiplied by the Offset Multiplier found in the info file (although this seems to always have to be 8). Unused areas are filled with zeros. List ID 1 starts at offset 0.*//* ...difficult to represent as monolithic C struct... */typedef struct { uint8_t type; /* PSD_TYPE_END_LIST */ uint8_t next_disc; /* 0x00 to stop PBC or 0xnn to switch to disc no nn */ uint16_t change_pic; /* 0 or 1000..2979, should be still image */ uint8_t reserved[4]; /* padded with 0x00 */} GNUC_PACKED PsdEndListDescriptor;#define PsdEndListDescriptor_SIZEOF 8typedef struct {#if defined(BITFIELD_LSBF) bool SelectionAreaFlag : 1; bool CommandListFlag : 1; bitfield_t reserved : 6;#else bitfield_t reserved : 6; bool CommandListFlag : 1; bool SelectionAreaFlag : 1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -