diff --git a/configure.ac b/configure.ac index 28a01e7183..2424dcb1f8 100644 --- a/configure.ac +++ b/configure.ac @@ -190,7 +190,7 @@ AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)]) AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)]) dnl GLib is required -GLIB_REQ=2.32.0 +GLIB_REQ=2.40.0 AG_GST_GLIB_CHECK([$GLIB_REQ]) dnl checks for gstreamer diff --git a/ext/hls/m3u8.c b/ext/hls/m3u8.c index b931749fa8..929e1d7976 100644 --- a/ext/hls/m3u8.c +++ b/ext/hls/m3u8.c @@ -30,25 +30,6 @@ #define GST_CAT_DEFAULT fragmented_debug -#if !GLIB_CHECK_VERSION (2, 33, 4) -#define g_list_copy_deep gst_g_list_copy_deep -static GList * -gst_g_list_copy_deep (GList * list, GCopyFunc func, gpointer user_data) -{ - list = g_list_copy (list); - - if (func != NULL) { - GList *l; - - for (l = list; l != NULL; l = l->next) { - l->data = func (l->data, user_data); - } - } - - return list; -} -#endif - static GstM3U8 *gst_m3u8_new (void); static void gst_m3u8_free (GstM3U8 * m3u8); static gboolean gst_m3u8_update (GstM3U8Client * client, GstM3U8 * m3u8, diff --git a/ext/libde265/libde265-dec.c b/ext/libde265/libde265-dec.c index 7cba37a16a..e11f12c115 100644 --- a/ext/libde265/libde265-dec.c +++ b/ext/libde265/libde265-dec.c @@ -41,58 +41,6 @@ #include "libde265-dec.h" -#if !GLIB_CHECK_VERSION(2, 36, 0) -#include -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef G_OS_WIN32 -#include -#endif -#define g_get_num_processors gst_g_get_num_processors -static guint -gst_g_get_num_processors (void) -{ - guint threads = 0; - -#if defined(_SC_NPROC_ONLN) - threads = sysconf (_SC_NPROC_ONLN); -#elif defined(_SC_NPROCESSORS_ONLN) - threads = sysconf (_SC_NPROCESSORS_ONLN); -#elif defined(G_OS_WIN32) - { - SYSTEM_INFO sysinfo; - DWORD_PTR process_cpus; - DWORD_PTR system_cpus; - - /* This *never* fails, but doesn't take CPU affinity into account */ - GetSystemInfo (&sysinfo); - threads = (int) sysinfo.dwNumberOfProcessors; - - /* This *can* fail, but produces correct results if affinity mask is used, - * unlike the simpler code above. - */ - if (GetProcessAffinityMask (GetCurrentProcess (), - &process_cpus, &system_cpus)) { - unsigned int count; - - for (count = 0; process_cpus != 0; process_cpus >>= 1) - if (process_cpus & 1) - count++; - } - } -#else -#warning "Don't know how to get number of CPU cores, will use the default thread count" - threads = DEFAULT_THREAD_COUNT; -#endif - - if (threads > 0) - return threads; - - return 1; -} -#endif /* !GLIB_CHECK_VERSION(2, 36, 0) */ - /* use two decoder threads if no information about * available CPU cores can be retrieved */ #define DEFAULT_THREAD_COUNT 2 diff --git a/gst-libs/gst/glib-compat-private.h b/gst-libs/gst/glib-compat-private.h index c96c005f54..1a4aa7d6b2 100644 --- a/gst-libs/gst/glib-compat-private.h +++ b/gst-libs/gst/glib-compat-private.h @@ -27,114 +27,6 @@ G_BEGIN_DECLS -#if !GLIB_CHECK_VERSION(2,25,0) - -#if defined (_MSC_VER) && !defined(_WIN64) -typedef struct _stat32 GStatBuf; -#else -typedef struct stat GStatBuf; -#endif - -#endif - -#if GLIB_CHECK_VERSION(2,26,0) -#define GLIB_HAS_GDATETIME -#endif - -/* See bug #651514 */ -#if GLIB_CHECK_VERSION(2,29,5) -#define G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE(a,b,c) \ - g_atomic_pointer_compare_and_exchange ((a),(b),(c)) -#define G_ATOMIC_INT_COMPARE_AND_EXCHANGE(a,b,c) \ - g_atomic_int_compare_and_exchange ((a),(b),(c)) -#else -#define G_ATOMIC_POINTER_COMPARE_AND_EXCHANGE(a,b,c) \ - g_atomic_pointer_compare_and_exchange ((volatile gpointer *)(a),(b),(c)) -#define G_ATOMIC_INT_COMPARE_AND_EXCHANGE(a,b,c) \ - g_atomic_int_compare_and_exchange ((volatile int *)(a),(b),(c)) -#endif - -/* See bug #651514 */ -#if GLIB_CHECK_VERSION(2,29,5) -#define G_ATOMIC_INT_ADD(a,b) g_atomic_int_add ((a),(b)) -#else -#define G_ATOMIC_INT_ADD(a,b) g_atomic_int_exchange_and_add ((a),(b)) -#endif - -/* copies */ - -#if GLIB_CHECK_VERSION (2, 31, 0) -#define g_mutex_new gst_g_mutex_new -static inline GMutex * -gst_g_mutex_new (void) -{ - GMutex *mutex = g_slice_new (GMutex); - g_mutex_init (mutex); - return mutex; -} -#define g_mutex_free gst_g_mutex_free -static inline void -gst_g_mutex_free (GMutex *mutex) -{ - g_mutex_clear (mutex); - g_slice_free (GMutex, mutex); -} -#define g_cond_new gst_g_cond_new -static inline GCond * -gst_g_cond_new (void) -{ - GCond *cond = g_slice_new (GCond); - g_cond_init (cond); - return cond; -} -#define g_cond_free gst_g_cond_free -static inline void -gst_g_cond_free (GCond *cond) -{ - g_cond_clear (cond); - g_slice_free (GCond, cond); -} -#define g_cond_timed_wait gst_g_cond_timed_wait -static inline gboolean -gst_g_cond_timed_wait (GCond *cond, GMutex *mutex, GTimeVal *abs_time) -{ - gint64 end_time; - - if (abs_time == NULL) { - g_cond_wait (cond, mutex); - return TRUE; - } - - end_time = abs_time->tv_sec; - end_time *= 1000000; - end_time += abs_time->tv_usec; - - /* would be nice if we had clock_rtoffset, but that didn't seem to - * make it into the kernel yet... - */ - /* if CLOCK_MONOTONIC is not defined then g_get_montonic_time() and - * g_get_real_time() are returning the same clock and we'd add ~0 - */ - end_time += g_get_monotonic_time () - g_get_real_time (); - return g_cond_wait_until (cond, mutex, end_time); -} -#endif /* GLIB_CHECK_VERSION (2, 31, 0) */ - -#if GLIB_CHECK_VERSION (2, 31, 0) -#define g_thread_create gst_g_thread_create -static inline GThread * -gst_g_thread_create (GThreadFunc func, gpointer data, gboolean joinable, - GError **error) -{ - GThread *thread = g_thread_try_new ("gst-check", func, data, error); - if (!joinable) - g_thread_unref (thread); - return thread; -} -#endif /* GLIB_CHECK_VERSION (2, 31, 0) */ - -/* adaptations */ - G_END_DECLS #endif diff --git a/gst/videomeasure/gstvideomeasure_ssim.c b/gst/videomeasure/gstvideomeasure_ssim.c index e85d68fbe0..13ba0358b9 100644 --- a/gst/videomeasure/gstvideomeasure_ssim.c +++ b/gst/videomeasure/gstvideomeasure_ssim.c @@ -1176,11 +1176,7 @@ gst_ssim_request_new_pad (GstElement * element, GstPadTemplate * templ, goto could_not_add_sink; else /* increment pad counter */ -#if GLIB_CHECK_VERSION(2,29,5) padcount = g_atomic_int_add (&ssim->padcount, 1); -#else - padcount = g_atomic_int_exchange_and_add (&ssim->padcount, 1); -#endif if (num != -1) { GstSSimOutputContext *c;