PKG_CHECK_MODULES(JACK, jack >= 0.99.10, HAVE_JACK="yes", HAVE_JACK="no")
AC_SUBST(JACK_CFLAGS)
AC_SUBST(JACK_LIBS)
+
+ AG_GST_PKG_CHECK_MODULES(JACK_0_120_2, jack >= 0.120.2)
+ if test x$HAVE_JACK_0_120_2 = xyes; then
+ AC_DEFINE(HAVE_JACK_0_120_2, 1, [defined if jack >= 0.120.2 is available])
+ fi
+
])
dnl *** jpeg ***
gst_jack_ring_buffer_delay (GstRingBuffer * buf)
{
GstJackAudioSink *sink;
- guint i, res = 0, latency;
+ guint i, res = 0;
+#ifdef HAVE_JACK_0_120_2
+ jack_latency_range_t range;
+#else
+ guint latency;
+#endif
jack_client_t *client;
sink = GST_JACK_AUDIO_SINK (GST_OBJECT_PARENT (buf));
client = gst_jack_audio_client_get_client (sink->client);
for (i = 0; i < sink->port_count; i++) {
- latency = jack_port_get_total_latency (client, sink->ports[i]);
+#ifdef HAVE_JACK_0_120_2
+ jack_port_get_latency_range (sink->ports[i], JackPlaybackLatency, &range);
+ if (range.max > res)
+ res = range.max;
+#else
+ latency = jack_port_get_total_latency (client, src->ports[i]);
if (latency > res)
res = latency;
+#endif
}
GST_LOG_OBJECT (sink, "delay %u", res);
gst_jack_ring_buffer_delay (GstRingBuffer * buf)
{
GstJackAudioSrc *src;
- guint i, res = 0, latency;
+ guint i, res = 0;
+#ifdef HAVE_JACK_0_120_2
+ jack_latency_range_t range;
+#else
+ guint latency;
+#endif
jack_client_t *client;
src = GST_JACK_AUDIO_SRC (GST_OBJECT_PARENT (buf));
client = gst_jack_audio_client_get_client (src->client);
for (i = 0; i < src->port_count; i++) {
+#ifdef HAVE_JACK_0_120_2
+ jack_port_get_latency_range (src->ports[i], JackCaptureLatency, &range);
+ if (range.max > res)
+ res = range.max;
+#else
latency = jack_port_get_total_latency (client, src->ports[i]);
if (latency > res)
res = latency;
+#endif
}
GST_DEBUG_OBJECT (src, "delay %u", res);