• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GStreamer
2  * Copyright (C) 2015 Руслан Ижбулатов <lrn1986@gmail.com>
3  *
4  * ksdeviceprovider.h: Kernel Streaming 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_KS_DEVICE_PROVIDER_H__
24 #define __GST_KS_DEVICE_PROVIDER_H__
25 
26 #ifdef HAVE_CONFIG_H
27 #include "config.h"
28 #endif
29 
30 #include <gst/gst.h>
31 #include <windows.h>
32 
33 G_BEGIN_DECLS
34 
35 typedef struct _GstKsDeviceProvider GstKsDeviceProvider;
36 typedef struct _GstKsDeviceProviderPrivate GstKsDeviceProviderPrivate;
37 typedef struct _GstKsDeviceProviderClass GstKsDeviceProviderClass;
38 
39 #define GST_TYPE_KS_DEVICE_PROVIDER                 (gst_ks_device_provider_get_type())
40 #define GST_IS_KS_DEVICE_PROVIDER(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_KS_DEVICE_PROVIDER))
41 #define GST_IS_KS_DEVICE_PROVIDER_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_KS_DEVICE_PROVIDER))
42 #define GST_KS_DEVICE_PROVIDER_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_KS_DEVICE_PROVIDER, GstKsDeviceProviderClass))
43 #define GST_KS_DEVICE_PROVIDER(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_KS_DEVICE_PROVIDER, GstKsDeviceProvider))
44 #define GST_KS_DEVICE_PROVIDER_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE_PROVIDER, GstKsDeviceProviderClass))
45 #define GST_KS_DEVICE_PROVIDER_CAST(obj)            ((GstKsDeviceProvider *)(obj))
46 
47 struct _GstKsDeviceProvider {
48   GstDeviceProvider parent;
49 
50   HANDLE            message_window;
51   ATOM              message_window_class;
52   HDEVNOTIFY        device_notify_handle;
53   HANDLE            wakeup_event;
54   GThread          *message_thread;
55 };
56 
57 typedef enum {
58   GST_KS_DEVICE_TYPE_INVALID = 0,
59   GST_KS_DEVICE_TYPE_VIDEO_SOURCE,
60   GST_KS_DEVICE_TYPE_VIDEO_SINK,
61   GST_KS_DEVICE_TYPE_AUDIO_SOURCE,
62   GST_KS_DEVICE_TYPE_AUDIO_SINK
63 } GstKsDeviceType;
64 
65 struct _GstKsDeviceProviderClass {
66   GstDeviceProviderClass    parent_class;
67 };
68 
69 GType gst_ks_device_provider_get_type (void);
70 
71 
72 typedef struct _GstKsDevice GstKsDevice;
73 typedef struct _GstKsDevicePrivate GstKsDevicePrivate;
74 typedef struct _GstKsDeviceClass GstKsDeviceClass;
75 
76 #define GST_TYPE_KS_DEVICE                 (gst_ks_device_get_type())
77 #define GST_IS_KS_DEVICE(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_KS_DEVICE))
78 #define GST_IS_KS_DEVICE_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_KS_DEVICE))
79 #define GST_KS_DEVICE_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_KS_DEVICE, GstKsDeviceClass))
80 #define GST_KS_DEVICE(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_KS_DEVICE, GstKsDevice))
81 #define GST_KS_DEVICE_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_DEVICE, GstKsDeviceClass))
82 #define GST_KS_DEVICE_CAST(obj)            ((GstKsDevice *)(obj))
83 
84 struct _GstKsDevice {
85   GstDevice         parent;
86 
87   GstKsDeviceType   type;
88   guint             device_index;
89   gchar            *path;
90   const gchar      *element;
91 };
92 
93 struct _GstKsDeviceClass {
94   GstDeviceClass    parent_class;
95 };
96 
97 GType gst_ks_device_get_type (void);
98 
99 G_END_DECLS
100 
101 #endif /* __GST_KS_DEVICE_PROVIDER_H__ */
102