Commit graph

13 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
Antoine Jacoutot
c765649505 libs: g-ir-scanner: do not hardcode libtool path
https://bugzilla.gnome.org/show_bug.cgi?id=726571
2018-05-18 13:41:25 +02:00
Tim-Philipp Müller
75c32b8afc allocators: GST_EXPORT -> GST_ALLOCATORS_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 10:20:23 +00:00
Sebastian Dröge
1aec533d21 allocators: move GstPhysMemoryAllocator abstraction from -bad to -base
This can be used in a generic way as common interface by all platforms
that, in one way or another, pass around physical memory addresses.

This is used by the gl lib and seems useful enough, so might just as
well move it next to the other allocators.

https://bugzilla.gnome.org/show_bug.cgi?id=779067
2017-12-19 12:01:26 +00:00
Tim-Philipp Müller
60e9629860 g-i: no need to load registry in g-i scanner 2017-05-04 23:55:20 +01:00
Tim-Philipp Müller
d52a74f32e g-i: pass compiler env to g-ir-scanner
It's what introspection.mak does as well. Should
fix spurious build failures on gnome-continuous.
2016-05-24 00:44:21 +01:00
Reynaldo H. Verdejo Pinochet
4ed7b0a0e6 Drop usage of deprecated g-ir-scanner --strip-prefix flag 2015-12-02 20:19:43 -08:00
Tim-Philipp Müller
c680e324bc Remove obsolete Android build cruft
This is not needed any longer.
2015-04-26 18:42:34 +01:00
Edward Hervey
3eb35c77cc introspection: Don't use g-ir-scanner cache at compile time
It pollutes user directories and we don't need to cache it

https://bugzilla.gnome.org/show_bug.cgi?id=747095
2015-03-31 11:21:43 +02:00
Wim Taymans
3205e90e83 fdmemory: make a base class for allocating fd-backed memory
Make a base class that can help with allocating fd-backed memory.
Make dmabuf extend from the base class.
We can now make methods to check if memory has an fd and get the fd for
all the different types of fd-backed memory.
2015-03-18 15:12:03 +01:00
Wim Taymans
4e6fba8604 fdmemory: add fd backed GstMemory to separate file
Make a separate file for the code to handle the fd backed memory.
This would make it possible later to add other allocators also using
fd backed memory.
2015-03-15 15:26:28 +01:00
Sebastian Dröge
37f0067946 allocators: Add single-include header 2013-02-19 10:05:38 +01:00
Benjamin Gaignard
ceecdb8e1d allocators: Add dmabuf-based GstMemory and GstAllocator
Create new GstMemory and GstAllocator base on dmabuf.
Memory is not allocated/freed by userland but mapped/unmmaped
from a dmabuf file descriptor when requested.

This allocator is included in a new lib called libgstallocators

https://bugzilla.gnome.org/show_bug.cgi?id=693826
2013-02-19 10:05:38 +01:00