#include "gstalsadeviceprobe.h"
#include "gst/interfaces/propertyprobe.h"
+G_LOCK_DEFINE_STATIC (probe_lock);
+
static const GList *
gst_alsa_device_property_probe_get_properties (GstPropertyProbe * probe)
{
/* well, not perfect, but better than no locking at all.
* In the worst case we leak a list node, so who cares? */
- GST_CLASS_LOCK (GST_OBJECT_CLASS (klass));
+ G_LOCK (probe_lock);
if (!list) {
GParamSpec *pspec;
list = g_list_append (NULL, pspec);
}
- GST_CLASS_UNLOCK (GST_OBJECT_CLASS (klass));
+ G_UNLOCK (probe_lock);
return list;
}
#endif
#include "gstalsamixer.h"
+#include "gst/glib-compat-private.h"
#include <errno.h>
static void gst_alsa_mixer_update_option (GstAlsaMixer * mixer,
#include "gstalsadeviceprobe.h"
#include <gst/gst-i18n-plugin.h>
+#include "gst/glib-compat-private.h"
#define DEFAULT_DEVICE "default"
#define DEFAULT_DEVICE_NAME ""
#include "gstalsasrc.h"
#include "gstalsadeviceprobe.h"
+#include "gst/glib-compat-private.h"
#include <gst/gst-i18n-plugin.h>
#include "gstoggdemux.h"
+#include "gst/glib-compat-private.h"
+
#define CHUNKSIZE (8500) /* this is out of vorbisfile */
/* we hope we get a granpos within this many bytes off the end */
#include "gsttextrender.h"
#include <string.h>
+#include "gst/glib-compat-private.h"
+
/* FIXME:
* - use proper strides and offset for I420
* - if text is wider than the video picture, it does not get
riff \
app
-noinst_HEADERS = gettext.h gst-i18n-plugin.h
+noinst_HEADERS = gettext.h gst-i18n-plugin.h glib-compat-private.h
# dependencies:
audio: interfaces pbutils
#include "gstappsink.h"
+#include "gst/glib-compat-private.h"
+
struct _GstAppSinkPrivate
{
GstCaps *caps;
#include "gstapp-marshal.h"
#include "gstappsrc.h"
+#include "gst/glib-compat-private.h"
+
struct _GstAppSrcPrivate
{
GCond *cond;
#include "gstaudiosink.h"
+#include "gst/glib-compat-private.h"
+
GST_DEBUG_CATEGORY_STATIC (gst_audio_sink_debug);
#define GST_CAT_DEFAULT gst_audio_sink_debug
abuf->running = TRUE;
GST_DEBUG_OBJECT (sink, "starting thread");
+
+#if !GLIB_CHECK_VERSION (2, 31, 0)
sink->thread =
g_thread_create ((GThreadFunc) audioringbuffer_thread_func, buf, TRUE,
&error);
+#else
+ sink->thread = g_thread_try_new ("audiosink-ringbuffer",
+ (GThreadFunc) audioringbuffer_thread_func, buf, &error);
+#endif
+
if (!sink->thread || error != NULL)
goto thread_failed;
#include "gstaudiosrc.h"
+#include "gst/glib-compat-private.h"
+
GST_DEBUG_CATEGORY_STATIC (gst_audio_src_debug);
#define GST_CAT_DEFAULT gst_audio_src_debug
abuf = GST_AUDIORING_BUFFER (buf);
abuf->running = TRUE;
+ /* FIXME: handle thread creation failure */
+#if !GLIB_CHECK_VERSION (2, 31, 0)
src->thread =
g_thread_create ((GThreadFunc) audioringbuffer_thread_func, buf, TRUE,
NULL);
+#else
+ src->thread = g_thread_try_new ("audiosrc-ringbuffer",
+ (GThreadFunc) audioringbuffer_thread_func, buf, NULL);
+#endif
+
GST_AUDIORING_BUFFER_WAIT (buf);
return result;
#include "gstringbuffer.h"
+#include "gst/glib-compat-private.h"
+
GST_DEBUG_CATEGORY_STATIC (gst_ring_buffer_debug);
#define GST_CAT_DEFAULT gst_ring_buffer_debug
--- /dev/null
+/*
+ * glib-compat.c
+ * Functions copied from glib 2.10
+ *
+ * Copyright 2005 David Schleef <ds@schleef.org>
+ */
+
+#ifndef __GLIB_COMPAT_PRIVATE_H__
+#define __GLIB_COMPAT_PRIVATE_H__
+
+#include <glib.h>
+
+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_static_rec_mutex_init gst_g_static_rec_mutex_init
+static inline void
+gst_g_static_rec_mutex_init (GStaticRecMutex *mutex)
+{
+ static const GStaticRecMutex init_mutex = G_STATIC_REC_MUTEX_INIT;
+
+ *mutex = init_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) */
+
+/* adaptations */
+
+G_END_DECLS
+
+#endif
#include "pbutils-marshal.h"
#include "pbutils-private.h"
+#include "gst/glib-compat-private.h"
+
GST_DEBUG_CATEGORY_STATIC (discoverer_debug);
#define GST_CAT_DEFAULT discoverer_debug
#include "gstrtspconnection.h"
#include "gstrtspbase64.h"
+#include "gst/glib-compat-private.h"
+
union gst_sockaddr
{
struct sockaddr sa;
#include <string.h>
#include "video.h"
+#include "gst/glib-compat-private.h"
+
static gboolean
caps_are_raw (const GstCaps * caps)
{
#endif
#include "gststreamcombiner.h"
+#include "gst/glib-compat-private.h"
static GstStaticPadTemplate src_template =
GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
GST_DEBUG_CATEGORY_INIT (gst_stream_combiner_debug, "streamcombiner", 0,
"Stream Combiner");
- gst_element_class_add_static_pad_template (gstelement_klass,
- &src_template);
- gst_element_class_add_static_pad_template (gstelement_klass,
- &sink_template);
+ gst_element_class_add_static_pad_template (gstelement_klass, &src_template);
+ gst_element_class_add_static_pad_template (gstelement_klass, &sink_template);
gstelement_klass->request_new_pad =
GST_DEBUG_FUNCPTR (gst_stream_combiner_request_new_pad);
#endif
#include "gststreamsplitter.h"
+#include "gst/glib-compat-private.h"
static GstStaticPadTemplate src_template =
GST_STATIC_PAD_TEMPLATE ("src_%d", GST_PAD_SRC, GST_PAD_REQUEST,
GST_DEBUG_CATEGORY_INIT (gst_stream_splitter_debug, "streamsplitter", 0,
"Stream Splitter");
- gst_element_class_add_static_pad_template (gstelement_klass,
- &src_template);
- gst_element_class_add_static_pad_template (gstelement_klass,
- &sink_template);
+ gst_element_class_add_static_pad_template (gstelement_klass, &src_template);
+ gst_element_class_add_static_pad_template (gstelement_klass, &sink_template);
gstelement_klass->request_new_pad =
GST_DEBUG_FUNCPTR (gst_stream_splitter_request_new_pad);
#include <string.h>
#include <gst/gst.h>
#include <gst/pbutils/pbutils.h>
+#include "gst/glib-compat-private.h"
#include "gstplay-marshal.h"
#include "gstplayback.h"
#include "gstrawcaps.h"
+#include "gst/glib-compat-private.h"
+
/* generic templates */
static GstStaticPadTemplate decoder_bin_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink",
#include <gst/pbutils/pbutils.h>
+#include "gst/glib-compat-private.h"
+
GST_DEBUG_CATEGORY_STATIC (gst_play_base_bin_debug);
#define GST_CAT_DEFAULT gst_play_base_bin_debug
#include "gstplaysink.h"
#include "gstsubtitleoverlay.h"
+#include "gst/glib-compat-private.h"
+
GST_DEBUG_CATEGORY_STATIC (gst_play_bin_debug);
#define GST_CAT_DEFAULT gst_play_bin_debug
#include <gst/pbutils/pbutils.h>
#include <gst/gst-i18n-plugin.h>
+#include "gst/glib-compat-private.h"
GST_DEBUG_CATEGORY_STATIC (gst_play_sink_convert_bin_debug);
#define GST_CAT_DEFAULT gst_play_sink_convert_bin_debug
#endif
#include "gststreamsynchronizer.h"
+#include "gst/glib-compat-private.h"
GST_DEBUG_CATEGORY_STATIC (stream_synchronizer_debug);
#define GST_CAT_DEFAULT stream_synchronizer_debug
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
- gst_element_class_add_static_pad_template (gstelement_class,
- &srctemplate);
- gst_element_class_add_static_pad_template (gstelement_class,
- &sinktemplate);
+ gst_element_class_add_static_pad_template (gstelement_class, &srctemplate);
+ gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate);
gst_element_class_set_details_simple (gstelement_class,
"Stream Synchronizer", "Generic",
#include <gst/video/video.h>
#include <string.h>
+#include "gst/glib-compat-private.h"
+
GST_DEBUG_CATEGORY_STATIC (subtitle_overlay_debug);
#define GST_CAT_DEFAULT subtitle_overlay_debug
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
- gst_element_class_add_static_pad_template (gstelement_class,
- &srctemplate);
+ gst_element_class_add_static_pad_template (gstelement_class, &srctemplate);
gst_element_class_add_static_pad_template (gstelement_class,
&video_sinktemplate);
#include "gstplay-enum.h"
#include "gstrawcaps.h"
+#include "gst/glib-compat-private.h"
+
#define GST_TYPE_URI_DECODE_BIN \
(gst_uri_decode_bin_get_type())
#define GST_URI_DECODE_BIN(obj) \
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
- gst_element_class_add_static_pad_template (gstelement_class,
- &srctemplate);
+ gst_element_class_add_static_pad_template (gstelement_class, &srctemplate);
gst_element_class_set_details_simple (gstelement_class,
"URI Decoder", "Generic/Bin/Decoder",
"Autoplug and decode an URI to raw media",
}
this->running = TRUE;
+
+#if !GLIB_CHECK_VERSION (2, 31, 0)
this->thread = g_thread_create ((GThreadFunc) gst_multi_fd_sink_thread,
this, TRUE, NULL);
+#else
+ this->thread = g_thread_new ("multifdsink",
+ (GThreadFunc) gst_multi_fd_sink_thread, this);
+#endif
GST_OBJECT_FLAG_SET (this, GST_MULTI_FD_SINK_OPEN);
/* Debugging category */
#include <gst/gstinfo.h>
+#include "gst/glib-compat-private.h"
+
GST_DEBUG_CATEGORY_EXTERN (gst_debug_ximagesink);
#define GST_CAT_DEFAULT gst_debug_ximagesink
GST_DEBUG_OBJECT (ximagesink, "run xevent thread, expose %d, events %d",
ximagesink->handle_expose, ximagesink->handle_events);
ximagesink->running = TRUE;
+#if !GLIB_CHECK_VERSION (2, 31, 0)
ximagesink->event_thread = g_thread_create (
(GThreadFunc) gst_ximagesink_event_thread, ximagesink, TRUE, NULL);
+#else
+ ximagesink->event_thread = g_thread_try_new ("ximagesink-events",
+ (GThreadFunc) gst_ximagesink_event_thread, ximagesink, NULL);
+#endif
}
} else {
if (ximagesink->event_thread) {
/* Debugging category */
#include <gst/gstinfo.h>
+
+#include "gst/glib-compat-private.h"
+
GST_DEBUG_CATEGORY_STATIC (gst_debug_xvimagesink);
#define GST_CAT_DEFAULT gst_debug_xvimagesink
GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
GST_DEBUG_OBJECT (xvimagesink, "run xevent thread, expose %d, events %d",
xvimagesink->handle_expose, xvimagesink->handle_events);
xvimagesink->running = TRUE;
+#if !GLIB_CHECK_VERSION (2, 31, 0)
xvimagesink->event_thread = g_thread_create (
(GThreadFunc) gst_xvimagesink_event_thread, xvimagesink, TRUE, NULL);
+#else
+ xvimagesink->event_thread = g_thread_try_new ("xvimagesink-events",
+ (GThreadFunc) gst_xvimagesink_event_thread, xvimagesink, NULL);
+#endif
}
} else {
if (xvimagesink->event_thread) {