1 /* GStreamer 2 * Copyright (C) 2008 Tristan Matthews <tristan@sat.qc.ca> 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice shall be included in 12 * all copies or substantial portions of the Software. 13 * 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 * DEALINGS IN THE SOFTWARE. 21 * 22 * Alternatively, the contents of this file may be used under the 23 * GNU Lesser General Public License Version 2.1 (the "LGPL"), in 24 * which case the following provisions apply instead of the ones 25 * mentioned above: 26 * 27 * This library is free software; you can redistribute it and/or 28 * modify it under the terms of the GNU Library General Public 29 * License as published by the Free Software Foundation; either 30 * version 2 of the License, or (at your option) any later version. 31 * 32 * This library is distributed in the hope that it will be useful, 33 * but WITHOUT ANY WARRANTY; without even the implied warranty of 34 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 35 * Library General Public License for more details. 36 * 37 * You should have received a copy of the GNU Library General Public 38 * License along with this library; if not, write to the 39 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 40 * Boston, MA 02110-1301, USA. 41 */ 42 43 #ifndef __GST_JACK_AUDIO_SRC_H__ 44 #define __GST_JACK_AUDIO_SRC_H__ 45 46 #include <jack/jack.h> 47 48 #include <gst/gst.h> 49 #include <gst/audio/gstaudiosrc.h> 50 51 #include "gstjackaudioclient.h" 52 #include "gstjack.h" 53 54 G_BEGIN_DECLS 55 56 #define GST_TYPE_JACK_AUDIO_SRC (gst_jack_audio_src_get_type()) 57 #define GST_JACK_AUDIO_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_JACK_AUDIO_SRC,GstJackAudioSrc)) 58 #define GST_JACK_AUDIO_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_JACK_AUDIO_SRC,GstJackAudioSrcClass)) 59 #define GST_JACK_AUDIO_SRC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),GST_TYPE_JACK_AUDIO_SRC,GstJackAudioSrcClass)) 60 #define GST_IS_JACK_AUDIO_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_JACK_AUDIO_SRC)) 61 #define GST_IS_JACK_AUDIO_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_JACK_AUDIO_SRC)) 62 63 typedef struct _GstJackAudioSrc GstJackAudioSrc; 64 typedef struct _GstJackAudioSrcClass GstJackAudioSrcClass; 65 66 struct _GstJackAudioSrc 67 { 68 GstAudioBaseSrc src; 69 70 /*< private >*/ 71 /* cached caps */ 72 GstCaps *caps; 73 74 /* properties */ 75 GstJackConnect connect; 76 gchar *server; 77 jack_client_t *jclient; 78 gchar *client_name; 79 gchar *port_pattern; 80 guint transport; 81 82 /* our client */ 83 GstJackAudioClient *client; 84 85 /* our ports */ 86 jack_port_t **ports; 87 int port_count; 88 sample_t **buffers; 89 }; 90 91 struct _GstJackAudioSrcClass 92 { 93 GstAudioBaseSrcClass parent_class; 94 }; 95 96 GType gst_jack_audio_src_get_type (void); 97 98 G_END_DECLS 99 100 #endif /* __GST_JACK_AUDIO_SRC_H__ */ 101