gmerlin
Data Fields
bg_ov_plugin_s Struct Reference

Video output plugin. More...

#include <plugin.h>

Data Fields

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

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

bg_plugin_common_t bg_ov_plugin_s::common

Infos and functions common to all plugin types.

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

Set window.

Parameters
privThe handle returned by the create() method
windowWindow 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
privThe 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
privThe handle returned by the create() method
nameThe name of the window
klassThe 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
privThe handle returned by the create() method
titleThe title for the window
void(* bg_ov_plugin_s::set_callbacks)(void *priv, bg_ov_callbacks_t *callbacks)

Set callbacks.

Parameters
privThe handle returned by the create() method
callbacksCallback 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
privThe handle returned by the create() method
formatVideo format
window_titleWindow 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

gavl_video_frame_t*(* bg_ov_plugin_s::get_frame)(void *priv)

Get a video frame for filling with data.

Parameters
privThe handle returned by the create() method
int(* bg_ov_plugin_s::add_overlay_stream)(void *priv, gavl_video_format_t *format)

Add a stream for transparent overlays.

Parameters
privThe handle returned by the create() method
formatFormat 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.

gavl_overlay_t*(* bg_ov_plugin_s::create_overlay)(void *priv, int id)

Allocate an overlay.

Parameters
privThe handle returned by the create() method
idThe 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
privThe handle returned by the create() method
streamStream index returned by add_overlay_stream()
ovlNew 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
privThe handle returned by the create() method
frameFrame 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
privThe handle returned by the create() method
frameFrame 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
privThe 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
privThe handle returned by the create() method
pixel_widthNew pixel width
pixel_heightNew pixel height
void(* bg_ov_plugin_s::destroy_overlay)(void *priv, int id, gavl_overlay_t *ovl)

Free a frame created with the create_frame() method.

Parameters
privThe handle returned by the create() method
frameThe frame to be freedFree an overlay created with the create_overlay() method.
privThe handle returned by the create() method
idThe id returned by the add_overlay_stream() method
ovlThe overlay to be freed
void(* bg_ov_plugin_s::close)(void *priv)

Close the plugin.

Parameters
privThe 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
privThe handle returned by the create() method
show1 for showing, 0 for hiding

The documentation for this struct was generated from the following file: