#ifndef __xvidcapture_bi__
#define __xvidcapture_bi__

' MPEG-4 video and audio high quality encoding
' based on the xvid encoder see at http://www.xvid.org
extern "C"

' open/create a stream with video only (width x height pixels per frame)
' fps = frames per second e.g. 24, quality 0-100
' return 1 on sucess or 0 on error
declare function OpenVideoStream lib "xvidcapture" ( _
  Filename as zstring ptr, _
  iWidth   as integer, _
  iHeight  as integer, _
  iFPS     as integer=24, _
  iQuality as integer=75) as integer

' open/create a stream with video and audio (width x height pixels per frame)
' fps = frames per second e.g. 24, quality 0-100
' bits per audio sample, chanels (1=mono 2=stereo), rate (11050,22050,44100)
' return 1 on success or 0 on error
declare function OpenVideoAudioStream lib "xvidcapture" ( _
  Filename  as zstring ptr, _
  iWidth    as integer, _
  iHeight   as integer, _
  iFPS      as integer=24, _
  iQuality  as integer=75, _
  iChannels as integer= 2, _
  iBits     as integer=16, _
  iRate     as integer=22050) as integer

' write one video frame in the stream with 32bit RGBA pixels (FreeBASIC or OpenGL format).
' the size of the pixel buffer must be at least width x height x 4 bytes
' return nBytes (compressed) written to the stream or 0 on error.
declare function Write32BitPixels  lib "xvidcapture" (pixels as any ptr) as integer

' write one video frame in the stream with 24bit BGR pixels. (Windows DIB or OpenGL format)
' the size of the pixel buffer must be at least width x height x 3 bytes
' return nBytes (compressed) written to the stream or 0 on error.
declare function Write24BitPixels  lib "xvidcapture" (pixels as any ptr) as integer

' write one video frame in the stream with 16bit 5:6:5 RGB pixels. (FreeBASIC or OpenGL format)
' the size of the pixel buffer must be at least width x height x 2 bytes
' return nBytes (compressed) written to the stream or 0 on error.
declare function Write16BitPixels  lib "xvidcapture" (pixels as any ptr) as integer

' write a chunk of audio samples in the stream (see also OpenVideoAudioStream)
' the size of the sample buffer must be at least nBytes
' return nBytes (compressed) written to the stream or 0 on error.
declare function WriteAudioSamples lib "xvidcapture" (samples as any ptr, nBytes as integer) as integer

' close the stream on end (after all video and audio data are written)
declare sub CloseStream lib "xvidcapture" ()

end extern
#endif ' __xvidcapture_bi__
