29#define GINGA_PRAGMA_DIAG PRAGMA_DIAG
30#define GINGA_PRAGMA_DIAG_PUSH PRAGMA_DIAG_PUSH
31#define GINGA_PRAGMA_DIAG_POP PRAGMA_DIAG_POP
32#define GINGA_PRAGMA_DIAG_IGNORE PRAGMA_DIAG_IGNORE
33#define GINGA_PRAGMA_DIAG_WARNING PRAGMA_DIAG_WARNING
43GINGA_PRAGMA_DIAG_PUSH ()
44GINGA_PRAGMA_DIAG_IGNORE (-Wcast-qual)
45GINGA_PRAGMA_DIAG_IGNORE (-Wconversion)
46#include <gst/app/gstappsink.h>
48#include <gst/video/video.h>
49GINGA_PRAGMA_DIAG_POP ()
67#define unused(...) G_GNUC_UNUSED __VA_ARGS__
69template <
typename... T>
71ignore_unused (
const T &...)
76#define cast(a, b) (dynamic_cast<a> ((b)))
77#define instanceof(a, b) (cast (a, (b)) != nullptr)
79#define tryinsert(a, b, fn) \
80 (std::count ((b).begin (), (b).end (), (a)) == 0) ? ((b).fn (a), true) \
83#define MAP_GET_IMPL(m, a, b) \
86 auto it = (m).find ((a)); \
87 if (it == (m).end ()) \
89 tryset ((b), it->second); \
94#define MAP_SET_IMPL(m, a, b) \
97 auto it = (m).find ((a)); \
99 return it == (m).end (); \
104#define GINGA_STRFUNC (__ginga_strfunc (G_STRFUNC)).c_str ()
105string __ginga_strfunc (
const string &);
106#define __ginga_log(fn, fmt, ...) \
107 fn ("%s: " fmt, GINGA_STRFUNC, ##__VA_ARGS__)
109#define TRACE(fmt, ...) __ginga_log (g_debug, fmt, ##__VA_ARGS__)
110#define WARNING(fmt, ...) __ginga_log (g_warning, fmt, ##__VA_ARGS__)
111#define ERROR(fmt, ...) __ginga_log (g_error, fmt, ##__VA_ARGS__)
112#define CRITICAL(fmt, ...) __ginga_log (g_critical, fmt, ##__VA_ARGS__)
114#define ERROR_NOT_IMPLEMENTED(fmt, ...) \
115 ERROR ("not implemented: " fmt, ##__VA_ARGS__)
118typedef GdkRGBA Color;
119typedef GdkRectangle Rect;
120typedef GstClockTime Time;
123#define GINGA_TIME_NONE GST_CLOCK_TIME_NONE
124#define GINGA_TIME_IS_VALID(t) GST_CLOCK_TIME_IS_VALID ((t))
125#define GINGA_STIME_NONE GST_CLOCK_STIME_NONE
126#define GINGA_STIME_IS_VALID(t) GST_CLOCK_STIME_IS_VALID ((t))
127#define GINGA_SECOND GST_SECOND
128#define GINGA_MSECOND GST_MSECOND
129#define GINGA_USECOND GST_USECOND
130#define GINGA_NSECOND GST_NSECOND
131#define GINGA_TIME_AS_SECONDS(t) GST_TIME_AS_SECONDS ((t))
132#define GINGA_TIME_AS_MSECONDS(t) GST_TIME_AS_MSECONDS ((t))
133#define GINGA_TIME_AS_USECONDS(t) GST_TIME_AS_USECONDS ((t))
134#define GINGA_TIME_AS_NSECONDS(t) GST_TIME_AS_NSECONDS ((t))
135#define GINGA_TIME_DIFF(s, e) GST_CLOCK_DIFF ((s), (e))
136#define GINGA_TIME_FORMAT GST_TIME_FORMAT
137#define GINGA_TIME_ARGS(t) GST_TIME_ARGS ((t))
138#define GINGA_STIME_FORMAT GST_STIME_FORMAT
139#define GINGA_STIME_ARGS(t) GST_STIME_ARGS ((t))
142bool floateq (
double,
double,
double epsilon = .0000001);
143#define doubleeq floateq
146bool try_parse_bool (
const string &,
bool *);
147bool parse_bool (
const string &);
149bool try_parse_color (
const string &, Color *);
150Color parse_color (
const string &);
152bool try_parse_list (
const string &,
char,
size_t,
size_t, list<string> *);
153list<string> parse_list (
const string &,
char,
size_t,
size_t);
155bool try_parse_table (
const string &, map<string, string> *);
156map<string, string> parse_table (
const string &);
158bool try_parse_time (
const string &, Time *);
159Time parse_time (
const string &);
161int parse_percent (
const string &,
int,
int,
int);
162guint8 parse_pixel (
const string &);
165bool _xstrtod (
const string &,
double *);
166bool _xstrtoll (
const string &, gint64 *, guint);
167bool _xstrtoull (
const string &, guint64 *, guint);
168double xstrtod (
const string &);
169gint xstrtoint (
const string &, guint8);
170gint8 xstrtoint8 (
const string &, guint8);
171gint64 xstrtoint64 (
const string &, guint8);
172guint xstrtouint (
const string &, guint8);
173guint8 xstrtouint8 (
const string &, guint8);
174guint64 xstrtouint64 (
const string &, guint8);
175bool xstrispercent (
const string &);
176double xstrtodorpercent (
const string &,
bool *);
177int xstrcasecmp (
const string &,
const string &);
178#define xstrcaseeq(s1, s2) (xstrcasecmp ((s1), (s2)) == 0)
179bool xstrhasprefix (
const string &,
const string &);
180bool xstrhassuffix (
const string &,
const string &);
181int G_GNUC_PRINTF (2, 3) xstrassign (
string &, const
char *, ...);
182string G_GNUC_PRINTF (1, 2) xstrbuild (const
char *, ...);
183string xstrstrip (
string);
184list<
string> xstrsplit (const
string &,
char);
185void xstrdelete (
void *);
188string xpathbasename (
string);
189string xpathdirname (
string);
190bool xpathisabs (const
string &);
191bool xpathisuri (const
string &);
192string xpathmakeabs (
string);
193string xpathbuild (const
string &, const
string &);
194string xpathbuildabs (const
string &, const
string &);
197string xpathfromuri (const
string &);
198string xurifromsrc (const
string &, const
string &);
199bool xurigetcontents (const
string &,
string &);
202typedef
void (*UserDataCleanFunc) (
void *);
208 bool getData (
const string &,
void **);
209 bool setData (
const string &,
void *, UserDataCleanFunc fn =
nullptr);
212 map<string, pair<
void *, void (*) (
void *)> > _udata;
216using namespace ginga;
Definition aux-ginga.h:204