mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
Added some convenience macros for creating format/querytype and eventmask functions
Original commit message from CVS: Added some convenience macros for creating format/querytype and eventmask functions
This commit is contained in:
parent
6bd5ed021c
commit
12fddba0bd
3 changed files with 35 additions and 0 deletions
|
@ -74,6 +74,17 @@ typedef struct
|
|||
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)),
|
||||
|
|
|
@ -39,6 +39,18 @@ typedef enum {
|
|||
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__ */
|
||||
|
|
12
gst/gstpad.h
12
gst/gstpad.h
|
@ -124,6 +124,18 @@ typedef enum {
|
|||
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)
|
||||
|
|
Loading…
Reference in a new issue