content/media/gstreamer/GStreamerLoader.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/media/gstreamer/GStreamerLoader.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,53 @@
     1.4 +/* vim:set ts=2 sw=2 sts=2 et cindent: */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef GStreamerLoader_h_
    1.10 +#define GStreamerLoader_h_
    1.11 +
    1.12 +#include <gst/gst.h>
    1.13 +#include <gst/gstbuffer.h>
    1.14 +#include <gst/gstelementfactory.h>
    1.15 +#include <gst/gststructure.h>
    1.16 +#include <gst/app/gstappsrc.h>
    1.17 +#include <gst/app/gstappsink.h>
    1.18 +// This include trips -Wreserved-user-defined-literal on clang. Ignoring it
    1.19 +// trips -Wpragmas on GCC (unknown warning), but ignoring that trips
    1.20 +// -Wunknown-pragmas on clang (unknown pragma).
    1.21 +#pragma GCC diagnostic push
    1.22 +#pragma GCC diagnostic ignored "-Wunknown-pragmas"
    1.23 +#pragma GCC diagnostic ignored "-Wpragmas"
    1.24 +#pragma GCC diagnostic ignored "-Wreserved-user-defined-literal"
    1.25 +#include <gst/video/video.h>
    1.26 +#pragma GCC diagnostic pop
    1.27 +
    1.28 +#if GST_VERSION_MAJOR == 1
    1.29 +#include <gst/video/gstvideometa.h>
    1.30 +#include <gst/video/gstvideopool.h>
    1.31 +#endif
    1.32 +
    1.33 +namespace mozilla {
    1.34 +
    1.35 +/*
    1.36 + * dlopens the required libraries and dlsyms the functions we need.
    1.37 + * Returns true on success, false otherwise.
    1.38 + */
    1.39 +bool load_gstreamer();
    1.40 +
    1.41 +/*
    1.42 + * Declare our extern function pointers using the types from the global
    1.43 + * gstreamer definitions.
    1.44 + */
    1.45 +#define GST_FUNC(_, func) extern typeof(::func)* func;
    1.46 +#define REPLACE_FUNC(func) GST_FUNC(-1, func)
    1.47 +#include "GStreamerFunctionList.h"
    1.48 +#undef GST_FUNC
    1.49 +#undef REPLACE_FUNC
    1.50 +
    1.51 +}
    1.52 +
    1.53 +#undef GST_CAPS_ANY
    1.54 +#define GST_CAPS_ANY (*_gst_caps_any)
    1.55 +
    1.56 +#endif // GStreamerLoader_h_

mercurial