diff --git a/gst-libs/gst/vaapi/gstcompat.h b/gst-libs/gst/vaapi/gstcompat.h deleted file mode 100644 index ad5a1724a4..0000000000 --- a/gst-libs/gst/vaapi/gstcompat.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * gstcompat.h - Compatibility glue for GStreamer - * - * Copyright (C) 2013 Intel Corporation - * Author: Gwenole Beauchesne - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - */ - -#ifndef GST_COMPAT_H -#define GST_COMPAT_H - -#include - -#include - -/* GstStructure */ -#undef gst_structure_get_fourcc -#define gst_structure_get_fourcc(structure, fieldname, value) \ - gst_compat_structure_get_fourcc(structure, fieldname, value) - -static inline gboolean -gst_compat_structure_get_fourcc(const GstStructure *structure, - const gchar *fieldname, guint32 *value) -{ - const gchar *s = gst_structure_get_string(structure, fieldname); - - if (!s || strlen(s) != 4) - return FALSE; - - *value = GST_MAKE_FOURCC(s[0], s[1], s[2], s[3]); - return TRUE; -} - -/* GstTypeFind */ -#undef GstTypeFindPeekFunction -#define GstTypeFindPeekFunction GstCompatTypeFindPeekFunction -#undef GstTypeFindSuggestFunction -#define GstTypeFindSuggestFunction GstCompatTypeFindSuggestFunction - -typedef const guint8 *(*GstCompatTypeFindPeekFunction)(gpointer, gint64, guint); -typedef void (*GstCompatTypeFindSuggestFunction)(gpointer, guint, GstCaps *); - -/* GstPad */ -#define GST_PAD_CHAIN_FUNCTION_ARGS \ - GstPad *pad, GstObject *parent, GstBuffer *buffer -#define GST_PAD_EVENT_FUNCTION_ARGS \ - GstPad *pad, GstObject *parent, GstEvent *event -#define GST_PAD_QUERY_FUNCTION_ARGS \ - GstPad *pad, GstObject *parent, GstQuery *query -#define GST_PAD_QUERY_FUNCTION_CALL(func, pad, parent, query) \ - (func)(pad, parent, query) - -/* Misc helpers */ -#define GST_MAKE_FORMAT_STRING(FORMAT) \ - "format=(string)" G_STRINGIFY(FORMAT) - -#endif /* GST_COMPAT_H */ diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c b/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c index d37ae9bb12..1aabe13d15 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_vc1.c @@ -1124,6 +1124,7 @@ gst_vaapi_decoder_vc1_decode_codec_data(GstVaapiDecoder *base_decoder, gint width, height; guint32 format; gint version; + const gchar *s; priv->has_codec_data = TRUE; @@ -1136,7 +1137,10 @@ gst_vaapi_decoder_vc1_decode_codec_data(GstVaapiDecoder *base_decoder, caps = GST_VAAPI_DECODER_CODEC_STATE(decoder)->caps; structure = gst_caps_get_structure(caps, 0); - if (!gst_structure_get_fourcc(structure, "format", &format)) { + s = gst_structure_get_string(structure, "format"); + if (s && strlen(s) == 4) { + format = GST_MAKE_FOURCC(s[0], s[1], s[2], s[3]); + } else { /* Try to determine format from "wmvversion" property */ if (gst_structure_get_int(structure, "wmvversion", &version)) format = (version >= 1 && version <= 3) ? diff --git a/gst-libs/gst/vaapi/gstvaapiprofile.c b/gst-libs/gst/vaapi/gstvaapiprofile.c index 1c831cdb77..51e273621b 100644 --- a/gst-libs/gst/vaapi/gstvaapiprofile.c +++ b/gst-libs/gst/vaapi/gstvaapiprofile.c @@ -127,7 +127,7 @@ static const GstVaapiProfileMap gst_vaapi_profiles[] = { "video/x-wmv, wmvversion=3", "main" }, { GST_VAAPI_PROFILE_VC1_ADVANCED, VAProfileVC1Advanced, - "video/x-wmv, wmvversion=3, " GST_MAKE_FORMAT_STRING(WVC1), "advanced" + "video/x-wmv, wmvversion=3, format=(string)WVC1", "advanced" }, #if VA_CHECK_VERSION(0,32,0) { GST_VAAPI_PROFILE_JPEG_BASELINE, VAProfileJPEGBaseline, diff --git a/gst-libs/gst/vaapi/sysdeps.h b/gst-libs/gst/vaapi/sysdeps.h index e17081f38f..f298f56bcc 100644 --- a/gst-libs/gst/vaapi/sysdeps.h +++ b/gst-libs/gst/vaapi/sysdeps.h @@ -32,6 +32,7 @@ #include #include "glibcompat.h" -#include "gstcompat.h" + +#include #endif /* SYSDEPS_H */ diff --git a/gst/vaapi/gstcompat.h b/gst/vaapi/gstcompat.h new file mode 100644 index 0000000000..c953783fd1 --- /dev/null +++ b/gst/vaapi/gstcompat.h @@ -0,0 +1,28 @@ +/* + * gstcompat.h - Compatibility glue for GStreamer + * + * Copyright (C) 2013 Intel Corporation + * Author: Gwenole Beauchesne + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + +#ifndef GST_COMPAT_H +#define GST_COMPAT_H + +#include "gst/vaapi/sysdeps.h" + +#endif /* GST_COMPAT_H */ diff --git a/gst/vaapi/gstvaapi.c b/gst/vaapi/gstvaapi.c index bf39038e2d..64ee44c477 100644 --- a/gst/vaapi/gstvaapi.c +++ b/gst/vaapi/gstvaapi.c @@ -22,7 +22,7 @@ * Boston, MA 02110-1301 USA */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include #include "gstvaapidecode.h" #include "gstvaapipostproc.h" diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index 7ada2b541e..1d2bd7bd2d 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -30,7 +30,7 @@ * the vaapisink element. */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include #include "gstvaapidecode.h" @@ -950,7 +950,7 @@ gst_vaapidecode_get_caps (GstPad * pad) #if !GST_CHECK_VERSION(1,4,0) static gboolean -gst_vaapidecode_query (GST_PAD_QUERY_FUNCTION_ARGS) +gst_vaapidecode_query (GstPad * pad, GstObject * parent, GstQuery * query) { GstVaapiDecode *const decode = GST_VAAPIDECODE (gst_pad_get_parent_element (pad)); @@ -1007,8 +1007,7 @@ gst_vaapidecode_sink_query (GstVideoDecoder * vdec, GstQuery * query) #else GstPad *pad = GST_VIDEO_DECODER_SINK_PAD (vdec); GstObject *parent = gst_pad_get_parent (pad); - ret = GST_PAD_QUERY_FUNCTION_CALL (plugin->sinkpad_query, pad, parent, - query); + ret = plugin->sinkpad_query (pad, parent, query); if (parent) gst_object_unref (parent); #endif @@ -1056,8 +1055,7 @@ gst_vaapidecode_src_query (GstVideoDecoder * vdec, GstQuery * query) #else GstPad *pad = GST_VIDEO_DECODER_SRC_PAD (vdec); GstObject *parent = gst_pad_get_parent (pad); - ret = GST_PAD_QUERY_FUNCTION_CALL (plugin->srcpad_query, pad, parent, - query); + ret = plugin->srcpad_query (pad, parent, query); if (parent) gst_object_unref (parent); #endif diff --git a/gst/vaapi/gstvaapidecodebin.c b/gst/vaapi/gstvaapidecodebin.c index 6454cb9e59..c95e50f168 100644 --- a/gst/vaapi/gstvaapidecodebin.c +++ b/gst/vaapi/gstvaapidecodebin.c @@ -20,7 +20,7 @@ * Boston, MA 02110-1301 USA */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include #include #include diff --git a/gst/vaapi/gstvaapiencode.c b/gst/vaapi/gstvaapiencode.c index 1167490296..8e06433456 100644 --- a/gst/vaapi/gstvaapiencode.c +++ b/gst/vaapi/gstvaapiencode.c @@ -21,7 +21,7 @@ * Boston, MA 02110-1301 USA */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include #include #include "gstvaapiencode.h" @@ -68,7 +68,7 @@ ensure_uploader (GstVaapiEncode * encode) } static gboolean -gst_vaapiencode_query (GST_PAD_QUERY_FUNCTION_ARGS) +gst_vaapiencode_query (GstPad * pad, GstObject * parent, GstQuery * query) { GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (gst_pad_get_parent_element (pad)); @@ -79,11 +79,9 @@ gst_vaapiencode_query (GST_PAD_QUERY_FUNCTION_ARGS) if (gst_vaapi_reply_to_query (query, plugin->display)) success = TRUE; else if (GST_PAD_IS_SINK (pad)) - success = GST_PAD_QUERY_FUNCTION_CALL (plugin->sinkpad_query, - plugin->sinkpad, parent, query); + success = plugin->sinkpad_query (plugin->sinkpad, parent, query); else - success = GST_PAD_QUERY_FUNCTION_CALL (plugin->srcpad_query, - plugin->srcpad, parent, query); + success = plugin->srcpad_query (plugin->srcpad, parent, query); gst_object_unref (plugin); return success; diff --git a/gst/vaapi/gstvaapiencode_h264.c b/gst/vaapi/gstvaapiencode_h264.c index 3c16c91cee..0f2bb64bc3 100644 --- a/gst/vaapi/gstvaapiencode_h264.c +++ b/gst/vaapi/gstvaapiencode_h264.c @@ -21,7 +21,7 @@ * Boston, MA 02110-1301 USA */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include #include #include diff --git a/gst/vaapi/gstvaapiencode_jpeg.c b/gst/vaapi/gstvaapiencode_jpeg.c index 07ce6eae13..009287a25c 100644 --- a/gst/vaapi/gstvaapiencode_jpeg.c +++ b/gst/vaapi/gstvaapiencode_jpeg.c @@ -20,7 +20,7 @@ * Boston, MA 02110-1301 USA */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include #include #include "gstvaapiencode_jpeg.h" diff --git a/gst/vaapi/gstvaapiencode_mpeg2.c b/gst/vaapi/gstvaapiencode_mpeg2.c index 0d6fb74c3d..9bbaa0020d 100644 --- a/gst/vaapi/gstvaapiencode_mpeg2.c +++ b/gst/vaapi/gstvaapiencode_mpeg2.c @@ -21,7 +21,7 @@ * Boston, MA 02110-1301 USA */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include #include #include "gstvaapiencode_mpeg2.h" diff --git a/gst/vaapi/gstvaapiencode_vp8.c b/gst/vaapi/gstvaapiencode_vp8.c index 0cba42b759..7e7099af7f 100644 --- a/gst/vaapi/gstvaapiencode_vp8.c +++ b/gst/vaapi/gstvaapiencode_vp8.c @@ -20,7 +20,7 @@ * Boston, MA 02110-1301 USA */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include #include #include "gstvaapiencode_vp8.h" diff --git a/gst/vaapi/gstvaapiparse.c b/gst/vaapi/gstvaapiparse.c index 81724be99d..f29e503dd9 100644 --- a/gst/vaapi/gstvaapiparse.c +++ b/gst/vaapi/gstvaapiparse.c @@ -20,7 +20,7 @@ * Boston, MA 02110-1301 USA */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include #include "gstvaapiparse.h" #include "gsth264parse.h" diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index 7a9a3fa7f3..d2639a5c7e 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -22,7 +22,7 @@ * Boston, MA 02110-1301 USA */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include #include #include "gstvaapipluginbase.h" diff --git a/gst/vaapi/gstvaapipluginutil.c b/gst/vaapi/gstvaapipluginutil.c index d9dfd5ed2a..d388eb3a60 100644 --- a/gst/vaapi/gstvaapipluginutil.c +++ b/gst/vaapi/gstvaapipluginutil.c @@ -22,7 +22,7 @@ * Boston, MA 02110-1301 USA */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include "gstvaapivideocontext.h" #if USE_DRM # include diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c index f47a419f40..dc72948b34 100644 --- a/gst/vaapi/gstvaapipostproc.c +++ b/gst/vaapi/gstvaapipostproc.c @@ -29,7 +29,7 @@ * implemented. */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include #include "gstvaapipostproc.h" diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c index 192cfa2c67..1b30fa5afd 100644 --- a/gst/vaapi/gstvaapisink.c +++ b/gst/vaapi/gstvaapisink.c @@ -31,7 +31,7 @@ * create its own internal window and render into it. */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include #include diff --git a/gst/vaapi/gstvaapiuploader.c b/gst/vaapi/gstvaapiuploader.c index 7d696e4384..70e654fc1c 100644 --- a/gst/vaapi/gstvaapiuploader.c +++ b/gst/vaapi/gstvaapiuploader.c @@ -22,7 +22,7 @@ * Boston, MA 02110-1301 USA */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include #include #include diff --git a/gst/vaapi/gstvaapivideobuffer.c b/gst/vaapi/gstvaapivideobuffer.c index 17641eaad5..6e27e029eb 100644 --- a/gst/vaapi/gstvaapivideobuffer.c +++ b/gst/vaapi/gstvaapivideobuffer.c @@ -27,7 +27,7 @@ * @short_description: VA video buffer for GStreamer */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include "gstvaapivideobuffer.h" #if USE_X11 && !GST_CHECK_VERSION(1,1,0) # include "gstvaapivideoconverter_x11.h" diff --git a/gst/vaapi/gstvaapivideobufferpool.c b/gst/vaapi/gstvaapivideobufferpool.c index 5aaf7eb830..74a18aaf41 100644 --- a/gst/vaapi/gstvaapivideobufferpool.c +++ b/gst/vaapi/gstvaapivideobufferpool.c @@ -20,7 +20,7 @@ * Boston, MA 02110-1301 USA */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include "gstvaapivideobufferpool.h" #include "gstvaapivideobuffer.h" #include "gstvaapivideomemory.h" diff --git a/gst/vaapi/gstvaapivideocontext.c b/gst/vaapi/gstvaapivideocontext.c index 54645c325f..6c3ee0916f 100644 --- a/gst/vaapi/gstvaapivideocontext.c +++ b/gst/vaapi/gstvaapivideocontext.c @@ -23,7 +23,7 @@ * Boston, MA 02110-1301 USA */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include "gstvaapivideocontext.h" #if GST_CHECK_VERSION(1,1,0) diff --git a/gst/vaapi/gstvaapivideoconverter_glx.c b/gst/vaapi/gstvaapivideoconverter_glx.c index 60c1678033..4cf1c822fc 100644 --- a/gst/vaapi/gstvaapivideoconverter_glx.c +++ b/gst/vaapi/gstvaapivideoconverter_glx.c @@ -22,7 +22,7 @@ * Boston, MA 02110-1301 USA */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include #include "gstvaapivideoconverter_glx.h" #include "gstvaapivideoconverter_x11.h" diff --git a/gst/vaapi/gstvaapivideoconverter_x11.c b/gst/vaapi/gstvaapivideoconverter_x11.c index 22ddd1366b..6fda71c76a 100644 --- a/gst/vaapi/gstvaapivideoconverter_x11.c +++ b/gst/vaapi/gstvaapivideoconverter_x11.c @@ -20,7 +20,7 @@ * Boston, MA 02110-1301 USA */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include #include "gstvaapivideoconverter_x11.h" #include "gstvaapipluginutil.h" diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c index 3583530696..409cdd48c7 100644 --- a/gst/vaapi/gstvaapivideomemory.c +++ b/gst/vaapi/gstvaapivideomemory.c @@ -20,7 +20,7 @@ * Boston, MA 02110-1301 USA */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include #include #include diff --git a/gst/vaapi/gstvaapivideometa.c b/gst/vaapi/gstvaapivideometa.c index ceff5d1588..aef333e440 100644 --- a/gst/vaapi/gstvaapivideometa.c +++ b/gst/vaapi/gstvaapivideometa.c @@ -27,7 +27,7 @@ * @short_description: VA video meta for GStreamer */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include #include #include "gstvaapivideometa.h" diff --git a/gst/vaapi/gstvaapivideometa_texture.c b/gst/vaapi/gstvaapivideometa_texture.c index 64efdcdc62..e1b4331d8d 100644 --- a/gst/vaapi/gstvaapivideometa_texture.c +++ b/gst/vaapi/gstvaapivideometa_texture.c @@ -24,7 +24,7 @@ * Boston, MA 02110-1301 USA */ -#include "gst/vaapi/sysdeps.h" +#include "gstcompat.h" #include "gst/vaapi/ogl_compat.h" #include "gstvaapivideometa.h" #include "gstvaapivideometa_texture.h" diff --git a/tests/codec.c b/tests/codec.c index 0269ae6c25..b30c0af4b5 100644 --- a/tests/codec.c +++ b/tests/codec.c @@ -42,7 +42,7 @@ static const CodecMap g_codec_map[] = { { "wmv3", GST_VAAPI_CODEC_VC1, "video/x-wmv, wmvversion=3" }, { "vc1", GST_VAAPI_CODEC_VC1, - "video/x-wmv, wmvversion=3, " GST_MAKE_FORMAT_STRING(WVC1) }, + "video/x-wmv, wmvversion=3, format=(string)WVC1" }, { NULL, } }; @@ -156,8 +156,8 @@ codec_identifier_new(const gchar *filename) goto error; tfp = &cip->type_find; - tfp->peek = (GstTypeFindPeekFunction)codec_identifier_peek; - tfp->suggest = (GstTypeFindSuggestFunction)codec_identifier_suggest; + tfp->peek = codec_identifier_peek; + tfp->suggest = codec_identifier_suggest; tfp->data = cip; return cip;