README.dvd_decoder
上传用户:aoeyumen
上传日期:2007-01-06
资源大小:3329k
文件大小:3k
- This module, dvd_decoder, can be used to playback DVD Video media streams
- 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 play a DVD Video
- This dvd_decoder module is just a wrapper for the io-controls of the
- convergence/LSI Logic DVD Decoder Card. By changing dvd_decoder.c to
- your own needs, you can implement other underlying decoder
- architectures, such as a software stream demultiplexers and software
- or hardware decoder for MPEG2 video, MPEG audio, AC3, SPU and CSS.
- First, you have to tell where the consuming device is. Pass the
- filename of the device to DecoderSetDevice(). This also initializes
- the module.
- From the information retreived from the info files of the DVD, the
- demux and the decoder have to be set up with stream numbers and
- stream parameters. This is done with DecoderSetVideoStream(),
- DecoderSetAudioStream() and DecoderSetSubPictureStream() for the
- demux, DecoderSetVideoAttr() for the video decoder,
- DecoderSetAudioAttr() and DecoderSetKaraokeMix() for the audio
- decoder, and DecoderSetSubPicturePalette() and DecoderHighlight()
- for the SPU (Sub Picture Unit, run-length encoded bitmaps to be
- overlayed onto the video for menus and subtitles) decoder.
- Also, a function DecoderPause() is provided to pause the decoding
- process.
- A number of CSS function is also provided: DecoderCSSBypass()
- bypasses the CSS module for unencrypted data. For encrypted data
- the drive and the decoder have to authenticate to each other
- with DecoderCSSDriveAuthChallenge(), DecoderCSSDriveAuthResponse()
- and DecoderCSSHostAuth(), then the keys for the disc and the title
- have to be sent into the decoder with DecoderCSSDiscKey() and
- DecoderCSSTitleKey().
- Then, you can use DecoderWrite() to write DVD data into the demux.
- The parsed PCI and DSI packets are only of interest for the navi-
- gator, so they are passed back by polling DecoderGetNaviPack().
- _____________________________________________________________________
- CSS - The DVD Content Scrambling System
- 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,cpm,cp_sec,cgms;
- if (!disc) return (DecoderCSSBypass())?-1:0;
- if ((agid=UDFCSSRequestAGID())<0) return -1;
- if (DecoderCSSDriveAuthChallenge((disc==1),CSSdata)) goto ERROR;
- if (UDFCSSDriveAuth(CSSdata)<0) goto ERROR;
- if (DecoderCSSDriveAuthResponse((disc==1),CSSdata)) goto ERROR;
- if (UDFCSSHostAuthChallenge(CSSdata)<0) goto ERROR;
- if (DecoderCSSHostAuth((disc==1),CSSdata)) goto ERROR;
- if (UDFCSSHostAuthResponse(CSSdata)<0) goto ERROR;
- if (disc==1) {
- if (UDFCSSDiscKey(CSSdata)<0) goto ERROR;
- if (DecoderCSSDiscKey(CSSdata)) goto ERROR;
- } else if (disc==2) {
- if (UDFCSSTitleKey(lba,CSSdata,&cpm,&cp_sec,&cgms)<0) goto ERROR;
- if (DecoderCSSTitleKey(CSSdata)) goto ERROR;
- }
- UDFCSSInvalidateAGID(agid);
- return 0;
- ERROR:
- UDFCSSInvalidateAGID(agid);
- return -1;
- }
- _____________________________________________________________________
- Version history:
- 19991209 (chw)
- First release.
-