2006-04-28 11:57:39 +00:00
|
|
|
/*
|
|
|
|
* GStreamer
|
2009-01-02 20:39:34 +00:00
|
|
|
* Copyright (C) 2006 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
|
|
|
* Copyright (C) 2008 Pioneers of the Inevitable <songbird@songbirdnest.com>
|
2012-06-12 10:42:31 +00:00
|
|
|
* Copyright (C) 2012 Fluendo S.A. <support@fluendo.com>
|
2009-01-02 20:39:34 +00:00
|
|
|
*
|
2006-04-28 11:57:39 +00:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
* DEALINGS IN THE SOFTWARE.
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the
|
|
|
|
* GNU Lesser General Public License Version 2.1 (the "LGPL"), in
|
|
|
|
* which case the following provisions apply instead of the ones
|
|
|
|
* mentioned above:
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-04 00:07:18 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2006-04-28 11:57:39 +00:00
|
|
|
*/
|
|
|
|
|
2013-03-05 20:17:52 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
2006-04-28 11:57:39 +00:00
|
|
|
#include <gst/gst.h>
|
2013-03-30 13:49:34 +00:00
|
|
|
#include <gst/audio/audio-channels.h>
|
|
|
|
#include "gstosxaudioringbuffer.h"
|
2009-01-02 20:39:34 +00:00
|
|
|
#include "gstosxaudiosink.h"
|
|
|
|
#include "gstosxaudiosrc.h"
|
2006-04-28 11:57:39 +00:00
|
|
|
|
2012-06-12 10:42:31 +00:00
|
|
|
#include <unistd.h> /* for getpid() */
|
|
|
|
|
2006-04-28 11:57:39 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (osx_audio_debug);
|
|
|
|
#define GST_CAT_DEFAULT osx_audio_debug
|
|
|
|
|
2012-06-12 10:42:31 +00:00
|
|
|
#include "gstosxcoreaudio.h"
|
|
|
|
|
2013-03-30 13:49:34 +00:00
|
|
|
static void gst_osx_audio_ring_buffer_dispose (GObject * object);
|
|
|
|
static gboolean gst_osx_audio_ring_buffer_open_device (GstAudioRingBuffer *
|
|
|
|
buf);
|
|
|
|
static gboolean gst_osx_audio_ring_buffer_close_device (GstAudioRingBuffer *
|
|
|
|
buf);
|
2006-04-28 11:57:39 +00:00
|
|
|
|
2013-03-30 13:49:34 +00:00
|
|
|
static gboolean gst_osx_audio_ring_buffer_acquire (GstAudioRingBuffer * buf,
|
|
|
|
GstAudioRingBufferSpec * spec);
|
|
|
|
static gboolean gst_osx_audio_ring_buffer_release (GstAudioRingBuffer * buf);
|
2006-04-28 11:57:39 +00:00
|
|
|
|
2013-03-30 13:49:34 +00:00
|
|
|
static gboolean gst_osx_audio_ring_buffer_start (GstAudioRingBuffer * buf);
|
|
|
|
static gboolean gst_osx_audio_ring_buffer_pause (GstAudioRingBuffer * buf);
|
|
|
|
static gboolean gst_osx_audio_ring_buffer_stop (GstAudioRingBuffer * buf);
|
|
|
|
static guint gst_osx_audio_ring_buffer_delay (GstAudioRingBuffer * buf);
|
|
|
|
static GstAudioRingBufferClass *ring_parent_class = NULL;
|
2006-04-28 11:57:39 +00:00
|
|
|
|
2013-03-30 13:49:34 +00:00
|
|
|
#define gst_osx_audio_ring_buffer_do_init \
|
|
|
|
GST_DEBUG_CATEGORY_INIT (osx_audio_debug, "osxaudio", 0, "OSX Audio Elements");
|
2009-01-02 20:39:34 +00:00
|
|
|
|
2013-03-30 13:49:34 +00:00
|
|
|
G_DEFINE_TYPE_WITH_CODE (GstOsxAudioRingBuffer, gst_osx_audio_ring_buffer,
|
|
|
|
GST_TYPE_AUDIO_RING_BUFFER, gst_osx_audio_ring_buffer_do_init);
|
2009-01-02 20:39:34 +00:00
|
|
|
|
|
|
|
static void
|
2013-03-30 13:49:34 +00:00
|
|
|
gst_osx_audio_ring_buffer_class_init (GstOsxAudioRingBufferClass * klass)
|
2006-04-28 11:57:39 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
2013-03-30 13:49:34 +00:00
|
|
|
GstAudioRingBufferClass *gstringbuffer_class;
|
2006-04-28 11:57:39 +00:00
|
|
|
|
|
|
|
gobject_class = (GObjectClass *) klass;
|
2013-03-30 13:49:34 +00:00
|
|
|
gstringbuffer_class = (GstAudioRingBufferClass *) klass;
|
2006-04-28 11:57:39 +00:00
|
|
|
|
|
|
|
ring_parent_class = g_type_class_peek_parent (klass);
|
|
|
|
|
2013-03-30 13:49:34 +00:00
|
|
|
gobject_class->dispose = gst_osx_audio_ring_buffer_dispose;
|
2006-04-28 11:57:39 +00:00
|
|
|
|
|
|
|
gstringbuffer_class->open_device =
|
2013-03-30 13:49:34 +00:00
|
|
|
GST_DEBUG_FUNCPTR (gst_osx_audio_ring_buffer_open_device);
|
2006-04-28 11:57:39 +00:00
|
|
|
gstringbuffer_class->close_device =
|
2013-03-30 13:49:34 +00:00
|
|
|
GST_DEBUG_FUNCPTR (gst_osx_audio_ring_buffer_close_device);
|
2006-04-28 11:57:39 +00:00
|
|
|
gstringbuffer_class->acquire =
|
2013-03-30 13:49:34 +00:00
|
|
|
GST_DEBUG_FUNCPTR (gst_osx_audio_ring_buffer_acquire);
|
2006-04-28 11:57:39 +00:00
|
|
|
gstringbuffer_class->release =
|
2013-03-30 13:49:34 +00:00
|
|
|
GST_DEBUG_FUNCPTR (gst_osx_audio_ring_buffer_release);
|
|
|
|
gstringbuffer_class->start =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_osx_audio_ring_buffer_start);
|
|
|
|
gstringbuffer_class->pause =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_osx_audio_ring_buffer_pause);
|
|
|
|
gstringbuffer_class->resume =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_osx_audio_ring_buffer_start);
|
|
|
|
gstringbuffer_class->stop =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_osx_audio_ring_buffer_stop);
|
|
|
|
gstringbuffer_class->delay =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_osx_audio_ring_buffer_delay);
|
|
|
|
|
|
|
|
GST_DEBUG ("osx audio ring buffer class init");
|
2006-04-28 11:57:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-03-30 13:49:34 +00:00
|
|
|
gst_osx_audio_ring_buffer_init (GstOsxAudioRingBuffer * ringbuffer)
|
2006-04-28 11:57:39 +00:00
|
|
|
{
|
2013-03-05 20:17:52 +00:00
|
|
|
ringbuffer->core_audio = gst_core_audio_new (GST_OBJECT (ringbuffer));
|
2006-04-28 11:57:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-03-30 13:49:34 +00:00
|
|
|
gst_osx_audio_ring_buffer_dispose (GObject * object)
|
2006-04-28 11:57:39 +00:00
|
|
|
{
|
2013-03-30 13:49:34 +00:00
|
|
|
GstOsxAudioRingBuffer *osxbuf;
|
2013-03-05 20:17:52 +00:00
|
|
|
|
2013-03-30 13:49:34 +00:00
|
|
|
osxbuf = GST_OSX_AUDIO_RING_BUFFER (object);
|
2013-03-05 20:17:52 +00:00
|
|
|
|
|
|
|
if (osxbuf->core_audio) {
|
|
|
|
g_object_unref (osxbuf->core_audio);
|
|
|
|
osxbuf->core_audio = NULL;
|
|
|
|
}
|
2006-04-28 11:57:39 +00:00
|
|
|
G_OBJECT_CLASS (ring_parent_class)->dispose (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2013-03-30 13:49:34 +00:00
|
|
|
gst_osx_audio_ring_buffer_open_device (GstAudioRingBuffer * buf)
|
2006-04-28 11:57:39 +00:00
|
|
|
{
|
2015-03-10 09:31:20 +00:00
|
|
|
GstOsxAudioRingBuffer *osxbuf = GST_OSX_AUDIO_RING_BUFFER (buf);
|
2009-01-02 20:39:34 +00:00
|
|
|
|
2014-11-28 16:53:17 +00:00
|
|
|
if (!gst_core_audio_select_device (osxbuf->core_audio))
|
2014-11-28 09:36:35 +00:00
|
|
|
return FALSE;
|
2009-01-02 20:39:34 +00:00
|
|
|
|
2013-03-05 20:17:52 +00:00
|
|
|
return gst_core_audio_open (osxbuf->core_audio);
|
2006-04-28 11:57:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2013-03-30 13:49:34 +00:00
|
|
|
gst_osx_audio_ring_buffer_close_device (GstAudioRingBuffer * buf)
|
2006-04-28 11:57:39 +00:00
|
|
|
{
|
2013-03-30 13:49:34 +00:00
|
|
|
GstOsxAudioRingBuffer *osxbuf;
|
|
|
|
osxbuf = GST_OSX_AUDIO_RING_BUFFER (buf);
|
2009-01-02 20:39:34 +00:00
|
|
|
|
2013-03-05 20:17:52 +00:00
|
|
|
return gst_core_audio_close (osxbuf->core_audio);
|
2012-06-12 10:42:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2013-03-30 13:49:34 +00:00
|
|
|
gst_osx_audio_ring_buffer_acquire (GstAudioRingBuffer * buf,
|
|
|
|
GstAudioRingBufferSpec * spec)
|
2012-06-12 10:42:31 +00:00
|
|
|
{
|
2013-03-05 20:17:52 +00:00
|
|
|
gboolean ret = FALSE, is_passthrough = FALSE;
|
2013-03-30 13:49:34 +00:00
|
|
|
GstOsxAudioRingBuffer *osxbuf;
|
2012-06-12 10:42:31 +00:00
|
|
|
AudioStreamBasicDescription format;
|
|
|
|
|
2013-03-30 13:49:34 +00:00
|
|
|
osxbuf = GST_OSX_AUDIO_RING_BUFFER (buf);
|
2012-06-12 10:42:31 +00:00
|
|
|
|
|
|
|
if (RINGBUFFER_IS_SPDIF (spec->type)) {
|
|
|
|
format.mFormatID = kAudioFormat60958AC3;
|
2013-04-12 19:18:04 +00:00
|
|
|
format.mSampleRate = (double) GST_AUDIO_INFO_RATE (&spec->info);
|
2012-06-12 10:42:31 +00:00
|
|
|
format.mChannelsPerFrame = 2;
|
|
|
|
format.mFormatFlags = kAudioFormatFlagIsSignedInteger |
|
|
|
|
kAudioFormatFlagIsPacked | kAudioFormatFlagIsNonMixable;
|
|
|
|
format.mBytesPerFrame = 0;
|
|
|
|
format.mBitsPerChannel = 16;
|
|
|
|
format.mBytesPerPacket = 6144;
|
|
|
|
format.mFramesPerPacket = 1536;
|
|
|
|
format.mReserved = 0;
|
|
|
|
spec->segsize = 6144;
|
|
|
|
spec->segtotal = 10;
|
2013-03-05 20:17:52 +00:00
|
|
|
is_passthrough = TRUE;
|
2012-06-12 10:42:31 +00:00
|
|
|
} else {
|
|
|
|
int width, depth;
|
|
|
|
/* Fill out the audio description we're going to be using */
|
|
|
|
format.mFormatID = kAudioFormatLinearPCM;
|
2013-04-12 19:18:04 +00:00
|
|
|
format.mSampleRate = (double) GST_AUDIO_INFO_RATE (&spec->info);
|
|
|
|
format.mChannelsPerFrame = GST_AUDIO_INFO_CHANNELS (&spec->info);
|
|
|
|
if (GST_AUDIO_INFO_IS_FLOAT (&spec->info)) {
|
2012-06-12 10:42:31 +00:00
|
|
|
format.mFormatFlags = kAudioFormatFlagsNativeFloatPacked;
|
2013-04-12 19:18:04 +00:00
|
|
|
width = depth = GST_AUDIO_INFO_WIDTH (&spec->info);
|
2012-06-12 10:42:31 +00:00
|
|
|
} else {
|
|
|
|
format.mFormatFlags = kAudioFormatFlagIsSignedInteger;
|
2013-04-12 19:18:04 +00:00
|
|
|
width = GST_AUDIO_INFO_WIDTH (&spec->info);
|
|
|
|
depth = GST_AUDIO_INFO_DEPTH (&spec->info);
|
2012-06-12 10:42:31 +00:00
|
|
|
if (width == depth) {
|
|
|
|
format.mFormatFlags |= kAudioFormatFlagIsPacked;
|
|
|
|
} else {
|
|
|
|
format.mFormatFlags |= kAudioFormatFlagIsAlignedHigh;
|
|
|
|
}
|
|
|
|
}
|
2014-12-22 11:56:05 +00:00
|
|
|
|
|
|
|
if (GST_AUDIO_INFO_IS_BIG_ENDIAN (&spec->info)) {
|
|
|
|
format.mFormatFlags |= kAudioFormatFlagIsBigEndian;
|
|
|
|
}
|
|
|
|
|
2013-04-12 19:18:04 +00:00
|
|
|
format.mBytesPerFrame = GST_AUDIO_INFO_BPF (&spec->info);
|
2012-06-12 10:42:31 +00:00
|
|
|
format.mBitsPerChannel = depth;
|
2013-04-12 19:18:04 +00:00
|
|
|
format.mBytesPerPacket = GST_AUDIO_INFO_BPF (&spec->info);
|
2012-06-12 10:42:31 +00:00
|
|
|
format.mFramesPerPacket = 1;
|
|
|
|
format.mReserved = 0;
|
|
|
|
spec->segsize =
|
2013-04-12 19:18:04 +00:00
|
|
|
(spec->latency_time * GST_AUDIO_INFO_RATE (&spec->info) /
|
|
|
|
G_USEC_PER_SEC) * GST_AUDIO_INFO_BPF (&spec->info);
|
2012-06-12 10:42:31 +00:00
|
|
|
spec->segtotal = spec->buffer_time / spec->latency_time;
|
2013-03-05 20:17:52 +00:00
|
|
|
is_passthrough = FALSE;
|
2012-06-12 10:42:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (osxbuf, "Format: " CORE_AUDIO_FORMAT,
|
|
|
|
CORE_AUDIO_FORMAT_ARGS (format));
|
|
|
|
|
2013-04-17 07:50:43 +00:00
|
|
|
if (GST_IS_OSX_AUDIO_SINK (GST_OBJECT_PARENT (buf))) {
|
2013-04-16 13:46:00 +00:00
|
|
|
gst_audio_ring_buffer_set_channel_positions (buf,
|
2013-04-17 07:50:43 +00:00
|
|
|
GST_OSX_AUDIO_SINK (GST_OBJECT_PARENT (buf))->channel_positions);
|
2013-04-16 13:46:00 +00:00
|
|
|
}
|
2013-04-10 12:06:16 +00:00
|
|
|
|
2013-03-30 13:49:34 +00:00
|
|
|
buf->size = spec->segtotal * spec->segsize;
|
|
|
|
buf->memory = g_malloc0 (buf->size);
|
2012-06-12 10:42:31 +00:00
|
|
|
|
2013-03-05 20:17:52 +00:00
|
|
|
ret = gst_core_audio_initialize (osxbuf->core_audio, format, spec->caps,
|
|
|
|
is_passthrough);
|
2012-06-12 10:42:31 +00:00
|
|
|
|
|
|
|
if (!ret) {
|
2013-03-30 13:49:34 +00:00
|
|
|
g_free (buf->memory);
|
|
|
|
buf->memory = NULL;
|
|
|
|
buf->size = 0;
|
2012-06-12 10:42:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
osxbuf->segoffset = 0;
|
|
|
|
|
|
|
|
return ret;
|
2006-04-28 11:57:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2013-03-30 13:49:34 +00:00
|
|
|
gst_osx_audio_ring_buffer_release (GstAudioRingBuffer * buf)
|
2006-04-28 11:57:39 +00:00
|
|
|
{
|
2013-03-30 13:49:34 +00:00
|
|
|
GstOsxAudioRingBuffer *osxbuf;
|
2006-04-28 11:57:39 +00:00
|
|
|
|
2013-03-30 13:49:34 +00:00
|
|
|
osxbuf = GST_OSX_AUDIO_RING_BUFFER (buf);
|
2006-04-28 11:57:39 +00:00
|
|
|
|
2013-03-05 20:17:52 +00:00
|
|
|
gst_core_audio_unitialize (osxbuf->core_audio);
|
2009-01-02 20:39:34 +00:00
|
|
|
|
2013-03-30 13:49:34 +00:00
|
|
|
g_free (buf->memory);
|
|
|
|
buf->memory = NULL;
|
|
|
|
buf->size = 0;
|
2006-04-28 11:57:39 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2012-06-12 10:42:31 +00:00
|
|
|
static gboolean
|
2013-03-30 13:49:34 +00:00
|
|
|
gst_osx_audio_ring_buffer_start (GstAudioRingBuffer * buf)
|
2006-04-28 11:57:39 +00:00
|
|
|
{
|
2013-03-30 13:49:34 +00:00
|
|
|
GstOsxAudioRingBuffer *osxbuf;
|
2009-01-02 20:39:34 +00:00
|
|
|
|
2013-03-30 13:49:34 +00:00
|
|
|
osxbuf = GST_OSX_AUDIO_RING_BUFFER (buf);
|
2009-01-02 20:39:34 +00:00
|
|
|
|
2013-03-05 20:17:52 +00:00
|
|
|
return gst_core_audio_start_processing (osxbuf->core_audio);
|
2012-06-12 10:42:31 +00:00
|
|
|
}
|
2009-01-02 20:39:34 +00:00
|
|
|
|
2012-06-12 10:42:31 +00:00
|
|
|
static gboolean
|
2013-03-30 13:49:34 +00:00
|
|
|
gst_osx_audio_ring_buffer_pause (GstAudioRingBuffer * buf)
|
2012-06-12 10:42:31 +00:00
|
|
|
{
|
2013-03-30 13:49:34 +00:00
|
|
|
GstOsxAudioRingBuffer *osxbuf = GST_OSX_AUDIO_RING_BUFFER (buf);
|
2012-06-12 10:42:31 +00:00
|
|
|
|
2013-03-05 20:17:52 +00:00
|
|
|
return gst_core_audio_pause_processing (osxbuf->core_audio);
|
2009-01-02 20:39:34 +00:00
|
|
|
}
|
|
|
|
|
2012-06-12 10:42:31 +00:00
|
|
|
|
|
|
|
static gboolean
|
2013-03-30 13:49:34 +00:00
|
|
|
gst_osx_audio_ring_buffer_stop (GstAudioRingBuffer * buf)
|
2009-01-02 20:39:34 +00:00
|
|
|
{
|
2013-03-30 13:49:34 +00:00
|
|
|
GstOsxAudioRingBuffer *osxbuf;
|
2009-01-02 20:39:34 +00:00
|
|
|
|
2013-03-30 13:49:34 +00:00
|
|
|
osxbuf = GST_OSX_AUDIO_RING_BUFFER (buf);
|
2009-01-02 20:39:34 +00:00
|
|
|
|
2013-03-05 20:17:52 +00:00
|
|
|
gst_core_audio_stop_processing (osxbuf->core_audio);
|
2009-01-02 20:39:34 +00:00
|
|
|
|
2012-06-12 10:42:31 +00:00
|
|
|
return TRUE;
|
2009-01-02 20:39:34 +00:00
|
|
|
}
|
|
|
|
|
2012-06-12 10:42:31 +00:00
|
|
|
static guint
|
2013-03-30 13:49:34 +00:00
|
|
|
gst_osx_audio_ring_buffer_delay (GstAudioRingBuffer * buf)
|
2009-01-02 20:39:34 +00:00
|
|
|
{
|
2013-03-30 13:49:34 +00:00
|
|
|
GstOsxAudioRingBuffer *osxbuf;
|
2013-03-05 20:17:52 +00:00
|
|
|
double latency;
|
2012-06-12 10:42:31 +00:00
|
|
|
guint samples;
|
2009-01-02 20:39:34 +00:00
|
|
|
|
2013-03-30 13:49:34 +00:00
|
|
|
osxbuf = GST_OSX_AUDIO_RING_BUFFER (buf);
|
2009-01-02 20:39:34 +00:00
|
|
|
|
2013-03-05 20:17:52 +00:00
|
|
|
if (!gst_core_audio_get_samples_and_latency (osxbuf->core_audio,
|
2013-04-12 19:18:04 +00:00
|
|
|
GST_AUDIO_INFO_RATE (&buf->spec.info), &samples, &latency)) {
|
2013-03-05 20:17:52 +00:00
|
|
|
return 0;
|
2012-06-12 10:42:31 +00:00
|
|
|
}
|
|
|
|
GST_DEBUG_OBJECT (buf, "Got latency: %f seconds -> %d samples",
|
|
|
|
latency, samples);
|
|
|
|
return samples;
|
2006-04-28 11:57:39 +00:00
|
|
|
}
|