1 /* GStreamer 2 * Copyright (C) 2018 Thibault Saunier <tsaunier@igalia.com> 3 * 4 * alsadeviceprovider.c: alsa device probing and monitoring 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Library General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Library General Public License for more details. 15 * 16 * You should have received a copy of the GNU Library General Public 17 * License along with this library; if not, write to the 18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 * Boston, MA 02111-1307, USA. 20 */ 21 22 23 #ifndef __GST_ALSA_DEVICE_PROVIDER_H__ 24 #define __GST_ALSA_DEVICE_PROVIDER_H__ 25 26 #ifdef HAVE_CONFIG_H 27 #include "config.h" 28 #endif 29 30 #include "gstalsa.h" 31 #include <gst/gst.h> 32 33 G_BEGIN_DECLS 34 35 typedef struct _GstAlsaDeviceProvider GstAlsaDeviceProvider; 36 typedef struct _GstAlsaDeviceProviderClass GstAlsaDeviceProviderClass; 37 38 #define GST_TYPE_ALSA_DEVICE_PROVIDER (gst_alsa_device_provider_get_type()) 39 #define GST_IS_ALSA_DEVICE_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_ALSA_DEVICE_PROVIDER)) 40 #define GST_IS_ALSA_DEVICE_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_ALSA_DEVICE_PROVIDER)) 41 #define GST_ALSA_DEVICE_PROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_ALSA_DEVICE_PROVIDER, GstAlsaDeviceProviderClass)) 42 #define GST_ALSA_DEVICE_PROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_ALSA_DEVICE_PROVIDER, GstAlsaDeviceProvider)) 43 #define GST_ALSA_DEVICE_PROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE_PROVIDER, GstAlsaDeviceProviderClass)) 44 #define GST_ALSA_DEVICE_PROVIDER_CAST(obj) ((GstAlsaDeviceProvider *)(obj)) 45 46 struct _GstAlsaDeviceProvider { 47 GstDeviceProvider parent; 48 }; 49 50 struct _GstAlsaDeviceProviderClass { 51 GstDeviceProviderClass parent_class; 52 }; 53 54 GType gst_alsa_device_provider_get_type (void); 55 56 57 typedef struct _GstAlsaDevice GstAlsaDevice; 58 typedef struct _GstAlsaDeviceClass GstAlsaDeviceClass; 59 60 #define GST_TYPE_ALSA_DEVICE (gst_alsa_device_get_type()) 61 #define GST_IS_ALSA_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_ALSA_DEVICE)) 62 #define GST_IS_ALSA_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_ALSA_DEVICE)) 63 #define GST_ALSA_DEVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_ALSA_DEVICE, GstAlsaDeviceClass)) 64 #define GST_ALSA_DEVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_ALSA_DEVICE, GstAlsaDevice)) 65 #define GST_ALSA_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE, GstAlsaDeviceClass)) 66 #define GST_ALSA_DEVICE_CAST(obj) ((GstAlsaDevice *)(obj)) 67 68 struct _GstAlsaDevice { 69 GstDevice parent; 70 71 snd_pcm_stream_t stream; 72 gchar *internal_name; 73 const gchar *element; 74 }; 75 76 struct _GstAlsaDeviceClass { 77 GstDeviceClass parent_class; 78 }; 79 80 GType gst_alsa_device_get_type (void); 81 82 G_END_DECLS 83 84 #endif /* __GST_ALSA_DEVICE_PROVIDER_H__ */ 85 86