Waave
An audio video engine
 All Data Structures Functions Variables Groups Pages
Functions
Stream manipulation

Detailed Description

Loading an audio or video stream in the Waave engine is done in three steps. First open a file and check it's type. Next you can set stream attributes to control the stream behavior. Finally load the stream so you can play it.

Functions

WVStream * WV_getStream (const char *filename)
 Open an audio/video file and give a stream handle.
WVStream * WV_closeStream (WVStream *stream)
 Close an opened stream.
int WV_getStreamType (WVStream *stream)
 Get the stream type : audio, video ...
int WV_getStreamWidth (WVStream *stream)
 Get the stream width.
int WV_getStreamHeight (WVStream *stream)
 Get the stream height.
int WV_loadStream (WVStream *stream)
 Load the stream in the Waave engine.

Function Documentation

WVStream* WV_closeStream ( WVStream *  stream)

Close an opened stream.

Parameters:
streamThe stream you want to release

The WV_getStream function return NULL on success, so the classic way to free a stream is :

myStream = WV_closeStream(myStream)
WVStream* WV_getStream ( const char *  filename)

Open an audio/video file and give a stream handle.

Parameters:
filenameThe file you want to open

To open a new stream just do a :

WVStream* newStream;
newStream = WV_getStream(filename);
int WV_getStreamHeight ( WVStream *  stream)

Get the stream height.

Parameters:
streamThe stream you want the height

Return the stream width or -1 if the stream doesn't contain video

int WV_getStreamType ( WVStream *  stream)

Get the stream type : audio, video ...

Parameters:
streamThe stream you want the type

Return the stream type. Possible returned values are :

Flag value Description
WV_STREAM_TYPE_NONE Unknow stream type
WV_STREAM_TYPE_AUDIO An audio only stream
WV_STREAM_TYPE_VIDEO An video only stream
WV_STREAM_TYPE_AUDIOVIDEO A stream with audio and video
int WV_getStreamWidth ( WVStream *  stream)

Get the stream width.

Parameters:
streamThe stream you want the width

Return the stream width or -1 if the stream doesn't contain video

int WV_loadStream ( WVStream *  stream)

Load the stream in the Waave engine.

Parameters:
streamThe stream to load.

Before playing a stream it need to be loaded in the Waave engine. WV_closeStream will unload it if needed.