• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 	gboolean path_changed;
54 
55 	guint num_paths;
56 
57 	GstElement *input_identity;
58 	GstEvent *last_stream_start;
59 	GstPad *sinkpad, *srcpad;
60 	gulong blocking_probe_id, drop_probe_id;
61 
62 	GstCaps *last_caps;
63 };
64 
65 
66 struct _GstSwitchBinClass
67 {
68 	GstBinClass parent_class;
69 };
70 
71 
72 struct _GstSwitchBinPath
73 {
74 	GstObject parent;
75 
76 	GstElement *element;
77 	GstCaps *caps;
78 	GstSwitchBin *bin;
79 };
80 
81 
82 GType gst_switch_bin_get_type(void);
83 GType gst_switch_bin_path_get_type(void);
84 GST_ELEMENT_REGISTER_DECLARE (switchbin);
85 
86 G_END_DECLS
87 
88 
89 #endif
90