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
This commit is contained in:
Tim-Philipp Müller 2018-09-24 11:52:22 +01:00
parent be3edc6ad6
commit b6411ae74c
67 changed files with 187 additions and 37 deletions

2
common

@ -1 +1 @@
Subproject commit ed78bee437dcbe22e6eef0031d9a29d157c0461f
Subproject commit cd1dee06bf07f094677d0cf3eea4a2e8c2636b24

View file

@ -2485,7 +2485,13 @@ fi
AC_SUBST(DEPRECATED_CFLAGS)
VISIBILITY_CFLAGS=""
AS_COMPILER_FLAG([-fvisibility=hidden], [VISIBILITY_CFLAGS="-fvisibility=hidden"])
AS_COMPILER_FLAG([-fvisibility=hidden], [
VISIBILITY_CFLAGS="-fvisibility=hidden"
AC_DEFINE(GST_API_EXPORT, [extern __attribute__ ((visibility ("default")))], [public symbol export define])
], [
VISIBILITY_CFLAGS=""
AC_DEFINE(GST_API_EXPORT, [extern], [public symbol export define])
])
AC_SUBST(VISIBILITY_CFLAGS)
VISIBILITY_CXXFLAGS=""

View file

@ -14,6 +14,7 @@ libgstadaptivedemux_@GST_API_VERSION@_la_CFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
-DGST_USE_UNSTABLE_API \
-DBUILDING_GST_ADAPTIVE_DEMUX \
$(GST_CFLAGS)
libgstadaptivedemux_@GST_API_VERSION@_la_LIBADD = \
$(top_builddir)/gst-libs/gst/uridownloader/libgsturidownloader-$(GST_API_VERSION).la \

View file

@ -25,7 +25,11 @@
#include <gst/gst.h>
#ifndef GST_ADAPTIVE_DEMUX_API
#define GST_ADAPTIVE_DEMUX_API GST_EXPORT
# ifdef BUILDING_GST_ADAPTIVE_DEMUX
# define GST_ADAPTIVE_DEMUX_API GST_API_EXPORT /* from config.h */
# else
# define GST_ADAPTIVE_DEMUX_API GST_API_IMPORT
# endif
#endif
#endif /* __GST_ADAPTIVE_DEMUX_PRELUDE_H__ */

View file

@ -1,6 +1,6 @@
gstadaptivedemux = library('gstadaptivedemux-' + api_version,
'gstadaptivedemux.c',
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'],
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API', '-DBUILDING_GST_ADAPTIVE_DEMUX'],
include_directories : [configinc, libsinc],
version : libversion,
soversion : soversion,

View file

@ -11,6 +11,7 @@ nodist_libgstbadaudio_@GST_API_VERSION@_la_SOURCES = $(BUILT_SOURCES)
libgstbadaudio_@GST_API_VERSION@_la_CFLAGS = \
-DGST_USE_UNSTABLE_API \
-DBUILDING_GST_AUDIO_BAD \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
$(GST_CFLAGS) $(ORC_CFLAGS) \

View file

@ -25,7 +25,11 @@
#include <gst/gst.h>
#ifndef GST_AUDIO_BAD_API
#define GST_AUDIO_BAD_API GST_EXPORT
# ifdef BUILDING_GST_AUDIO_BAD
# define GST_AUDIO_BAD_API GST_API_EXPORT /* from config.h */
# else
# define GST_AUDIO_BAD_API GST_API_IMPORT
# endif
#endif
#endif /* __GST_AUDIO_BAD_PRELUDE_H__ */

View file

@ -27,6 +27,9 @@
* non-interleaved (planar) audio buffers. Before using, an audio format
* must be configured with gst_planar_audio_adapter_configure()
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstplanaraudioadapter.h"

View file

@ -5,7 +5,7 @@ install_headers(badaudio_headers, subdir : 'gstreamer-1.0/gst/audio')
gstbadaudio = library('gstbadaudio-' + api_version,
badaudio_sources,
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'],
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API', '-DBUILDING_GST_AUDIO_BAD'],
include_directories : [configinc, libsinc],
version : libversion,
soversion : soversion,

View file

@ -19,6 +19,7 @@ libgstbasecamerabinsrc_@GST_API_VERSION@_la_CFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
-DGST_USE_UNSTABLE_API \
-DBUILDING_GST_BASE_CAMERA_BIN_SRC \
$(GST_CFLAGS)
libgstbasecamerabinsrc_@GST_API_VERSION@_la_LIBADD = \
-lgstapp-$(GST_API_VERSION) $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS) $(GST_LIBS)

View file

@ -25,7 +25,11 @@
#include <gst/gst.h>
#ifndef GST_BASE_CAMERA_BIN_SRC_API
#define GST_BASE_CAMERA_BIN_SRC_API GST_EXPORT
# ifdef BUILDING_GST_BASE_CAMERA_BIN_SRC
# define GST_BASE_CAMERA_BIN_SRC_API GST_API_EXPORT /* from config.h */
# else
# define GST_BASE_CAMERA_BIN_SRC_API GST_API_IMPORT
# endif
#endif
#endif /* __GST_BASE_CAMERA_BIN_SRC_PRELUDE_H__ */

View file

@ -17,6 +17,9 @@
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstcamerabin-enum.h"

View file

@ -26,6 +26,10 @@
* #GstCameraBinVideo.
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/app/gstappsrc.h>
#include <gst/app/gstappsink.h>
#include <gst/glib-compat-private.h>

View file

@ -13,7 +13,7 @@ install_headers(camerabin_headers, subdir : 'gstreamer-1.0/gst/basecamerabinsrc'
gstbasecamerabin = library('gstbasecamerabinsrc-' + api_version,
camerabin_sources,
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'],
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API', '-DBUILDING_GST_BASE_CAMERA_BIN_SRC'],
include_directories : [configinc, libsinc],
version : libversion,
soversion : soversion,

View file

@ -26,6 +26,7 @@ libgstcodecparsers_@GST_API_VERSION@include_HEADERS = \
libgstcodecparsers_@GST_API_VERSION@_la_CFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) \
-DGST_USE_UNSTABLE_API \
-DBUILDING_GST_CODEC_PARSERS \
$(GST_CFLAGS) \
-Dvp8_norm=gst_codecparsers_vp8_norm \
-Dvp8dx_start_decode=gst_codecparsers_vp8dx_start_decode \

View file

@ -25,7 +25,11 @@
#include <gst/gst.h>
#ifndef GST_CODEC_PARSERS_API
#define GST_CODEC_PARSERS_API GST_EXPORT
# ifdef BUILDING_GST_CODEC_PARSERS
# define GST_CODEC_PARSERS_API GST_API_EXPORT /* from config.h */
# else
# define GST_CODEC_PARSERS_API GST_API_IMPORT
# endif
#endif
#endif /* __GST_CODEC_PARSERS_PRELUDE_H__ */

View file

@ -7,7 +7,9 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "dboolhuff.h"

View file

@ -24,6 +24,9 @@
* @short_description: Manage JPEG 2000 sampling and colorspace fields
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstjpeg2000sampling.h"

View file

@ -26,6 +26,9 @@
* Provides useful functions for parsing JPEG images
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include <stdlib.h>

View file

@ -7,6 +7,9 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstvp8rangedecoder.h"
#include "dboolhuff.h"

View file

@ -34,6 +34,7 @@ install_headers(codecparser_headers, subdir : 'gstreamer-1.0/gst/codecparsers')
cp_args = [
'-DGST_USE_UNSTABLE_API',
'-DBUILDING_GST_CODEC_PARSERS',
'-Dvp8_norm=gst_codecparsers_vp8_norm',
'-Dvp8dx_start_decode=gst_codecparsers_vp8dx_start_decode',
'-Dvp8dx_bool_decoder_fill=gst_codecparsers_vp8dx_bool_decoder_fill',

View file

@ -18,6 +18,9 @@
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "parserutils.h"

View file

@ -7,6 +7,9 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include "vp8utils.h"

View file

@ -9,6 +9,7 @@ libgstinsertbin_@GST_API_VERSION@include_HEADERS = gstinsertbin.h
libgstinsertbin_@GST_API_VERSION@_la_CFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) \
-DBUILDING_GST_INSERT_BIN \
$(GST_CFLAGS)
libgstinsertbin_@GST_API_VERSION@_la_LIBADD = \

View file

@ -34,7 +34,11 @@
#include <gst/gst.h>
#ifndef GST_INSERT_BIN_API
#define GST_INSERT_BIN_API GST_EXPORT
# ifdef BUILDING_GST_INSERT_BIN
# define GST_INSERT_BIN_API GST_API_EXPORT /* from config.h */
# else
# define GST_INSERT_BIN_API GST_API_IMPORT
# endif
#endif
G_BEGIN_DECLS

View file

@ -4,7 +4,7 @@ install_headers(insert_headers, subdir : 'gstreamer-1.0/gst/insertbin')
gstinsertbin = library('gstinsertbin-' + api_version,
insert_sources,
c_args : gst_plugins_bad_args + [ '-DGST_USE_UNSTABLE_API' ],
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API', '-DBUILDING_GST_INSERT_BIN'],
include_directories : [configinc, libsinc],
version : libversion,
soversion : soversion,

View file

@ -34,6 +34,7 @@ nodist_libgstphotography_@GST_API_VERSION@_la_SOURCES = \
libgstphotography_@GST_API_VERSION@_la_CFLAGS = \
-DGST_USE_UNSTABLE_API \
-DBUILDING_GST_PHOTOGRAPHY \
$(GST_PLUGINS_BAD_CFLAGS) \
$(GST_CFLAGS)
libgstphotography_@GST_API_VERSION@_la_LIBADD = $(GST_LIBS)

View file

@ -4,6 +4,7 @@ install_headers(photo_headers, subdir : 'gstreamer-1.0/gst/interfaces')
photo_enums = gnome.mkenums_simple('photography-enumtypes',
sources : photo_headers,
body_prefix : '#ifdef HAVE_CONFIG_H\n#include "config.h"\n#endif',
header_prefix : '#include <gst/interfaces/photography-prelude.h>',
decorator: 'GST_PHOTOGRAPHY_API',
install_header: true,
@ -14,7 +15,7 @@ photoenum_h = photo_enums[1]
gstphotography = library('gstphotography-' + api_version,
photography_sources, photoenum_h, photoenum_c,
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'],
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API', '-DBUILDING_GST_PHOTOGRAPHY'],
include_directories : [configinc, libsinc],
version : libversion,
soversion : soversion,

View file

@ -25,7 +25,11 @@
#include <gst/gst.h>
#ifndef GST_PHOTOGRAPHY_API
#define GST_PHOTOGRAPHY_API GST_EXPORT
# ifdef BUILDING_GST_PHOTOGRAPHY
# define GST_PHOTOGRAPHY_API GST_API_EXPORT /* from config.h */
# else
# define GST_PHOTOGRAPHY_API GST_API_IMPORT
# endif
#endif
#endif /* __GST_PHOTOGRAPHY_PRELUDE_H__ */

View file

@ -12,6 +12,7 @@ libgstisoff_@GST_API_VERSION@include_HEADERS = \
libgstisoff_@GST_API_VERSION@_la_CFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) \
-DGST_USE_UNSTABLE_API \
-DBUILDING_GST_ISOFF \
$(GST_CFLAGS)
libgstisoff_@GST_API_VERSION@_la_LIBADD = \

View file

@ -21,6 +21,9 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstisoff.h"
#include <gst/base/gstbytereader.h>

View file

@ -31,7 +31,11 @@
G_BEGIN_DECLS
#ifndef GST_ISOFF_API
#define GST_ISOFF_API GST_EXPORT
# ifdef BUILDING_GST_ISOFF
# define GST_ISOFF_API GST_API_EXPORT /* from config.h */
# else
# define GST_ISOFF_API GST_API_IMPORT
# endif
#endif
typedef enum {

View file

@ -8,7 +8,7 @@ install_headers(isoff_headers, subdir : 'gstreamer-1.0/gst/isoff')
gstisoff = library('gstisoff-' + api_version,
isoff_sources,
c_args : gst_plugins_bad_args + [ '-DGST_USE_UNSTABLE_API' ],
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API', '-DBUILDING_GST_ISOFF'],
include_directories : [configinc, libsinc],
version : libversion,
soversion : soversion,

View file

@ -28,6 +28,7 @@ nodist_libgstmpegts_@GST_API_VERSION@include_HEADERS = \
libgstmpegts_@GST_API_VERSION@_la_CFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) \
-DGST_USE_UNSTABLE_API \
-DBUILDING_GST_MPEGTS \
$(GST_CFLAGS)
libgstmpegts_@GST_API_VERSION@_la_LIBADD = \

View file

@ -19,6 +19,9 @@
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include <stdlib.h>

View file

@ -20,6 +20,10 @@
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>

View file

@ -28,6 +28,9 @@
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include <stdlib.h>

View file

@ -20,6 +20,10 @@
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>

View file

@ -28,6 +28,9 @@
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include <stdlib.h>

View file

@ -20,6 +20,7 @@ install_headers(mpegts_headers, subdir : 'gstreamer-1.0/gst/mpegts')
mpegts_enums = gnome.mkenums_simple('gstmpegts-enumtypes',
sources : mpegts_headers,
body_prefix : '#ifdef HAVE_CONFIG_H\n#include "config.h"\n#endif',
header_prefix : '#include <gst/mpegts/mpegts-prelude.h>',
decorator : 'GST_MPEGTS_API',
install_header: true,
@ -31,7 +32,7 @@ gen_sources = [mpegtsenumtypes_h]
gstmpegts = library('gstmpegts-' + api_version,
mpegts_sources, mpegts_enums,
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'],
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API', '-DBUILDING_GST_MPEGTS'],
include_directories : [configinc, libsinc],
version : libversion,
soversion : soversion,

View file

@ -25,7 +25,11 @@
#include <gst/gst.h>
#ifndef GST_MPEGTS_API
#define GST_MPEGTS_API GST_EXPORT
# ifdef BUILDING_GST_MPEGTS
# define GST_MPEGTS_API GST_API_EXPORT /* from config.h */
# else
# define GST_MPEGTS_API GST_API_IMPORT
# endif
#endif
#endif /* __GST_MPEGTS_PRELUDE_H__ */

View file

@ -7,6 +7,7 @@ libgstopencv_@GST_API_VERSION@_la_SOURCES = \
libgstopencv_@GST_API_VERSION@_la_CXXFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CXXFLAGS) \
-DBUILDING_GST_OPENCV \
$(OPENCV_CFLAGS)
libgstopencv_@GST_API_VERSION@_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) \

View file

@ -13,7 +13,7 @@ opencv_dep = dependency('opencv', version : '>= 3.0.0', required : get_option('o
if opencv_dep.found()
gstopencv = library('gstopencv-' + api_version,
opencv_sources,
c_args : gst_plugins_bad_args,
c_args : gst_plugins_bad_args + ['-DBUILDING_GST_OPENCV'],
include_directories : [configinc, libsinc],
version : libversion,
soversion : soversion,

View file

@ -25,7 +25,11 @@
#include <gst/gst.h>
#ifndef GST_OPENCV_API
#define GST_OPENCV_API GST_EXPORT
# ifdef BUILDING_GST_OPENCV
# define GST_OPENCV_API GST_API_EXPORT /* from config.h */
# else
# define GST_OPENCV_API GST_API_IMPORT
# endif
#endif
#endif /* __GST_OPENCV_PRELUDE_H__ */

View file

@ -12,6 +12,7 @@ libgstplayer_@GST_API_VERSION@_la_SOURCES = \
libgstplayer_@GST_API_VERSION@_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
-DBUILDING_GST_PLAYER \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CFLAGS)

View file

@ -25,7 +25,7 @@ install_headers(gstplayer_headers, subdir : 'gstreamer-' + api_version + '/gst/p
gstplayer = library('gstplayer-' + api_version,
gstplayer_sources,
c_args : gst_plugins_bad_args,
c_args : gst_plugins_bad_args + ['-DBUILDING_GST_PLAYER'],
include_directories : [configinc, libsinc],
version : libversion,
soversion : soversion,

View file

@ -25,7 +25,11 @@
#include <gst/gst.h>
#ifndef GST_PLAYER_API
#define GST_PLAYER_API GST_EXPORT
# ifdef BUILDING_GST_PLAYER
# define GST_PLAYER_API GST_API_EXPORT /* from config.h */
# else
# define GST_PLAYER_API GST_API_IMPORT
# endif
#endif
#endif /* __GST_PLAYER_PRELUDE_H__ */

View file

@ -7,6 +7,7 @@ libgstsctp_1_0_la_SOURCES = \
libgstsctp_1_0_la_CFLAGS = \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
-DBUILDING_GST_SCTP \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CFLAGS)

View file

@ -13,7 +13,7 @@ install_headers(sctp_headers, subdir : 'gstreamer-1.0/gst/sctp')
libgstsctp = library('gstsctp-' + api_version,
sctp_sources,
c_args : gst_plugins_bad_args,
c_args : gst_plugins_bad_args + ['-DBUILDING_GST_SCTP'],
include_directories : [configinc, libsinc],
version : libversion,
soversion : soversion,

View file

@ -25,7 +25,11 @@
#include <gst/gst.h>
#ifndef GST_SCTP_API
#define GST_SCTP_API GST_EXPORT
# ifdef BUILDING_GST_SCTP
# define GST_SCTP_API GST_API_EXPORT /* from config.h */
# else
# define GST_SCTP_API GST_API_IMPORT
# endif
#endif
#endif /* __GST_SCTP_PRELUDE_H__ */

View file

@ -22,6 +22,9 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "sctpreceivemeta.h"

View file

@ -22,6 +22,9 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "sctpsendmeta.h"

View file

@ -12,6 +12,7 @@ libgsturidownloader_@GST_API_VERSION@include_HEADERS = \
libgsturidownloader_@GST_API_VERSION@_la_CFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) \
-DGST_USE_UNSTABLE_API \
-DBUILDING_GST_URI_DOWNLOADER \
$(GST_CFLAGS)
libgsturidownloader_@GST_API_VERSION@_la_LIBADD = \

View file

@ -18,6 +18,9 @@
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <glib.h>
#include <gst/base/gsttypefindhelper.h>

View file

@ -18,6 +18,9 @@
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <glib.h>
#include "gstfragment.h"

View file

@ -12,7 +12,7 @@ install_headers(urid_headers, subdir : 'gstreamer-1.0/gst/uridownloader')
gsturidownloader = library('gsturidownloader-' + api_version,
urid_sources,
c_args : gst_plugins_bad_args + [ '-DGST_USE_UNSTABLE_API' ],
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API', '-DBUILDING_GST_URI_DOWNLOADER'],
include_directories : [configinc, libsinc],
version : libversion,
soversion : soversion,

View file

@ -25,7 +25,11 @@
#include <gst/gst.h>
#ifndef GST_URI_DOWNLOADER_API
#define GST_URI_DOWNLOADER_API GST_EXPORT
# ifdef BUILDING_GST_URI_DOWNLOADER
# define GST_URI_DOWNLOADER_API GST_API_EXPORT /* from config.h */
# else
# define GST_URI_DOWNLOADER_API GST_API_IMPORT
# endif
#endif
#endif /* __GST_URI_DOWNLOADER_PRELUDE_H__ */

View file

@ -10,6 +10,7 @@ nodist_libgstbadvideo_@GST_API_VERSION@_la_SOURCES = $(BUILT_SOURCES)
libgstbadvideo_@GST_API_VERSION@_la_CFLAGS = \
-DGST_USE_UNSTABLE_API \
-DBUILDING_GST_VIDEO_BAD \
-I$(top_srcdir)/gst-libs \
-I$(top_builddir)/gst-libs \
$(GST_CFLAGS) $(ORC_CFLAGS) \

View file

@ -10,7 +10,7 @@ install_headers(badvideo_headers, subdir : 'gstreamer-1.0/gst/video')
gstbadvideo = library('gstbadvideo-' + api_version,
badvideo_sources,
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'],
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API', '-DBUILDING_GST_VIDEO_BAD'],
include_directories : [configinc, libsinc],
version : libversion,
soversion : soversion,

View file

@ -25,7 +25,11 @@
#include <gst/gst.h>
#ifndef GST_VIDEO_BAD_API
#define GST_VIDEO_BAD_API GST_EXPORT
# ifdef BUILDING_GST_VIDEO_BAD
# define GST_VIDEO_BAD_API GST_API_EXPORT /* from config.h */
# else
# define GST_VIDEO_BAD_API GST_API_IMPORT
# endif
#endif
#endif /* __GST_VIDEO_BAD_PRELUDE_H__ */

View file

@ -9,6 +9,7 @@ libgstwayland_@GST_API_VERSION@_la_CFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_CFLAGS) \
-DBUILDING_GST_WAYLAND \
$(WAYLAND_CFLAGS)
libgstwayland_@GST_API_VERSION@_la_LIBADD = \

View file

@ -9,7 +9,7 @@ use_wayland = wl_protocol_dep.found() and wl_client_dep.found() and wl_scanner.f
if use_wayland
gstwayland = library('gstwayland-' + api_version,
'wayland.c',
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'],
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API', '-DBUILDING_GST_WAYLAND'],
include_directories : [configinc, libsinc],
version : libversion,
soversion : soversion,

View file

@ -30,7 +30,11 @@
#include <wayland-client.h>
#ifndef GST_WAYLAND_API
#define GST_WAYLAND_API GST_EXPORT
# ifdef BUILDING_GST_WAYLAND
# define GST_WAYLAND_API GST_API_EXPORT /* from config.h */
# else
# define GST_WAYLAND_API GST_API_IMPORT
# endif
#endif
G_BEGIN_DECLS

View file

@ -38,6 +38,7 @@ nodist_libgstwebrtc_@GST_API_VERSION@include_HEADERS = $(built_headers)
libgstwebrtc_@GST_API_VERSION@_la_CFLAGS = \
-I$(top_builddir)/gst-libs \
-I$(top_srcdir)/gst-libs \
-DBUILDING_GST_WEBRTC \
$(GST_PLUGINS_BASE_CFLAGS) \
$(GST_BASE_CFLAGS) \
$(GST_CFLAGS) \

View file

@ -27,6 +27,7 @@ webrtc_enumtypes_headers = [
webrtc_enums = gnome.mkenums_simple('webrtc-enumtypes',
sources : webrtc_enumtypes_headers,
body_prefix : '#ifdef HAVE_CONFIG_H\n#include "config.h"\n#endif',
header_prefix : '#include <gst/webrtc/webrtc_fwd.h>',
decorator: 'GST_WEBRTC_API',
install_header: true,
@ -41,7 +42,7 @@ gstwebrtc_dependencies = [gstbase_dep, gstsdp_dep]
gstwebrtc = library('gstwebrtc-' + api_version,
webrtc_sources, gstwebrtc_c, gstwebrtc_h,
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API'],
c_args : gst_plugins_bad_args + ['-DGST_USE_UNSTABLE_API', '-DBUILDING_GST_WEBRTC'],
include_directories : [configinc, libsinc],
version : libversion,
soversion : soversion,

View file

@ -28,7 +28,11 @@
#include <gst/gst.h>
#ifndef GST_WEBRTC_API
#define GST_WEBRTC_API GST_EXPORT
# ifdef BUILDING_GST_WEBRTC
# define GST_WEBRTC_API GST_API_EXPORT /* from config.h */
# else
# define GST_WEBRTC_API GST_API_IMPORT
# endif
#endif
#include <gst/webrtc/webrtc-enumtypes.h>

View file

@ -32,6 +32,8 @@ plugins_install_dir = '@0@/gstreamer-1.0'.format(get_option('libdir'))
cc = meson.get_compiler('c')
cxx = meson.get_compiler('cpp')
cdata = configuration_data()
if cc.get_id() == 'msvc'
# Ignore several spurious warnings for things gstreamer does very commonly
# If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
@ -61,12 +63,17 @@ if cc.has_link_argument('-Wl,-Bsymbolic-functions')
endif
# Symbol visibility
if cc.has_argument('-fvisibility=hidden')
if cc.get_id() == 'msvc'
export_define = '__declspec(dllexport) extern'
elif cc.has_argument('-fvisibility=hidden')
add_project_arguments('-fvisibility=hidden', language: 'c')
export_define = 'extern __attribute__ ((visibility ("default")))'
else
export_define = 'extern'
endif
if cxx.has_argument('-fvisibility=hidden')
add_project_arguments('-fvisibility=hidden', language: 'cpp')
endif
# Passing this through the command line would be too messy
cdata.set('GST_API_EXPORT', export_define)
# Disable strict aliasing
if cc.has_argument('-fno-strict-aliasing')
@ -100,7 +107,6 @@ if glib_checks.disabled() or (glib_checks.auto() and not gst_version_is_dev)
add_project_arguments('-DG_DISABLE_CHECKS', language: 'c')
endif
cdata = configuration_data()
check_headers = [
['HAVE_DLFCN_H', 'dlfcn.h'],
['HAVE_FCNTL_H', 'fcntl.h'],