2006-04-28 14:55:20 +00:00
|
|
|
/*
|
|
|
|
* GStreamer
|
|
|
|
* Copyright 2005,2006 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
|
|
|
*
|
|
|
|
* 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:
|
2004-05-20 19:45:13 +00:00
|
|
|
*
|
2006-04-28 14:55:20 +00:00
|
|
|
* 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:
|
2004-05-20 19:45:13 +00:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
/**
|
|
|
|
* SECTION:element-plugin
|
|
|
|
*
|
|
|
|
* <refsect2>
|
|
|
|
* <title>Example launch line</title>
|
|
|
|
* <para>
|
|
|
|
* <programlisting>
|
|
|
|
* gst-launch -v -m osxaudiosrc ! fakesink
|
|
|
|
* </programlisting>
|
|
|
|
* </para>
|
|
|
|
* </refsect2>
|
|
|
|
*/
|
|
|
|
|
2004-05-20 19:45:13 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2006-04-28 14:55:20 +00:00
|
|
|
# include <config.h>
|
2004-05-20 19:45:13 +00:00
|
|
|
#endif
|
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
#include <gst/gst.h>
|
2004-05-20 19:45:13 +00:00
|
|
|
#include <CoreAudio/CoreAudio.h>
|
2006-04-28 14:55:20 +00:00
|
|
|
#include "gstosxaudiosrc.h"
|
|
|
|
#include "gstosxaudioelement.h"
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (osx_audiosrc_debug);
|
|
|
|
#define GST_CAT_DEFAULT osx_audiosrc_debug
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
static GstElementDetails gst_osx_audio_src_details =
|
|
|
|
GST_ELEMENT_DETAILS ("Audio Source (OSX)",
|
2004-05-20 19:45:13 +00:00
|
|
|
"Source/Audio",
|
2006-04-28 14:55:20 +00:00
|
|
|
"Input from a sound card in OS X",
|
2004-12-11 13:43:19 +00:00
|
|
|
"Zaheer Abbas Merali <zaheerabbas at merali dot org>");
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
/* Filter signals and args */
|
2004-05-20 19:45:13 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
/* FILL ME */
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
ARG_0,
|
|
|
|
ARG_DEVICE
|
|
|
|
};
|
|
|
|
|
|
|
|
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
2004-05-20 19:45:13 +00:00
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("audio/x-raw-float, "
|
2006-04-28 14:55:20 +00:00
|
|
|
"endianness = (int) {" G_STRINGIFY (G_BYTE_ORDER) " }, "
|
|
|
|
"signed = (boolean) { TRUE }, "
|
|
|
|
"width = (int) 32, "
|
|
|
|
"depth = (int) 32, " "rate = (int) 44100, " "channels = (int) 2")
|
2004-05-20 19:45:13 +00:00
|
|
|
);
|
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
static void gst_osx_audio_src_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_osx_audio_src_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec);
|
2004-05-20 19:45:13 +00:00
|
|
|
|
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
static GstRingBuffer *gst_osx_audio_src_create_ringbuffer (GstBaseAudioSrc *
|
|
|
|
src);
|
|
|
|
/*static GstCaps* gst_osx_audio_sink_getcaps (GstBaseSink * bsrc);*/
|
|
|
|
static void gst_osx_audio_src_osxelement_init (gpointer g_iface,
|
|
|
|
gpointer iface_data);
|
|
|
|
OSStatus gst_osx_audio_src_io_proc (AudioDeviceID inDevice,
|
|
|
|
const AudioTimeStamp * inNow, const AudioBufferList * inInputData,
|
|
|
|
const AudioTimeStamp * inInputTime, AudioBufferList * outOutputData,
|
|
|
|
const AudioTimeStamp * inOutputTime, void *inClientData);
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
static void
|
|
|
|
gst_osx_audio_src_osxelement_do_init (GType type)
|
2004-05-20 19:45:13 +00:00
|
|
|
{
|
2006-04-28 14:55:20 +00:00
|
|
|
static const GInterfaceInfo osxelement_info = {
|
|
|
|
gst_osx_audio_src_osxelement_init,
|
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_INIT (osx_audiosrc_debug, "osxaudiosrc", 0,
|
|
|
|
"OSX Audio Src");
|
Activate osxaudio in gst-plugins-good with proper build setup.
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudio.c:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init), (gst_osx_audio_sink_init),
(gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer), (plugin_init):
* sys/osxaudio/gstosxaudiosrc.c:
(gst_osx_audio_src_osxelement_do_init), (gst_osx_audio_src_init),
(gst_osx_audio_src_create_ringbuffer):
* sys/osxaudio/gstosxringbuffer.c: (gst_osx_ring_buffer_get_type),
(gst_osx_ring_buffer_class_init), (gst_osx_ring_buffer_init),
(gst_osx_ring_buffer_acquire), (gst_osx_ring_buffer_start),
(gst_osx_ring_buffer_pause), (gst_osx_ring_buffer_stop):
* sys/osxaudio/gstosxringbuffer.h:
Activate osxaudio in gst-plugins-good with proper build setup.
Add inlined documentation.
Fix debug statements
Fix ringbuffer when pausing.
Fixes #323471
2007-03-15 11:39:53 +00:00
|
|
|
GST_DEBUG ("Adding static interface");
|
2006-04-28 14:55:20 +00:00
|
|
|
g_type_add_interface_static (type, GST_OSX_AUDIO_ELEMENT_TYPE,
|
|
|
|
&osxelement_info);
|
2004-05-20 19:45:13 +00:00
|
|
|
}
|
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
GST_BOILERPLATE_FULL (GstOsxAudioSrc, gst_osx_audio_src, GstBaseAudioSrc,
|
2006-05-06 00:14:09 +00:00
|
|
|
GST_TYPE_BASE_AUDIO_SRC, gst_osx_audio_src_osxelement_do_init);
|
2006-04-28 14:55:20 +00:00
|
|
|
|
|
|
|
|
2006-05-06 00:14:09 +00:00
|
|
|
static void
|
|
|
|
gst_osx_audio_src_base_init (gpointer g_class)
|
2004-05-20 19:45:13 +00:00
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
|
|
|
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
2006-04-28 14:55:20 +00:00
|
|
|
gst_static_pad_template_get (&src_factory));
|
|
|
|
|
|
|
|
gst_element_class_set_details (element_class, &gst_osx_audio_src_details);
|
2004-05-20 19:45:13 +00:00
|
|
|
}
|
2006-04-28 14:55:20 +00:00
|
|
|
|
|
|
|
/* initialize the plugin's class */
|
2004-05-20 19:45:13 +00:00
|
|
|
static void
|
2006-04-28 14:55:20 +00:00
|
|
|
gst_osx_audio_src_class_init (GstOsxAudioSrcClass * klass)
|
2004-05-20 19:45:13 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
GstElementClass *gstelement_class;
|
2006-04-28 14:55:20 +00:00
|
|
|
GstBaseAudioSrcClass *gstbaseaudiosrc_class;
|
2004-05-20 19:45:13 +00:00
|
|
|
|
|
|
|
gobject_class = (GObjectClass *) klass;
|
|
|
|
gstelement_class = (GstElementClass *) klass;
|
2006-04-28 14:55:20 +00:00
|
|
|
gstbaseaudiosrc_class = (GstBaseAudioSrcClass *) klass;
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-04-08 21:21:45 +00:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
gobject_class->set_property =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_osx_audio_src_set_property);
|
|
|
|
gobject_class->get_property =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_osx_audio_src_get_property);
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_DEVICE,
|
2007-10-23 08:38:50 +00:00
|
|
|
g_param_spec_int ("device", "Device ID", "Device ID of input device",
|
2006-04-28 14:55:20 +00:00
|
|
|
0, G_MAXINT, 0, G_PARAM_READWRITE));
|
|
|
|
|
|
|
|
gstbaseaudiosrc_class->create_ringbuffer =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_osx_audio_src_create_ringbuffer);
|
2004-05-20 19:45:13 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
/* initialize the new element
|
|
|
|
* instantiate pads and add them to element
|
|
|
|
* set functions
|
|
|
|
* initialize structure
|
|
|
|
*/
|
2004-05-20 19:45:13 +00:00
|
|
|
static void
|
2006-04-28 14:55:20 +00:00
|
|
|
gst_osx_audio_src_init (GstOsxAudioSrc * src, GstOsxAudioSrcClass * gclass)
|
2004-05-20 19:45:13 +00:00
|
|
|
{
|
2006-04-28 14:55:20 +00:00
|
|
|
/* GstElementClass *klass = GST_ELEMENT_GET_CLASS (sink); */
|
|
|
|
gst_base_src_set_live (GST_BASE_SRC (src), TRUE);
|
|
|
|
src->ringbuffer = NULL;
|
Activate osxaudio in gst-plugins-good with proper build setup.
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudio.c:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init), (gst_osx_audio_sink_init),
(gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer), (plugin_init):
* sys/osxaudio/gstosxaudiosrc.c:
(gst_osx_audio_src_osxelement_do_init), (gst_osx_audio_src_init),
(gst_osx_audio_src_create_ringbuffer):
* sys/osxaudio/gstosxringbuffer.c: (gst_osx_ring_buffer_get_type),
(gst_osx_ring_buffer_class_init), (gst_osx_ring_buffer_init),
(gst_osx_ring_buffer_acquire), (gst_osx_ring_buffer_start),
(gst_osx_ring_buffer_pause), (gst_osx_ring_buffer_stop):
* sys/osxaudio/gstosxringbuffer.h:
Activate osxaudio in gst-plugins-good with proper build setup.
Add inlined documentation.
Fix debug statements
Fix ringbuffer when pausing.
Fixes #323471
2007-03-15 11:39:53 +00:00
|
|
|
GST_DEBUG ("Initialising object");
|
2006-04-28 14:55:20 +00:00
|
|
|
gst_osx_audio_src_create_ringbuffer (GST_BASE_AUDIO_SRC (src));
|
2004-05-20 19:45:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2006-04-28 14:55:20 +00:00
|
|
|
gst_osx_audio_src_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
2004-05-20 19:45:13 +00:00
|
|
|
{
|
2006-04-28 14:55:20 +00:00
|
|
|
GstOsxAudioSrc *src = GST_OSX_AUDIO_SRC (object);
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_DEVICE:
|
|
|
|
if (src->ringbuffer)
|
|
|
|
src->ringbuffer->device_id = g_value_get_int (value);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
2004-05-20 19:45:13 +00:00
|
|
|
}
|
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
static void
|
|
|
|
gst_osx_audio_src_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec)
|
2004-05-20 19:45:13 +00:00
|
|
|
{
|
2006-04-28 14:55:20 +00:00
|
|
|
GstOsxAudioSrc *src = GST_OSX_AUDIO_SRC (object);
|
|
|
|
int val = 0;
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_DEVICE:
|
|
|
|
if (src->ringbuffer)
|
|
|
|
val = src->ringbuffer->device_id;
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
g_value_set_int (value, val);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
/* GstElement vmethod implementations */
|
2004-05-20 19:45:13 +00:00
|
|
|
|
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
/* GstBaseAudioSink vmethod implementations */
|
|
|
|
static GstRingBuffer *
|
|
|
|
gst_osx_audio_src_create_ringbuffer (GstBaseAudioSrc * src)
|
|
|
|
{
|
|
|
|
GstOsxAudioSrc *osxsrc;
|
2007-10-23 08:38:50 +00:00
|
|
|
OSStatus status;
|
|
|
|
UInt32 propertySize;
|
2006-04-28 14:55:20 +00:00
|
|
|
|
|
|
|
osxsrc = GST_OSX_AUDIO_SRC (src);
|
|
|
|
if (!osxsrc->ringbuffer) {
|
Activate osxaudio in gst-plugins-good with proper build setup.
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudio.c:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init), (gst_osx_audio_sink_init),
(gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer), (plugin_init):
* sys/osxaudio/gstosxaudiosrc.c:
(gst_osx_audio_src_osxelement_do_init), (gst_osx_audio_src_init),
(gst_osx_audio_src_create_ringbuffer):
* sys/osxaudio/gstosxringbuffer.c: (gst_osx_ring_buffer_get_type),
(gst_osx_ring_buffer_class_init), (gst_osx_ring_buffer_init),
(gst_osx_ring_buffer_acquire), (gst_osx_ring_buffer_start),
(gst_osx_ring_buffer_pause), (gst_osx_ring_buffer_stop):
* sys/osxaudio/gstosxringbuffer.h:
Activate osxaudio in gst-plugins-good with proper build setup.
Add inlined documentation.
Fix debug statements
Fix ringbuffer when pausing.
Fixes #323471
2007-03-15 11:39:53 +00:00
|
|
|
GST_DEBUG ("Creating ringbuffer");
|
2006-04-28 14:55:20 +00:00
|
|
|
osxsrc->ringbuffer = g_object_new (GST_TYPE_OSX_RING_BUFFER, NULL);
|
2007-10-23 08:38:50 +00:00
|
|
|
/* change the device to the Default Input Device */
|
|
|
|
propertySize = sizeof (osxsrc->ringbuffer->device_id);
|
|
|
|
status = AudioHardwareGetProperty (kAudioHardwarePropertyDefaultInputDevice,
|
|
|
|
&propertySize, &osxsrc->ringbuffer->device_id);
|
Activate osxaudio in gst-plugins-good with proper build setup.
Original commit message from CVS:
* configure.ac:
* sys/Makefile.am:
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudio.c:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init), (gst_osx_audio_sink_init),
(gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer), (plugin_init):
* sys/osxaudio/gstosxaudiosrc.c:
(gst_osx_audio_src_osxelement_do_init), (gst_osx_audio_src_init),
(gst_osx_audio_src_create_ringbuffer):
* sys/osxaudio/gstosxringbuffer.c: (gst_osx_ring_buffer_get_type),
(gst_osx_ring_buffer_class_init), (gst_osx_ring_buffer_init),
(gst_osx_ring_buffer_acquire), (gst_osx_ring_buffer_start),
(gst_osx_ring_buffer_pause), (gst_osx_ring_buffer_stop):
* sys/osxaudio/gstosxringbuffer.h:
Activate osxaudio in gst-plugins-good with proper build setup.
Add inlined documentation.
Fix debug statements
Fix ringbuffer when pausing.
Fixes #323471
2007-03-15 11:39:53 +00:00
|
|
|
GST_DEBUG ("osx src 0x%p element 0x%p ioproc 0x%p", osxsrc,
|
2006-04-28 14:55:20 +00:00
|
|
|
GST_OSX_AUDIO_ELEMENT_GET_INTERFACE (osxsrc),
|
|
|
|
(void *) gst_osx_audio_src_io_proc);
|
|
|
|
osxsrc->ringbuffer->element = GST_OSX_AUDIO_ELEMENT_GET_INTERFACE (osxsrc);
|
2004-05-20 19:45:13 +00:00
|
|
|
}
|
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
return GST_RING_BUFFER (osxsrc->ringbuffer);
|
|
|
|
}
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
OSStatus
|
|
|
|
gst_osx_audio_src_io_proc (AudioDeviceID inDevice, const AudioTimeStamp * inNow,
|
|
|
|
const AudioBufferList * inInputData, const AudioTimeStamp * inInputTime,
|
|
|
|
AudioBufferList * outOutputData, const AudioTimeStamp * inOutputTime,
|
|
|
|
void *inClientData)
|
|
|
|
{
|
|
|
|
GstOsxRingBuffer *buf = GST_OSX_RING_BUFFER (inClientData);
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
guint8 *writeptr;
|
|
|
|
gint writeseg;
|
|
|
|
gint len;
|
2007-10-23 08:38:50 +00:00
|
|
|
gint bytesToCopy;
|
close #333784 unref the result of gst_pad_get_parent() by: Christophe Fergeau.
Original commit message from CVS:
* ext/cairo/gsttextoverlay.c: (gst_text_overlay_setcaps):
* ext/esd/esdmon.c: (gst_esdmon_get):
* ext/flac/gstflactag.c: (gst_flac_tag_chain):
* ext/gdk_pixbuf/gstgdkpixbuf.c: (gst_gdk_pixbuf_sink_setcaps),
(gst_gdk_pixbuf_sink_getcaps):
* ext/jpeg/gstjpegenc.c: (gst_jpegenc_getcaps),
(gst_jpegenc_setcaps):
* ext/jpeg/gstsmokedec.c: (gst_smokedec_chain):
* ext/jpeg/gstsmokeenc.c: (gst_smokeenc_getcaps),
(gst_smokeenc_setcaps):
* ext/libmng/gstmngdec.c: (gst_mngdec_sinklink),
(gst_mngdec_src_getcaps):
* ext/libmng/gstmngenc.c: (gst_mngenc_sinklink),
(gst_mngenc_chain):
* ext/libpng/gstpngenc.c: (gst_pngenc_setcaps):
* ext/mikmod/gstmikmod.c: (gst_mikmod_srclink):
* ext/speex/gstspeexdec.c: (speex_dec_convert),
(speex_dec_src_event), (speex_dec_chain):
* gst/avi/gstavimux.c: (gst_avimux_vidsinkconnect),
(gst_avimux_audsinkconnect), (gst_avimux_handle_event):
* gst/debug/negotiation.c: (gst_negotiation_getcaps),
(gst_negotiation_pad_link), (gst_negotiation_chain):
* gst/flx/gstflxdec.c: (gst_flxdec_src_query_handler),
(gst_flxdec_chain):
* gst/interleave/deinterleave.c: (deinterleave_sink_link),
(deinterleave_chain):
* gst/law/mulaw-encode.c: (mulawenc_setcaps):
* gst/median/gstmedian.c: (gst_median_link):
* gst/monoscope/gstmonoscope.c: (gst_monoscope_srcconnect),
(gst_monoscope_chain):
* gst/rtp/gstrtpL16pay.c: (gst_rtpL16pay_sinkconnect):
* gst/wavenc/gstwavenc.c: (gst_wavenc_sink_setcaps):
* sys/osxaudio/gstosxaudiosink.c: (gst_osxaudiosink_chain):
* sys/osxaudio/gstosxaudiosrc.c: (gst_osxaudiosrc_get):
close #333784 unref the result of gst_pad_get_parent()
by: Christophe Fergeau.
2006-03-13 15:49:08 +00:00
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
if (gst_ring_buffer_prepare_read (GST_RING_BUFFER (buf), &writeseg, &writeptr,
|
|
|
|
&len)) {
|
2007-10-23 08:38:50 +00:00
|
|
|
bytesToCopy = inInputData->mBuffers[0].mDataByteSize;
|
|
|
|
memcpy (writeptr, (char *) inInputData->mBuffers[0].mData, bytesToCopy);
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
/* clear written samples */
|
|
|
|
/*gst_ring_buffer_clear (GST_RING_BUFFER(buf), writeseg); */
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
/* we wrote one segment */
|
|
|
|
gst_ring_buffer_advance (GST_RING_BUFFER (buf), 1);
|
2004-05-20 19:45:13 +00:00
|
|
|
}
|
2006-04-28 14:55:20 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
static void
|
|
|
|
gst_osx_audio_src_osxelement_init (gpointer g_iface, gpointer iface_data)
|
|
|
|
{
|
|
|
|
GstOsxAudioElementInterface *iface = (GstOsxAudioElementInterface *) g_iface;
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-04-28 14:55:20 +00:00
|
|
|
iface->io_proc = gst_osx_audio_src_io_proc;
|
2004-05-20 19:45:13 +00:00
|
|
|
}
|