mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 00:01:23 +00:00
plugins: add support for headless pipelines.
This commit is contained in:
parent
34a2b33c1a
commit
6118e76b62
2 changed files with 49 additions and 0 deletions
|
@ -9,6 +9,11 @@ libgstvaapi_CFLAGS = \
|
||||||
|
|
||||||
libgstvaapi_LIBS =
|
libgstvaapi_LIBS =
|
||||||
|
|
||||||
|
if USE_DRM
|
||||||
|
libgstvaapi_LIBS += \
|
||||||
|
$(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-drm-$(GST_MAJORMINOR).la
|
||||||
|
endif
|
||||||
|
|
||||||
if USE_X11
|
if USE_X11
|
||||||
libgstvaapi_LIBS += \
|
libgstvaapi_LIBS += \
|
||||||
$(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_MAJORMINOR).la
|
$(top_builddir)/gst-libs/gst/vaapi/libgstvaapi-x11-$(GST_MAJORMINOR).la
|
||||||
|
|
|
@ -26,6 +26,9 @@
|
||||||
#endif
|
#endif
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <gst/video/videocontext.h>
|
#include <gst/video/videocontext.h>
|
||||||
|
#if USE_DRM
|
||||||
|
# include <gst/vaapi/gstvaapidisplay_drm.h>
|
||||||
|
#endif
|
||||||
#if USE_X11
|
#if USE_X11
|
||||||
# include <gst/vaapi/gstvaapidisplay_x11.h>
|
# include <gst/vaapi/gstvaapidisplay_x11.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -48,6 +51,10 @@ static const char *display_types[] = {
|
||||||
#if USE_X11
|
#if USE_X11
|
||||||
"x11-display",
|
"x11-display",
|
||||||
"x11-display-name",
|
"x11-display-name",
|
||||||
|
#endif
|
||||||
|
#if USE_DRM
|
||||||
|
"drm-device",
|
||||||
|
"drm-device-path",
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
@ -73,6 +80,11 @@ static const DisplayMap g_display_map[] = {
|
||||||
{ "glx",
|
{ "glx",
|
||||||
GST_VAAPI_DISPLAY_TYPE_GLX,
|
GST_VAAPI_DISPLAY_TYPE_GLX,
|
||||||
gst_vaapi_display_glx_new },
|
gst_vaapi_display_glx_new },
|
||||||
|
#endif
|
||||||
|
#if USE_DRM
|
||||||
|
{ "drm",
|
||||||
|
GST_VAAPI_DISPLAY_TYPE_DRM,
|
||||||
|
gst_vaapi_display_drm_new },
|
||||||
#endif
|
#endif
|
||||||
{ NULL, }
|
{ NULL, }
|
||||||
};
|
};
|
||||||
|
@ -148,6 +160,20 @@ gst_vaapi_set_display(
|
||||||
g_return_if_fail(G_VALUE_HOLDS_OBJECT(value));
|
g_return_if_fail(G_VALUE_HOLDS_OBJECT(value));
|
||||||
dpy = g_value_dup_object(value);
|
dpy = g_value_dup_object(value);
|
||||||
}
|
}
|
||||||
|
#if USE_DRM
|
||||||
|
else if (!strcmp(type, "drm-device")) {
|
||||||
|
gint device;
|
||||||
|
g_return_if_fail(G_VALUE_HOLDS_INT(value));
|
||||||
|
device = g_value_get_int(value);
|
||||||
|
dpy = gst_vaapi_display_drm_new_with_device(device);
|
||||||
|
}
|
||||||
|
else if (!strcmp(type, "drm-device-path")) {
|
||||||
|
const gchar *device_path;
|
||||||
|
g_return_if_fail(G_VALUE_HOLDS_STRING(value));
|
||||||
|
device_path = g_value_get_string(value);
|
||||||
|
dpy = gst_vaapi_display_drm_new(device_path);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#if USE_X11
|
#if USE_X11
|
||||||
else if (!strcmp(type, "x11-display-name")) {
|
else if (!strcmp(type, "x11-display-name")) {
|
||||||
g_return_if_fail(G_VALUE_HOLDS_STRING(value));
|
g_return_if_fail(G_VALUE_HOLDS_STRING(value));
|
||||||
|
@ -219,6 +245,24 @@ gst_vaapi_reply_to_query(GstQuery *query, GstVaapiDisplay *display)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
switch (display_type) {
|
switch (display_type) {
|
||||||
|
#if USE_DRM
|
||||||
|
case GST_VAAPI_DISPLAY_TYPE_DRM: {
|
||||||
|
GstVaapiDisplayDRM * const drm_dpy =
|
||||||
|
GST_VAAPI_DISPLAY_DRM(display);
|
||||||
|
if (!strcmp(type, "drm-device-path"))
|
||||||
|
gst_video_context_query_set_string(query, type,
|
||||||
|
gst_vaapi_display_drm_get_device_path(drm_dpy));
|
||||||
|
#if 0
|
||||||
|
/* XXX: gst_video_context_query_set_int() does not exist yet */
|
||||||
|
else if (!strcmp(type, "drm-device"))
|
||||||
|
gst_video_context_query_set_int(query, type,
|
||||||
|
gst_vaapi_display_drm_get_device(drm_dpy));
|
||||||
|
#endif
|
||||||
|
else
|
||||||
|
res = FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#if USE_X11
|
#if USE_X11
|
||||||
#if USE_GLX
|
#if USE_GLX
|
||||||
case GST_VAAPI_DISPLAY_TYPE_GLX:
|
case GST_VAAPI_DISPLAY_TYPE_GLX:
|
||||||
|
|
Loading…
Reference in a new issue