Original commit message from CVS:
Added some convenience macros for creating format/querytype and eventmask
functions
GstEventFlag flags;
} GstEventMask;
+#define GST_EVENT_MASK_FUNCTION(functionname, a...) \
+static const GstEventMask* \
+functionname (GstPad *pad) \
+{ \
+ static const GstEventMask masks[] = { \
+ a, \
+ { 0, } \
+ }; \
+ return masks; \
+}
+
/* seek events, extends GstEventFlag */
typedef enum {
GST_SEEK_METHOD_CUR = (1 << (GST_SEEK_METHOD_SHIFT + 0)),
GST_FORMAT_UNITS = 6,
} GstFormat;
+#define GST_FORMATS_FUNCTION(functionname, a...) \
+static const GstFormat* \
+functionname (GstPad *pad) \
+{ \
+ static const GstFormat formats[] = { \
+ a, \
+ 0 \
+ }; \
+ return formats; \
+}
+
+
G_END_DECLS
#endif /* __GST_FORMAT_H__ */
GST_PAD_QUERY_JITTER,
GST_PAD_QUERY_SEGMENT_END
} GstPadQueryType;
+
+#define GST_PAD_QUERY_TYPE_FUNCTION(functionname, a...) \
+static const GstPadQueryType* \
+functionname (GstPad *pad) \
+{ \
+ static const GstPadQueryType types[] = { \
+ a, \
+ 0 \
+ }; \
+ return types; \
+}
+
/* this defines the functions used to chain buffers
* pad is the sink pad (so the same chain function can be used for N pads)