bg_visualization_plugin_s Struct Reference
[Audio Visualization plugins]

Audio visualization plugin. More...

#include <plugin.h>

Data Fields

bg_plugin_common_t common
 Infos and functions common to all plugin types.
void(* set_callbacks )(void *priv, bg_ov_callbacks_t *cb)
 return callback
int(* open_ov )(void *priv, gavl_audio_format_t *audio_format, gavl_video_format_t *video_format)
 Open a frame based visualization plugin.
int(* open_win )(void *priv, gavl_audio_format_t *audio_format, const char *window_id)
 Open a window based visualization plugin.
void(* update )(void *priv, gavl_audio_frame_t *frame)
 Send audio data to the plugin.
void(* draw_frame )(void *priv, gavl_video_frame_t *frame)
 Draw an image.
void(* show_frame )(void *priv)
 Show the image.
void(* close )(void *priv)
 Close a plugin.

Detailed Description

Audio visualization plugin.

These plugins get audio samples and run visualizations of them. Output can be either into a gavl_video_frame_t or directly via OpenGL. Which method is used is denoted by the BG_PLUGIN_VISUALIZE_FRAME and BG_PLUGIN_VISUALIZE_GL flags.

For OpenGL, you need to pass a window ID to the plugin. The plugin is then responsible for creating Subwindows and setting up an OpenGL context. In General, it's stronly recommended to use the bg_visualizer_t module to use visualizations.


Field Documentation

Infos and functions common to all plugin types.

return callback

Parameters:
priv The handle returned by the create() method
Parameters:
cb The callbacks to be called
int(* bg_visualization_plugin_s::open_ov)(void *priv, gavl_audio_format_t *audio_format, gavl_video_format_t *video_format)

Open a frame based visualization plugin.

Parameters:
priv The handle returned by the create() method
Parameters:
audio_format Audio format
Parameters:
video_format Video format
The audio format parameter will most likely changed to the nearest supported format. In the video format parameter, you usually pass the desired render size. Everything else (except the framerate) will be set up by the plugin.
int(* bg_visualization_plugin_s::open_win)(void *priv, gavl_audio_format_t *audio_format, const char *window_id)

Open a window based visualization plugin.

Parameters:
priv The handle returned by the create() method
Parameters:
audio_format Audio format
Parameters:
window_id A window ID
The audio format parameter will most likely changed to the nearest supported format. For the window id, use strings formatted like the one returned by bg_ov_plugin_t

Send audio data to the plugin.

Parameters:
priv The handle returned by the create() method
Parameters:
frame Audio frame
This updates the plugin with new audio samples. After that, we may or may not call the draw_frame function below to actually draw an image. Note, that visualization plugins are not required to do internal audio buffering, so it's wise to pass a frame with as many samples as the samples_per_frame member of the audio format returned by open_ov or open_win.

Draw an image.

Parameters:
priv The handle returned by the create() method
Parameters:
The video frame to draw to
For OpenGL plugins, frame is NULL. For frame based plugins, the image will be drawn into the frame you pass. You must display the frame on your own then.

Show the image.

Parameters:
priv The handle returned by the create() method
This function is needed only for OpenGL plugins. Under X11, it will typically call glXSwapBuffers and process events on the X11 window.

void(* bg_visualization_plugin_s::close)(void *priv)

Close a plugin.

Parameters:
priv The handle returned by the create() method

The documentation for this struct was generated from the following file:
Generated on Sat Jan 28 06:53:19 2012 for gmerlin by  doxygen 1.6.3