plugin: guard pointers to pad query functions

Since gstreamer 1.4 is not required to have pad query functions if the query
vmethods are used.

This patch guards out the pad query functions for gstreamer < 1.4

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=757629
This commit is contained in:
Víctor Manuel Jáquez Leal 2015-11-05 12:58:52 +01:00
parent ea802072d1
commit 1efe569639
2 changed files with 10 additions and 3 deletions

View file

@ -199,13 +199,17 @@ gst_vaapi_plugin_base_init (GstVaapiPluginBase * plugin,
/* sink pad */
plugin->sinkpad = gst_element_get_static_pad (GST_ELEMENT (plugin), "sink");
plugin->sinkpad_query = GST_PAD_QUERYFUNC (plugin->sinkpad);
gst_video_info_init (&plugin->sinkpad_info);
#if !GST_CHECK_VERSION(1,4,0)
plugin->sinkpad_query = GST_PAD_QUERYFUNC (plugin->sinkpad);
#endif
/* src pad */
if (!(GST_OBJECT_FLAGS (plugin) & GST_ELEMENT_FLAG_SINK)) {
plugin->srcpad = gst_element_get_static_pad (GST_ELEMENT (plugin), "src");
#if !GST_CHECK_VERSION(1,4,0)
plugin->srcpad_query = GST_PAD_QUERYFUNC (plugin->srcpad);
#endif
}
gst_video_info_init (&plugin->srcpad_info);
}

View file

@ -121,7 +121,6 @@ struct _GstVaapiPluginBase
gboolean sinkpad_caps_changed;
gboolean sinkpad_caps_is_raw;
GstVideoInfo sinkpad_info;
GstPadQueryFunction sinkpad_query;
GstBufferPool *sinkpad_buffer_pool;
guint sinkpad_buffer_size;
@ -129,9 +128,13 @@ struct _GstVaapiPluginBase
GstCaps *srcpad_caps;
gboolean srcpad_caps_changed;
GstVideoInfo srcpad_info;
GstPadQueryFunction srcpad_query;
GstBufferPool *srcpad_buffer_pool;
#if !GST_CHECK_VERSION(1,4,0)
GstPadQueryFunction srcpad_query;
GstPadQueryFunction sinkpad_query;
#endif
GstVaapiDisplay *display;
GstVaapiDisplayType display_type;
GstVaapiDisplayType display_type_req;