switchbin: Initial checkin
[platform/upstream/gstreamer.git] / gst / switchbin / gstswitchbin.h
1 /* switchbin
2  * Copyright (C) 2016  Carlos Rafael Giani
3  *
4  * gstswitchbin.h: Header for GstSwitchBin object
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., 51 Franklin St, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21
22
23 #ifndef GSTSWITCHBIN_H___
24 #define GSTSWITCHBIN_H___
25
26 #include <gst/gst.h>
27
28
29 G_BEGIN_DECLS
30
31
32 typedef struct _GstSwitchBin GstSwitchBin;
33 typedef struct _GstSwitchBinClass GstSwitchBinClass;
34 typedef struct _GstSwitchBinPath GstSwitchBinPath;
35
36
37 #define GST_TYPE_SWITCH_BIN             (gst_switch_bin_get_type())
38 #define GST_SWITCH_BIN(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_SWITCH_BIN, GstSwitchBin))
39 #define GST_SWITCH_BIN_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_SWITCH_BIN, GstSwitchBinClass))
40 #define GST_SWITCH_BIN_CAST(obj)        ((GstSwitchBin *)(obj))
41 #define GST_IS_SWITCH_BIN(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_SWITCH_BIN))
42 #define GST_IS_SWITCH_BIN_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_SWITCH_BIN))
43
44
45 struct _GstSwitchBin
46 {
47         GstBin parent;
48
49         GMutex path_mutex;
50
51         GstSwitchBinPath **paths;
52         GstSwitchBinPath *current_path;
53         guint num_paths;
54
55         GstElement *input_identity;
56         GstEvent *last_stream_start;
57         GstPad *sinkpad, *srcpad;
58         gulong blocking_probe_id, drop_probe_id;
59
60         GstCaps *last_caps;
61 };
62
63
64 struct _GstSwitchBinClass
65 {
66         GstBinClass parent_class;
67 };
68
69
70 struct _GstSwitchBinPath
71 {
72         GstObject parent;
73
74         GstElement *element;
75         GstCaps *caps;
76         GstSwitchBin *bin;
77 };
78
79
80 GType gst_switch_bin_get_type(void);
81 GType gst_switch_bin_path_get_type(void);
82
83
84 G_END_DECLS
85
86
87 #endif