From: Gwenole Beauchesne Date: Tue, 24 Jul 2012 13:07:48 +0000 (+0200) Subject: Fix build without X11. X-Git-Tag: 0.4.0~86 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0bf1e761f963a11c476d5d87a141b9c27cad5892;p=platform%2Fupstream%2Fgstreamer-vaapi.git Fix build without X11. --- diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c index 226efdc..7238518 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay.c @@ -90,8 +90,10 @@ gst_vaapi_display_type_get_type(void) static const GEnumValue display_types[] = { { GST_VAAPI_DISPLAY_TYPE_ANY, "Auto detection", "any" }, +#if USE_X11 { GST_VAAPI_DISPLAY_TYPE_X11, "VA/X11 display", "x11" }, +#endif #if USE_GLX { GST_VAAPI_DISPLAY_TYPE_GLX, "VA/GLX display", "glx" }, diff --git a/gst/vaapi/gstvaapipluginutil.c b/gst/vaapi/gstvaapipluginutil.c index 08ca36a..ac7efeb 100644 --- a/gst/vaapi/gstvaapipluginutil.c +++ b/gst/vaapi/gstvaapipluginutil.c @@ -45,8 +45,10 @@ static const char *display_types[] = { "wl-display", "wl-display-name", #endif +#if USE_X11 "x11-display", "x11-display-name", +#endif NULL }; @@ -146,6 +148,7 @@ gst_vaapi_set_display( g_return_if_fail(G_VALUE_HOLDS_OBJECT(value)); dpy = g_value_dup_object(value); } +#if USE_X11 else if (!strcmp(type, "x11-display-name")) { g_return_if_fail(G_VALUE_HOLDS_STRING(value)); #if USE_GLX @@ -162,6 +165,7 @@ gst_vaapi_set_display( if (!dpy) dpy = gst_vaapi_display_x11_new_with_display(g_value_get_pointer(value)); } +#endif #if USE_WAYLAND else if (!strcmp(type, "wl-display")) { struct wl_display *wl_display; @@ -215,6 +219,7 @@ gst_vaapi_reply_to_query(GstQuery *query, GstVaapiDisplay *display) } else { switch (display_type) { +#if USE_X11 #if USE_GLX case GST_VAAPI_DISPLAY_TYPE_GLX: #endif @@ -232,6 +237,7 @@ gst_vaapi_reply_to_query(GstQuery *query, GstVaapiDisplay *display) res = FALSE; break; } +#endif #if USE_WAYLAND case GST_VAAPI_DISPLAY_TYPE_WAYLAND: { GstVaapiDisplayWayland * const wlvadpy = diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c index e5441a7..4c6fd80 100644 --- a/gst/vaapi/gstvaapisink.c +++ b/gst/vaapi/gstvaapisink.c @@ -35,8 +35,10 @@ #include #include #include -#include -#include +#if USE_X11 +# include +# include +#endif #if USE_GLX # include # include @@ -141,8 +143,10 @@ gst_vaapisink_video_context_iface_init(GstVideoContextInterface *iface) /* GstXOverlay interface */ +#if USE_X11 static gboolean gst_vaapisink_ensure_window_xid(GstVaapiSink *sink, guintptr window_id); +#endif static GstFlowReturn gst_vaapisink_show_frame(GstBaseSink *base_sink, GstBuffer *buffer); @@ -158,7 +162,16 @@ gst_vaapisink_xoverlay_set_window_handle(GstXOverlay *overlay, guintptr window) sink->display_type = GST_VAAPI_DISPLAY_TYPE_X11; sink->foreign_window = TRUE; - gst_vaapisink_ensure_window_xid(sink, window); + + switch (sink->display_type) { +#if USE_X11 + case GST_VAAPI_DISPLAY_TYPE_X11: + gst_vaapisink_ensure_window_xid(sink, window); + break; +#endif + default: + break; + } } static void @@ -213,6 +226,7 @@ gst_vaapisink_destroy(GstVaapiSink *sink) gst_caps_replace(&sink->caps, NULL); } +#if USE_X11 /* Checks whether a ConfigureNotify event is in the queue */ typedef struct _ConfigureNotifyEventPendingArgs ConfigureNotifyEventPendingArgs; struct _ConfigureNotifyEventPendingArgs { @@ -263,6 +277,7 @@ configure_notify_event_pending( ); return args.match; } +#endif static const gchar * get_display_type_name(GstVaapiDisplayType display_type) @@ -360,6 +375,7 @@ gst_vaapisink_ensure_window(GstVaapiSink *sink, guint width, guint height) sink->window = gst_vaapi_window_glx_new(display, width, height); goto notify_xoverlay_interface; #endif +#if USE_X11 case GST_VAAPI_DISPLAY_TYPE_X11: sink->window = gst_vaapi_window_x11_new(display, width, height); notify_xoverlay_interface: @@ -370,6 +386,7 @@ gst_vaapisink_ensure_window(GstVaapiSink *sink, guint width, guint height) gst_vaapi_window_x11_get_xid(GST_VAAPI_WINDOW_X11(sink->window)) ); break; +#endif #if USE_WAYLAND case GST_VAAPI_DISPLAY_TYPE_WAYLAND: sink->window = gst_vaapi_window_wayland_new(display, width, height); @@ -383,6 +400,7 @@ gst_vaapisink_ensure_window(GstVaapiSink *sink, guint width, guint height) return sink->window != NULL; } +#if USE_X11 static gboolean gst_vaapisink_ensure_window_xid(GstVaapiSink *sink, guintptr window_id) { @@ -432,6 +450,7 @@ gst_vaapisink_ensure_window_xid(GstVaapiSink *sink, guintptr window_id) } return sink->window != NULL; } +#endif static gboolean gst_vaapisink_start(GstBaseSink *base_sink) @@ -735,9 +754,11 @@ gst_vaapisink_show_frame(GstBaseSink *base_sink, GstBuffer *buffer) success = gst_vaapisink_show_frame_glx(sink, surface, flags); break; #endif +#if USE_X11 case GST_VAAPI_DISPLAY_TYPE_X11: success = gst_vaapisink_put_surface(sink, surface, flags); break; +#endif #if USE_WAYLAND case GST_VAAPI_DISPLAY_TYPE_WAYLAND: success = gst_vaapisink_put_surface(sink, surface, flags); diff --git a/pkgconfig/Makefile.am b/pkgconfig/Makefile.am index 22628bd..dd1012a 100644 --- a/pkgconfig/Makefile.am +++ b/pkgconfig/Makefile.am @@ -1,5 +1,7 @@ pcfiles_in = gstreamer-vaapi.pc.in +if USE_X11 pcfiles_in += gstreamer-vaapi-x11.pc.in +endif if USE_GLX pcfiles_in += gstreamer-vaapi-glx.pc.in endif