QtGStreamer  1.2.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
global.h
1 /*
2  Copyright (C) 2010 George Kiagiadakis <kiagiadakis.george@gmail.com>
3 
4  This library is free software; you can redistribute it and/or modify
5  it under the terms of the GNU Lesser General Public License as published
6  by the Free Software Foundation; either version 2.1 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 #ifndef QGST_GLOBAL_H
18 #define QGST_GLOBAL_H
19 
20 // workaround for https://bugreports.qt-project.org/browse/QTBUG-22829
21 #if defined(Q_MOC_RUN) && !defined(BOOST_TT_HAS_OPERATOR_HPP_INCLUDED)
22 #define BOOST_TT_HAS_OPERATOR_HPP_INCLUDED
23 #endif
24 
25 #include "../QGlib/type.h"
26 #include <QtCore/QtGlobal>
27 #include <QtCore/QDate>
28 #include <QtCore/QSharedPointer>
29 
30 /* defined by cmake when building this library */
31 #if defined(QtGStreamer_EXPORTS) || defined(Qt5GStreamer_EXPORTS)
32 # define QTGSTREAMER_EXPORT Q_DECL_EXPORT
33 #else
34 # define QTGSTREAMER_EXPORT Q_DECL_IMPORT
35 #endif
36 
37 #if !defined(Q_OS_WIN) && !defined(Q_CC_NOKIAX86) && \
38  !defined(Q_CC_RVCT) && defined(QT_VISIBILITY_AVAILABLE)
39 # define QTGSTREAMER_NO_EXPORT __attribute__((visibility("hidden")))
40 #else
41 # define QTGSTREAMER_NO_EXPORT
42 #endif
43 
44 #define QGST_REGISTER_TYPE(T) \
45  QGLIB_REGISTER_TYPE_WITH_EXPORT_MACRO(T, QTGSTREAMER_EXPORT)
46 
47 //cyclic dependency, must include after defining the above
48 #include "enums.h"
49 
50 //registered in value.cpp
51 QGST_REGISTER_TYPE(QDate) //codegen: skip=true
52 QGST_REGISTER_TYPE(QDateTime) //codegen: skip=true
53 
54 
55 #define QGST_WRAPPER_GSTCLASS_DECLARATION(Class) \
56  typedef struct _Gst##Class Gst##Class;
57 
58 #define QGST_WRAPPER_DIFFERENT_GSTCLASS_DECLARATION(Class, CClass) \
59  typedef struct _Gst##CClass Gst##Class;
60 
61 #define QGST_WRAPPER_REFPOINTER_DECLARATION(Class) \
62  namespace QGst { \
63  class Class; \
64  typedef QGlib::RefPointer<Class> Class##Ptr; \
65  }
66 
67 #define QGST_WRAPPER_DECLARATION(Class) \
68  QGST_WRAPPER_GSTCLASS_DECLARATION(Class) \
69  QGST_WRAPPER_REFPOINTER_DECLARATION(Class)
70 
71 QGST_WRAPPER_DECLARATION(Bin)
72 QGST_WRAPPER_DECLARATION(Bus)
73 QGST_WRAPPER_DECLARATION(Caps)
74 QGST_WRAPPER_DECLARATION(ChildProxy)
75 QGST_WRAPPER_DECLARATION(Clock)
76 QGST_WRAPPER_DECLARATION(ColorBalanceChannel)
77 QGST_WRAPPER_DECLARATION(ColorBalance)
78 QGST_WRAPPER_DECLARATION(Discoverer)
79 QGST_WRAPPER_DECLARATION(DiscovererInfo)
80 QGST_WRAPPER_DECLARATION(DiscovererStreamInfo)
81 QGST_WRAPPER_DECLARATION(DiscovererContainerInfo)
82 QGST_WRAPPER_DECLARATION(DiscovererAudioInfo)
83 QGST_WRAPPER_DECLARATION(DiscovererVideoInfo)
84 QGST_WRAPPER_DECLARATION(DiscovererSubtitleInfo)
85 QGST_WRAPPER_DECLARATION(Element)
86 QGST_WRAPPER_DECLARATION(ElementFactory)
87 QGST_WRAPPER_DECLARATION(GhostPad)
88 QGST_WRAPPER_DECLARATION(Message)
89 QGST_WRAPPER_REFPOINTER_DECLARATION(EosMessage)
90 QGST_WRAPPER_REFPOINTER_DECLARATION(ErrorMessage)
91 QGST_WRAPPER_REFPOINTER_DECLARATION(WarningMessage)
92 QGST_WRAPPER_REFPOINTER_DECLARATION(InfoMessage)
93 QGST_WRAPPER_REFPOINTER_DECLARATION(TagMessage)
94 QGST_WRAPPER_REFPOINTER_DECLARATION(BufferingMessage)
95 QGST_WRAPPER_REFPOINTER_DECLARATION(StateChangedMessage)
96 QGST_WRAPPER_REFPOINTER_DECLARATION(StepDoneMessage)
97 QGST_WRAPPER_REFPOINTER_DECLARATION(StreamStatusMessage)
98 QGST_WRAPPER_REFPOINTER_DECLARATION(ApplicationMessage)
99 QGST_WRAPPER_REFPOINTER_DECLARATION(ElementMessage)
100 QGST_WRAPPER_REFPOINTER_DECLARATION(SegmentDoneMessage)
101 QGST_WRAPPER_REFPOINTER_DECLARATION(DurationChangedMessage)
102 QGST_WRAPPER_REFPOINTER_DECLARATION(LatencyMessage)
103 QGST_WRAPPER_REFPOINTER_DECLARATION(AsyncDoneMessage)
104 QGST_WRAPPER_REFPOINTER_DECLARATION(RequestStateMessage)
105 QGST_WRAPPER_REFPOINTER_DECLARATION(StepStartMessage)
106 QGST_WRAPPER_REFPOINTER_DECLARATION(QosMessage)
107 QGST_WRAPPER_DECLARATION(MiniObject)
108 QGST_WRAPPER_DECLARATION(Object)
109 QGST_WRAPPER_DECLARATION(Pad)
110 QGST_WRAPPER_DECLARATION(Pipeline)
111 QGST_WRAPPER_DECLARATION(PluginFeature)
112 QGST_WRAPPER_DECLARATION(Query)
113 QGST_WRAPPER_REFPOINTER_DECLARATION(PositionQuery)
114 QGST_WRAPPER_REFPOINTER_DECLARATION(DurationQuery)
115 QGST_WRAPPER_REFPOINTER_DECLARATION(LatencyQuery)
116 QGST_WRAPPER_REFPOINTER_DECLARATION(SeekingQuery)
117 QGST_WRAPPER_REFPOINTER_DECLARATION(SegmentQuery)
118 QGST_WRAPPER_REFPOINTER_DECLARATION(ConvertQuery)
119 QGST_WRAPPER_REFPOINTER_DECLARATION(FormatsQuery)
120 QGST_WRAPPER_REFPOINTER_DECLARATION(BufferingQuery)
121 QGST_WRAPPER_REFPOINTER_DECLARATION(UriQuery)
122 QGST_WRAPPER_DECLARATION(Buffer)
123 QGST_WRAPPER_DECLARATION(Allocator)
124 QGST_WRAPPER_DECLARATION(Memory)
125 QGST_WRAPPER_DECLARATION(BufferList)
126 QGST_WRAPPER_DECLARATION(Event)
127 QGST_WRAPPER_REFPOINTER_DECLARATION(FlushStartEvent)
128 QGST_WRAPPER_REFPOINTER_DECLARATION(FlushStopEvent)
129 QGST_WRAPPER_REFPOINTER_DECLARATION(CapsEvent)
130 QGST_WRAPPER_REFPOINTER_DECLARATION(EosEvent)
131 QGST_WRAPPER_REFPOINTER_DECLARATION(SegmentEvent)
132 QGST_WRAPPER_REFPOINTER_DECLARATION(TagEvent)
133 QGST_WRAPPER_REFPOINTER_DECLARATION(BufferSizeEvent)
134 QGST_WRAPPER_REFPOINTER_DECLARATION(SinkMessageEvent)
135 QGST_WRAPPER_REFPOINTER_DECLARATION(QosEvent)
136 QGST_WRAPPER_REFPOINTER_DECLARATION(SeekEvent)
137 QGST_WRAPPER_REFPOINTER_DECLARATION(NavigationEvent)
138 QGST_WRAPPER_REFPOINTER_DECLARATION(LatencyEvent)
139 QGST_WRAPPER_REFPOINTER_DECLARATION(StepEvent)
140 QGST_WRAPPER_DECLARATION(StreamVolume)
141 QGST_WRAPPER_DECLARATION(Sample)
142 QGST_WRAPPER_GSTCLASS_DECLARATION(Structure)
143 QGST_WRAPPER_GSTCLASS_DECLARATION(TagList)
144 QGST_WRAPPER_GSTCLASS_DECLARATION(Segment)
145 QGST_WRAPPER_GSTCLASS_DECLARATION(AllocationParams)
146 namespace QGst {
147  class Structure;
148  class SharedStructure;
149  typedef QSharedPointer<SharedStructure> StructurePtr;
150  typedef QSharedPointer<const SharedStructure> StructureConstPtr;
151  class AllocationParams;
152  class MapInfo;
153  class Segment;
154 }
155 QGST_WRAPPER_GSTCLASS_DECLARATION(URIHandler)
156 QGST_WRAPPER_REFPOINTER_DECLARATION(UriHandler)
157 QGST_WRAPPER_DECLARATION(VideoOrientation)
158 QGST_WRAPPER_DECLARATION(VideoOverlay)
159 
160 #undef QGST_WRAPPER_DECLARATION
161 #undef QGST_WRAPPER_REFPOINTER_DECLARATION
162 #undef QGST_WRAPPER_GSTCLASS_DECLARATION
163 
164 
165 #define QGST_WRAPPER(Class) \
166  QGLIB_WRAPPER_DECLARATION_MACRO(Class, Class, Gst, Class)
167 
168 #define QGST_WRAPPER_DIFFERENT_C_CLASS(Class, CClass) \
169  QGLIB_WRAPPER_DECLARATION_MACRO(Class, CClass, Gst, Class)
170 
171 #define QGST_WRAPPER_FAKE_SUBCLASS(Sub, Class) \
172  QGLIB_WRAPPER_DECLARATION_MACRO(Sub##Class, Class, Gst, Class)
173 
174 #define QGST_REGISTER_SUBCLASS(BASECLASS, TYPE) \
175  namespace QGlib { \
176  template <> \
177  struct GetTypeImpl<QGst::TYPE##BASECLASS> { \
178  inline operator Type() { return GetType<QGst::BASECLASS>(); }; \
179  }; \
180  }
181 
182 #endif