GstGLWindow

GstGLWindow — window/surface abstraction

Synopsis

enum                GstGLWindowError;
GQuark              gst_gl_window_error_quark           (void);
#define             GST_GL_WINDOW_ERROR
void                (*GstGLWindowResizeCB)              (gpointer data,
                                                         guint width,
                                                         guint height);
#define             GST_GL_WINDOW_RESIZE_CB             (f)
void                (*GstGLWindowCB)                    (gpointer data);
#define             GST_GL_WINDOW_CB                    (f)
                    GstGLWindow;
                    GstGLWindowClass;
GstGLWindow *       gst_gl_window_new                   (GstGLDisplay *display);
void                gst_gl_window_draw                  (GstGLWindow *window,
                                                         guint width,
                                                         guint height);
void                gst_gl_window_draw_unlocked         (GstGLWindow *window,
                                                         guint width,
                                                         guint height);
gboolean            gst_gl_window_is_running            (GstGLWindow *window);
void                gst_gl_window_quit                  (GstGLWindow *window);
void                gst_gl_window_run                   (GstGLWindow *window);
GstGLContext *      gst_gl_window_get_context           (GstGLWindow *window);
guintptr            gst_gl_window_get_display           (GstGLWindow *window);
void                gst_gl_window_send_message          (GstGLWindow *window,
                                                         GstGLWindowCB callback,
                                                         gpointer data);
void                gst_gl_window_send_message_async    (GstGLWindow *window,
                                                         GstGLWindowCB callback,
                                                         gpointer data,
                                                         GDestroyNotify destroy);
void                gst_gl_window_set_close_callback    (GstGLWindow *window,
                                                         GstGLWindowCB callback,
                                                         gpointer data,
                                                         GDestroyNotify destroy_notify);
void                gst_gl_window_set_draw_callback     (GstGLWindow *window,
                                                         GstGLWindowCB callback,
                                                         gpointer data,
                                                         GDestroyNotify destroy_notify);
void                gst_gl_window_set_resize_callback   (GstGLWindow *window,
                                                         GstGLWindowResizeCB callback,
                                                         gpointer data,
                                                         GDestroyNotify destroy_notify);
void                gst_gl_window_set_window_handle     (GstGLWindow *window,
                                                         guintptr handle);
guintptr            gst_gl_window_get_window_handle     (GstGLWindow *window);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GstObject
               +----GstGLWindow

Description

GstGLWindow represents a window that elements can render into. A window can either be a user visible window (onscreen) or hidden (offscreen).

Details

enum GstGLWindowError

typedef enum {
  GST_GL_WINDOW_ERROR_FAILED,
  GST_GL_WINDOW_ERROR_OLD_LIBS,
  GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
} GstGLWindowError;

GST_GL_WINDOW_ERROR_FAILED

GST_GL_WINDOW_ERROR_OLD_LIBS

GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE


gst_gl_window_error_quark ()

GQuark              gst_gl_window_error_quark           (void);

GST_GL_WINDOW_ERROR

#define GST_GL_WINDOW_ERROR (gst_gl_window_error_quark ())

GstGLWindowResizeCB ()

void                (*GstGLWindowResizeCB)              (gpointer data,
                                                         guint width,
                                                         guint height);

GST_GL_WINDOW_RESIZE_CB()

#define GST_GL_WINDOW_RESIZE_CB(f)		 ((GstGLWindowResizeCB) (f))

GstGLWindowCB ()

void                (*GstGLWindowCB)                    (gpointer data);

GST_GL_WINDOW_CB()

#define GST_GL_WINDOW_CB(f)			 ((GstGLWindowCB) (f))

GstGLWindow

typedef struct _GstGLWindow GstGLWindow;

GstGLWindow is an opaque struct and should only be accessed through the provided api.


GstGLWindowClass

typedef struct {
  GstObjectClass parent_class;

  guintptr (*get_display)        (GstGLWindow *window);
  void     (*set_window_handle)  (GstGLWindow *window, guintptr id);
  guintptr (*get_window_handle)  (GstGLWindow *window);
  void     (*draw_unlocked)      (GstGLWindow *window, guint width, guint height);
  void     (*draw)               (GstGLWindow *window, guint width, guint height);
  void     (*run)                (GstGLWindow *window);
  void     (*quit)               (GstGLWindow *window);
  void     (*send_message)       (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
  void     (*send_message_async) (GstGLWindow *window, GstGLWindowCB callback, gpointer data, GDestroyNotify destroy);

  gboolean (*open)               (GstGLWindow *window, GError **error);
  void     (*close)              (GstGLWindow *window);
} GstGLWindowClass;

GstObjectClass parent_class;

Parent class

get_display ()

Gets the current windowing system display connection

set_window_handle ()

Set a window to render into

get_window_handle ()

Gets the current window that this GstGLWindow is rendering into

draw_unlocked ()

redraw the window with the specified dimensions

draw ()

redraw the window with the specified dimensions

run ()

run the mainloop

quit ()

send a quit to the mainloop

send_message ()

invoke a function on the window thread. Required to be reentrant.

send_message_async ()

invoke a function on the window thread. run may or may not have been called. Required to be reentrant.

open ()

open the connection to the display

close ()

close the connection to the display

gst_gl_window_new ()

GstGLWindow *       gst_gl_window_new                   (GstGLDisplay *display);

display :

a GstGLDisplay

Returns :

a new GstGLWindow using display's connection. [transfer full]

Since 1.4


gst_gl_window_draw ()

void                gst_gl_window_draw                  (GstGLWindow *window,
                                                         guint width,
                                                         guint height);

Redraw the window contents. Implementations should invoke the draw callback.

window :

a GstGLWindow

width :

requested width of the window

height :

requested height of the window

Since 1.4


gst_gl_window_draw_unlocked ()

void                gst_gl_window_draw_unlocked         (GstGLWindow *window,
                                                         guint width,
                                                         guint height);

Redraw the window contents. Implementations should invoke the draw callback.

window :

a GstGLWindow

width :

requested width of the window

height :

requested height of the window

Since 1.4


gst_gl_window_is_running ()

gboolean            gst_gl_window_is_running            (GstGLWindow *window);

Whether the runloop is running

window :

a GstGLWindow

Since 1.4


gst_gl_window_quit ()

void                gst_gl_window_quit                  (GstGLWindow *window);

Quit the runloop's execution.

window :

a GstGLWindow

Since 1.4


gst_gl_window_run ()

void                gst_gl_window_run                   (GstGLWindow *window);

Start the execution of the runloop.

window :

a GstGLWindow

Since 1.4


gst_gl_window_get_context ()

GstGLContext *      gst_gl_window_get_context           (GstGLWindow *window);

window :

a GstGLWindow

Returns :

the GstGLContext associated with this window. [transfer full]

Since 1.4


gst_gl_window_get_display ()

guintptr            gst_gl_window_get_display           (GstGLWindow *window);

window :

a GstGLWindow

Returns :

the windowing system display handle for this window

Since 1.4


gst_gl_window_send_message ()

void                gst_gl_window_send_message          (GstGLWindow *window,
                                                         GstGLWindowCB callback,
                                                         gpointer data);

Invoke callback with data on the window thread. callback is guarenteed to have executed when this function returns.

window :

a GstGLWindow

callback :

function to invoke. [scope async]

data :

data to invoke callback with. [closure]

Since 1.4


gst_gl_window_send_message_async ()

void                gst_gl_window_send_message_async    (GstGLWindow *window,
                                                         GstGLWindowCB callback,
                                                         gpointer data,
                                                         GDestroyNotify destroy);

Invoke callback with data on the window thread. The callback may not have been executed when this function returns.

window :

a GstGLWindow

callback :

function to invoke. [scope async]

data :

data to invoke callback with. [closure]

destroy :

called when data is not needed anymore. [destroy]

Since 1.4


gst_gl_window_set_close_callback ()

void                gst_gl_window_set_close_callback    (GstGLWindow *window,
                                                         GstGLWindowCB callback,
                                                         gpointer data,
                                                         GDestroyNotify destroy_notify);

Sets the callback called when the window is about to close.

window :

a GstGLWindow

callback :

function to invoke. [scope notified]

data :

data to invoke callback with. [closure]

destroy_notify :

called when data is not needed any more. [destroy]

Since 1.4


gst_gl_window_set_draw_callback ()

void                gst_gl_window_set_draw_callback     (GstGLWindow *window,
                                                         GstGLWindowCB callback,
                                                         gpointer data,
                                                         GDestroyNotify destroy_notify);

Sets the draw callback called everytime gst_gl_window_draw() is called

window :

a GstGLWindow

callback :

function to invoke. [scope notified]

data :

data to invoke callback with. [closure]

destroy_notify :

called when data is not needed any more. [destroy]

Since 1.4


gst_gl_window_set_resize_callback ()

void                gst_gl_window_set_resize_callback   (GstGLWindow *window,
                                                         GstGLWindowResizeCB callback,
                                                         gpointer data,
                                                         GDestroyNotify destroy_notify);

Sets the resize callback called everytime a resize of the window occurs.

window :

a GstGLWindow

callback :

function to invoke. [scope notified]

data :

data to invoke callback with. [closure]

destroy_notify :

called when data is not needed any more. [destroy]

Since 1.4


gst_gl_window_set_window_handle ()

void                gst_gl_window_set_window_handle     (GstGLWindow *window,
                                                         guintptr handle);

Sets the window that this window should render into. Some implementations require this to be called with a valid handle before drawing can commence.

window :

a GstGLWindow

handle :

handle to the window

Since 1.4


gst_gl_window_get_window_handle ()

guintptr            gst_gl_window_get_window_handle     (GstGLWindow *window);

window :

a GstGLWindow

Returns :

the window handle we are currently rendering into

Since 1.4

See Also

GstGLContext, GstGLDisplay