Commit graph

40 commits

Author SHA1 Message Date
Xavier Claessens
247697ce62 gl: win32: fix crash when finalizing GstGLContext
gst_gl_context_finalize() is calling gst_gl_window_win32_quit()
which was posting a message. But then window_proc takes window's
context and get a NULL.

Now that we've got a GMainLoop we can do like other backends and
simply call g_main_loop_quit().

This also remove duplicated code to release the parent window and
potential crash there because parent_proc could be NULL if we never
created the internal window. That could happen for example if setting
state to READY then setting a window_handle, and go back to NULL state.

https://bugzilla.gnome.org/show_bug.cgi?id=749601
2015-05-21 14:33:53 -04:00
Xavier Claessens
e1a827822e gl: win32: Fix leaked GstGLContext
https://bugzilla.gnome.org/show_bug.cgi?id=749601
2015-05-21 14:33:53 -04:00
Xavier Claessens
0acc18c60f gl: win32: set the parent window when creating internal window
When _set_window_handle() was called in READY state, it wasn't
set to the internal window created later.

https://bugzilla.gnome.org/show_bug.cgi?id=749601
2015-05-21 14:33:52 -04:00
Xavier Claessens
e24bc348bd gl: win32: use a GMainContext to dispatch win32 messages
gst_gl_window_win32_send_message_async() could be called before the
internal window is created so we cannot use PostMessage there.

x11 and wayland backends both create a custom GSource for this,
so there is no reason to not do that for win32.

https://bugzilla.gnome.org/show_bug.cgi?id=749601
2015-05-21 14:33:52 -04:00
Matthew Waters
1e6011bcdf gl/win32: fixup compilation 2015-01-29 23:46:57 +11:00
Matthew Waters
6cf97eb221 glwindow: make showing a window explicit
Also fixes the cgl context always displaying a window to render to for
every GstGLContextCocoa created
2015-01-29 22:26:37 +11:00
Matthew Waters
ab48bb6f0f glwindow: remove width/height from _draw()
Depending on the platform, it was only ever implemented to 1) set a
default surface size, 2) resize based on the video frame or 3) nothing.
Instead, provide a set_preferred_size () that elements/applications
can use to request a certain size which may be ignored for
videooverlay/other cases.
2015-01-23 16:11:31 +11:00
Matthew Waters
567185a277 glcontext: add more functionality to wrapped contexts
Implements get_current_context() and get_proc_address() for wrapped
contexts.
2014-10-30 18:58:50 +11:00
Matthew Waters
81ceca1aea glcontext: add api for retreiving the current context and api
that is current in the calling thread.
2014-10-28 17:33:20 +11:00
Matthew Waters
3ddcec8062 gl/win32: make send_message reentrant
I could not find a comparable win32API function so keep the running
thread pointer to compare against.

https://bugzilla.gnome.org/show_bug.cgi?id=730782
2014-05-28 00:57:25 +10:00
Sebastian Dröge
cad1bb32c8 gl: Try harder to load symbols from the correct place
This commit makes the loading of the GModules threadsafe, and
always first tries to load the symbol for the GL library that
is selected for the current context. Only then it falls back
to looking into the current module (NULL), and only as a last
resort the context specific function (e.g. eglGetProcAddress())
is called.

Also add configure parameters to select the names of the library
modules instead of using the defaults, and let the defaults be
independent of the G_MODULE_SUFFIX.

https://bugzilla.gnome.org/show_bug.cgi?id=728753
2014-05-01 14:36:54 +02:00
Matthew Waters
e356088f15 gl: fix out-of-source builds pt2
21b897de2f did this for x11 and wayland.
Do it for the other backends as well.
2014-03-27 22:03:14 +11:00
Matthew Waters
9908375fc0 gl: remove explicit reference to X_CFLAGS
They are in GL_CFLAGS if required
2014-03-24 23:19:02 +11:00
Matthew Waters
45c94fa750 gl/win32: use the correct include and gst-indent 2014-03-23 00:39:43 +11:00
Wang Xin-yu (王昕宇)
05cb4bc6a5 gl: use wglCreateContextAttribsARB to create share context
https://bugzilla.gnome.org/show_bug.cgi?id=726494
2014-03-20 15:45:02 +11:00
Julien Isorce
e870244e39 gl: keep only one occurence of '#include <EGL/egl.h>'
To simply maintainance if we need to put specific includes around it.
2014-03-19 14:43:13 +00:00
Matthew Waters
3ad466945e [891/906] context: add support for wrapping external contexts 2014-03-15 18:37:07 +01:00
Matthew Waters
cf7838a0b6 [862/906] window: remove set_need_lock
No-one is using it.  The only code that did was the x11 one which
doesn't need it anymore.
2014-03-15 18:37:05 +01:00
Matthew Waters
db1c7a242b [818/906] window: add send_message_async vmethod
- provide a default synchronous send_message
- make context creation threadsafe again
2014-03-15 18:37:02 +01:00
Matthew Waters
311592f8b1 [807/906] context: Move some window error enums to context 2014-03-15 18:37:02 +01:00
Matthew Waters
b24021b1ac [801/906] context: Reimplement GL context sharing
https://bugzilla.gnome.org/show_bug.cgi?id=704806
2014-03-15 18:37:01 +01:00
Matthew Waters
95c08c2ee2 [794/906] context: add subclasses for the different platforms (egl, glx, wgl, etc)
- most code taken from the Window subclasses
- tested combinations: xEGL, GLX, Wayland+EGL, Cocoa (under GNUStep), WGL (Wine)
2014-03-15 18:37:01 +01:00
Matthew Waters
cf5e910d9b [793/906] add a GstGLContext object that will be the basis of OpenGL contexts
At the moment it just sits in between GstGLDisplay and GstGLWindow
performing some of the stuff that GstGLWindow used to do.
2014-03-15 18:37:01 +01:00
Matthew Waters
b5d595f402 [792/906] build: use our own in tree headers before system ones
allows us to develop against the tree rather than what may be installed
2014-03-15 18:37:01 +01:00
Sebastian Dröge
3900c6750c [774/906] win32: Fix some compiler errors/warnings 2014-03-15 18:37:00 +01:00
Sebastian Dröge
20cb4fb038 [771/906] gl: Some less long/ulong/gulong usage 2014-03-15 18:36:59 +01:00
Sebastian Dröge
2b6e54d416 [752/906] glwindow: Add destroy notifies for the data of the callbacks
And actually call the close callback when the window is closed.
2014-03-15 18:36:58 +01:00
Sebastian Dröge
4c7388be18 [743/906] win32: Allow setting window handle before creating the context 2014-03-15 18:36:58 +01:00
Sebastian Dröge
83d066b0a5 [734/906] win32: Make automake happy by using noinst_HEADERS 2014-03-15 18:36:57 +01:00
Sebastian Dröge
a5a46aa833 [733/906] gl: Major header and include cleanup 2014-03-15 18:36:57 +01:00
Matthew Waters
908cc1989b [726/906] window: don't call a NULL destroy function 2014-03-15 18:36:57 +01:00
Matthew Waters
9adc3c8cf3 [695/906] build: remove libtool warning about -version-info not used in convenience libraries 2014-03-15 18:36:55 +01:00
Matthew Waters
d4fabed3e4 [678/906] window_win32_wgl: implement wglGetProcAddress for extension functions 2014-03-15 18:36:54 +01:00
Matthew Waters
8b0b154d6e [676/906] windwo_win32: port to new API 2014-03-15 18:36:54 +01:00
Matthew Waters
fa3c3b8434 [642/906] add gstglconfig.h for apps to find out what our capabilites are
ie libgstgl can be compiled with any combination of opengl/gles2
2014-03-15 18:36:52 +01:00
Matthew Waters
76dfdd656f [629/906] window: add GError for error handling of context creation 2014-03-15 18:36:51 +01:00
Matthew Waters
bbd3b4dbd9 [623/906] move GL includes into a single file 2014-03-15 18:36:51 +01:00
Matthew Waters
fd998dc0a5 [621/906] GstGLRendererAPI => GstGLAPI and get GstGLAPI from a window 2014-03-15 18:36:51 +01:00
Matthew Waters
411a87fb0b [619/906] fix typo for win32 debug variables 2014-03-15 18:36:51 +01:00
Matthew Waters
1679a0be7e [616/906] move window-specific code into seperate subfolders 2014-03-15 18:36:50 +01:00