|
1 /* vim:set ts=2 sw=2 sts=2 et cindent: */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
|
4 * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #ifndef GStreamerLoader_h_ |
|
7 #define GStreamerLoader_h_ |
|
8 |
|
9 #include <gst/gst.h> |
|
10 #include <gst/gstbuffer.h> |
|
11 #include <gst/gstelementfactory.h> |
|
12 #include <gst/gststructure.h> |
|
13 #include <gst/app/gstappsrc.h> |
|
14 #include <gst/app/gstappsink.h> |
|
15 // This include trips -Wreserved-user-defined-literal on clang. Ignoring it |
|
16 // trips -Wpragmas on GCC (unknown warning), but ignoring that trips |
|
17 // -Wunknown-pragmas on clang (unknown pragma). |
|
18 #pragma GCC diagnostic push |
|
19 #pragma GCC diagnostic ignored "-Wunknown-pragmas" |
|
20 #pragma GCC diagnostic ignored "-Wpragmas" |
|
21 #pragma GCC diagnostic ignored "-Wreserved-user-defined-literal" |
|
22 #include <gst/video/video.h> |
|
23 #pragma GCC diagnostic pop |
|
24 |
|
25 #if GST_VERSION_MAJOR == 1 |
|
26 #include <gst/video/gstvideometa.h> |
|
27 #include <gst/video/gstvideopool.h> |
|
28 #endif |
|
29 |
|
30 namespace mozilla { |
|
31 |
|
32 /* |
|
33 * dlopens the required libraries and dlsyms the functions we need. |
|
34 * Returns true on success, false otherwise. |
|
35 */ |
|
36 bool load_gstreamer(); |
|
37 |
|
38 /* |
|
39 * Declare our extern function pointers using the types from the global |
|
40 * gstreamer definitions. |
|
41 */ |
|
42 #define GST_FUNC(_, func) extern typeof(::func)* func; |
|
43 #define REPLACE_FUNC(func) GST_FUNC(-1, func) |
|
44 #include "GStreamerFunctionList.h" |
|
45 #undef GST_FUNC |
|
46 #undef REPLACE_FUNC |
|
47 |
|
48 } |
|
49 |
|
50 #undef GST_CAPS_ANY |
|
51 #define GST_CAPS_ANY (*_gst_caps_any) |
|
52 |
|
53 #endif // GStreamerLoader_h_ |