README
上传用户:aoeyumen
上传日期:2007-01-06
资源大小:3329k
文件大小:3k
- This module, dvd_udf, can be used to access DVD Video discs or
- image files in the same format.
- The Makefile is more a dummy Makefile, it just compiles the
- two object files. The use of this module is to include it in
- a project of your own, e.g. a DVD Video Navigator.
- _____________________________________________________________________
- How to access UDF
- First, you have to open the block device of the disc, or the
- image file with UDFOpenDisc(). It returns a positive file
- number on success, or -1 on error
- Then, you can use UDFFindFile() to search files in the UDF
- directory tree on that disc. Pass the complete, absolute
- filename as parameter.
- UDFFindFile() incorporates the process described in part
- 6.9.2 "How to read a UDF disc" of chapter 6.9 "Requirements
- for DVD-ROM" of the OSTA Universal Disk Format Specification,
- Revision 1.02 (www.osta.org) (actually, it spells "Univeral"
- on the first page of their PDF. Obviously since 1995. Check
- it out yourself.)
- Another function, UDFReadLB() is provided to access the data
- on the disc. Pass the number of the first block and the amount
- of blocks to read, and a pointer to enough allocated memory
- to hold the read data.
- simplified example:
- #include "dvd_udf.h"
- int filenumber;
- unsigned long int lbnum;
- unsigned char data[DVD_VIDEO_LB_LEN];
- if ((filenumber=UDFOpenDisc("/dev/dvd"))>=0) {
- if ((lbnum=UDFFindFile("/VIDEO_TS/VIDEO_TS.IFO"))) {
- if (UDFReadLB(lbnum,1,data)) {
- /* parse first block of VIDEO_TS.IFO in data[] */
- }
- }
- }
- _____________________________________________________________________
- CSS - The DVD Content Scrambling System
- The CSS authorisation requires the DVD extension to the
- CD-ROM driver, available for linux from www.kernel.dk
- Without this support, an error -2 will be returned by
- all CSS functions.
- Receiving an error can also mean, that the DVD disc is
- not CSS encrypted.
- Example of a CSS authorisation, requires a licensed DVD decoder:
- // CSS key exchange
- // disc: 0=disable/bypass, 1=disc key, 2=title key
- // lba: logical block address of title
- int CSS(int disc, u32 lba) {
- char CSSdata[2048];
- int agid;
- if (!disc) return (DecoderCSSBypass())?-1:0;
- if ((agid=UDFCSSRequestAGID())<0) return -1;
- if (DecoderCSSDriveAuthChallenge((disc==1),CSSdata)) return -1;
- if (UDFCSSDriveAuth(CSSdata)<0) return -1;
- if (DecoderCSSDriveAuthResponse((disc==1),CSSdata)) return -1;
- if (UDFCSSHostAuthChallenge(CSSdata)<0) return -1;
- if (DecoderCSSHostAuth((disc==1),CSSdata)) return -1;
- if (UDFCSSHostAuthResponse(CSSdata)<0) return -1;
- if (disc==1) {
- if (UDFCSSDiscKey(CSSdata)<0) return -1;
- if (DecoderCSSDiscKey(CSSdata)) return -1;
- } else if (disc==2) {
- if (UDFCSSTitleKey(lba,CSSdata)<0) return -1;
- if (DecoderCSSTitleKey(CSSdata)) return -1;
- }
- return 0;
- }
- _____________________________________________________________________
- Version history:
- 19991115 (chw)
- Functions UDFReadLB(), UDFFindFile() and UDFOpenDisc() implemented.
- 19991124 (chw)
- Added CSS support
- moved _LARGEFILE64_SOURCE from .h into .c (duh!)
- removed stricmp package, using strcasecmp now.
-