1 /* GStreamer
2  * Copyright (C) 2019 Josh Matthews <josh@joshmatthews.net>
3  *
4  * avfdeviceprovider.h: AVF 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_AVF_DEVICE_PROVIDER_H__
24 #define __GST_AVF_DEVICE_PROVIDER_H__
25 
26 #ifdef HAVE_CONFIG_H
27 #include "config.h"
28 #endif
29 
30 #include <gst/gst.h>
31 #include "avfvideosrc.h"
32 
33 G_BEGIN_DECLS
34 
35 typedef struct _GstAVFDeviceProvider GstAVFDeviceProvider;
36 typedef struct _GstAVFDeviceProviderPrivate GstAVFDeviceProviderPrivate;
37 typedef struct _GstAVFDeviceProviderClass GstAVFDeviceProviderClass;
38 
39 #define GST_TYPE_AVF_DEVICE_PROVIDER                 (gst_avf_device_provider_get_type())
40 #define GST_IS_AVF_DEVICE_PROVIDER(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_AVF_DEVICE_PROVIDER))
41 #define GST_IS_AVF_DEVICE_PROVIDER_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_AVF_DEVICE_PROVIDER))
42 #define GST_AVF_DEVICE_PROVIDER_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_AVF_DEVICE_PROVIDER, GstAVFDeviceProviderClass))
43 #define GST_AVF_DEVICE_PROVIDER(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_AVF_DEVICE_PROVIDER, GstAVFDeviceProvider))
44 #define GST_AVF_DEVICE_PROVIDER_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE_PROVIDER, GstAVFDeviceProviderClass))
45 #define GST_AVF_DEVICE_PROVIDER_CAST(obj)            ((GstAvfDeviceProvider *)(obj))
46 
47 struct _GstAVFDeviceProvider {
48   GstDeviceProvider parent;
49 };
50 
51 typedef enum {
52   GST_AVF_DEVICE_TYPE_INVALID = 0,
53   GST_AVF_DEVICE_TYPE_VIDEO_SOURCE,
54 } GstAvfDeviceType;
55 
56 struct _GstAVFDeviceProviderClass {
57   GstDeviceProviderClass    parent_class;
58 };
59 
60 GType gst_avf_device_provider_get_type (void);
61 
62 
63 typedef struct _GstAvfDevice GstAvfDevice;
64 typedef struct _GstAvfDevicePrivate GstAvfDevicePrivate;
65 typedef struct _GstAvfDeviceClass GstAvfDeviceClass;
66 
67 #define GST_TYPE_AVF_DEVICE                 (gst_avf_device_get_type())
68 #define GST_IS_AVF_DEVICE(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_AVF_DEVICE))
69 #define GST_IS_AVF_DEVICE_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_AVF_DEVICE))
70 #define GST_AVF_DEVICE_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_AVF_DEVICE, GstAvfDeviceClass))
71 #define GST_AVF_DEVICE(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_AVF_DEVICE, GstAvfDevice))
72 #define GST_AVF_DEVICE_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE, GstAvfDeviceClass))
73 #define GST_AVF_DEVICE_CAST(obj)            ((GstAvfDevice *)(obj))
74 
75 struct _GstAvfDevice {
76   GstDevice         parent;
77 
78   GstAvfDeviceType  type;
79   int               device_index;
80   const gchar      *element;
81 };
82 
83 struct _GstAvfDeviceClass {
84   GstDeviceClass    parent_class;
85 };
86 
87 GType gst_avf_device_get_type (void);
88 
89 G_END_DECLS
90 
91 #endif /* __GST_AVF_DEVICE_PROVIDER_H__ */
92