sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
/*
|
|
|
|
* GStreamer
|
2009-01-02 20:39:34 +00:00
|
|
|
* Copyright (C) 2005,2006 Zaheer Abbas Merali <zaheerabbas at merali dot org>
|
|
|
|
* Copyright (C) 2007,2008 Pioneers of the Inevitable <songbird@songbirdnest.com>
|
|
|
|
*
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +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:
|
2004-05-20 19:45:13 +00:00
|
|
|
*
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +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.
|
2007-02-27 11:59:21 +00:00
|
|
|
*
|
2009-01-02 20:39:34 +00:00
|
|
|
* The development of this code was made possible due to the involvement of
|
|
|
|
* Pioneers of the Inevitable, the creators of the Songbird Music player
|
2007-02-27 11:59:21 +00:00
|
|
|
*
|
2004-05-20 19:45:13 +00:00
|
|
|
*/
|
|
|
|
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
/**
|
2009-01-29 08:10:08 +00:00
|
|
|
* SECTION:element-osxaudiosink
|
|
|
|
*
|
|
|
|
* This element renders raw audio samples using the CoreAudio api.
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
*
|
|
|
|
* <refsect2>
|
2009-01-29 08:10:08 +00:00
|
|
|
* <title>Example pipelines</title>
|
|
|
|
* |[
|
|
|
|
* gst-launch filesrc location=sine.ogg ! oggdemux ! vorbisdec ! audioconvert ! audioresample ! osxaudiosink
|
|
|
|
* ]| Play an Ogg/Vorbis file.
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
* </refsect2>
|
2009-01-29 08:10:08 +00:00
|
|
|
*
|
|
|
|
* Last reviewed on 2006-03-01 (0.10.4)
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
*/
|
|
|
|
|
2004-05-20 19:45:13 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
# include <config.h>
|
2004-05-20 19:45:13 +00:00
|
|
|
#endif
|
|
|
|
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
#include <gst/gst.h>
|
|
|
|
#include <CoreAudio/CoreAudio.h>
|
2008-08-26 21:13:08 +00:00
|
|
|
#include <CoreAudio/AudioHardware.h>
|
2004-05-20 19:45:13 +00:00
|
|
|
#include "gstosxaudiosink.h"
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
#include "gstosxaudioelement.h"
|
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_STATIC (osx_audiosink_debug);
|
|
|
|
#define GST_CAT_DEFAULT osx_audiosink_debug
|
2004-05-20 19:45:13 +00:00
|
|
|
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
/* Filter signals and args */
|
2004-05-20 19:45:13 +00:00
|
|
|
enum
|
|
|
|
{
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
/* FILL ME */
|
2004-05-20 19:45:13 +00:00
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
ARG_0,
|
2009-01-02 20:39:34 +00:00
|
|
|
ARG_DEVICE,
|
|
|
|
ARG_VOLUME
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
};
|
|
|
|
|
2009-01-02 20:39:34 +00:00
|
|
|
#define DEFAULT_VOLUME 1.0
|
|
|
|
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
|
2004-05-20 19:45:13 +00:00
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("audio/x-raw-float, "
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
"endianness = (int) {" G_STRINGIFY (G_BYTE_ORDER) " }, "
|
|
|
|
"signed = (boolean) { TRUE }, "
|
2006-04-28 14:55:20 +00:00
|
|
|
"width = (int) 32, "
|
2008-08-26 21:13:08 +00:00
|
|
|
"depth = (int) 32, "
|
2009-01-02 20:39:34 +00:00
|
|
|
"rate = (int) [1, MAX], " "channels = (int) [1, MAX]")
|
2004-05-20 19:45:13 +00:00
|
|
|
);
|
|
|
|
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
static void gst_osx_audio_sink_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec);
|
|
|
|
static void gst_osx_audio_sink_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec);
|
|
|
|
|
|
|
|
static GstRingBuffer *gst_osx_audio_sink_create_ringbuffer (GstBaseAudioSink *
|
|
|
|
sink);
|
|
|
|
static void gst_osx_audio_sink_osxelement_init (gpointer g_iface,
|
|
|
|
gpointer iface_data);
|
2008-08-26 21:13:08 +00:00
|
|
|
static void gst_osx_audio_sink_select_device (GstOsxAudioSink * osxsink);
|
2009-01-02 20:39:34 +00:00
|
|
|
static void gst_osx_audio_sink_set_volume (GstOsxAudioSink * sink);
|
|
|
|
|
|
|
|
static OSStatus gst_osx_audio_sink_io_proc (GstOsxRingBuffer * buf,
|
|
|
|
AudioUnitRenderActionFlags * ioActionFlags,
|
|
|
|
const AudioTimeStamp * inTimeStamp,
|
|
|
|
UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList * bufferList);
|
2008-08-26 21:13:08 +00:00
|
|
|
|
2004-05-20 19:45:13 +00:00
|
|
|
static void
|
2009-01-02 20:39:34 +00:00
|
|
|
gst_osx_audio_sink_do_init (GType type)
|
2004-05-20 19:45:13 +00:00
|
|
|
{
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
static const GInterfaceInfo osxelement_info = {
|
|
|
|
gst_osx_audio_sink_osxelement_init,
|
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_INIT (osx_audiosink_debug, "osxaudiosink", 0,
|
|
|
|
"OSX Audio Sink");
|
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");
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
g_type_add_interface_static (type, GST_OSX_AUDIO_ELEMENT_TYPE,
|
|
|
|
&osxelement_info);
|
|
|
|
}
|
2004-05-20 19:45:13 +00:00
|
|
|
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
GST_BOILERPLATE_FULL (GstOsxAudioSink, gst_osx_audio_sink, GstBaseAudioSink,
|
2009-01-02 20:39:34 +00:00
|
|
|
GST_TYPE_BASE_AUDIO_SINK, gst_osx_audio_sink_do_init);
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2006-05-06 00:14:09 +00:00
|
|
|
static void
|
|
|
|
gst_osx_audio_sink_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,
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
gst_static_pad_template_get (&sink_factory));
|
|
|
|
|
2010-03-18 13:31:35 +00:00
|
|
|
gst_element_class_set_details_simple (element_class, "Audio Sink (OSX)",
|
|
|
|
"Sink/Audio",
|
|
|
|
"Output to a sound card in OS X",
|
|
|
|
"Zaheer Abbas Merali <zaheerabbas at merali dot org>");
|
2004-05-20 19:45:13 +00:00
|
|
|
}
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
|
2004-05-20 19:45:13 +00:00
|
|
|
static void
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
gst_osx_audio_sink_class_init (GstOsxAudioSinkClass * klass)
|
2004-05-20 19:45:13 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
GstElementClass *gstelement_class;
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
GstBaseSinkClass *gstbasesink_class;
|
|
|
|
GstBaseAudioSinkClass *gstbaseaudiosink_class;
|
2004-05-20 19:45:13 +00:00
|
|
|
|
|
|
|
gobject_class = (GObjectClass *) klass;
|
|
|
|
gstelement_class = (GstElementClass *) klass;
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
gstbasesink_class = (GstBaseSinkClass *) klass;
|
|
|
|
gstbaseaudiosink_class = (GstBaseAudioSinkClass *) 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
|
|
|
|
2010-06-06 15:57:03 +00:00
|
|
|
gobject_class->set_property = gst_osx_audio_sink_set_property;
|
|
|
|
gobject_class->get_property = gst_osx_audio_sink_get_property;
|
2004-05-20 19:45:13 +00:00
|
|
|
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_DEVICE,
|
|
|
|
g_param_spec_int ("device", "Device ID", "Device ID of output device",
|
|
|
|
0, G_MAXINT, 0, G_PARAM_READWRITE));
|
|
|
|
|
2009-01-02 20:39:34 +00:00
|
|
|
g_object_class_install_property (gobject_class, ARG_VOLUME,
|
|
|
|
g_param_spec_double ("volume", "Volume", "Volume of this stream",
|
|
|
|
0, 1.0, 1.0, G_PARAM_READWRITE));
|
|
|
|
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
gstbaseaudiosink_class->create_ringbuffer =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_osx_audio_sink_create_ringbuffer);
|
2004-05-20 19:45:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
gst_osx_audio_sink_init (GstOsxAudioSink * sink, GstOsxAudioSinkClass * gclass)
|
2004-05-20 19:45:13 +00:00
|
|
|
{
|
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");
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2008-08-26 21:13:08 +00:00
|
|
|
sink->device_id = kAudioDeviceUnknown;
|
2009-01-02 20:39:34 +00:00
|
|
|
sink->volume = DEFAULT_VOLUME;
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
}
|
2004-05-20 19:45:13 +00:00
|
|
|
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
static void
|
|
|
|
gst_osx_audio_sink_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec)
|
|
|
|
{
|
|
|
|
GstOsxAudioSink *sink = GST_OSX_AUDIO_SINK (object);
|
2004-05-20 19:45:13 +00:00
|
|
|
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_DEVICE:
|
2008-08-26 21:13:08 +00:00
|
|
|
sink->device_id = g_value_get_int (value);
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
break;
|
2009-01-02 20:39:34 +00:00
|
|
|
case ARG_VOLUME:
|
|
|
|
sink->volume = g_value_get_double (value);
|
|
|
|
gst_osx_audio_sink_set_volume (sink);
|
|
|
|
break;
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
2004-05-20 19:45:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
gst_osx_audio_sink_get_property (GObject * object, guint prop_id,
|
|
|
|
GValue * value, GParamSpec * pspec)
|
2004-05-20 19:45:13 +00:00
|
|
|
{
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
GstOsxAudioSink *sink = GST_OSX_AUDIO_SINK (object);
|
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_DEVICE:
|
2008-08-26 21:13:08 +00:00
|
|
|
g_value_set_int (value, sink->device_id);
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
break;
|
2009-01-02 20:39:34 +00:00
|
|
|
case ARG_VOLUME:
|
|
|
|
g_value_set_double (value, sink->volume);
|
|
|
|
break;
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
2004-05-20 19:45:13 +00:00
|
|
|
}
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GstRingBuffer *
|
|
|
|
gst_osx_audio_sink_create_ringbuffer (GstBaseAudioSink * sink)
|
2004-05-20 19:45:13 +00:00
|
|
|
{
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
GstOsxAudioSink *osxsink;
|
2008-08-26 21:13:08 +00:00
|
|
|
GstOsxRingBuffer *ringbuffer;
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
|
|
|
|
osxsink = GST_OSX_AUDIO_SINK (sink);
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2008-08-26 21:13:08 +00:00
|
|
|
gst_osx_audio_sink_select_device (osxsink);
|
|
|
|
|
|
|
|
GST_DEBUG ("Creating ringbuffer");
|
|
|
|
ringbuffer = g_object_new (GST_TYPE_OSX_RING_BUFFER, NULL);
|
|
|
|
GST_DEBUG ("osx sink 0x%p element 0x%p ioproc 0x%p", osxsink,
|
|
|
|
GST_OSX_AUDIO_ELEMENT_GET_INTERFACE (osxsink),
|
|
|
|
(void *) gst_osx_audio_sink_io_proc);
|
2009-01-02 20:39:34 +00:00
|
|
|
|
|
|
|
gst_osx_audio_sink_set_volume (osxsink);
|
|
|
|
|
2008-08-26 21:13:08 +00:00
|
|
|
ringbuffer->element = GST_OSX_AUDIO_ELEMENT_GET_INTERFACE (osxsink);
|
|
|
|
ringbuffer->device_id = osxsink->device_id;
|
|
|
|
|
|
|
|
return GST_RING_BUFFER (ringbuffer);
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
}
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2009-01-02 20:39:34 +00:00
|
|
|
/* HALOutput AudioUnit will request fairly arbitrarily-sized chunks of data,
|
|
|
|
* not of a fixed size. So, we keep track of where in the current ringbuffer
|
|
|
|
* segment we are, and only advance the segment once we've read the whole
|
|
|
|
* thing */
|
|
|
|
static OSStatus
|
|
|
|
gst_osx_audio_sink_io_proc (GstOsxRingBuffer * buf,
|
|
|
|
AudioUnitRenderActionFlags * ioActionFlags,
|
|
|
|
const AudioTimeStamp * inTimeStamp,
|
|
|
|
UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList * bufferList)
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
{
|
|
|
|
guint8 *readptr;
|
|
|
|
gint readseg;
|
|
|
|
gint len;
|
2009-01-02 20:39:34 +00:00
|
|
|
gint remaining = bufferList->mBuffers[0].mDataByteSize;
|
|
|
|
gint offset = 0;
|
|
|
|
|
|
|
|
while (remaining) {
|
|
|
|
if (!gst_ring_buffer_prepare_read (GST_RING_BUFFER (buf),
|
|
|
|
&readseg, &readptr, &len))
|
|
|
|
return 0;
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
|
2009-01-02 20:39:34 +00:00
|
|
|
len -= buf->segoffset;
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
|
2009-01-02 20:39:34 +00:00
|
|
|
if (len > remaining)
|
|
|
|
len = remaining;
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
|
2009-01-02 20:39:34 +00:00
|
|
|
memcpy ((char *) bufferList->mBuffers[0].mData + offset,
|
|
|
|
readptr + buf->segoffset, len);
|
|
|
|
|
|
|
|
buf->segoffset += len;
|
|
|
|
offset += len;
|
|
|
|
remaining -= len;
|
|
|
|
|
|
|
|
if ((gint) buf->segoffset == GST_RING_BUFFER (buf)->spec.segsize) {
|
|
|
|
/* clear written samples */
|
|
|
|
gst_ring_buffer_clear (GST_RING_BUFFER (buf), readseg);
|
|
|
|
|
|
|
|
/* we wrote one segment */
|
|
|
|
gst_ring_buffer_advance (GST_RING_BUFFER (buf), 1);
|
|
|
|
|
|
|
|
buf->segoffset = 0;
|
|
|
|
}
|
2004-05-20 19:45:13 +00:00
|
|
|
}
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_osx_audio_sink_osxelement_init (gpointer g_iface, gpointer iface_data)
|
|
|
|
{
|
|
|
|
GstOsxAudioElementInterface *iface = (GstOsxAudioElementInterface *) g_iface;
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2009-01-02 20:39:34 +00:00
|
|
|
iface->io_proc = (AURenderCallback) gst_osx_audio_sink_io_proc;
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
}
|
2004-05-20 19:45:13 +00:00
|
|
|
|
2009-01-02 20:39:34 +00:00
|
|
|
static void
|
|
|
|
gst_osx_audio_sink_set_volume (GstOsxAudioSink * sink)
|
|
|
|
{
|
|
|
|
if (!sink->audiounit)
|
|
|
|
return;
|
|
|
|
|
|
|
|
AudioUnitSetParameter (sink->audiounit, kHALOutputParam_Volume,
|
|
|
|
kAudioUnitScope_Global, 0, (float) sink->volume, 0);
|
|
|
|
}
|
2008-08-26 21:13:08 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gst_osx_audio_sink_select_device (GstOsxAudioSink * osxsink)
|
sys/osxaudio/: Port of osxaudiosink to 0.10
Original commit message from CVS:
2006-04-26 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/osxaudio/Makefile.am:
* sys/osxaudio/gstosxaudioelement.c:
(gst_osx_audio_element_get_type),
(gst_osx_audio_element_class_init):
* sys/osxaudio/gstosxaudioelement.h:
* sys/osxaudio/gstosxaudiosink.c:
(gst_osx_audio_sink_osxelement_do_init),
(gst_osx_audio_sink_base_init), (gst_osx_audio_sink_class_init),
(gst_osx_audio_sink_init), (gst_osx_audio_sink_set_property),
(gst_osx_audio_sink_get_property), (gst_osx_audio_sink_getcaps),
(gst_osx_audio_sink_create_ringbuffer),
(gst_osx_audio_sink_io_proc), (gst_osx_audio_sink_osxelement_init),
(plugin_init):
* sys/osxaudio/gstosxaudiosink.h:
Port of osxaudiosink to 0.10
2006-04-26 16:29:38 +00:00
|
|
|
{
|
2008-08-26 21:13:08 +00:00
|
|
|
OSStatus status;
|
|
|
|
UInt32 propertySize;
|
2006-04-28 14:55:20 +00:00
|
|
|
|
2008-08-26 21:13:08 +00:00
|
|
|
if (osxsink->device_id == kAudioDeviceUnknown) {
|
2009-01-02 20:39:34 +00:00
|
|
|
/* If no specific device has been selected by the user, then pick the
|
|
|
|
* default device */
|
2008-08-26 21:13:08 +00:00
|
|
|
GST_DEBUG_OBJECT (osxsink, "Selecting device for OSXAudioSink");
|
|
|
|
propertySize = sizeof (osxsink->device_id);
|
|
|
|
status =
|
|
|
|
AudioHardwareGetProperty (kAudioHardwarePropertyDefaultOutputDevice,
|
|
|
|
&propertySize, &osxsink->device_id);
|
|
|
|
|
2009-01-02 20:39:34 +00:00
|
|
|
if (status) {
|
2008-08-26 21:13:08 +00:00
|
|
|
GST_WARNING_OBJECT (osxsink,
|
|
|
|
"AudioHardwareGetProperty returned %d", (int) status);
|
2009-01-02 20:39:34 +00:00
|
|
|
} else {
|
2008-08-26 21:13:08 +00:00
|
|
|
GST_DEBUG_OBJECT (osxsink, "AudioHardwareGetProperty returned 0");
|
2009-01-02 20:39:34 +00:00
|
|
|
}
|
2008-08-26 21:13:08 +00:00
|
|
|
|
2009-01-02 20:39:34 +00:00
|
|
|
if (osxsink->device_id == kAudioDeviceUnknown) {
|
2008-08-26 21:13:08 +00:00
|
|
|
GST_WARNING_OBJECT (osxsink,
|
|
|
|
"AudioHardwareGetProperty: device_id is kAudioDeviceUnknown");
|
2009-01-02 20:39:34 +00:00
|
|
|
}
|
2008-08-26 21:13:08 +00:00
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (osxsink, "AudioHardwareGetProperty: device_id is %lu",
|
|
|
|
(long) osxsink->device_id);
|
|
|
|
}
|
|
|
|
}
|