bg_ov_plugin_s Struct Reference
[Video output]

Video output plugin. More...

#include <plugin.h>

Data Fields

bg_plugin_common_t common
 Infos and functions common to all plugin types.
void(* set_window )(void *priv, const char *window_id)
 Set window.
const char *(* get_window )(void *priv)
 Get window.
void(* set_window_options )(void *priv, const char *name, const char *klass, const gavl_video_frame_t *icon, const gavl_video_format_t *icon_format)
 Set window class.
void(* set_window_title )(void *priv, const char *title)
 Set window title.
void(* set_callbacks )(void *priv, bg_ov_callbacks_t *callbacks)
 Set callbacks.
int(* open )(void *priv, gavl_video_format_t *format, int keep_aspect)
 Open plugin.
gavl_video_frame_t *(* create_frame )(void *priv)
 Allocate a video frame.
int(* add_overlay_stream )(void *priv, gavl_video_format_t *format)
 Add a stream for transparent overlays.
gavl_overlay_t *(* create_overlay )(void *priv, int id)
 Allocate an overlay.
void(* set_overlay )(void *priv, int stream, gavl_overlay_t *ovl)
 Set an overlay for a specific stream.
void(* put_video )(void *priv, gavl_video_frame_t *frame)
 Display a frame of a video stream.
void(* put_still )(void *priv, gavl_video_frame_t *frame)
 Display a still image.
void(* handle_events )(void *priv)
 Get all events from the queue and handle them.
void(* update_aspect )(void *priv, int pixel_width, int pixel_height)
 Update aspect ratio.
void(* destroy_frame )(void *priv, gavl_video_frame_t *frame)
 Free a frame created with the create_frame() method.
void(* destroy_overlay )(void *priv, int id, gavl_overlay_t *ovl)
 Free an overlay created with the create_overlay() method.
void(* close )(void *priv)
 Close the plugin.
void(* show_window )(void *priv, int show)
 Show or hide the window.

Detailed Description

Video output plugin.

This handles video output and still-image display. In a window based system, it will typically open a new window, which is owned by the plugin.


Field Documentation

Infos and functions common to all plugin types.

void(* bg_ov_plugin_s::set_window)(void *priv, const char *window_id)

Set window.

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

Call this immediately after creation of the plugin to embed video output into a foreign application. For X11, the window identifier has the form <display_name>:<normal_id>:<fullscreen_id>.

const char*(* bg_ov_plugin_s::get_window)(void *priv)

Get window.

Parameters:
priv The handle returned by the create() method
Returns:
Window identifier
void(* bg_ov_plugin_s::set_window_options)(void *priv, const char *name, const char *klass, const gavl_video_frame_t *icon, const gavl_video_format_t *icon_format)

Set window class.

Parameters:
priv The handle returned by the create() method
name The name of the window
klass The class of the window

This makes sense probably only in an X11 environment. If the klass argument is the same for all windows of an application, they, might be grouped together in the window list. On X11 this results in a call to XSetClassHint().

void(* bg_ov_plugin_s::set_window_title)(void *priv, const char *title)

Set window title.

Parameters:
priv The handle returned by the create() method
title The title for the window
void(* bg_ov_plugin_s::set_callbacks)(void *priv, bg_ov_callbacks_t *callbacks)

Set callbacks.

Parameters:
priv The handle returned by the create() method
callbacks Callback structure initialized by the caller before
int(* bg_ov_plugin_s::open)(void *priv, gavl_video_format_t *format, int keep_aspect)

Open plugin.

Parameters:
priv The handle returned by the create() method
format Video format
window_title Window title

The format will be changed to the nearest format, which is supported by the plugin. To convert the source format to the output format, use a gavl_video_converter_t

Allocate a video frame.

Parameters:
priv The handle returned by the create() method
Returns:
a newly allocated video frame

This optional method allocates a video frame in a plugin specific manner (e.g. in a shared memory segment). If this funtion is defined, all frames which are passed to the plugin, must be allocated by this function. Before the plugin is closed, all created frames must be freed with the destroy_frame() method.

Add a stream for transparent overlays.

Parameters:
priv The handle returned by the create() method
format Format of the overlays
Returns:
The index of the overlay stream

It's up to the plugin, if they are realized in hardware or with a gavl_overlay_blend_context_t, but they must be there. add_overlay_stream() must be called after open()

An application can have more than one overlay stream. Typical is one for subtitles and one for OSD.

Allocate an overlay.

Parameters:
priv The handle returned by the create() method
id The id returned by the add_overlay_stream() method
Returns:
a newly allocated overlay

This optional method allocates an overlay in a plugin specific manner (e.g. in a shared memory segment). If this funtion is defined, all overlays which are passed to the plugin, must be allocated by this function. Before the plugin is closed, all created overlays must be freed with the destroy_overlay() method.

void(* bg_ov_plugin_s::set_overlay)(void *priv, int stream, gavl_overlay_t *ovl)

Set an overlay for a specific stream.

Parameters:
priv The handle returned by the create() method
stream Stream index returned by add_overlay_stream()
ovl New overlay or NULL
void(* bg_ov_plugin_s::put_video)(void *priv, gavl_video_frame_t *frame)

Display a frame of a video stream.

Parameters:
priv The handle returned by the create() method
frame Frame to display

This is for video playback

void(* bg_ov_plugin_s::put_still)(void *priv, gavl_video_frame_t *frame)

Display a still image.

Parameters:
priv The handle returned by the create() method
frame Frame to display

This function is like put_video() with the difference, that the frame will be remembered and redisplayed, when an expose event is received.

void(* bg_ov_plugin_s::handle_events)(void *priv)

Get all events from the queue and handle them.

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

This function processes and handles all events, which were received from the windowing system. It calls mouse and key-callbacks, and redisplays the image when in still mode.

void(* bg_ov_plugin_s::update_aspect)(void *priv, int pixel_width, int pixel_height)

Update aspect ratio.

Parameters:
priv The handle returned by the create() method
pixel_width New pixel width
pixel_height New pixel height

Free a frame created with the create_frame() method.

Parameters:
priv The handle returned by the create() method
frame The frame to be freed
void(* bg_ov_plugin_s::destroy_overlay)(void *priv, int id, gavl_overlay_t *ovl)

Free an overlay created with the create_overlay() method.

Parameters:
priv The handle returned by the create() method
id The id returned by the add_overlay_stream() method
ovl The overlay to be freed
void(* bg_ov_plugin_s::close)(void *priv)

Close the plugin.

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

Close everything so the plugin can be opened with a differtent format after.

void(* bg_ov_plugin_s::show_window)(void *priv, int show)

Show or hide the window.

Parameters:
priv The handle returned by the create() method
show 1 for showing, 0 for hiding

The documentation for this struct was generated from the following file:
Generated on Sun Feb 28 07:34:31 2010 for gmerlin by  doxygen 1.6.3