[ Previous | Next | Contents | Glossary | Home | Search ]
Ultimedia Services Version 2 for AIX: Programmer's Guide and Reference

UMSVCDFileRead

The UMSVCDFileRead object provides methods to play synchronized audio and video from Video CD MPEG1 files.

The UMSVCDFileRead object uses the generic base classes of the UMSObject.

To learn more about the UMSVCDFileRead object, see:

For introductory information, see Formatted File Access Objects.

Enumeration Lists

To avoid name collision on defines, integer values have been captured as enumerated lists. The detailed method descriptions describe the valid or possible values for the specific use. The enumerated lists that are defined for this object are listed below.

enum ReturnCode {
   Success,
   Failure,
   FileNotOpen,
   StorageAllocationFailure,
   ReadFailure,
   WriteFailure,
   ReadOnly,
   WriteOnly,
   InvalidArgument,
   EndOfFile
   };
enum TrackType  {
   Movie,
   Audio
   };

Defined Constants

The following constants are defined for the UMSVCDFileRead object.

const long cd_device_block_size = CD_DEVICE_BLOCK_SIZE;

Defined Structures

The following structures are defined for the UMSVCDFileRead object.

typedef sequence<octet> Buffer;

Recommended Sequence of Methods

open_track_wfilename(in long track, in TrackType type, in string path )
lseek(in long offset, in long whence, inout long position)
read(inout Buffer buf, in long nbyte, inout long bytes_read)
close

Methods Descriptions

ReturnCode get_track_info(in long track,in TrackType type,in string path, out long absolute_offset, out long size )

Description

Returns the byte offset from the beginning of the VideoCD to the Video CD Movie File(Track) and the size in bytes of the Video CD Movie File, given the Track number, Track type and device of the CD Player in use.

Arguments
in long track Track number of the Video CD Movie File to read. (ie. If Video CD Movie File name is avseq01.dat, then Track number is 1.)
in TrackType type Track type of the Video CD Movie File to read, can either be Video (UMSVCDFileRead_Movie) or Audio(UMSVCDFileRead_Audio).
in string path Optional parameter, usually NULL, which invokes the lookup in the UMS_Config file for the device name of the CD Player in use for the Video CD. If specified, it will override this lookup for this device name, must be the raw device name. (ie. /dev/rcd0)
out long absolute_offset Offset in bytes from the beginning of the Video CD to the Video CD Movie File.
out long size Size in bytes of the Video CD Movie File.
Return Values

Success

Failure

ReturnCode open_track(in long track, in TrackType type, in string path )

Description

Opens the Video CD Movie File(Track) for reading given the Track number, Track type and device of the CD Player in use.

Arguments
in long track Track number of the Video CD Movie File to open. (ie. If Video CD Movie File name is avseq01.dat, then Track number is 1.)
in TrackType type Track type of the Video CD Movie File to open, can either be Video (UMSVCDFileRead_Movie) or Audio(UMSVCDFileRead_Audio).
in string path Optional parameter, usually NULL, which invokes the lookup in the UMS_Config file for the device name of the CD Player in use for the Video CD. If specified, it will override this lookup for this device name, must be the raw device name. (ie. /dev/rcd0)
Return Values

Success

Failure

ReturnCode read(inout Buffer buf, in long nbyte, inout long bytes_read)

Description

Reads the Video CD Movie File(Track) given the number of bytes to read and places the read data in a buffer. File must already be open.

Arguments
inout Buffer buf Buffer where data read is placed.
in long nbyte Number of bytes to read.
inout long bytes_read Number of bytes read into the buffer.
Return Values

FileNotOpen

ReadFailure

Success

ReturnCode lseek(in long offset, in long whence, inout long position)

Description

Seeks to a byte position on the Video CD Movie File(Track). Can specify to seek from beginning of file or from current position. File must already be open.

Arguments
in long offset The number of bytes to seek.
in long whence Where to begin the seek, from the beginning of the Video CD Movie File(SEEK_SET) or from the current position(SEEK_CUR).
inout long position The byte position on the Video CD Movie File where the seek finished.
Return Values

FileNotOpen

ReadFailure

Success

Failure

ReturnCode get_track_length(inout long length)

Description

Gets the Video CD Movie File(Track) size in bytes. File must already be open.

Arguments
inout long length Size in bytes of the Video CD Movie File(Track).
Return Values

Success

FileNotOpen

ReturnCode get_track_info_wfilename(in string szTrackName, in TrackType type, in string device, out long absolute_offset, out long file_size )

Description

Returns the byte offset from the beginning of the VideoCD to the Video CD Movie File(Track) and the size in bytes of the Video CD Movie File, given the Track file name, Track type and device of the CD Player in use.

Arguments
in long track Track file name of the Video CD Movie File to read.
in TrackType type Not used, enter 1UL .
in string path Optional parameter, usually NULL, which invokes the lookup in the UMS_Config file for the device name of the CD Player in use for the Video CD. If specified, it will override this lookup for this device name, must be the raw device name. (ie. /dev/rcd0)
out long absolute_offset Offset in bytes from the beginning of the Video CD to the Video CD Movie File.
out long size Size in bytes of the Video CD Movie File.
Return Values

Success

Failure

ReturnCode open_track_wfilename(in string szTrackName, in TrackType type, in string device )

Description

Opens the Video CD Movie File(Track) for reading given the Track file name, and device of the CD Player in use.

Arguments
in long track Track file name of the Video CD Movie File to read.
in TrackType type Not used, enter 1UL.
in string path Optional parameter, usually NULL, which invokes the lookup in the UMS_Config file for the device name of the CD Player in use for the Video CD. If specified, it will override this lookup for this device name, must be the raw device name. (ie. /dev/rcd0)
Return Values

Success

Failure

ReturnCode get_devicename(in string szDevice, in string szDefaultDevice, out string szDeviceName)

Description

Determines the CD Player raw device name in use by the Video CD, given the optional raw device name and default raw device name.

Arguments
in string szDevice Optional parameter. Can specify the device name of the CD Player here, which will override the lookup for it in the UMS_Config file. This is usually NULL.
in string szDefaultDevice Specifies which type of device for the Video CD you would like to use, either the device name(VCD_CD_PROPERTY) or the raw device name(VCD_RCD_PROPERTY). ( ie. /dev/cd0 or /dev/rcd0 respectively)
out string szDeviceName Device name of the CD Player in use for the Video CD as read from the UMS_Config file.
Return Values

Success

ReturnCode close()

Description

Closes the UMSVCDFileReader.

Arguments

None.

Return Values

Success

For introductory information, see Formatted File Access Objects.


[ Previous | Next | Contents | Glossary | Home | Search ]