/* Drawing is asynchronous: gst_gl_window_draw is not blocking
* It means that it does not wait for stuff to be executed in other threads
*/
- gst_gl_window_draw (window, GST_VIDEO_SINK_WIDTH (gl_sink),
+ gst_gl_window_set_preferred_size (window, GST_VIDEO_SINK_WIDTH (gl_sink),
GST_VIDEO_SINK_HEIGHT (gl_sink));
+ gst_gl_window_draw (window);
}
alive = gst_gl_window_is_running (window);
gst_object_unref (window);
window);
static void gst_gl_window_android_egl_set_window_handle (GstGLWindow * window,
guintptr handle);
-static void gst_gl_window_android_egl_draw (GstGLWindow * window, guint width,
- guint height);
+static void gst_gl_window_android_egl_draw (GstGLWindow * window);
static void gst_gl_window_android_egl_run (GstGLWindow * window);
static void gst_gl_window_android_egl_quit (GstGLWindow * window);
static void gst_gl_window_android_egl_send_message_async (GstGLWindow * window,
return (guintptr) window_egl->native_window;
}
-struct draw
-{
- GstGLWindowAndroidEGL *window;
- guint width, height;
-};
-
static void
draw_cb (gpointer data)
{
- struct draw *draw_data = data;
- GstGLWindowAndroidEGL *window_egl = draw_data->window;
+ GstGLWindowAndroidEGL *window_egl = data;
GstGLWindow *window = GST_GL_WINDOW (window_egl);
GstGLContext *context = gst_gl_window_get_context (window);
GstGLContextEGL *context_egl = GST_GL_CONTEXT_EGL (context);
}
static void
-gst_gl_window_android_egl_draw (GstGLWindow * window, guint width, guint height)
+gst_gl_window_android_egl_draw (GstGLWindow * window)
{
- struct draw draw_data;
- GstGLWindowAndroidEGL *window_egl = GST_GL_WINDOW_ANDROID_EGL (window);
-
- draw_data.window = window_egl;
- draw_data.width = width;
- draw_data.height = height;
-
- gst_gl_window_send_message (window, (GstGLWindowCB) draw_cb, &draw_data);
+ gst_gl_window_send_message (window, (GstGLWindowCB) draw_cb, window);
}
static guintptr
struct _GstGLContextCocoaPrivate
{
- CGLContextObj gl_context;
CGLPixelFormatObj pixel_format;
+ CGLContextObj gl_context;
CGLContextObj external_gl_context;
+
+ GstGLAPI context_api;
+
gint source_id;
};
/* =============================================================*/
@interface GstGLCAOpenGLLayer : CAOpenGLLayer {
+@public
GstGLContextCocoa *gst_gl_context;
CGLContextObj gl_context;
+
+@private
gint expected_dims[4];
}
- (id)initWithGstGLContext:(GstGLContextCocoa *)context;
@end
@interface GstGLNSView: NSView {
+@public
GstGLWindowCocoa *window_cocoa;
GstGLCAOpenGLLayer *layer;
}
gl->Viewport (result.x, result.y, result.w, result.h);
if (window) {
- gst_gl_window_cocoa_draw_thread (GST_GL_WINDOW_COCOA (window), 320, 240);
+ gst_gl_window_cocoa_draw_thread (GST_GL_WINDOW_COCOA (window));
gst_object_unref (window);
}
GstGLWindowCocoa * gst_gl_window_cocoa_new (void);
-void gst_gl_window_cocoa_draw_thread (GstGLWindowCocoa *window_cocoa,
- guint width, guint height);
+void gst_gl_window_cocoa_draw_thread (GstGLWindowCocoa *window_cocoa);
G_END_DECLS
static guintptr gst_gl_window_cocoa_get_window_handle (GstGLWindow * window);
static void gst_gl_window_cocoa_set_window_handle (GstGLWindow * window,
guintptr handle);
-static void gst_gl_window_cocoa_draw (GstGLWindow * window, guint width, guint height);
+static void gst_gl_window_cocoa_draw (GstGLWindow * window);
static void gst_gl_window_cocoa_run (GstGLWindow * window);
static void gst_gl_window_cocoa_quit (GstGLWindow * window);
static void gst_gl_window_cocoa_send_message_async (GstGLWindow * window,
GstGLWindowCB callback, gpointer data, GDestroyNotify destroy);
+static void gst_gl_window_cocoa_set_preferred_size (GstGLWindow * window,
+ gint width, gint height);
struct _GstGLWindowCocoaPrivate
{
gboolean visible;
GMainContext *main_context;
GMainLoop *loop;
+ gint preferred_width;
+ gint preferred_height;
GLint viewport_dim[4];
};
window_class->quit = GST_DEBUG_FUNCPTR (gst_gl_window_cocoa_quit);
window_class->send_message_async =
GST_DEBUG_FUNCPTR (gst_gl_window_cocoa_send_message_async);
+ window_class->set_preferred_size =
+ GST_DEBUG_FUNCPTR (gst_gl_window_cocoa_set_preferred_size);
}
static void
gst_gl_window_cocoa_init (GstGLWindowCocoa * window)
{
window->priv = GST_GL_WINDOW_COCOA_GET_PRIVATE (window);
+
+ window->priv->preferred_width = 320;
+ window->priv->preferred_height = 240;
}
/* Must be called in the gl thread */
}
void
-gst_gl_window_cocoa_draw_thread (GstGLWindowCocoa *window_cocoa, guint width, guint height)
+gst_gl_window_cocoa_draw_thread (GstGLWindowCocoa *window_cocoa)
{
GstGLWindowCocoaPrivate *priv = window_cocoa->priv;
windowRect.origin.x += x;
windowRect.origin.y += mainRect.size.height > y ? (mainRect.size.height - y) * 0.5 : y;
- windowRect.size.width = width;
- windowRect.size.height = height;
+ windowRect.size.width = window_cocoa->priv->preferred_width;
+ windowRect.size.height = window_cocoa->priv->preferred_height;
GST_DEBUG ("window rect: %d %d %d %d\n", (int) windowRect.origin.x,
(int) windowRect.origin.y, (int) windowRect.size.width,
}
static void
-gst_gl_window_cocoa_draw (GstGLWindow * window, guint width, guint height)
+gst_gl_window_cocoa_draw (GstGLWindow * window)
{
GstGLWindowCocoa *window_cocoa = GST_GL_WINDOW_COCOA (window);
GstGLNSView *view = (GstGLNSView *)[window_cocoa->priv->internal_win_id contentView];
});
}
+static void
+gst_gl_window_cocoa_set_preferred_size (GstGLWindow * window, gint width,
+ gint height)
+{
+ GstGLWindowCocoa *window_cocoa = GST_GL_WINDOW_COCOA (window);
+
+ window_cocoa->priv->preferred_width = width;
+ window_cocoa->priv->preferred_height = height;
+}
+
static void
gst_gl_window_cocoa_run (GstGLWindow * window)
{
gl_layer = ((GstGLNSView *)[window_cocoa->priv->internal_win_id contentView])->layer;
[gl_layer resize:resize_data->bounds];
- gst_gl_window_draw (window, resize_data->bounds.size.width, resize_data->bounds.size.height);
+ gst_gl_window_draw (window);
}
gst_object_unref (context);
[pool release];
window);
static void gst_gl_window_dispmanx_egl_set_window_handle (GstGLWindow * window,
guintptr handle);
-static void gst_gl_window_dispmanx_egl_draw (GstGLWindow * window, guint width,
- guint height);
+static void gst_gl_window_dispmanx_set_preferred_size (GstGLWindow * window,
+ gint width, gint height);
+static void gst_gl_window_dispmanx_egl_draw (GstGLWindow * window);
static void gst_gl_window_dispmanx_egl_run (GstGLWindow * window);
static void gst_gl_window_dispmanx_egl_quit (GstGLWindow * window);
static void gst_gl_window_dispmanx_egl_send_message_async (GstGLWindow * window,
window_class->open = GST_DEBUG_FUNCPTR (gst_gl_window_dispmanx_egl_open);
window_class->get_display =
GST_DEBUG_FUNCPTR (gst_gl_window_dispmanx_egl_get_display);
+ window_class->set_preferred_size =
+ GST_DEBUG_FUNCPTR (gst_gl_window_dispmanx_egl_set_preferred_size);
}
static void
{
}
+static void
+gst_gl_window_dispmanx_set_preferred_size (GstGLWindow * window)
+{
+ GstGLWindowDispmanxEGL *window_egl = GST_GL_WINDOW_DISPMANX_EGL (window);
+
+ window_egl->preferred_width = width;
+ window_egl->preferred_height = height;
+}
+
static void
window_resize (GstGLWindowDispmanxEGL * window_egl, guint width, guint height)
{
vc_dispmanx_update_submit_sync (dispman_update);
if (GST_GL_WINDOW (window_egl)->resize)
- GST_GL_WINDOW (window_egl)->resize (GST_GL_WINDOW (window_egl)->
- resize_data, width, height);
+ GST_GL_WINDOW (window_egl)->
+ resize (GST_GL_WINDOW (window_egl)->resize_data, width, height);
}
window_egl->native.width = width;
window_egl->native.height = height;
}
-struct draw
-{
- GstGLWindowDispmanxEGL *window;
- guint width, height;
-};
-
static void
draw_cb (gpointer data)
{
- struct draw *draw_data = data;
- GstGLWindowDispmanxEGL *window_egl = draw_data->window;
+ GstGLWindowDispmanxEGL *window_egl = data;
GstGLWindow *window = GST_GL_WINDOW (window_egl);
GstGLContext *context = gst_gl_window_get_context (window);
GstGLContextClass *context_class = GST_GL_CONTEXT_GET_CLASS (context);
- if (window_egl->native.width != draw_data->width
- || window_egl->native.height != draw_data->height) {
+ if (window_egl->native.width != window_egl->preferred_width
+ || window_egl->native.height != window_egl->preferred_height) {
GST_DEBUG ("dimensions don't match, attempting resize");
- window_resize (window_egl, draw_data->width, draw_data->height);
+ window_resize (window_egl, window_egl->preferred_width,
+ window_egl->preferred_height);
}
if (window->draw)
}
static void
-gst_gl_window_dispmanx_egl_draw (GstGLWindow * window, guint width,
- guint height)
+gst_gl_window_dispmanx_egl_draw (GstGLWindow * window)
{
- struct draw draw_data;
-
- draw_data.window = GST_GL_WINDOW_DISPMANX_EGL (window);
- draw_data.width = width;
- draw_data.height = height;
-
- gst_gl_window_send_message (window, (GstGLWindowCB) draw_cb, &draw_data);
+ gst_gl_window_send_message (window, (GstGLWindowCB) draw_cb, window);
}
static guintptr
uint32_t dp_width;
EGL_DISPMANX_WINDOW_T native;
+ gint preferred_width;
+ gint preferred_height;
+
GMainContext *main_context;
GMainLoop *loop;
static guintptr gst_gl_window_eagl_get_window_handle (GstGLWindow * window);
static void gst_gl_window_eagl_set_window_handle (GstGLWindow * window,
guintptr handle);
-static void gst_gl_window_eagl_draw (GstGLWindow * window, guint width,
- guint height);
+static void gst_gl_window_eagl_set_preferred_size (GstGLWindow * window,
+ gint width gint height);
+static void gst_gl_window_eagl_draw (GstGLWindow * window);
static void gst_gl_window_eagl_run (GstGLWindow * window);
static void gst_gl_window_eagl_quit (GstGLWindow * window);
static void gst_gl_window_eagl_send_message_async (GstGLWindow * window,
{
UIView *view;
gint window_width, window_height;
+ gint preferred_width, preferred_height;
GMainContext *main_context;
GMainLoop *loop;
GST_DEBUG_FUNCPTR (gst_gl_window_eagl_send_message_async);
window_class->open = GST_DEBUG_FUNCPTR (gst_gl_window_eagl_open);
window_class->close = GST_DEBUG_FUNCPTR (gst_gl_window_eagl_close);
+ window_class->set_preferred_size =
+ GST_DEBUG_FUNCPTR (gst_gl_window_eagl_set_preferred_size);
}
static void
(GSourceFunc) _run_message, message);
}
-struct draw
+static void
+gst_gl_window_eagl_set_preferred_size (GstGLWindow * window, gint width, gint height)
{
- GstGLWindowEagl *window;
- guint width, height;
-};
+ GstGLWdindowEagl *window_eagl = GST_GL_WINDOW_EAGL (window);
+
+ window_eagl->priv->preferred_width = width;
+ window_eagl->priv->preferred_height = height;
+}
static void
draw_cb (gpointer data)
{
- struct draw *draw_data = data;
- GstGLWindowEagl *window_eagl = draw_data->window;
+ GstGLWindowEagl *window_eagl = data;
GstGLWindow *window = GST_GL_WINDOW (window_eagl);
GstGLContext *context = gst_gl_window_get_context (window);
GstGLContextEagl *eagl_context = GST_GL_CONTEXT_EAGL (context);
eagl_layer = (CAEAGLLayer *)[window_eagl->priv->view layer];
size = eagl_layer.frame.size;
- if (window_eagl->priv->window_width != size.width || window_eagl->priv->window_height != size.height) {
- window_eagl->priv->window_width = size.width;
- window_eagl->priv->window_height = size.height;
+ if (window_eagl->priv->window_width != window_eagl->priv->preferred_width ||
+ window_eagl->priv->window_height != window_eagl->priv->preferred_height) {
+ window_eagl->priv->window_width = window_eagl->priv->preferred_width;
+ window_eagl->priv->window_height = window_eagl->priv->preferred_height;
if (window->resize)
- window->resize (window->resize_data, size.width, size.height);
+ window->resize (window->resize_data, window_eagl->priv->preferred_width,
+ window_eagl->priv->preferred_height);
}
}
}
static void
-gst_gl_window_eagl_draw (GstGLWindow * window, guint width, guint height)
+gst_gl_window_eagl_draw (GstGLWindow * window)
{
- struct draw draw_data;
-
- draw_data.window = GST_GL_WINDOW_EAGL (window);
- draw_data.width = width;
- draw_data.height = height;
-
- gst_gl_window_send_message (window, (GstGLWindowCB) draw_cb, &draw_data);
+ gst_gl_window_send_message (window, (GstGLWindowCB) draw_cb, window);
}
/**
* gst_gl_window_draw_unlocked:
* @window: a #GstGLWindow
- * @width: requested width of the window
- * @height: requested height of the window
*
* Redraw the window contents. Implementations should invoke the draw callback.
*
* Since: 1.4
*/
void
-gst_gl_window_draw_unlocked (GstGLWindow * window, guint width, guint height)
+gst_gl_window_draw_unlocked (GstGLWindow * window)
{
GstGLWindowClass *window_class;
window_class = GST_GL_WINDOW_GET_CLASS (window);
g_return_if_fail (window_class->draw_unlocked != NULL);
- window_class->draw_unlocked (window, width, height);
+ window_class->draw_unlocked (window);
}
/**
* gst_gl_window_draw:
* @window: a #GstGLWindow
- * @width: requested width of the window
- * @height: requested height of the window
*
* Redraw the window contents. Implementations should invoke the draw callback.
*
* Since: 1.4
*/
void
-gst_gl_window_draw (GstGLWindow * window, guint width, guint height)
+gst_gl_window_draw (GstGLWindow * window)
{
GstGLWindowClass *window_class;
return;
}
- window_class->draw (window, width, height);
+ window_class->draw (window);
+}
+
+/**
+ * gst_gl_window_set_preferred_size:
+ * @window: a #GstGLWindow
+ * @width: new preferred width
+ * @height: new preferred height
+ *
+ * Set the preferred width and height of the window. Implementations are free
+ * to ignore this information.
+ *
+ * Since: 1.6
+ */
+void
+gst_gl_window_set_preferred_size (GstGLWindow * window, gint width, gint height)
+{
+ GstGLWindowClass *window_class;
+
+ g_return_if_fail (GST_GL_IS_WINDOW (window));
+ window_class = GST_GL_WINDOW_GET_CLASS (window);
+
+ if (window_class->set_preferred_size)
+ window_class->set_preferred_size (window, width, height);
}
/**
return (guintptr) dummy->handle;
}
-struct draw
-{
- GstGLDummyWindow *window;
- guint width, height;
-};
-
static void
draw_cb (gpointer data)
{
- struct draw *draw_data = data;
- GstGLDummyWindow *dummy = draw_data->window;
+ GstGLDummyWindow *dummy = data;
GstGLWindow *window = GST_GL_WINDOW (dummy);
GstGLContext *context = gst_gl_window_get_context (window);
GstGLContextClass *context_class = GST_GL_CONTEXT_GET_CLASS (context);
}
static void
-gst_gl_dummy_window_draw (GstGLWindow * window, guint width, guint height)
+gst_gl_dummy_window_draw (GstGLWindow * window)
{
- struct draw draw_data;
-
- draw_data.window = (GstGLDummyWindow *) window;
- draw_data.width = width;
- draw_data.height = height;
-
- gst_gl_window_send_message (window, (GstGLWindowCB) draw_cb, &draw_data);
+ gst_gl_window_send_message (window, (GstGLWindowCB) draw_cb, window);
}
static guintptr
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 (*draw_unlocked) (GstGLWindow *window);
+ void (*draw) (GstGLWindow *window);
void (*run) (GstGLWindow *window);
void (*quit) (GstGLWindow *window);
void (*send_message) (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
void (*close) (GstGLWindow *window);
void (*get_surface_dimensions) (GstGLWindow *window, guint *width, guint *height);
void (*handle_events) (GstGLWindow *window, gboolean handle_events);
+ void (*set_preferred_size) (GstGLWindow *window, gint width, gint height);
/*< private >*/
gpointer _reserved[GST_PADDING];
void gst_gl_window_set_window_handle (GstGLWindow *window, guintptr handle);
guintptr gst_gl_window_get_window_handle (GstGLWindow *window);
-void gst_gl_window_draw_unlocked (GstGLWindow *window, guint width, guint height);
-void gst_gl_window_draw (GstGLWindow *window, guint width, guint height);
+void gst_gl_window_draw_unlocked (GstGLWindow *window);
+void gst_gl_window_draw (GstGLWindow *window);
void gst_gl_window_run (GstGLWindow *window);
void gst_gl_window_quit (GstGLWindow *window);
void gst_gl_window_send_message (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
void gst_gl_window_get_surface_dimensions (GstGLWindow * window, guint * width,
guint * height);
void gst_gl_window_handle_events (GstGLWindow * window, gboolean handle_events);
+void gst_gl_window_set_preferred_size (GstGLWindow * window, gint width, gint height);
GstGLContext * gst_gl_window_get_context (GstGLWindow *window);
window);
static void gst_gl_window_wayland_egl_set_window_handle (GstGLWindow * window,
guintptr handle);
-static void gst_gl_window_wayland_egl_draw (GstGLWindow * window, guint width,
- guint height);
+static void gst_gl_window_wayland_egl_draw (GstGLWindow * window);
static void gst_gl_window_wayland_egl_run (GstGLWindow * window);
static void gst_gl_window_wayland_egl_quit (GstGLWindow * window);
static void gst_gl_window_wayland_egl_send_message_async (GstGLWindow * window,
window_egl->window.window_height = height;
}
-struct draw
-{
- GstGLWindowWaylandEGL *window;
- guint width, height;
-};
-
static void
draw_cb (gpointer data)
{
- struct draw *draw_data = data;
- GstGLWindowWaylandEGL *window_egl = draw_data->window;
+ GstGLWindowWaylandEGL *window_egl = data;
GstGLWindow *window = GST_GL_WINDOW (window_egl);
GstGLContext *context = gst_gl_window_get_context (window);
GstGLContextClass *context_class = GST_GL_CONTEXT_GET_CLASS (context);
}
static void
-gst_gl_window_wayland_egl_draw (GstGLWindow * window, guint width, guint height)
+gst_gl_window_wayland_egl_draw (GstGLWindow * window)
{
- struct draw draw_data;
-
- draw_data.window = GST_GL_WINDOW_WAYLAND_EGL (window);
- draw_data.width = width;
- draw_data.height = height;
-
- gst_gl_window_send_message (window, (GstGLWindowCB) draw_cb, &draw_data);
+ gst_gl_window_send_message (window, (GstGLWindowCB) draw_cb, window);
}
static guintptr
struct _GstGLWindowWin32Private
{
GThread *thread;
+
+ gint preferred_width;
+ gint preferred_height;
};
#define GST_CAT_DEFAULT gst_gl_window_win32_debug
static void gst_gl_window_win32_set_window_handle (GstGLWindow * window,
guintptr handle);
static guintptr gst_gl_window_win32_get_display (GstGLWindow * window);
-static void gst_gl_window_win32_draw (GstGLWindow * window, guint width,
- guint height);
+static void gst_gl_window_win32_set_preferred_size (GstGLWindow * window,
+ gint width, gint height);
+static void gst_gl_window_win32_draw (GstGLWindow * window);
static void gst_gl_window_win32_run (GstGLWindow * window);
static void gst_gl_window_win32_quit (GstGLWindow * window);
static void gst_gl_window_win32_send_message_async (GstGLWindow * window,
GST_DEBUG_FUNCPTR (gst_gl_window_win32_send_message_async);
window_class->get_display =
GST_DEBUG_FUNCPTR (gst_gl_window_win32_get_display);
+ window_class->set_preferred_size =
+ GST_DEBUG_FUNCPTR (gst_gl_window_win32_set_preferred_size);
}
static void
window_win32->parent_win_id = (HWND) id;
}
+static void
+gst_gl_window_win32_set_preferred_size (GstGLWindow * window, gint width,
+ gint height)
+{
+ GstGLWindowWin32 *window_win32 = GST_GL_WINDOW_WIN32 (window);
+
+ window_win32->priv->preferred_width = width;
+ window_win32->priv->preferred_height = height;
+}
+
/* Thread safe */
static void
-gst_gl_window_win32_draw (GstGLWindow * window, guint width, guint height)
+gst_gl_window_win32_draw (GstGLWindow * window)
{
GstGLWindowWin32 *window_win32 = GST_GL_WINDOW_WIN32 (window);
+ gint width = window_win32->priv->preferred_width;
+ gint height = window_win32->priv->preferred_height;
if (!window_win32->visible) {
HWND parent_id = window_win32->parent_win_id;
{
gboolean activate;
gboolean activate_result;
+
+ gint preferred_width;
+ gint preferred_height;
};
guintptr gst_gl_window_x11_get_display (GstGLWindow * window);
void gst_gl_window_x11_set_window_handle (GstGLWindow * window,
guintptr handle);
guintptr gst_gl_window_x11_get_window_handle (GstGLWindow * window);
-void gst_gl_window_x11_draw_unlocked (GstGLWindow * window, guint width,
- guint height);
-void gst_gl_window_x11_draw (GstGLWindow * window, guint width, guint height);
+static void gst_gl_window_x11_set_preferred_size (GstGLWindow * window,
+ gint width, gint height);
+void gst_gl_window_x11_draw_unlocked (GstGLWindow * window);
+void gst_gl_window_x11_draw (GstGLWindow * window);
void gst_gl_window_x11_run (GstGLWindow * window);
void gst_gl_window_x11_quit (GstGLWindow * window);
void gst_gl_window_x11_send_message_async (GstGLWindow * window,
GST_DEBUG_FUNCPTR (gst_gl_window_x11_get_surface_dimensions);
window_class->handle_events =
GST_DEBUG_FUNCPTR (gst_gl_window_x11_handle_events);
+ window_class->set_preferred_size =
+ GST_DEBUG_FUNCPTR (gst_gl_window_x11_set_preferred_size);
}
static void
return window_x11->internal_win_id;
}
+static void
+gst_gl_window_x11_set_preferred_size (GstGLWindow * window, gint width,
+ gint height)
+{
+ GstGLWindowX11 *window_x11 = GST_GL_WINDOW_X11 (window);
+
+ window_x11->priv->preferred_width = width;
+ window_x11->priv->preferred_height = height;
+}
+
/* Called in the gl thread */
void
-gst_gl_window_x11_draw_unlocked (GstGLWindow * window, guint width,
- guint height)
+gst_gl_window_x11_draw_unlocked (GstGLWindow * window)
{
GstGLWindowX11 *window_x11;
}
}
-struct draw
-{
- GstGLWindowX11 *window;
- guint width, height;
-};
-
static void
draw_cb (gpointer data)
{
- struct draw *draw_data = data;
- GstGLWindowX11 *window_x11 = draw_data->window;
- guint width = draw_data->width;
- guint height = draw_data->height;
+ GstGLWindowX11 *window_x11 = data;
+ guint width = window_x11->priv->preferred_width;
+ guint height = window_x11->priv->preferred_height;
if (g_main_loop_is_running (window_x11->loop)) {
XWindowAttributes attr;
}
}
- gst_gl_window_x11_draw_unlocked (GST_GL_WINDOW (window_x11), width, height);
+ gst_gl_window_x11_draw_unlocked (GST_GL_WINDOW (window_x11));
}
}
/* Not called by the gl thread */
void
-gst_gl_window_x11_draw (GstGLWindow * window, guint width, guint height)
+gst_gl_window_x11_draw (GstGLWindow * window)
{
- struct draw draw_data;
-
- draw_data.window = GST_GL_WINDOW_X11 (window);
- draw_data.width = width;
- draw_data.height = height;
-
- /* Call from the GL thread */
- gst_gl_window_send_message (window, (GstGLWindowCB) draw_cb, &draw_data);
+ gst_gl_window_send_message (window, (GstGLWindowCB) draw_cb, window);
}
void