mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
alsa: port to new GLib thread API
This commit is contained in:
parent
d6522cf6a6
commit
794af4fc51
4 changed files with 10 additions and 10 deletions
|
@ -117,7 +117,7 @@ gst_alsasink_finalise (GObject * object)
|
||||||
GstAlsaSink *sink = GST_ALSA_SINK (object);
|
GstAlsaSink *sink = GST_ALSA_SINK (object);
|
||||||
|
|
||||||
g_free (sink->device);
|
g_free (sink->device);
|
||||||
g_mutex_free (sink->alsa_lock);
|
g_mutex_clear (&sink->alsa_lock);
|
||||||
|
|
||||||
g_mutex_lock (&output_mutex);
|
g_mutex_lock (&output_mutex);
|
||||||
--output_ref;
|
--output_ref;
|
||||||
|
@ -254,7 +254,7 @@ gst_alsasink_init (GstAlsaSink * alsasink)
|
||||||
alsasink->device = g_strdup (DEFAULT_DEVICE);
|
alsasink->device = g_strdup (DEFAULT_DEVICE);
|
||||||
alsasink->handle = NULL;
|
alsasink->handle = NULL;
|
||||||
alsasink->cached_caps = NULL;
|
alsasink->cached_caps = NULL;
|
||||||
alsasink->alsa_lock = g_mutex_new ();
|
g_mutex_init (&alsasink->alsa_lock);
|
||||||
|
|
||||||
g_mutex_lock (&output_mutex);
|
g_mutex_lock (&output_mutex);
|
||||||
if (output_ref == 0) {
|
if (output_ref == 0) {
|
||||||
|
|
|
@ -39,9 +39,9 @@ G_BEGIN_DECLS
|
||||||
typedef struct _GstAlsaSink GstAlsaSink;
|
typedef struct _GstAlsaSink GstAlsaSink;
|
||||||
typedef struct _GstAlsaSinkClass GstAlsaSinkClass;
|
typedef struct _GstAlsaSinkClass GstAlsaSinkClass;
|
||||||
|
|
||||||
#define GST_ALSA_SINK_GET_LOCK(obj) (GST_ALSA_SINK_CAST (obj)->alsa_lock)
|
#define GST_ALSA_SINK_GET_LOCK(obj) (&GST_ALSA_SINK_CAST (obj)->alsa_lock)
|
||||||
#define GST_ALSA_SINK_LOCK(obj) (g_mutex_lock (GST_ALSA_SINK_GET_LOCK (obj)))
|
#define GST_ALSA_SINK_LOCK(obj) (g_mutex_lock (GST_ALSA_SINK_GET_LOCK (obj)))
|
||||||
#define GST_ALSA_SINK_UNLOCK(obj) (g_mutex_unlock (GST_ALSA_SINK_GET_LOCK (obj)))
|
#define GST_ALSA_SINK_UNLOCK(obj) (g_mutex_unlock (GST_ALSA_SINK_GET_LOCK (obj)))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstAlsaSink:
|
* GstAlsaSink:
|
||||||
|
@ -72,7 +72,7 @@ struct _GstAlsaSink {
|
||||||
|
|
||||||
GstCaps *cached_caps;
|
GstCaps *cached_caps;
|
||||||
|
|
||||||
GMutex *alsa_lock;
|
GMutex alsa_lock;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstAlsaSinkClass {
|
struct _GstAlsaSinkClass {
|
||||||
|
|
|
@ -112,7 +112,7 @@ gst_alsasrc_finalize (GObject * object)
|
||||||
GstAlsaSrc *src = GST_ALSA_SRC (object);
|
GstAlsaSrc *src = GST_ALSA_SRC (object);
|
||||||
|
|
||||||
g_free (src->device);
|
g_free (src->device);
|
||||||
g_mutex_free (src->alsa_lock);
|
g_mutex_clear (&src->alsa_lock);
|
||||||
|
|
||||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
@ -225,7 +225,7 @@ gst_alsasrc_init (GstAlsaSrc * alsasrc)
|
||||||
alsasrc->device = g_strdup (DEFAULT_PROP_DEVICE);
|
alsasrc->device = g_strdup (DEFAULT_PROP_DEVICE);
|
||||||
alsasrc->cached_caps = NULL;
|
alsasrc->cached_caps = NULL;
|
||||||
|
|
||||||
alsasrc->alsa_lock = g_mutex_new ();
|
g_mutex_init (&alsasrc->alsa_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CHECK(call, error) \
|
#define CHECK(call, error) \
|
||||||
|
|
|
@ -35,7 +35,7 @@ G_BEGIN_DECLS
|
||||||
#define GST_IS_ALSA_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ALSA_SRC))
|
#define GST_IS_ALSA_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ALSA_SRC))
|
||||||
#define GST_ALSA_SRC_CAST(obj) ((GstAlsaSrc *)(obj))
|
#define GST_ALSA_SRC_CAST(obj) ((GstAlsaSrc *)(obj))
|
||||||
|
|
||||||
#define GST_ALSA_SRC_GET_LOCK(obj) (GST_ALSA_SRC_CAST (obj)->alsa_lock)
|
#define GST_ALSA_SRC_GET_LOCK(obj) (&GST_ALSA_SRC_CAST (obj)->alsa_lock)
|
||||||
#define GST_ALSA_SRC_LOCK(obj) (g_mutex_lock (GST_ALSA_SRC_GET_LOCK (obj)))
|
#define GST_ALSA_SRC_LOCK(obj) (g_mutex_lock (GST_ALSA_SRC_GET_LOCK (obj)))
|
||||||
#define GST_ALSA_SRC_UNLOCK(obj) (g_mutex_unlock (GST_ALSA_SRC_GET_LOCK (obj)))
|
#define GST_ALSA_SRC_UNLOCK(obj) (g_mutex_unlock (GST_ALSA_SRC_GET_LOCK (obj)))
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ struct _GstAlsaSrc {
|
||||||
snd_pcm_uframes_t buffer_size;
|
snd_pcm_uframes_t buffer_size;
|
||||||
snd_pcm_uframes_t period_size;
|
snd_pcm_uframes_t period_size;
|
||||||
|
|
||||||
GMutex *alsa_lock;
|
GMutex alsa_lock;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstAlsaSrcClass {
|
struct _GstAlsaSrcClass {
|
||||||
|
|
Loading…
Reference in a new issue