Bink SDK 1.5v

# BINK_OPEN_FLAGS

The basic type BINK_OPEN_FLAGS describes the special or unusual ways of opening a Bink file.

#### Fundamental Values

Value | Description
--- | ---
BINKFILEHANDLE | Use this flag to tell Bink that the file name that you passed in isn't a file name at all, but rather a file handle. Bink will then use this handle instead of opening a new file. Note that you have to typecast the file handle to a "char*" when using this flag. This flag is useful when you'd like to have a resource file that contains multiple Bink files. When you use this flag, Bink won't open (or close) the file handle. Under Win32 and Xbox, the file handle value must be a handle returned from the system function "CreateFile". Under MacOS, the file handle value must be a pointer returned from the system function "FSpOpenDF". On the Nintendo GameCube, this file handle value must be a DVDFileInfo pointer returned from the system function "DVDFastOpen". On the GameCube, you must also fill in the userData field (fileInfo->cb.userData) in the DVDFileInfo pointer with the starting file offset of the video in this file handle (usually zero). This oddness is because there is no system function for determining the current file position on the GameCube. Also note that this starting file offset must be a multiple of 32.
BINKFROMMEMORY | Use this flag to tell Bink that the file name that you passed in isn't a file name at all, but rather a pointer to an entire Bink file already loaded into memory. Bink will then use this memory to play from. You must not free the memory address that you pass in until you have called BinkClose. On MacOS and GameCube, you must first dword endian-swap your memory buffer before passing it to BinkOpen.
BINKSNDTRACK | Use this flag to tell Bink to play a specific sound track. By default, Bink will play the first sound track in the Bink file, so use this flag to force Bink to use the track ID set in a previous call to the BinkSetSoundTrack function. So, to use this flag, you must first call BinkSetSoundTrack with the desired track ID number, and then open the Bink file using this flag.
BINKNOSKIP | Bink will skip frames if the video begins to fall behind the audio. Bink won't skip frames at all if the Bink file contains no audio, or if you use this flag. This flag is useful when you want the video quality to have precedence over the sound quality (good for cartoon-style animations).
BINKPRELOADALL | Use this flag to tell Bink to preload the entire animation into memory. If Bink is unable to preload the animation into memory, then the open will fail.
BINKALPHA | This flag tells Bink that you want to decompress the alpha plane data if it is present in the file. By default, Bink does not decompress the alpha plane, so you must set this flag if you intend to use any of the alpha bitplane formats (BINKSURFACE32A or BINKSURFACE4444).
BINKGRAYSCALE | This flag tells Bink that you want to play the Bink file back in grayscale mode. Grayscale mode is much faster in both the decompression step (Bink only has to decompress the Y plane) and the YUV conversion step. If you compressed the Bink file in grayscale mode, then this flag will automatically be set.
BINKFRAMERATE | Use this flag to tell Bink to override the frame rate in the Bink file and use the frame rate specified by a previous call to the BinkSetFrameRate function. So, to use this flag, you first call BinkSetFrameRate with the desired rate, and then open the Bink file using this flag.
BINKCOPY2XH | Use this flag to tell Bink to playback the video in 2x height doubled mode. This will cause each line to be duplicated (which will double the height). If the video was compressed in 2x height doubled mode with the Bink compressor, then this flag will automatically be set - you can override it with any of the other COPY flags.
BINKCOPY2XHI | Use this flag to tell Bink to playback the video in 2x height interlaced mode. This will cause the video to be expanded to every other scanline (which will double the height). If the video was compressed in interlaced mode with the Bink compressor, then this flag will automatically be set - you can override it with any of the other COPY flags.
BINKCOPY2XW | Use this flag to tell Bink to playback the video in 2x width doubled mode. This will cause each pixel to be duplicated (which will double the width). If the video was compressed in 2x width doubled mode with the Bink compressor, then this flag will automatically be set - you can override it with any of the other COPY flags.
BINKCOPY2XWH | Use this flag to tell Bink to playback the video in 2x width and height doubled mode. This will cause each line and each pixel to be duplicated (which will double both the width and height). If the video was compressed in 2x width and height doubled mode with the Bink compressor, then this flag will automatically be set - you can override it with any of the other COPY flags.
BINKCOPY2XWHI | Use this flag to tell Bink to playback the video in 2x width doubled and height interlaced mode. This will cause each pixel to be duplicated and every other scanline to be skipped (which will double both the width and height). If the video was compressed in 2x width and height interlaced mode with the Bink compressor, then this flag will automatically be set - you can override it with any of the other COPY flags.
BINKCOPY1XI | This copy flag tells Bink to play the movie in normal 1x mode, but to only copy ever other scanline during playback. This saves half the time of a normal frame copy, so it is useful on under-powered machines.
BINKCOPYNOSCALING | Use this flag to tell Bink to playback the video without any doubling or interlacing. Use this flag to counteract the automatic effect of a video compressed in one of the interlaced or doubled modes.
BINKNOMMX | This flag tells Bink not to use MMX while decompressing or when converting colorspaces. Bink runs much slower without MMX, so you will usually just want to leave this flag alone. This flag isn't supported on Xbox - MMX is always used when running on the Xbox.
BINKSIMULATE | Use this flag to tell Bink to simulate the device speed set in a previous call to the BinkSetSimulate function. To use this flag, you first call BinkSetSimulate with the device speed, and then open the Bink file using this flag.
BINKIOSIZE | Use this flag to tell Bink to override the default IO buffer size with the size set in a previous call to the BinkSetIOSize function. To use this flag, you must first call BinkSetIOSize with the IO size, and then open the Bink file using this flag.
BINKNOFILLIOBUF | Use this flag to tell Bink not to fill the IO buffer in BinkOpen. By default, Bink completely fills the IO buffer before returning from BinkOpen. Using this flag will speed up the opening process, but it can cause skipping early in the movie.
BINKIOPROCESSOR | This flag lets you completely replace the file IO system that Bink will use to read the Bink file. This is a not a trivial job, but you can perform any type of IO using this flag (even streaming from an Internet address). If you are interested in using this flag, contact RAD for more information.
BINKNOTHREADEDIO | Use this flag to tell Bink not to use multi-threaded IO. By default, Bink creates a background thread that reads from the Bink file in the background. If you don't want Bink to do any of this background processing, then you can turn it off with this flag.

#### Discussion

The Bink flags are passed to the BinkOpen function to enable special or unusual processing modes. You will almost always pass zero for the Bink flags, but you can use any of these options when the need arises. The various COPY flags are very useful for creating really scalable video playback. For example, say you have a 320x240 movie, using the different COPY flags, you could offer the following playback modes:
1) No flags - normal 320x240 playback
2) BINKCOPY1XI - 320x240 with 1x interlacing for slow machines.
3) BINKCOPY2XWHI - 640x480 with 2x interlacing for medium machines.
4) BINKCOPY2XWH - 640x480 with 2x doubling for fast machines.

Group: Bink API
Related Sections: Alpha Planes, Scaling
Related Functions: BinkClose, BinkDoFrame, BinkGetLogoAddress, BinkMacOpen, BinkOpen, BinkSetFrameRate, BinkSetIO, BinkSetIOSize, BinkSetSimulate, BinkSetSoundOnOff, BinkSetSoundTrack
Related Basic Types: BINK_COPY_FLAGS, BINK_OPEN_FLAGS
Related Structures: BINK

For technical support, e-mail Bink1@radgametools.com
© Copyright 1994-2003 RAD Game Tools, Inc. All Rights Reserved.