gmerlin
|
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... | |
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.
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.
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.
priv | The handle returned by the create() method |
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.
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.
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.
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.
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
gavl_video_frame_t*(* bg_ov_plugin_s::get_frame)(void *priv) |
Get a video frame for filling with data.
priv | The 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.
priv | The handle returned by the create() method |
format | Format of the overlays |
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.
priv | The handle returned by the create() method |
id | The id returned by the add_overlay_stream() method |
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.
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.
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.
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.
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.
priv | The handle returned by the create() method |
pixel_width | New pixel width |
pixel_height | New 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.
priv | The handle returned by the create() method |
frame | The frame to be freedFree an overlay created with the create_overlay() method. |
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.
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.
priv | The handle returned by the create() method |
show | 1 for showing, 0 for hiding |