audiobasesink->buffer_time = DEFAULT_BUFFER_TIME;
audiobasesink->latency_time = DEFAULT_LATENCY_TIME;
- audiobasesink->provide_clock = DEFAULT_PROVIDE_CLOCK;
audiobasesink->priv->slave_method = DEFAULT_SLAVE_METHOD;
audiobasesink->priv->drift_tolerance = DEFAULT_DRIFT_TOLERANCE;
audiobasesink->priv->alignment_threshold = DEFAULT_ALIGNMENT_THRESHOLD;
basesink->can_activate_pull = DEFAULT_CAN_ACTIVATE_PULL;
gst_base_sink_set_last_buffer_enabled (basesink, FALSE);
+ if (DEFAULT_PROVIDE_CLOCK)
+ GST_OBJECT_FLAG_SET (basesink, GST_ELEMENT_FLAG_PROVIDE_CLOCK);
+ else
+ GST_OBJECT_FLAG_UNSET (basesink, GST_ELEMENT_FLAG_PROVIDE_CLOCK);
}
static void
goto wrong_state;
GST_OBJECT_LOCK (sink);
- if (!sink->provide_clock)
+ if (!GST_OBJECT_FLAG_IS_SET (sink, GST_ELEMENT_FLAG_PROVIDE_CLOCK))
goto clock_disabled;
clock = GST_CLOCK_CAST (gst_object_ref (sink->provided_clock));
g_return_if_fail (GST_IS_AUDIO_BASE_SINK (sink));
GST_OBJECT_LOCK (sink);
- sink->provide_clock = provide;
+ if (provide)
+ GST_OBJECT_FLAG_SET (sink, GST_ELEMENT_FLAG_PROVIDE_CLOCK);
+ else
+ GST_OBJECT_FLAG_UNSET (sink, GST_ELEMENT_FLAG_PROVIDE_CLOCK);
GST_OBJECT_UNLOCK (sink);
}
g_return_val_if_fail (GST_IS_AUDIO_BASE_SINK (sink), FALSE);
GST_OBJECT_LOCK (sink);
- result = sink->provide_clock;
+ result = GST_OBJECT_FLAG_IS_SET (sink, GST_ELEMENT_FLAG_PROVIDE_CLOCK);
GST_OBJECT_UNLOCK (sink);
return result;
struct _GstAudioBaseSrcPrivate
{
- gboolean provide_clock;
-
/* the clock slaving algorithm in use */
GstAudioBaseSrcSlaveMethod slave_method;
};
audiobasesrc->buffer_time = DEFAULT_BUFFER_TIME;
audiobasesrc->latency_time = DEFAULT_LATENCY_TIME;
- audiobasesrc->priv->provide_clock = DEFAULT_PROVIDE_CLOCK;
+ if (DEFAULT_PROVIDE_CLOCK)
+ GST_OBJECT_FLAG_SET (audiobasesrc, GST_ELEMENT_FLAG_PROVIDE_CLOCK);
+ else
+ GST_OBJECT_FLAG_UNSET (audiobasesrc, GST_ELEMENT_FLAG_PROVIDE_CLOCK);
audiobasesrc->priv->slave_method = DEFAULT_SLAVE_METHOD;
/* reset blocksize we use latency time to calculate a more useful
* value based on negotiated format. */
(GstAudioClockGetTimeFunc) gst_audio_base_src_get_time, audiobasesrc,
NULL);
+
/* we are always a live source */
gst_base_src_set_live (GST_BASE_SRC (audiobasesrc), TRUE);
/* we operate in time */
goto wrong_state;
GST_OBJECT_LOCK (src);
- if (!src->priv->provide_clock)
+ if (!GST_OBJECT_FLAG_IS_SET (src, GST_ELEMENT_FLAG_PROVIDE_CLOCK))
goto clock_disabled;
clock = GST_CLOCK_CAST (gst_object_ref (src->clock));
g_return_if_fail (GST_IS_AUDIO_BASE_SRC (src));
GST_OBJECT_LOCK (src);
- src->priv->provide_clock = provide;
+ if (provide)
+ GST_OBJECT_FLAG_SET (src, GST_ELEMENT_FLAG_PROVIDE_CLOCK);
+ else
+ GST_OBJECT_FLAG_UNSET (src, GST_ELEMENT_FLAG_PROVIDE_CLOCK);
GST_OBJECT_UNLOCK (src);
}
g_return_val_if_fail (GST_IS_AUDIO_BASE_SRC (src), FALSE);
GST_OBJECT_LOCK (src);
- result = src->priv->provide_clock;
+ result = GST_OBJECT_FLAG_IS_SET (src, GST_ELEMENT_FLAG_PROVIDE_CLOCK);
GST_OBJECT_UNLOCK (src);
return result;
* @src: a #GstAudioBaseSrc
* @method: the new slave method
*
- * Controls how clock slaving will be performed in @src.
+ * Controls how clock slaving will be performed in @src.
*
* Since: 0.10.20
*/