Waave
An audio video engine
 All Data Structures Functions Variables Groups Pages
Functions
Standard SDL 2.0 streaming objects

Detailed Description

There functions permit to create standard streaming objects to stream video with a sdl renderer using textures. The renderer is not cleared by the object so do it one time before start streaming.

Don't forget to reset the object and clear the renderer when the renderer's viewport is modified !

Only for SDL 2.0 or greater !

Functions

WVStreamingObjectWV_getStreamRendererObj (SDL_Renderer *targetRenderer, SDL_Rect *destRect, int updateFlag)
 Get a new renderer streaming object.
void WV_resetStreamRendererOutput (WVStreamingObject *streamObj, SDL_Renderer *targetRenderer, SDL_Rect *destRect)
 Change/update the renderer of a renderer streaming object.
void WV_freeStreamRendererObj (WVStreamingObject *streamObj)
 Free a renderer streaming object.

Function Documentation

void WV_freeStreamRendererObj ( WVStreamingObject streamObj)

Free a renderer streaming object.

Parameters:
streamObjThe released streaming object

Free a streaming object created with WV_getStreamRendererObj. Be carefull that the streaming object pointer is not reset.

WVStreamingObject* WV_getStreamRendererObj ( SDL_Renderer *  targetRenderer,
SDL_Rect *  destRect,
int  updateFlag 
)

Get a new renderer streaming object.

Parameters:
targetRendererThe sdl renderer we use to stream video data
destRectThe destination rectangle. The entire rendering target if NULL;
updateFlagSet it if you want that waave update the target surface with SDL_RenderPresent

Create a new streaming object for a sdl renderer. Be carefull to use it only for one video stream !

void WV_resetStreamRendererOutput ( WVStreamingObject streamObj,
SDL_Renderer *  targetRenderer,
SDL_Rect *  destRect 
)

Change/update the renderer of a renderer streaming object.

Parameters:
streamObjThe modified/updated streaming object
targetRendererThe new/updated renderer
destRectThe new/updated destination rectangle. May be NULL.

Call this function when the renderer's viewport is modified ! It's also possible to change the renderer of a streaming object without recreate it. This can be done at any time ! Even if the stream is playing.