README.dvd_file
上传用户:aoeyumen
上传日期:2007-01-06
资源大小:3329k
文件大小:3k
- This module, dvd_file, can be used to access DVD Video discs
- mounted onto the filesystem, e.g. an udf mounted DVD-ROM.
- This access does not place restrictions on the physical
- order of files or blocks on the medium, as direct DVD Video
- access does. As a direct result of this, CSS is not working.
- Only unencrypted DVD Video discs can be played.
- The Makefile is more a dummy Makefile, it just compiles the
- object file. The use of this module is to include it in
- a project of your own, e.g. a DVD Video Navigator.
- _____________________________________________________________________
- How to access The DVD Video
- First, you have to tell where the disc resides in the filesystem.
- Pass the path to or into the VIDEO_TS directory (not case sensitive),
- as well as the requested block size (for DVD Video: 2048) to
- FileSetVideoPath(). Unless the path is set successfully, all
- other functions return with an error.
- Then, you can use FileReadVMGM(), FileReadVTSM() and FileReadVTS()
- to read a single block of VIDEO_TS.VOB, VTS_xx_0.VOB and VTS_xx_y.VOB,
- respectively. Where xx is the video title set number ('vtsn'),
- and y the segment number 1 to 9 of the title file. The segment
- number is determined automatically from the block number.
- 'lbnum' is the number of the block to read, relative to the
- beginning of the file and starting from 0.
- 'data' has to point to at least 2048 bytes allocated memory.
- simplified example:
- #include "DVDPlayerAPI.h"
- #include "dvd_file.h"
- #define LB_LEN 2048 // Length of one logical block in bytes
- int vtsn; // current video title set number
- u32 lbn; // logical block number currently being played
- u32 vobu_ea; // last block of current VOBU
- DVDDomainID Domain;
- unsigned char LB[LB_LEN];
- int InfoFileParser(int VTS_number, void *infostruct) {
- int blocks;
- u8 *infodata;
- int bup=0; // do we use the backup?
- int request;
- if ((VTS_number<0) || (VTS_number>99)) return 1; // illegal title number
- request=((VTS_number)?2:1);
- while (1) {
- if (!(blocks=FileReadIFO(VTS_number,bup,&infodata))) return 1;
- if (ParseInfo(infodata,infostruct)!=request) { // not provided here
- free(infodata);
- if (bup++) return 1;
- continue;
- } else {
- return 0;
- }
- }
- }
- void Play() {
- int err;
- switch (Domain) {
- case DVDDomainVideoManagerMenu:
- err=FileReadVMGM(lbn,LB);
- break;
- case DVDDomainVideoTitleSetMenu:
- err=FileReadVTSM(vtsn,lbn,LB);
- break;
- case DVDDomainTitle:
- err=FileReadVTS(vtsn,lbn,LB);
- break;
- default:
- lbn=vobu_ea;
- err=1;
- break;
- }
- if (!err) {
- err=parse_LB(LB); // function not included in example
- }
- ps.lbn++;
- }
- int main (int argc, char* argv[]) {
- FileSetVideoPath(argv[1],LB_LEN);
- InfoFileParser(0,vmgi);
- // now, insert lots of magical dvd menu stuff.
- // results in "play title 1", for example.
- vtsn=1;
- InfoFileParser(vtsn,vtsi);
- Domain=DVDDomainTitle; // this is done magically
- lbn=0; // this as well. actual numbers may vary.
- while (ps.lbn<=vobu_ea) Play();
- }
-
- _____________________________________________________________________
- Version history:
- 19991209 (chw)
- First release.
-
-