Bink SDK 1.5v

# BinkCopyToBuffer

The function BinkCopyToBuffer copies a video frame from the internal Bink memory buffers to a specified memory address.

    S32 BinkCopyToBuffer(
      HBINK bink,
      VOID_PTR dest_addr,
      S32 dest_pitch,
      U32 dest_height,
      U32 dest_x,
      U32 dest_y,
      BINK_COPY_FLAGS copy_flags
    );

#### In Parameters

bink
  Specifies the Bink handle.
dest_addr
  Address of the destination memory buffer.
dest_pitch
  Pitch of the destination buffer in bytes.
dest_height
  Height of the destination buffer in pixels.
dest_x
  X (left) pixel offset into the destination buffer.
dest_y
  Y (top) pixel offset into the destination buffer.
copy_flags
  Specifies the flags that describe the destination buffer type and other special copy options.

#### Returns

Returns one if the frame was skipped, or zero otherwise.

#### Discussion

Use this function to copy the decompressed pixels from Bink's internal decompression buffers into a destination address. This destination address can be any linear piece of memory - malloc-ed memory, DirectDraw surface pointers, the Buffer address in a BinkBuffer structure, etc. If the destination uses the RGB colorspace, then this function also performs the conversion from YUV to RGB. If you are using the BinkBuffer API, use the bink_buf->Buffer field for the dest_addr parameter, the bink_buf->BufferPitch field for the dest_pitch parameter, the bink_buf->Height field for the dest_height parameter, and the bink_buf->SurfaceType field for the copy_flags parameter. Also make sure you call BinkBufferLock before calling BinkCopyToBuffer and BinkBufferUnlock immediately after. See ExamW32.C for details. If you are using DirectDraw, then simply lock the surface you want to copy to, call BinkCopyToBuffer (with lpSurface for the dest_addr parameter and lPitch for the dest_pitch), and then unlock the surface. See ExamDDP.C for details. Note that if the video is falling behind the audio, then this function may return without copying any pixels. If the copy is skipped, then this function will return a non-zero value. If copy was successful, then a zero will be returned. To copy just a piece of the internal buffers, use the BinkCopyToBufferRect function. On the Nintendo GameCube, note that due to the swizzled output, you must use divisible-by-four values for the X offset, Y offset, width, and height parameters. Inverted scanline buffers (bottom-up) are also supported (although rarely necessary now a days). To specify an inverted buffer, pass in a negative pitch. Inverted buffers will be slower than standard top-down buffers.

Group: Bink API
Related Sections: Bink Examples for the Nintendo GameCube, Bink Playback on the Nintendo GameCube, Scaling
Related Functions: BinkBufferLock, BinkBufferOpen, BinkBufferUnlock, BinkCopyToBufferRect, BinkDDSurfaceType, BinkDX8SurfaceType, BinkDoFrame, BinkGDSurfaceType
Related Basic Types: BINKBUFFER_OPEN_FLAGS, BINK_COPY_FLAGS, HBINK, S32, U32, VOID_PTR
Related Structures: BINKBUFFER

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