|
| VideoOverlay (VideoOverlay&& src) noexcept |
|
VideoOverlay& | operator= (VideoOverlay&& src) noexcept |
|
| ~VideoOverlay () noexcept override |
|
GstVideoOverlay* | gobj () |
| Provides access to the underlying C GObject. More...
|
|
const GstVideoOverlay* | gobj () const |
| Provides access to the underlying C GObject. More...
|
|
void | set_window_handle (guintptr window_handle) |
| This will call the video overlay's set_window_handle method. More...
|
|
void | got_window_handle (guintptr window_handle) |
| This will post a "have-window-handle" element message on the bus. More...
|
|
void | prepare_window_handle () |
| This will post a "prepare-window-handle" element message on the bus to give applications an opportunity to call gst_video_overlay_set_window_handle() before a plugin creates its own window. More...
|
|
void | expose () |
| Tell an overlay that it has been exposed. More...
|
|
void | handle_events (bool handle_events) |
| Tell an overlay that it should handle events from the window system. More...
|
|
bool | set_render_rectangle (int x, int y, int width, int height) |
| Configure a subregion as a video target within the window set by gst_video_overlay_set_window_handle(). More...
|
|
virtual void | set_window_handle_vfunc (guintptr handle) |
| Virtual method to configure the window handle. More...
|
|
virtual void | expose_vfunc () |
| Virtual method to handle expose events. More...
|
|
virtual void | handle_events_vfunc (bool handle_events) |
| Virtual method to handle events. More...
|
|
virtual void | set_render_rectangle_vfunc (int x, int y, int width, int height) |
| Virtual method to set the render rectangle. More...
|
|
| Interface () |
|
| Interface (Interface &&src) noexcept |
|
Interface & | operator= (Interface &&src) noexcept |
|
| Interface (const Glib::Interface_Class &interface_class) |
|
| Interface (GObject *castitem) |
|
| ~Interface () noexcept override |
|
| Interface (const Interface &)=delete |
|
Interface & | operator= (const Interface &)=delete |
|
GObject * | gobj () |
|
const GObject * | gobj () const |
|
| ObjectBase (const ObjectBase &)=delete |
|
ObjectBase & | operator= (const ObjectBase &)=delete |
|
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value) |
|
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const |
|
void | set_property (const Glib::ustring &property_name, const PropertyType &value) |
|
void | get_property (const Glib::ustring &property_name, PropertyType &value) const |
|
void | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void > &slot) |
|
void | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void > &&slot) |
|
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, const sigc::slot< void > &slot) |
|
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, sigc::slot< void > &&slot) |
|
void | freeze_notify () |
|
void | thaw_notify () |
|
virtual void | reference () const |
|
virtual void | unreference () const |
|
GObject * | gobj () |
|
const GObject * | gobj () const |
|
GObject * | gobj_copy () const |
|
| trackable () noexcept |
|
| trackable (const trackable &src) noexcept |
|
| trackable (trackable &&src) |
|
| ~trackable () |
|
void | add_destroy_notify_callback (void *data, func_destroy_notify func) const |
|
void | notify_callbacks () |
|
trackable & | operator= (const trackable &src) |
|
trackable & | operator= (trackable &&src) |
|
void | remove_destroy_notify_callback (void *data) const |
|
An interface for setting/getting a Window on elements supporting it.
The VideoOverlay interface is used for 2 main purposes :
- To get a grab on the Window where the video sink element is going to render. This is achieved by either being informed about the Window identifier that the video sink element generated, or by forcing the video sink element to use a specific Window identifier for rendering.
- To force a redrawing of the latest video frame the video sink element displayed on the Window. Indeed if the Pipeline is in STATE_PAUSED state, moving the Window around will damage its content. Application developers will want to handle the Expose events themselves and force the video sink element to refresh the Window's content.
Using the Window created by the video sink is probably the simplest scenario, in some cases, though, it might not be flexible enough for application developers if they need to catch events such as mouse moves and button clicks.
Setting a specific Window identifier on the video sink element is the most flexible solution but it has some issues. Indeed the application needs to set its Window identifier at the right time to avoid internal Window creation from the video sink element. To solve this issue a Message is posted on the bus to inform the application that it should set the Window identifier immediately. Here is an example on how to do that correctly:
#include <gdk/gdkx.h>
...
void PlayerWindow::on_bus_message_sync(
{
return;
if(!message->get_structure().has_name("prepare-xwindow-id"))
return;
Gst::Interface::cast <Gst::XOverlay>(element);
if(xoverlay)
{
const gulong xWindowId =
GDK_WINDOW_XID(widget->get_window()->gobj());
xoverlay->set_xwindow_id(xWindowId);
}
}
...
int main (int argc, char *argv[])
{
...
bus->enable_sync_message_emission();
bus->signal_sync_message().connect(
...
}
bool Gst::VideoOverlay::set_render_rectangle |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
Configure a subregion as a video target within the window set by gst_video_overlay_set_window_handle().
If this is not used or not supported the video will fill the area of the window set as the overlay to 100%. By specifying the rectangle, the video can be overlayed to a specific region of that window only. After setting the new rectangle one should call gst_video_overlay_expose() to force a redraw. To unset the region pass -1 for the width and height parameters.
This method is needed for non fullscreen video overlay in UI toolkits that do not support subwindows.
- Parameters
-
x | The horizontal offset of the render area inside the window. |
y | The vertical offset of the render area inside the window. |
width | The width of the render area inside the window. |
height | The height of the render area inside the window. |
- Returns
false
if not supported by the sink.