meson: Bump minimal GLib version to 2.44

This means we can use some newer features and get rid of some
boilerplate code using the G_DECLARE_* macros.

As discussed on IRC, 2.44 is old enough by now to start depending on it.
This commit is contained in:
Niels De Graef 2019-05-31 23:04:11 +02:00 committed by Nicolas Dufresne
parent 2bed2687bb
commit f3970565f0
5 changed files with 2 additions and 65 deletions

View file

@ -215,7 +215,7 @@ dnl *** checks for dependency libraries ***
dnl GLib
GLIB_REQ=2.40.0
GLIB_REQ=2.44.0
AG_GST_GLIB_CHECK([$GLIB_REQ])
dnl Orc

View file

@ -557,45 +557,6 @@ gst_multiudpsink_finalize (GObject * object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
/* replacement until we can depend unconditionally on the real one in GLib */
#ifndef HAVE_G_SOCKET_SEND_MESSAGES
#define g_socket_send_messages gst_socket_send_messages
static gint
gst_socket_send_messages (GSocket * socket, GstOutputMessage * messages,
guint num_messages, gint flags, GCancellable * cancellable, GError ** error)
{
gssize result;
gint i;
for (i = 0; i < num_messages; ++i) {
GstOutputMessage *msg = &messages[i];
GError *msg_error = NULL;
result = g_socket_send_message (socket, msg->address,
msg->vectors, msg->num_vectors,
msg->control_messages, msg->num_control_messages,
flags, cancellable, &msg_error);
if (result < 0) {
/* if we couldn't send all messages, just return how many we did
* manage to send, provided we managed to send at least one */
if (msg_error->code == G_IO_ERROR_WOULD_BLOCK && i > 0) {
g_error_free (msg_error);
return i;
} else {
g_propagate_error (error, msg_error);
return -1;
}
}
msg->bytes_sent = result;
}
return i;
}
#endif /* HAVE_G_SOCKET_SEND_MESSAGES */
static gsize
fill_vectors (GOutputVector * vecs, GstMapInfo * maps, guint n, GstBuffer * buf)
{

View file

@ -38,27 +38,7 @@ G_BEGIN_DECLS
typedef struct _GstMultiUDPSink GstMultiUDPSink;
typedef struct _GstMultiUDPSinkClass GstMultiUDPSinkClass;
#if GLIB_CHECK_VERSION (2, 43, 2)
#define HAVE_G_SOCKET_SEND_MESSAGES
#endif
#ifndef HAVE_G_SOCKET_SEND_MESSAGES
/* same as GOutputMessage used for g_socket_send_messages() */
typedef struct {
/*< private >*/
GSocketAddress *address;
GOutputVector *vectors;
guint num_vectors;
guint bytes_sent;
GSocketControlMessage **control_messages;
guint num_control_messages;
} GstOutputMessage;
#else
typedef GOutputMessage GstOutputMessage;
#endif /* HAVE_G_SOCKET_SEND_MESSAGES*/
typedef struct {
gint ref_count; /* for memory management */

View file

@ -897,12 +897,8 @@ retry:
* with udpsink generated a "port unreachable" ICMP response. We ignore
* that and try again.
* On Windows we get G_IO_ERROR_CONNECTION_CLOSED instead */
#if GLIB_CHECK_VERSION(2,44,0)
if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_HOST_UNREACHABLE) ||
g_error_matches (err, G_IO_ERROR, G_IO_ERROR_CONNECTION_CLOSED)) {
#else
if (g_error_matches (err, G_IO_ERROR, G_IO_ERROR_HOST_UNREACHABLE)) {
#endif
g_clear_error (&err);
goto retry;
}

View file

@ -19,7 +19,7 @@ gst_version_is_dev = gst_version_minor % 2 == 1 and gst_version_micro < 90
# FIXME: automagic
have_cxx = add_languages('cpp', required : false)
glib_req = '>= 2.40.0'
glib_req = '>= 2.44.0'
orc_req = '>= 0.4.17'
gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)