G_BEGIN_DECLS
-#if GLIB_CHECK_VERSION(2,26,0)
-#define GLIB_HAS_GDATETIME
-#endif
-
/* copies */
-#if 0 //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
filter->poles = 4;
filter->ripple = 0.25;
- filter->lock = g_mutex_new ();
+ g_mutex_init (&filter->lock);
}
static void
{
GstAudioChebBand *filter = GST_AUDIO_CHEB_BAND (object);
- g_mutex_free (filter->lock);
- filter->lock = NULL;
+ g_mutex_clear (&filter->lock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
switch (prop_id) {
case PROP_MODE:
- g_mutex_lock (filter->lock);
+ g_mutex_lock (&filter->lock);
filter->mode = g_value_get_enum (value);
generate_coefficients (filter);
- g_mutex_unlock (filter->lock);
+ g_mutex_unlock (&filter->lock);
break;
case PROP_TYPE:
- g_mutex_lock (filter->lock);
+ g_mutex_lock (&filter->lock);
filter->type = g_value_get_int (value);
generate_coefficients (filter);
- g_mutex_unlock (filter->lock);
+ g_mutex_unlock (&filter->lock);
break;
case PROP_LOWER_FREQUENCY:
- g_mutex_lock (filter->lock);
+ g_mutex_lock (&filter->lock);
filter->lower_frequency = g_value_get_float (value);
generate_coefficients (filter);
- g_mutex_unlock (filter->lock);
+ g_mutex_unlock (&filter->lock);
break;
case PROP_UPPER_FREQUENCY:
- g_mutex_lock (filter->lock);
+ g_mutex_lock (&filter->lock);
filter->upper_frequency = g_value_get_float (value);
generate_coefficients (filter);
- g_mutex_unlock (filter->lock);
+ g_mutex_unlock (&filter->lock);
break;
case PROP_RIPPLE:
- g_mutex_lock (filter->lock);
+ g_mutex_lock (&filter->lock);
filter->ripple = g_value_get_float (value);
generate_coefficients (filter);
- g_mutex_unlock (filter->lock);
+ g_mutex_unlock (&filter->lock);
break;
case PROP_POLES:
- g_mutex_lock (filter->lock);
+ g_mutex_lock (&filter->lock);
filter->poles = GST_ROUND_UP_4 (g_value_get_int (value));
generate_coefficients (filter);
- g_mutex_unlock (filter->lock);
+ g_mutex_unlock (&filter->lock);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
gfloat ripple;
/* < private > */
- GMutex *lock;
+ GMutex lock;
};
struct _GstAudioChebBandClass
filter->poles = 4;
filter->ripple = 0.25;
- filter->lock = g_mutex_new ();
+ g_mutex_init (&filter->lock);
}
static void
{
GstAudioChebLimit *filter = GST_AUDIO_CHEB_LIMIT (object);
- g_mutex_free (filter->lock);
- filter->lock = NULL;
+ g_mutex_clear (&filter->lock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
switch (prop_id) {
case PROP_MODE:
- g_mutex_lock (filter->lock);
+ g_mutex_lock (&filter->lock);
filter->mode = g_value_get_enum (value);
generate_coefficients (filter);
- g_mutex_unlock (filter->lock);
+ g_mutex_unlock (&filter->lock);
break;
case PROP_TYPE:
- g_mutex_lock (filter->lock);
+ g_mutex_lock (&filter->lock);
filter->type = g_value_get_int (value);
generate_coefficients (filter);
- g_mutex_unlock (filter->lock);
+ g_mutex_unlock (&filter->lock);
break;
case PROP_CUTOFF:
- g_mutex_lock (filter->lock);
+ g_mutex_lock (&filter->lock);
filter->cutoff = g_value_get_float (value);
generate_coefficients (filter);
- g_mutex_unlock (filter->lock);
+ g_mutex_unlock (&filter->lock);
break;
case PROP_RIPPLE:
- g_mutex_lock (filter->lock);
+ g_mutex_lock (&filter->lock);
filter->ripple = g_value_get_float (value);
generate_coefficients (filter);
- g_mutex_unlock (filter->lock);
+ g_mutex_unlock (&filter->lock);
break;
case PROP_POLES:
- g_mutex_lock (filter->lock);
+ g_mutex_lock (&filter->lock);
filter->poles = GST_ROUND_UP_2 (g_value_get_int (value));
generate_coefficients (filter);
- g_mutex_unlock (filter->lock);
+ g_mutex_unlock (&filter->lock);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
gfloat ripple;
/* < private > */
- GMutex *lock;
+ GMutex lock;
};
struct _GstAudioChebLimitClass
g_value_unset (&v);
gst_audio_fir_filter_update_kernel (self, va);
- self->lock = g_mutex_new ();
+ g_mutex_init (&self->lock);
}
/* GstAudioFilter vmethod implementations */
{
GstAudioFIRFilter *self = GST_AUDIO_FIR_FILTER (object);
- g_mutex_free (self->lock);
- self->lock = NULL;
+ g_mutex_clear (&self->lock);
if (self->kernel)
g_value_array_free (self->kernel);
switch (prop_id) {
case PROP_KERNEL:
- g_mutex_lock (self->lock);
+ g_mutex_lock (&self->lock);
/* update kernel already pushes residues */
gst_audio_fir_filter_update_kernel (self, g_value_dup_boxed (value));
- g_mutex_unlock (self->lock);
+ g_mutex_unlock (&self->lock);
break;
case PROP_LATENCY:
- g_mutex_lock (self->lock);
+ g_mutex_lock (&self->lock);
self->latency = g_value_get_uint64 (value);
gst_audio_fir_filter_update_kernel (self, NULL);
- g_mutex_unlock (self->lock);
+ g_mutex_unlock (&self->lock);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
guint64 latency;
/* < private > */
- GMutex *lock;
+ GMutex lock;
};
struct _GstAudioFIRFilterClass {
b = NULL;
gst_audio_iir_filter_update_coefficients (self, a, b);
- self->lock = g_mutex_new ();
+ g_mutex_init (&self->lock);
}
/* GstAudioFilter vmethod implementations */
{
GstAudioIIRFilter *self = GST_AUDIO_IIR_FILTER (object);
- g_mutex_free (self->lock);
- self->lock = NULL;
+ g_mutex_clear (&self->lock);
if (self->a)
g_value_array_free (self->a);
switch (prop_id) {
case PROP_A:
- g_mutex_lock (self->lock);
+ g_mutex_lock (&self->lock);
gst_audio_iir_filter_update_coefficients (self, g_value_dup_boxed (value),
NULL);
- g_mutex_unlock (self->lock);
+ g_mutex_unlock (&self->lock);
break;
case PROP_B:
- g_mutex_lock (self->lock);
+ g_mutex_lock (&self->lock);
gst_audio_iir_filter_update_coefficients (self, NULL,
g_value_dup_boxed (value));
- g_mutex_unlock (self->lock);
+ g_mutex_unlock (&self->lock);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
GValueArray *a, *b;
/* < private > */
- GMutex *lock;
+ GMutex lock;
};
struct _GstAudioIIRFilterClass {
self->mode = MODE_BAND_PASS;
self->window = WINDOW_HAMMING;
- self->lock = g_mutex_new ();
+ g_mutex_init (&self->lock);
}
static void
{
GstAudioWSincBand *self = GST_AUDIO_WSINC_BAND (object);
- g_mutex_free (self->lock);
- self->lock = NULL;
+ g_mutex_clear (&self->lock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
case PROP_LENGTH:{
gint val;
- g_mutex_lock (self->lock);
+ g_mutex_lock (&self->lock);
val = g_value_get_int (value);
if (val % 2 == 0)
val++;
self->kernel_length = val;
gst_audio_wsincband_build_kernel (self);
}
- g_mutex_unlock (self->lock);
+ g_mutex_unlock (&self->lock);
break;
}
case PROP_LOWER_FREQUENCY:
- g_mutex_lock (self->lock);
+ g_mutex_lock (&self->lock);
self->lower_frequency = g_value_get_float (value);
gst_audio_wsincband_build_kernel (self);
- g_mutex_unlock (self->lock);
+ g_mutex_unlock (&self->lock);
break;
case PROP_UPPER_FREQUENCY:
- g_mutex_lock (self->lock);
+ g_mutex_lock (&self->lock);
self->upper_frequency = g_value_get_float (value);
gst_audio_wsincband_build_kernel (self);
- g_mutex_unlock (self->lock);
+ g_mutex_unlock (&self->lock);
break;
case PROP_MODE:
- g_mutex_lock (self->lock);
+ g_mutex_lock (&self->lock);
self->mode = g_value_get_enum (value);
gst_audio_wsincband_build_kernel (self);
- g_mutex_unlock (self->lock);
+ g_mutex_unlock (&self->lock);
break;
case PROP_WINDOW:
- g_mutex_lock (self->lock);
+ g_mutex_lock (&self->lock);
self->window = g_value_get_enum (value);
gst_audio_wsincband_build_kernel (self);
- g_mutex_unlock (self->lock);
+ g_mutex_unlock (&self->lock);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
gint kernel_length; /* length of the filter kernel */
/* < private > */
- GMutex *lock;
+ GMutex lock;
};
struct _GstAudioWSincBandClass {
self->kernel_length = 101;
self->cutoff = 0.0;
- self->lock = g_mutex_new ();
+ g_mutex_init (&self->lock);
}
static void
{
GstAudioWSincLimit *self = GST_AUDIO_WSINC_LIMIT (object);
- g_mutex_free (self->lock);
- self->lock = NULL;
+ g_mutex_clear (&self->lock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
case PROP_LENGTH:{
gint val;
- g_mutex_lock (self->lock);
+ g_mutex_lock (&self->lock);
val = g_value_get_int (value);
if (val % 2 == 0)
val++;
self->kernel_length = val;
gst_audio_wsinclimit_build_kernel (self);
}
- g_mutex_unlock (self->lock);
+ g_mutex_unlock (&self->lock);
break;
}
case PROP_FREQUENCY:
- g_mutex_lock (self->lock);
+ g_mutex_lock (&self->lock);
self->cutoff = g_value_get_float (value);
gst_audio_wsinclimit_build_kernel (self);
- g_mutex_unlock (self->lock);
+ g_mutex_unlock (&self->lock);
break;
case PROP_MODE:
- g_mutex_lock (self->lock);
+ g_mutex_lock (&self->lock);
self->mode = g_value_get_enum (value);
gst_audio_wsinclimit_build_kernel (self);
- g_mutex_unlock (self->lock);
+ g_mutex_unlock (&self->lock);
break;
case PROP_WINDOW:
- g_mutex_lock (self->lock);
+ g_mutex_lock (&self->lock);
self->window = g_value_get_enum (value);
gst_audio_wsinclimit_build_kernel (self);
- g_mutex_unlock (self->lock);
+ g_mutex_unlock (&self->lock);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
gint kernel_length;
/* < private > */
- GMutex *lock;
+ GMutex lock;
};
struct _GstAudioWSincLimitClass {
GstStructure *structure;
gboolean ret;
- g_mutex_lock (aspect_ratio_crop->crop_lock);
+ g_mutex_lock (&aspect_ratio_crop->crop_lock);
structure = gst_caps_get_structure (caps, 0);
gst_aspect_ratio_transform_structure (aspect_ratio_crop, structure, NULL,
"sink");
ret = gst_pad_set_caps (peer_pad, caps);
gst_object_unref (peer_pad);
- g_mutex_unlock (aspect_ratio_crop->crop_lock);
+ g_mutex_unlock (&aspect_ratio_crop->crop_lock);
return ret;
}
aspect_ratio_crop = GST_ASPECT_RATIO_CROP (object);
- if (aspect_ratio_crop->crop_lock)
- g_mutex_free (aspect_ratio_crop->crop_lock);
+ g_mutex_clear (&aspect_ratio_crop->crop_lock);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
aspect_ratio_crop->ar_num = 0;
aspect_ratio_crop->ar_denom = 1;
- aspect_ratio_crop->crop_lock = g_mutex_new ();
+ g_mutex_init (&aspect_ratio_crop->crop_lock);
/* add the transform element */
aspect_ratio_crop->videocrop = gst_element_factory_make ("videocrop", NULL);
aspect_ratio_crop = GST_ASPECT_RATIO_CROP (gst_pad_get_parent (pad));
- g_mutex_lock (aspect_ratio_crop->crop_lock);
+ g_mutex_lock (&aspect_ratio_crop->crop_lock);
peer = gst_pad_get_peer (aspect_ratio_crop->sink);
if (peer == NULL) {
gst_object_unref (peer);
}
- g_mutex_unlock (aspect_ratio_crop->crop_lock);
+ g_mutex_unlock (&aspect_ratio_crop->crop_lock);
gst_object_unref (aspect_ratio_crop);
if (return_caps && filter) {
gint ar_num; /* if < 1 then don't change ar */
gint ar_denom;
- GMutex *crop_lock;
+ GMutex crop_lock;
};
struct _GstAspectRatioCropClass