Commit graph

29 commits

Author SHA1 Message Date
Tim-Philipp Müller
dc29bc4e13 libs: fix API export/import and 'inconsistent linkage' on MSVC
For each lib we build export its own API in headers when we're
building it, otherwise import the API from the headers.

This fixes linker warnings on Windows when building with MSVC.

The problem was that we had defined all GST_*_API decorators
unconditionally to GST_EXPORT. This was intentional and only
supposed to be temporary, but caused linker warnings because
we tell the linker that we want to export all symbols even
those from externall DLLs, and when the linker notices that
they were in external DLLS and not present locally it warns.

What we need to do when building each library is: export
the library's own symbols and import all other symbols. To
this end we define e.g. BUILDING_GST_FOO and then we define
the GST_FOO_API decorator either to export or to import
symbols depending on whether BUILDING_GST_FOO is set or not.
That way external users of each library API automatically
get the import.

While we're at it, add new GST_API_EXPORT in config.h and use
that for GST_*_API decorators instead of GST_EXPORT.

The right export define depends on the toolchain and whether
we're using -fvisibility=hidden or not, so it's better to set it
to the right thing directly than hard-coding a compiler whitelist
in the public header.

We put the export define into config.h instead of passing it via the
command line to the compiler because it might contain spaces and brackets
and in the autotools scenario we'd have to pass that through multiple
layers of plumbing and Makefile/shell escaping and we're just not going
to be *that* lucky.

The export define is only used if we're compiling our lib, not by external
users of the lib headers, so it's not a problem to put it into config.h

Also, this means all .c files of libs need to include config.h
to get the export marker defined, so fix up a few that didn't
include config.h.

This commit depends on a common submodule commit that makes gst-glib-gen.mak
add an #include "config.h" to generated enum/marshal .c files for the
autotools build.

https://bugzilla.gnome.org/show_bug.cgi?id=797185
2018-09-24 08:45:34 +01:00
Tim-Philipp Müller
b6e65172fe gl: fix build
Include private headers for parent class debug categories.
2017-12-09 19:32:29 +00:00
Matthew Waters
4c75bab70d glcontext: add public swap_buffers function
That simply calls the implementation
2017-12-09 19:32:28 +00:00
Sebastian Dröge
a9a05c01a9 gst: Clear floating flag in constructor of all GstObject subclasses that are not owned by any parent
https://bugzilla.gnome.org/show_bug.cgi?id=743062
2017-12-09 19:32:28 +00:00
Matthew Waters
50f60c9ae9 gl/android: don't install the android window header
It's not needed
2017-12-09 19:32:24 +00:00
Matthew Waters
18ac98c58b gl: GST_GL_TYPE -> GST_TYPE_GL
Some deprecated symbols are kept for backwards compatibility
2017-12-09 19:32:23 +00:00
Holger Kaelberer
944923080b glwindow: Fix android build
https://bugzilla.gnome.org/show_bug.cgi?id=760972
2017-12-09 19:32:15 +00:00
Matthew Waters
06de6998e5 gl: be consistent in gobject boilerpate
GST_GL_IS_* vs GST_IS_GL_*

git grep -l 'GST_GL_IS_' | xargs sed -i 's/GST_GL_IS_/GST_IS_GL_/g'
2017-12-09 19:32:09 +00:00
Matthew Waters
e9864e2e3e glwindow: remove unused draw_unlocked function
The functionality is provided by draw anyway and is leftover from
X11's specific threading requirements that no longer apply.
2017-12-09 19:32:08 +00:00
Matthew Waters
63bbe9406a glwindow: add API to request a resize event on the next draw
- glimagesink needs to be able to resize the viewport on aspect ratio
  changes resulting from either caps changes or 3d output mode changes.
- Performing a glViewport outside the GstGLWindow::resize callback
  will not have the winsys' stack of viewports required to correctly
  place the output frame.

Provide a function to request a resize on the next draw event from the
winsys.

Also track size changes inside the base GstGLWindow class rather
than in each subclass.

https://bugzilla.gnome.org/show_bug.cgi?id=755111
2017-12-09 19:32:08 +00:00
Matthew Waters
6ccaafc0f3 glwindow: pass display to implementation's _new()
So they have to opportunity to fail if they cannot handle the
display connection.

https://bugzilla.gnome.org/show_bug.cgi?id=752743
2017-12-09 19:32:07 +00:00
Matthew Waters
6a7bb242f9 android: add missing egl.h include 2017-12-09 19:32:05 +00:00
Matthew Waters
bb1de83ff2 gl/window: use the default main loop implementation for all backends
fixes glimagsink being unable to display.

https://bugzilla.gnome.org/show_bug.cgi?id=750337
2017-12-09 19:32:03 +00:00
Matthew Waters
9968b512c5 gl/window: hopefully fixup compile warnings on android/ios 2017-12-09 19:31:56 +00:00
Matthew Waters
5b8f3e7870 gl/window: create the main loop/context on init/finalize
Avoids races setting the window handle from the main thread.

https://bugzilla.gnome.org/show_bug.cgi?id=745633
2017-12-09 19:31:56 +00:00
Matthew Waters
019367c128 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.
2017-12-09 19:31:53 +00:00
Sebastian Dröge
6fb0f1d1c7 gl/android: Notify the window's resize callback about surface dimension changes
https://bugzilla.gnome.org/show_bug.cgi?id=728107
2017-12-09 19:31:37 +00:00
Matthew Waters
6491e4d275 gl: fix out-of-source builds pt2
21b897de2f did this for x11 and wayland.
Do it for the other backends as well.
2017-12-09 19:31:35 +00:00
Julien Isorce
b30d15d4b8 gl: keep only one occurence of '#include <EGL/egl.h>'
To simply maintainance if we need to put specific includes around it.
2017-12-09 19:31:34 +00:00
Matthew Waters
2026f60879 [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.
2017-12-09 19:31:33 +00:00
Matthew Waters
266ffc48be [824/906] android: Build fixes
https://bugzilla.gnome.org/show_bug.cgi?id=709786
2017-12-09 19:31:31 +00:00
Matthew Waters
3b1ec77cf8 [818/906] window: add send_message_async vmethod
- provide a default synchronous send_message
- make context creation threadsafe again
2017-12-09 19:31:31 +00:00
Matthew Waters
b8b9fced19 [796/906] move egl into its own directory 2017-12-09 19:31:31 +00:00
Matthew Waters
83ac943fc4 [795/906] android: port to GstGLContext
not tested
2017-12-09 19:31:31 +00:00
Matthew Waters
e80533dcee [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.
2017-12-09 19:31:30 +00:00
Matthew Waters
175f28848c [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
2017-12-09 19:31:30 +00:00
Sebastian Dröge
a41b21f4a5 [758/906] android: Don't require a window to be set
This allows the filters to be usable without a GL sink downstream.
2017-12-09 19:31:30 +00:00
Sebastian Dröge
90450a39b7 [746/906] android: Add comment to clarify the type of a variable 2017-12-09 19:31:29 +00:00
Sebastian Dröge
192b37980f [735/906] gl: Add support for Android
https://bugzilla.gnome.org/show_bug.cgi?id=703340
2017-12-09 19:31:29 +00:00