Commit graph

227 commits

Author SHA1 Message Date
Tim-Philipp Müller
57c8e0146f libs: figure out right export define in configure
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:39:37 +01:00
Tim-Philipp Müller
46ed0f0489 libs: fix 'inconsistent DLL linkage' warnings on Windows
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.

https://bugzilla.gnome.org/show_bug.cgi?id=797185
2018-09-23 23:23:01 +01:00
Nirbheek Chauhan
c389c59b22 meson: Maintain macOS ABI through dylib versioning
Requires Meson 0.48, but the feature will be ignored on older versions
so it's safe to add it without bumping the requirement.

Documentation:
https://github.com/mesonbuild/meson/blob/master/docs/markdown/Reference-manual.md#shared_library
2018-08-31 14:40:14 +05:30
Tim-Philipp Müller
2db8e3705f Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-06-24 12:49:14 +02:00
luz.paz
4a402c1c7d Fix typos in comments and docs
Found via `codespell`

https://bugzilla.gnome.org/show_bug.cgi?id=795610
2018-05-01 11:18:03 +01:00
Xavier Claessens
b00b1d5361 Meson: Use library() to build both static and shared libs
Meson supports building both static and shared libraries in a single
library() call. It has the advantage of reusing the same .o objects and
thus avoid double compilation.

https://bugzilla.gnome.org/show_bug.cgi?id=794627
2018-04-25 00:40:30 +01:00
Sebastian Dröge
29e81988fb net: Include gstnetcontrolmessagemeta.h in net.h 2018-03-21 10:20:14 +02:00
Tim-Philipp Müller
d86a90550b net: GST_EXPORT -> GST_NET_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 00:57:37 +00:00
Michele Dionisio
0af74cb599 ptp: fix build failure with #undef USE_MEASUREMENT_FILTERING
"Label ‘out’ used but not defined", since it's also used by
the USE_MEDIAN_PRE_FILTERING branch.

https://bugzilla.gnome.org/show_bug.cgi?id=785631
2018-01-18 17:45:28 +00:00
Michael Tretter
bbafb78b1e ptpclock: do not require a name to create a clock
The gst_ptp_clock_new() does not actually require a name. However, for
example the rtpjitterbuffer may create a clock without a name, fail, and
fall back to not using the PTP clock.

https://bugzilla.gnome.org/show_bug.cgi?id=791034
2017-12-01 10:02:11 +02:00
Tim-Philipp Müller
db3ea93439 libs: fix indentation 2017-11-24 13:40:33 +01:00
Sebastian Dröge
4c795924db net: Add new file to the meson.build 2017-11-01 12:27:31 +02:00
Robert Rosengren
5d885b9dc7 netutils: Add util for setting socket DSCP
Util function for setting QoS DSCP added, to remove duplicated code in
netclientclock and nettimeprovider. Fix build error if missing IP_TOS.

https://bugzilla.gnome.org/show_bug.cgi?id=784737
2017-11-01 11:00:47 +02:00
Robert Rosengren
4c8058272e netclientclock: Add possibility to set QoS DSCP value
https://bugzilla.gnome.org/show_bug.cgi?id=784737
2017-10-19 16:14:17 +02:00
Robert Rosengren
a3e1fca7ee nettimeprovider: Add possibility to set QoS DSCP value
https://bugzilla.gnome.org/show_bug.cgi?id=784737
2017-10-19 16:14:17 +02:00
Havard Graff
fee176d253 meson: remove vs_module_defs
The GST_EXPORT should handle it.
2017-10-05 09:35:41 +01:00
Reynaldo H. Verdejo Pinochet
402159fb88 Use proper GtkDoc notation for NULL/FALSE/TRUE 2017-10-03 13:54:25 -07:00
Andrejs Vasiljevs
d99c9d9944 ptp: Unref timeout GSource for delay requests
https://bugzilla.gnome.org/show_bug.cgi?id=783864
2017-06-16 17:57:35 +03:00
Sebastian Dröge
f119e93b47 gst: Clear floating flag in constructor of all GstObject subclasses that are not owned by any parent
I.e. most of them unfortunately.

https://bugzilla.gnome.org/show_bug.cgi?id=743062
2017-05-17 10:40:37 +03:00
Sebastian Dröge
daa98fc02a gst: Don't ref_sink() GstObject subclasses in instance_init/constructor
This is something bindings can't handle and it causes leaks. Instead
move the ref_sink() to the explicit, new() constructors.

This means that abstract classes, and anything that can have subclasses,
will have to do ref_sink() in their new() function now. Specifically
this affects GstClock and GstControlSource.

https://bugzilla.gnome.org/show_bug.cgi?id=743062
2017-05-17 10:40:37 +03:00
Sebastian Dröge
30f871d274 gst: Correctly annotate functions taking floating reference parameters and returning floating references
https://bugzilla.gnome.org/show_bug.cgi?id=702960
2017-05-17 10:40:37 +03:00
Tim-Philipp Müller
72103b7d51 libs: net: mark symbols explicitly for export with GST_EXPORT 2017-05-15 23:13:39 +01:00
Tim-Philipp Müller
3d8d81ecb7 g-i: no need to load registry in g-i scanner 2017-05-04 21:59:48 +01:00
Rico Tzschichholz
72e42f0ce9 meson: A couple for GIR-generation fixes 2017-04-13 10:05:53 +01:00
Thibault Saunier
5ef7a20687 meson: libs: Add gir to the source list of the dependency 2017-01-27 16:36:39 -03:00
Thibault Saunier
a87b4551a6 Port gtk-doc comments to their equivalent markdown syntax
Modernizing our documentation and preparing a possible move to hotdoc.
This commits also adds missing @title metadatas to all SECTIONs
2017-01-27 16:36:38 -03:00
Marcin Kolny
90f101981c net: set clock name in the constructor
gst_net_client_clock_new() and gst_ntp_clock_new() didn't set the
"name" property.

https://bugzilla.gnome.org/show_bug.cgi?id=775538
2016-12-06 12:10:17 +02:00
Scott D Phillips
075744a894 Cast away const from GstMetaInfo in *_get_meta_info() functions
MSVC warns about the const in the implicit argument conversion in the
calls to g_once_init_{enter,leave}. It's OK so explicitly cast it.

https://bugzilla.gnome.org/show_bug.cgi?id=774293
2016-11-15 14:51:18 +02:00
Nirbheek Chauhan
0e439fe6ad meson: Fir dependencies of gstnet-1.0
It depends on gst_base_dep which will pull in gst_dep
2016-11-11 04:42:30 +05:30
Thibault Saunier
0079aea21c meson: Advertise dependency on gst_dep generating girs
And do not simply link to libgst as the gir information
location only exist in declare_dependecy

https://bugzilla.gnome.org/show_bug.cgi?id=774044
2016-11-09 17:00:49 -03:00
Nirbheek Chauhan
b2f9808722 Add support for Meson as alternative/parallel build system
https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Mathieu Duponchelle <mathieu.duponchelle@opencreed.com>
Jussi Pakkanen <jpakkane@gmail.com> (original port)

Highlights of the features provided are:
* Faster builds on Linux (~40-50% faster)
* The ability to build with MSVC on Windows
* Generate Visual Studio project files
* Generate XCode project files
* Much faster builds on Windows (on-par with Linux)
* Seriously fast configure and building on embedded

... and many more. For more details see:

http://blog.nirbheek.in/2016/05/gstreamer-and-meson-new-hope.html
http://blog.nirbheek.in/2016/07/building-and-developing-gstreamer-using.html

Building with Meson should work on both Linux and Windows, but may
need a few more tweaks on other operating systems.
2016-08-19 21:26:14 +01:00
Guillaume Desmottes
4a41468ce7 Use MAY_BE_LEAKED_FLAG
This helps having "make check" passing with the leaks tracer enabled.

https://bugzilla.gnome.org/show_bug.cgi?id=766008
2016-06-02 23:14:15 +01:00
Tim-Philipp Müller
0274650e42 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:40:27 +01:00
Arun Raghavan
a3ae9213e5 netclientclock: Always dump clock observations in logs
This makes it possible to examine what values we get in logs, and
potentially tune our filtering/extrapolation in various scenarios.
2016-03-25 12:58:53 +05:30
Sebastian Dröge
b2a111c19d netclientclock: Remove some obsolete code that can cause warnings 2016-03-09 16:07:27 +02:00
Sebastian Dröge
7124e56bb5 netclientclock: Don't reset calibration of internal clock whenever a new netclient clock is created
https://bugzilla.gnome.org/show_bug.cgi?id=763325
2016-03-09 15:38:53 +02:00
Nirbheek Chauhan
806dbeeef3 Whenever we include windows.h, also define WIN32_LEAN_AND_MEAN
This reduces the number of symbols and code pulled in drastically
2016-02-20 10:07:42 +00:00
Nirbheek Chauhan
fd823ed129 ptpclock: Only include unistd.h if found
unistd.h is not provided by the  Microsoft Visual C++ compiler. It instead
provides the necessary defines through io.h
2016-02-20 10:07:31 +00:00
Sebastian Dröge
7b49459f1a netclientclock: Check return value of g_socket_close()
CID 1348452
2016-01-15 09:48:32 +01:00
Sebastian Dröge
3315f483bc netclientclock: Free data after removing it from the list
Does not matter here but makes Coverity more happy. It can't
know that g_list_remove() only looks at the pointer value but
does not dereference it.

CID 1348454
2016-01-15 09:02:42 +01:00
Florin Apostol
f875bec51e netclientclock: Fix GError memory leak in handling NTP response
Error was not released if gst_ntp_packet_receive failed.

https://bugzilla.gnome.org/show_bug.cgi?id=760598
2016-01-13 23:01:18 +01:00
Stefan Sauer
2159aa56bc docs: remove parent docs for GstPtpClock
Instance docs don't need to docuemnt the parent (first member).
2016-01-06 18:17:27 +01:00
Sebastian Dröge
01ba6d40a8 clock: Fix typo
clocked -> clock
2016-01-05 16:44:53 +02:00
Sebastian Dröge
1c010fd230 netclientclock: Disconnect the "synced" signal handler from the internal clock
Not from the external one.
2016-01-05 15:00:14 +02:00
Sebastian Dröge
58b4e075a6 ntp: The clock inherits from GstNetClientClock, not just GstSystemClock 2016-01-05 13:41:08 +02:00
Sebastian Dröge
29136a0186 netclientclock: Destroy a cached clock 60 seconds after its last use
There's not much lost by having the clock idle around a bit longer but it will
potentially allow anybody wanting to use the same clock server again to sync
much faster.
2016-01-04 17:18:07 +02:00
Sebastian Dröge
33dcec7b74 netclientclock: Only ever run one clock against a specific server
If multiple net/NTP clocks are created for the same server, reuse the same
internal clock for all of them. This makes sure that we don't flood the server
with too many requests and also possibly allows faster synchronization if
there already was an earlier synchronized clock when creating a new one.
2016-01-04 16:31:23 +02:00
Sebastian Dröge
23abc425d4 nettimeprovider: Use GInitable instead of having a new() function that can return NULL
Bindings don't like that much and as we're using GIO here anyway we can as
well use GInitable for possibly failing initialization.
2016-01-04 10:40:35 +02:00
Sebastian Dröge
5dc8cea6f4 nettimeprovider: Mark address, port and clock properties CONSTRUCT_ONLY
They can't sensibly be changed after construction.
2016-01-04 10:40:35 +02:00
Sebastian Dröge
9f36b4383b netclientclock: Implement resolval of hostnames
Just allowing IPs here is not ideal and implementing DNS resolval is easy.
2015-12-30 16:59:24 +02:00