WIP: ges: fix API export/import and 'inconsistent linkage' on MSVC

Export GES library API in headers when we're building the
library itself, otherwise import the API from the headers.

This fixes linker warnings on Windows when building with MSVC.

Fix up some missing config.h includes when building the lib which
is needed to get the export api define from config.h

Fixes https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/42
This commit is contained in:
Tim-Philipp Müller 2018-09-24 15:41:24 +01:00 committed by Thibault Saunier
parent 059af7ba32
commit a7347ca8f7
65 changed files with 216 additions and 7 deletions

View file

@ -353,7 +353,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)
dnl disable strict aliasing

View file

@ -155,7 +155,7 @@ noinst_HEADERS = \
libges_@GST_API_VERSION@_la_CFLAGS = -I$(top_srcdir) $(GST_PBUTILS_CFLAGS) \
$(GST_VIDEO_CFLAGS) $(GST_CONTROLLER_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) \
$(GST_CFLAGS) $(XML_CFLAGS) $(GIO_CFLAGS) $(GST_VALIDATE_CFLAGS) \
-DG_LOG_DOMAIN=\"GES\"
-DG_LOG_DOMAIN=\"GES\" -DBUILDING_GES
libges_@GST_API_VERSION@_la_LIBADD = $(GST_PBUTILS_LIBS) \
$(GST_VIDEO_LIBS) $(GST_CONTROLLER_LIBS) $(GST_PLUGINS_BASE_LIBS) \
$(GST_BASE_LIBS) $(GST_LIBS) $(XML_LIBS) $(GIO_LIBS) $(GST_VALIDATE_LIBS)

View file

@ -82,6 +82,9 @@
* ges_asset_request_async(). All the #GESAssets are cached and thus any asset that has already
* been created can be requested again without overhead.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges.h"
#include "ges-internal.h"

View file

@ -48,6 +48,9 @@
* </tgroup>
* </informaltable>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges/ges-meta-container.h"

View file

@ -27,6 +27,9 @@
* output silence. Useful for testing pipelines, or to fill gaps in an audio
* track.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-track-element.h"

View file

@ -36,6 +36,9 @@
* - rate: 44100
* - layout: interleaved
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-smart-adder.h"

View file

@ -23,6 +23,9 @@
* @title: GESAudioTransition
* @short_description: implements audio crossfade transition
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-track-element.h"

View file

@ -23,6 +23,9 @@
* @title: GESAudioUriSource
* @short_description: outputs a single audio stream from a given file
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-utils.h"
#include "ges-internal.h"

View file

@ -22,6 +22,9 @@
*
* NOTE: This is for internal use exclusively
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-auto-transition.h"
#include "ges-internal.h"

View file

@ -25,6 +25,9 @@
* The effect will be applied on the sources that have lower priorities
* (higher number) between the inpoint and the end of it.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <ges/ges.h>
#include "ges-internal.h"

View file

@ -23,6 +23,9 @@
* @short_description: adds an effect to a stream in a GESSourceClip or a
* GESLayer
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <glib/gprintf.h>

View file

@ -23,6 +23,9 @@
* @title: GESBaseTransitionClip
* @short_description: Base classes for transitions
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <ges/ges.h>
#include "ges-internal.h"

View file

@ -17,6 +17,9 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges.h"
#include "ges-internal.h"

View file

@ -26,6 +26,9 @@
* it is mostly used to get information about the #GESTrackType-s the objects extracted
* from it can potentialy create #GESTrackElement for.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-clip-asset.h"

View file

@ -31,6 +31,9 @@
* Keeps a reference to the #GESTrackElement(s) it created and
* sets/updates their properties.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-clip.h"
#include "ges.h"

View file

@ -17,6 +17,9 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-command-line-formatter.h"

View file

@ -24,6 +24,9 @@
* @short_description: Base Class for objects responsible for controlling other
* GESTimelineElement-s
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-container.h"
#include "ges.h"

View file

@ -24,6 +24,9 @@
* This is internal, and implementation details, so we are not showing it in the
* documentation
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-effect-asset.h"
#include "ges-track-element.h"

View file

@ -26,6 +26,9 @@
* The effect will be applied on the sources that have lower priorities
* (higher number) between the inpoint and the end of it.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <ges/ges.h>
#include "ges-internal.h"

View file

@ -23,6 +23,9 @@
* @short_description: adds an effect build from a parse-launch style
* bin description to a stream in a GESSourceClip or a GESLayer
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-extractable.h"

View file

@ -23,6 +23,9 @@
* @title: GES Enumerations
* @short_description: Various enums for the Gstreamer Editing Services
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-enums.h"
#include "ges-internal.h"

View file

@ -25,6 +25,10 @@
*
* FIXME: Long description needed
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-asset.h"
#include "ges-internal.h"
#include "ges-extractable.h"

View file

@ -24,6 +24,9 @@
* @short_description: Timeline saving and loading.
*
**/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include <gio/gio.h>

View file

@ -31,6 +31,9 @@
* should be instaciated to group the various #GESTimelineElement passed
* in parametter.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-group.h"
#include "ges.h"

View file

@ -28,6 +28,9 @@
* chosen will be determined by the in-point property on the track element. For
* image files, do not set the in-point property.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-track-element.h"

View file

@ -30,6 +30,9 @@
* priorities of individual Clips. Two layers should not have the
* same priority within a given timeline.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-layer.h"

View file

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

View file

@ -25,6 +25,10 @@
* Outputs the video stream from a given image sequence. The start frame
* chosen will be determined by the in-point property on the track element.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <string.h>
#include "ges-internal.h"

View file

@ -25,6 +25,9 @@
*
* Operations are any kind of object that both outputs AND consumes data.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges.h"
#include "ges-internal.h"

View file

@ -23,6 +23,9 @@
* @title: GESOperation
* @short_description: Base Class for effects and overlays
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-track-element.h"

View file

@ -30,6 +30,9 @@
* Transitions, which change from one source to another over time, are
* not considered overlays.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-operation-clip.h"

View file

@ -27,6 +27,9 @@
* in a simple fashion.
* Its usage is inspired by the 'playbin' element from gst-plugins-base.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/gst.h>
#include <gst/video/videooverlay.h>

View file

@ -27,6 +27,10 @@
*
* Deprecated: 1.0
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#undef VERSION
#endif
#include <libxml/xmlreader.h>
#include <libxml/tree.h>
@ -41,7 +45,7 @@
#include <ges/ges.h>
/* The Pitivi etree formatter is 0.1 we set GES one to 0.2 */
#define VERSION "0.2"
//#define VERSION "0.2"
#define DOUBLE_VERSION 0.2
#undef GST_CAT_DEFAULT

View file

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

View file

@ -44,6 +44,10 @@
* a set of signals. Also it handles problem such as missing files/missing
* #GstElement and lets you try to recover from those.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges.h"
#include "ges-internal.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 <gst/gst.h>
#include <gst/video/video.h>

View file

@ -17,6 +17,10 @@
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.";
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/audio/audio.h>
#include "ges-types.h"

View file

@ -16,6 +16,9 @@
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.";
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstframepositioner.h"
#include "ges-types.h"

View file

@ -23,6 +23,9 @@
* @title: GESSourceClip
* @short_description: Base Class for sources of a GESLayer
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-clip.h"

View file

@ -23,6 +23,9 @@
* @title: GESSource
* @short_description: Base Class for single-media sources
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges/ges-meta-container.h"

View file

@ -17,6 +17,9 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-structure-parser.h"

View file

@ -17,6 +17,10 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-structured-interface.h"
#include <string.h>

View file

@ -28,6 +28,9 @@
* You can use the ges_asset_request_simple API to create an Asset
* capable of extracting GESTestClip-s
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-test-clip.h"

View file

@ -25,6 +25,9 @@
*
* Renders text onto the next lower priority stream using textrender.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-text-overlay-clip.h"

View file

@ -24,6 +24,9 @@
* @short_description: render text onto another video stream in a GESLayer
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-track-element.h"

View file

@ -26,6 +26,9 @@
* as priority. A GESTimelineElement can have a parent object which will be
* responsible for controlling its timing properties.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-utils.h"
#include "ges-timeline-element.h"

View file

@ -40,6 +40,9 @@
* Note that any change you make in the timeline will not actually be taken
* into account until you call the #ges_timeline_commit method.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-project.h"

View file

@ -26,6 +26,9 @@
* Renders the given text in the specified font, at specified position, and
* with the specified background pattern.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-title-clip.h"

View file

@ -87,6 +87,9 @@
* </tgroup>
* </informaltable>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-track-element.h"

View file

@ -23,6 +23,9 @@
* @title: GESTrackElementAsset
* @short_description: A GESAsset subclass specialized in GESTrackElement extraction
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-track-element-asset.h"

View file

@ -30,6 +30,10 @@
* its container, like the start position, the inpoint, the duration and the
* priority.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-extractable.h"
#include "ges-track-element.h"

View file

@ -27,6 +27,9 @@
*
* Contains the compatible TrackElement(s).
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-track.h"

View file

@ -36,6 +36,9 @@
* that this value can be changed after creation and the GESExtractable.asset value
* will be updated when needed.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <ges/ges.h>
#include "ges-internal.h"

View file

@ -24,6 +24,9 @@
* @short_description: base class for audio and video transitions
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <ges/ges.h>
#include "ges-internal.h"

View file

@ -28,6 +28,10 @@
* let you get information about the medias. Also, the tags found in the media file are
* set as Metadatas of the Asser.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <errno.h>
#include <gst/pbutils/pbutils.h>
#include "ges.h"

View file

@ -26,6 +26,9 @@
* Represents all the output streams from a particular uri. It is assumed that
* the URI points to a file of some type.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-uri-clip.h"

View file

@ -23,6 +23,9 @@
* @short_description: Convenience methods
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>

View file

@ -77,6 +77,9 @@
* </tgroup>
* </informaltable>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/pbutils/missing-plugins.h>

View file

@ -23,6 +23,9 @@
* @title: GESVideoTestSource
* @short_description: produce solid colors and patterns
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-internal.h"
#include "ges-track-element.h"

View file

@ -22,6 +22,9 @@
* @title: GESVideoTrack
* @short_description: A standard GESTrack for raw video
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "ges-video-track.h"
#include "ges-smart-video-mixer.h"

View file

@ -23,6 +23,9 @@
* @title: GESVideoTransition
* @short_description: implements video crossfade transition
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <ges/ges.h>
#include "ges-internal.h"

View file

@ -23,6 +23,9 @@
* @title: GESVideoUriSource
* @short_description: outputs a single video stream from a given file
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/pbutils/missing-plugins.h>

View file

@ -17,6 +17,10 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#undef VERSION
#endif
/* TODO Determine error codes numbers */

View file

@ -160,7 +160,7 @@ libges = library('ges-1.0', ges_sources, parser,
version : libversion,
soversion : soversion,
darwin_versions : osxversion,
c_args : [ges_c_args],
c_args : [ges_c_args] + ['-DBUILDING_GES'],
include_directories : [configinc],
install : true,
dependencies : libges_deps)

View file

@ -29,6 +29,9 @@ glib_req = '>= 2.40.0'
gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
cc = meson.get_compiler('c')
cdata = configuration_data()
# Ignore several spurious warnings for things gstreamer does very commonly
# If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
# If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
@ -47,16 +50,23 @@ 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
# 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')
add_project_arguments('-fno-strict-aliasing', language: 'c')
endif
cdata = configuration_data()
cdata.set('VERSION', '"@0@"'.format(gst_version))
cdata.set('PACKAGE', '"gst-editing-services"')
cdata.set('PACKAGE_VERSION', '"@0@"'.format(gst_version))