plugins: allow builds without GLX enabled for GStreamer 1.2.

Don't try to build GLTextureUploadMeta related code if GLX is not
enabled during GStreamer >= 1.2 builds.
This commit is contained in:
Gwenole Beauchesne 2013-12-11 13:25:51 +01:00
parent 6b6c10d94d
commit c2eabc17dd
3 changed files with 5 additions and 9 deletions

View file

@ -37,7 +37,7 @@
#include "gstvaapipluginutil.h"
#include "gstvaapivideocontext.h"
#include "gstvaapivideobuffer.h"
#if GST_CHECK_VERSION(1,1,0)
#if GST_CHECK_VERSION(1,1,0) && USE_GLX
#include "gstvaapivideometa_texture.h"
#endif
#if GST_CHECK_VERSION(1,0,0)
@ -341,7 +341,7 @@ gst_vaapidecode_push_decoded_frame(GstVideoDecoder *vdec,
}
}
#if GST_CHECK_VERSION(1,1,0)
#if GST_CHECK_VERSION(1,1,0) && USE_GLX
if (decode->has_texture_upload_meta)
gst_buffer_ensure_texture_upload_meta(out_frame->output_buffer);
#endif
@ -552,7 +552,7 @@ gst_vaapidecode_decide_allocation(GstVideoDecoder *vdec, GstQuery *query)
config = gst_buffer_pool_get_config(pool);
gst_buffer_pool_config_add_option(config,
GST_BUFFER_POOL_OPTION_VIDEO_META);
#if GST_CHECK_VERSION(1,1,0)
#if GST_CHECK_VERSION(1,1,0) && USE_GLX
decode->has_texture_upload_meta = gst_query_find_allocation_meta(query,
GST_VIDEO_GL_TEXTURE_UPLOAD_META_API_TYPE, NULL);
if (decode->has_texture_upload_meta)

View file

@ -24,7 +24,7 @@
#include "gstvaapivideobufferpool.h"
#include "gstvaapivideobuffer.h"
#include "gstvaapivideomemory.h"
#if GST_CHECK_VERSION(1,1,0)
#if GST_CHECK_VERSION(1,1,0) && USE_GLX
#include "gstvaapivideometa_texture.h"
#endif
@ -222,7 +222,7 @@ gst_vaapi_video_buffer_pool_alloc_buffer(GstBufferPool *pool,
vmeta->unmap = gst_video_meta_unmap_vaapi_memory;
}
#if GST_CHECK_VERSION(1,1,0)
#if GST_CHECK_VERSION(1,1,0) && USE_GLX
if (priv->has_texture_upload_meta)
gst_buffer_add_texture_upload_meta(buffer);
#endif

View file

@ -76,9 +76,7 @@ gst_vaapi_texture_upload(GstVideoGLTextureUploadMeta *meta, guint texture_id[4])
return gst_vaapi_texture_put_surface(texture, surface,
gst_vaapi_video_meta_get_render_flags(vmeta));
}
#endif
#if GST_CHECK_VERSION(1,1,0)
gboolean
gst_buffer_add_texture_upload_meta(GstBuffer *buffer)
{
@ -88,12 +86,10 @@ gst_buffer_add_texture_upload_meta(GstBuffer *buffer)
if (!buffer)
return FALSE;
#if USE_GLX
meta = gst_buffer_add_video_gl_texture_upload_meta(buffer,
GST_VIDEO_GL_TEXTURE_ORIENTATION_X_NORMAL_Y_NORMAL,
1, tex_type, gst_vaapi_texture_upload,
NULL, NULL, gst_vaapi_texure_upload_free);
#endif
return meta != NULL;
}