mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
Fix build without X11.
This commit is contained in:
parent
9e00c87367
commit
0bf1e761f9
4 changed files with 34 additions and 3 deletions
|
@ -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" },
|
||||
|
|
|
@ -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 =
|
||||
|
|
|
@ -35,8 +35,10 @@
|
|||
#include <gst/video/videocontext.h>
|
||||
#include <gst/vaapi/gstvaapivideobuffer.h>
|
||||
#include <gst/vaapi/gstvaapivideosink.h>
|
||||
#include <gst/vaapi/gstvaapidisplay_x11.h>
|
||||
#include <gst/vaapi/gstvaapiwindow_x11.h>
|
||||
#if USE_X11
|
||||
# include <gst/vaapi/gstvaapidisplay_x11.h>
|
||||
# include <gst/vaapi/gstvaapiwindow_x11.h>
|
||||
#endif
|
||||
#if USE_GLX
|
||||
# include <gst/vaapi/gstvaapidisplay_glx.h>
|
||||
# include <gst/vaapi/gstvaapiwindow_glx.h>
|
||||
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue