diff --git a/gst-libs/gst/vaapi/gstcompat.h b/gst-libs/gst/vaapi/gstcompat.h index 81fa868168..8ff3180620 100644 --- a/gst-libs/gst/vaapi/gstcompat.h +++ b/gst-libs/gst/vaapi/gstcompat.h @@ -50,4 +50,13 @@ gst_compat_video_overlay_rectangle_get_pixels_unscaled_raw( &width, &height, &stride, flags); } +/* GstTypeFind */ +#undef GstTypeFindPeekFunction +#define GstTypeFindPeekFunction GstCompatTypeFindPeekFunction +#undef GstTypeFindSuggestFunction +#define GstTypeFindSuggestFunction GstCompatTypeFindSuggestFunction + +typedef guint8 *(*GstCompatTypeFindPeekFunction)(gpointer, gint64, guint); +typedef void (*GstCompatTypeFindSuggestFunction)(gpointer, guint, const GstCaps *); + #endif /* GST_COMPAT_H */ diff --git a/tests/codec.c b/tests/codec.c index 2a8aca194c..fa690f1490 100644 --- a/tests/codec.c +++ b/tests/codec.c @@ -98,7 +98,7 @@ typedef struct { GstTypeFind type_find; } CodecIdentifier; -static guint8 * +static const guint8 * codec_identifier_peek(gpointer data, gint64 offset, guint size) { CodecIdentifier * const cip = data; @@ -111,13 +111,13 @@ codec_identifier_peek(gpointer data, gint64 offset, guint size) } static void -codec_identifier_suggest(gpointer data, guint probability, const GstCaps *caps) +codec_identifier_suggest(gpointer data, guint probability, GstCaps *caps) { CodecIdentifier * const cip = data; if (cip->probability < probability) { cip->probability = probability; - gst_caps_replace(&cip->caps, (GstCaps *)caps); + gst_caps_replace(&cip->caps, caps); } } @@ -155,8 +155,8 @@ codec_identifier_new(const gchar *filename) goto error; tfp = &cip->type_find; - tfp->peek = codec_identifier_peek; - tfp->suggest = codec_identifier_suggest; + tfp->peek = (GstTypeFindPeekFunction)codec_identifier_peek; + tfp->suggest = (GstTypeFindSuggestFunction)codec_identifier_suggest; tfp->data = cip; return cip;