vaapi: prefix USE_FOO defines to fix build with mesa 22.3.0
Apparently mesa 22.3.0 has updated the egl headers, and eglplatform.h now
contains commit
3670d645f4
after which xlib headers don't get included by default anymore but are
dependent upon whether USE_X11 was defined.
This breaks headless builds of gstreamer-vaapi because we always define
an internal define USE_X11 as either 1 or 0.
Change these defines to GST_VAAPI_USE_XYZ instead to avoid this.
Fixes #1634
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3555>
This commit is contained in:
parent
4aeb3def20
commit
4d70b9f87c
@ -338,7 +338,7 @@ config_create (GstVaapiContext * context)
|
|||||||
g_assert (attrib_index < G_N_ELEMENTS (attribs));
|
g_assert (attrib_index < G_N_ELEMENTS (attribs));
|
||||||
|
|
||||||
switch (cip->usage) {
|
switch (cip->usage) {
|
||||||
#if USE_ENCODERS
|
#if GST_VAAPI_USE_ENCODERS
|
||||||
case GST_VAAPI_CONTEXT_USAGE_ENCODE:
|
case GST_VAAPI_CONTEXT_USAGE_ENCODE:
|
||||||
{
|
{
|
||||||
const GstVaapiConfigInfoEncoder *const config = &cip->config.encoder;
|
const GstVaapiConfigInfoEncoder *const config = &cip->config.encoder;
|
||||||
|
@ -115,23 +115,23 @@ gst_vaapi_display_type_get_type (void)
|
|||||||
static const GEnumValue display_types[] = {
|
static const GEnumValue display_types[] = {
|
||||||
{GST_VAAPI_DISPLAY_TYPE_ANY,
|
{GST_VAAPI_DISPLAY_TYPE_ANY,
|
||||||
"Auto detection", "any"},
|
"Auto detection", "any"},
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
{GST_VAAPI_DISPLAY_TYPE_X11,
|
{GST_VAAPI_DISPLAY_TYPE_X11,
|
||||||
"VA/X11 display", "x11"},
|
"VA/X11 display", "x11"},
|
||||||
#endif
|
#endif
|
||||||
#if USE_GLX
|
#if GST_VAAPI_USE_GLX
|
||||||
{GST_VAAPI_DISPLAY_TYPE_GLX,
|
{GST_VAAPI_DISPLAY_TYPE_GLX,
|
||||||
"VA/GLX display", "glx"},
|
"VA/GLX display", "glx"},
|
||||||
#endif
|
#endif
|
||||||
#if USE_EGL
|
#if GST_VAAPI_USE_EGL
|
||||||
{GST_VAAPI_DISPLAY_TYPE_EGL,
|
{GST_VAAPI_DISPLAY_TYPE_EGL,
|
||||||
"VA/EGL display", "egl"},
|
"VA/EGL display", "egl"},
|
||||||
#endif
|
#endif
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
{GST_VAAPI_DISPLAY_TYPE_WAYLAND,
|
{GST_VAAPI_DISPLAY_TYPE_WAYLAND,
|
||||||
"VA/Wayland display", "wayland"},
|
"VA/Wayland display", "wayland"},
|
||||||
#endif
|
#endif
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
{GST_VAAPI_DISPLAY_TYPE_DRM,
|
{GST_VAAPI_DISPLAY_TYPE_DRM,
|
||||||
"VA/DRM display", "drm"},
|
"VA/DRM display", "drm"},
|
||||||
#endif
|
#endif
|
||||||
@ -1896,13 +1896,13 @@ static gboolean
|
|||||||
get_render_mode_default (GstVaapiDisplay * display, GstVaapiRenderMode * pmode)
|
get_render_mode_default (GstVaapiDisplay * display, GstVaapiRenderMode * pmode)
|
||||||
{
|
{
|
||||||
switch (GST_VAAPI_DISPLAY_VADISPLAY_TYPE (display)) {
|
switch (GST_VAAPI_DISPLAY_VADISPLAY_TYPE (display)) {
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
case GST_VAAPI_DISPLAY_TYPE_WAYLAND:
|
case GST_VAAPI_DISPLAY_TYPE_WAYLAND:
|
||||||
/* wl_buffer mapped from VA surface through vaGetSurfaceBufferWl() */
|
/* wl_buffer mapped from VA surface through vaGetSurfaceBufferWl() */
|
||||||
*pmode = GST_VAAPI_RENDER_MODE_OVERLAY;
|
*pmode = GST_VAAPI_RENDER_MODE_OVERLAY;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
case GST_VAAPI_DISPLAY_TYPE_DRM:
|
case GST_VAAPI_DISPLAY_TYPE_DRM:
|
||||||
/* vaGetSurfaceBufferDRM() returns the underlying DRM buffer handle */
|
/* vaGetSurfaceBufferDRM() returns the underlying DRM buffer handle */
|
||||||
*pmode = GST_VAAPI_RENDER_MODE_OVERLAY;
|
*pmode = GST_VAAPI_RENDER_MODE_OVERLAY;
|
||||||
|
@ -28,10 +28,10 @@
|
|||||||
#include "gstvaapiwindow_priv.h"
|
#include "gstvaapiwindow_priv.h"
|
||||||
#include "gstvaapitexture_egl.h"
|
#include "gstvaapitexture_egl.h"
|
||||||
|
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
#include "gstvaapidisplay_x11.h"
|
#include "gstvaapidisplay_x11.h"
|
||||||
#endif
|
#endif
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
#include "gstvaapidisplay_wayland.h"
|
#include "gstvaapidisplay_wayland.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -110,13 +110,13 @@ gst_vaapi_display_egl_bind_display (GstVaapiDisplay * base_display,
|
|||||||
native_egl_display = params->gl_display;
|
native_egl_display = params->gl_display;
|
||||||
|
|
||||||
if (!native_vaapi_display) {
|
if (!native_vaapi_display) {
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
if (params->display_type == GST_VAAPI_DISPLAY_TYPE_ANY
|
if (params->display_type == GST_VAAPI_DISPLAY_TYPE_ANY
|
||||||
|| params->display_type == GST_VAAPI_DISPLAY_TYPE_X11
|
|| params->display_type == GST_VAAPI_DISPLAY_TYPE_X11
|
||||||
|| params->display_type == GST_VAAPI_DISPLAY_TYPE_EGL)
|
|| params->display_type == GST_VAAPI_DISPLAY_TYPE_EGL)
|
||||||
native_vaapi_display = gst_vaapi_display_x11_new (NULL);
|
native_vaapi_display = gst_vaapi_display_x11_new (NULL);
|
||||||
#endif
|
#endif
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
if (!native_vaapi_display)
|
if (!native_vaapi_display)
|
||||||
native_vaapi_display = gst_vaapi_display_wayland_new (NULL);
|
native_vaapi_display = gst_vaapi_display_wayland_new (NULL);
|
||||||
#endif
|
#endif
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include "gstvaapisurface_drm.h"
|
#include "gstvaapisurface_drm.h"
|
||||||
#include "gstvaapisurface_priv.h"
|
#include "gstvaapisurface_priv.h"
|
||||||
|
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
#include <drm_fourcc.h>
|
#include <drm_fourcc.h>
|
||||||
#else
|
#else
|
||||||
#define DRM_FORMAT_MOD_LINEAR 0ULL
|
#define DRM_FORMAT_MOD_LINEAR 0ULL
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#define DEBUG 1
|
#define DEBUG 1
|
||||||
#include "gst/vaapi/gstvaapidebug.h"
|
#include "gst/vaapi/gstvaapidebug.h"
|
||||||
|
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
#include <drm_fourcc.h>
|
#include <drm_fourcc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ typedef struct _GstVideoFormatMapMap
|
|||||||
|
|
||||||
#define VA_BYTE_ORDER_NOT_CARE 0
|
#define VA_BYTE_ORDER_NOT_CARE 0
|
||||||
|
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
#define MAKE_DRM_FORMAT(DRM_FORMAT) G_PASTE(DRM_FORMAT_,DRM_FORMAT)
|
#define MAKE_DRM_FORMAT(DRM_FORMAT) G_PASTE(DRM_FORMAT_,DRM_FORMAT)
|
||||||
#else
|
#else
|
||||||
#define MAKE_DRM_FORMAT(DRM_FORMAT) 0
|
#define MAKE_DRM_FORMAT(DRM_FORMAT) 0
|
||||||
@ -643,7 +643,7 @@ gst_vaapi_video_format_create_map (VAImageFormat * formats, guint n)
|
|||||||
guint
|
guint
|
||||||
gst_vaapi_drm_format_from_va_fourcc (guint32 fourcc)
|
gst_vaapi_drm_format_from_va_fourcc (guint32 fourcc)
|
||||||
{
|
{
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
const GArray *map = gst_vaapi_video_formats_map;
|
const GArray *map = gst_vaapi_video_formats_map;
|
||||||
const GstVideoFormatMap *m;
|
const GstVideoFormatMap *m;
|
||||||
guint i;
|
guint i;
|
||||||
@ -679,7 +679,7 @@ gst_vaapi_drm_format_from_va_fourcc (guint32 fourcc)
|
|||||||
GstVideoFormat
|
GstVideoFormat
|
||||||
gst_vaapi_video_format_from_drm_format (guint drm_format)
|
gst_vaapi_video_format_from_drm_format (guint drm_format)
|
||||||
{
|
{
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
const GArray *map = gst_vaapi_video_formats_map;
|
const GArray *map = gst_vaapi_video_formats_map;
|
||||||
const GstVideoFormatMap *m;
|
const GstVideoFormatMap *m;
|
||||||
guint i;
|
guint i;
|
||||||
|
@ -29,14 +29,14 @@
|
|||||||
#include "gstvaapisink.h"
|
#include "gstvaapisink.h"
|
||||||
#include "gstvaapidecodebin.h"
|
#include "gstvaapidecodebin.h"
|
||||||
|
|
||||||
#if USE_ENCODERS
|
#if GST_VAAPI_USE_ENCODERS
|
||||||
#include "gstvaapiencode_h264.h"
|
#include "gstvaapiencode_h264.h"
|
||||||
#include "gstvaapiencode_mpeg2.h"
|
#include "gstvaapiencode_mpeg2.h"
|
||||||
#include "gstvaapiencode_jpeg.h"
|
#include "gstvaapiencode_jpeg.h"
|
||||||
#include "gstvaapiencode_vp8.h"
|
#include "gstvaapiencode_vp8.h"
|
||||||
#include "gstvaapiencode_h265.h"
|
#include "gstvaapiencode_h265.h"
|
||||||
|
|
||||||
#if USE_VP9_ENCODER
|
#if GST_VAAPI_USE_VP9_ENCODER
|
||||||
#include "gstvaapiencode_vp9.h"
|
#include "gstvaapiencode_vp9.h"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -109,7 +109,7 @@ display_get_decoder_codecs (GstVaapiDisplay * display)
|
|||||||
return codecs;
|
return codecs;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_ENCODERS
|
#if GST_VAAPI_USE_ENCODERS
|
||||||
static GArray *
|
static GArray *
|
||||||
display_get_encoder_codecs (GstVaapiDisplay * display)
|
display_get_encoder_codecs (GstVaapiDisplay * display)
|
||||||
{
|
{
|
||||||
@ -144,7 +144,7 @@ static const GstVaapiEncoderMap vaapi_encode_map[] = {
|
|||||||
DEF_ENC (MPEG2, mpeg2),
|
DEF_ENC (MPEG2, mpeg2),
|
||||||
DEF_ENC (JPEG, jpeg),
|
DEF_ENC (JPEG, jpeg),
|
||||||
DEF_ENC (VP8, vp8),
|
DEF_ENC (VP8, vp8),
|
||||||
#if USE_VP9_ENCODER
|
#if GST_VAAPI_USE_VP9_ENCODER
|
||||||
DEF_ENC (VP9, vp9),
|
DEF_ENC (VP9, vp9),
|
||||||
#endif
|
#endif
|
||||||
DEF_ENC (H265, h265),
|
DEF_ENC (H265, h265),
|
||||||
@ -217,7 +217,7 @@ plugin_init (GstPlugin * plugin)
|
|||||||
rank = GST_RANK_MARGINAL;
|
rank = GST_RANK_MARGINAL;
|
||||||
gst_element_register (plugin, "vaapisink", rank, GST_TYPE_VAAPISINK);
|
gst_element_register (plugin, "vaapisink", rank, GST_TYPE_VAAPISINK);
|
||||||
|
|
||||||
#if USE_ENCODERS
|
#if GST_VAAPI_USE_ENCODERS
|
||||||
gst_vaapiencode_register (plugin, display);
|
gst_vaapiencode_register (plugin, display);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#include "gstvaapidecode_props.h"
|
#include "gstvaapidecode_props.h"
|
||||||
#include "gstvaapipluginutil.h"
|
#include "gstvaapipluginutil.h"
|
||||||
#include "gstvaapivideobuffer.h"
|
#include "gstvaapivideobuffer.h"
|
||||||
#if (USE_GLX || USE_EGL)
|
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
|
||||||
#include "gstvaapivideometa_texture.h"
|
#include "gstvaapivideometa_texture.h"
|
||||||
#endif
|
#endif
|
||||||
#include "gstvaapivideobufferpool.h"
|
#include "gstvaapivideobufferpool.h"
|
||||||
@ -44,7 +44,7 @@
|
|||||||
#include <gst/vaapi/gstvaapidecoder_vp8.h>
|
#include <gst/vaapi/gstvaapidecoder_vp8.h>
|
||||||
#include <gst/vaapi/gstvaapidecoder_h265.h>
|
#include <gst/vaapi/gstvaapidecoder_h265.h>
|
||||||
#include <gst/vaapi/gstvaapidecoder_vp9.h>
|
#include <gst/vaapi/gstvaapidecoder_vp9.h>
|
||||||
#if USE_AV1_DECODER
|
#if GST_VAAPI_USE_AV1_DECODER
|
||||||
#include <gst/vaapi/gstvaapidecoder_av1.h>
|
#include <gst/vaapi/gstvaapidecoder_av1.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ char *gst_vaapidecode_sink_caps_str = NULL;
|
|||||||
static const char gst_vaapidecode_src_caps_str[] =
|
static const char gst_vaapidecode_src_caps_str[] =
|
||||||
GST_VAAPI_MAKE_SURFACE_CAPS "; "
|
GST_VAAPI_MAKE_SURFACE_CAPS "; "
|
||||||
GST_VIDEO_CAPS_MAKE_WITH_FEATURES(GST_CAPS_FEATURE_MEMORY_DMABUF, GST_VAAPI_FORMATS_ALL) " ;"
|
GST_VIDEO_CAPS_MAKE_WITH_FEATURES(GST_CAPS_FEATURE_MEMORY_DMABUF, GST_VAAPI_FORMATS_ALL) " ;"
|
||||||
#if (USE_GLX || USE_EGL)
|
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
|
||||||
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS "; "
|
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS "; "
|
||||||
#endif
|
#endif
|
||||||
GST_VIDEO_CAPS_MAKE(GST_VAAPI_FORMATS_ALL);
|
GST_VIDEO_CAPS_MAKE(GST_VAAPI_FORMATS_ALL);
|
||||||
@ -269,7 +269,7 @@ gst_vaapidecode_ensure_allowed_srcpad_caps (GstVaapiDecode * decode)
|
|||||||
gst_caps_set_features_simple (dma_caps,
|
gst_caps_set_features_simple (dma_caps,
|
||||||
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_DMABUF));
|
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_DMABUF));
|
||||||
}
|
}
|
||||||
#if (USE_GLX || USE_EGL)
|
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
|
||||||
if (!GST_VAAPI_PLUGIN_BASE_SRC_PAD_CAN_DMABUF (decode)
|
if (!GST_VAAPI_PLUGIN_BASE_SRC_PAD_CAN_DMABUF (decode)
|
||||||
&& gst_vaapi_display_has_opengl (GST_VAAPI_PLUGIN_BASE_DISPLAY (decode))) {
|
&& gst_vaapi_display_has_opengl (GST_VAAPI_PLUGIN_BASE_DISPLAY (decode))) {
|
||||||
gltexup_caps = gst_caps_from_string (GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS);
|
gltexup_caps = gst_caps_from_string (GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS);
|
||||||
@ -341,7 +341,7 @@ gst_vaapidecode_update_src_caps (GstVaapiDecode * decode)
|
|||||||
if (feature == GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED)
|
if (feature == GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
#if (!USE_GLX && !USE_EGL)
|
#if (!GST_VAAPI_USE_GLX && !GST_VAAPI_USE_EGL)
|
||||||
/* This is a very pathological situation. Should not happen. */
|
/* This is a very pathological situation. Should not happen. */
|
||||||
if (feature == GST_VAAPI_CAPS_FEATURE_GL_TEXTURE_UPLOAD_META)
|
if (feature == GST_VAAPI_CAPS_FEATURE_GL_TEXTURE_UPLOAD_META)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -632,7 +632,7 @@ gst_vaapidecode_push_decoded_frame (GstVideoDecoder * vdec,
|
|||||||
GST_BUFFER_FLAG_SET (out_frame->output_buffer,
|
GST_BUFFER_FLAG_SET (out_frame->output_buffer,
|
||||||
GST_VIDEO_BUFFER_FLAG_FIRST_IN_BUNDLE);
|
GST_VIDEO_BUFFER_FLAG_FIRST_IN_BUNDLE);
|
||||||
}
|
}
|
||||||
#if (USE_GLX || USE_EGL)
|
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
|
||||||
if (decode->has_texture_upload_meta)
|
if (decode->has_texture_upload_meta)
|
||||||
gst_buffer_ensure_texture_upload_meta (out_frame->output_buffer);
|
gst_buffer_ensure_texture_upload_meta (out_frame->output_buffer);
|
||||||
#endif
|
#endif
|
||||||
@ -860,7 +860,7 @@ gst_vaapidecode_decide_allocation (GstVideoDecoder * vdec, GstQuery * query)
|
|||||||
|
|
||||||
decode->has_texture_upload_meta = FALSE;
|
decode->has_texture_upload_meta = FALSE;
|
||||||
|
|
||||||
#if (USE_GLX || USE_EGL)
|
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
|
||||||
decode->has_texture_upload_meta =
|
decode->has_texture_upload_meta =
|
||||||
gst_query_find_allocation_meta (query,
|
gst_query_find_allocation_meta (query,
|
||||||
GST_VIDEO_GL_TEXTURE_UPLOAD_META_API_TYPE, NULL) &&
|
GST_VIDEO_GL_TEXTURE_UPLOAD_META_API_TYPE, NULL) &&
|
||||||
@ -972,7 +972,7 @@ gst_vaapidecode_create (GstVaapiDecode * decode, GstCaps * caps)
|
|||||||
case GST_VAAPI_CODEC_VP9:
|
case GST_VAAPI_CODEC_VP9:
|
||||||
decode->decoder = gst_vaapi_decoder_vp9_new (dpy, caps);
|
decode->decoder = gst_vaapi_decoder_vp9_new (dpy, caps);
|
||||||
break;
|
break;
|
||||||
#if USE_AV1_DECODER
|
#if GST_VAAPI_USE_AV1_DECODER
|
||||||
case GST_VAAPI_CODEC_AV1:
|
case GST_VAAPI_CODEC_AV1:
|
||||||
decode->decoder = gst_vaapi_decoder_av1_new (dpy, caps);
|
decode->decoder = gst_vaapi_decoder_av1_new (dpy, caps);
|
||||||
break;
|
break;
|
||||||
|
@ -96,7 +96,7 @@ static const char gst_vaapi_decode_bin_sink_caps_str[] =
|
|||||||
static const char gst_vaapi_decode_bin_src_caps_str[] =
|
static const char gst_vaapi_decode_bin_src_caps_str[] =
|
||||||
GST_VAAPI_MAKE_SURFACE_CAPS ", "
|
GST_VAAPI_MAKE_SURFACE_CAPS ", "
|
||||||
GST_CAPS_INTERLACED_FALSE "; "
|
GST_CAPS_INTERLACED_FALSE "; "
|
||||||
#if (USE_GLX || USE_EGL)
|
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
|
||||||
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS ", "
|
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS ", "
|
||||||
GST_CAPS_INTERLACED_FALSE "; "
|
GST_CAPS_INTERLACED_FALSE "; "
|
||||||
#endif
|
#endif
|
||||||
|
@ -698,7 +698,7 @@ gst_vaapi_plugin_base_create_pool (GstVaapiPluginBase * plugin, GstCaps * caps,
|
|||||||
gst_buffer_pool_config_add_option (config,
|
gst_buffer_pool_config_add_option (config,
|
||||||
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT);
|
GST_BUFFER_POOL_OPTION_VIDEO_ALIGNMENT);
|
||||||
}
|
}
|
||||||
#if (USE_GLX || USE_EGL)
|
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
|
||||||
if (options & GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_GL_TEXTURE_UPLOAD) {
|
if (options & GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_GL_TEXTURE_UPLOAD) {
|
||||||
gst_buffer_pool_config_add_option (config,
|
gst_buffer_pool_config_add_option (config,
|
||||||
GST_BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META);
|
GST_BUFFER_POOL_OPTION_VIDEO_GL_TEXTURE_UPLOAD_META);
|
||||||
@ -987,7 +987,7 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin,
|
|||||||
guint i, size, min, max, pool_options, num_allocators;
|
guint i, size, min, max, pool_options, num_allocators;
|
||||||
gint index_allocator;
|
gint index_allocator;
|
||||||
gboolean update_pool = FALSE;
|
gboolean update_pool = FALSE;
|
||||||
#if (USE_GLX || USE_EGL)
|
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
|
||||||
guint idx;
|
guint idx;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -999,7 +999,7 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin,
|
|||||||
if (gst_query_find_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL))
|
if (gst_query_find_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL))
|
||||||
pool_options |= GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_VIDEO_META;
|
pool_options |= GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_VIDEO_META;
|
||||||
|
|
||||||
#if (USE_GLX || USE_EGL)
|
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
|
||||||
if (gst_query_find_allocation_meta (query,
|
if (gst_query_find_allocation_meta (query,
|
||||||
GST_VIDEO_GL_TEXTURE_UPLOAD_META_API_TYPE, &idx) &&
|
GST_VIDEO_GL_TEXTURE_UPLOAD_META_API_TYPE, &idx) &&
|
||||||
gst_vaapi_caps_feature_contains (caps,
|
gst_vaapi_caps_feature_contains (caps,
|
||||||
@ -1328,13 +1328,13 @@ gst_vaapi_plugin_base_set_gl_context (GstVaapiPluginBase * plugin,
|
|||||||
gst_object_replace (&plugin->gl_context, object);
|
gst_object_replace (&plugin->gl_context, object);
|
||||||
|
|
||||||
switch (gst_gl_context_get_gl_platform (gl_context)) {
|
switch (gst_gl_context_get_gl_platform (gl_context)) {
|
||||||
#if USE_GLX
|
#if GST_VAAPI_USE_GLX
|
||||||
case GST_GL_PLATFORM_GLX:
|
case GST_GL_PLATFORM_GLX:
|
||||||
display_type = GST_VAAPI_DISPLAY_TYPE_GLX;
|
display_type = GST_VAAPI_DISPLAY_TYPE_GLX;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case GST_GL_PLATFORM_EGL:
|
case GST_GL_PLATFORM_EGL:
|
||||||
#if USE_EGL
|
#if GST_VAAPI_USE_EGL
|
||||||
display_type = GST_VAAPI_DISPLAY_TYPE_EGL;
|
display_type = GST_VAAPI_DISPLAY_TYPE_EGL;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
@ -1531,7 +1531,7 @@ void
|
|||||||
gst_vaapi_plugin_base_set_srcpad_can_dmabuf (GstVaapiPluginBase * plugin,
|
gst_vaapi_plugin_base_set_srcpad_can_dmabuf (GstVaapiPluginBase * plugin,
|
||||||
GstObject * object)
|
GstObject * object)
|
||||||
{
|
{
|
||||||
#if USE_EGL && USE_GST_GL_HELPERS
|
#if GST_VAAPI_USE_EGL && USE_GST_GL_HELPERS
|
||||||
GstVaapiPadPrivate *srcpriv = GST_VAAPI_PAD_PRIVATE (plugin->srcpad);
|
GstVaapiPadPrivate *srcpriv = GST_VAAPI_PAD_PRIVATE (plugin->srcpad);
|
||||||
GstGLContext *const gl_context = GST_GL_CONTEXT (object);
|
GstGLContext *const gl_context = GST_GL_CONTEXT (object);
|
||||||
|
|
||||||
|
@ -26,24 +26,24 @@
|
|||||||
#include "gstvaapivideocontext.h"
|
#include "gstvaapivideocontext.h"
|
||||||
#include <gst/vaapi/gstvaapiprofilecaps.h>
|
#include <gst/vaapi/gstvaapiprofilecaps.h>
|
||||||
#include <gst/vaapi/gstvaapiutils.h>
|
#include <gst/vaapi/gstvaapiutils.h>
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
# include <gst/vaapi/gstvaapidisplay_drm.h>
|
# include <gst/vaapi/gstvaapidisplay_drm.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
# include <gst/vaapi/gstvaapidisplay_x11.h>
|
# include <gst/vaapi/gstvaapidisplay_x11.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_GLX
|
#if GST_VAAPI_USE_GLX
|
||||||
# include <gst/vaapi/gstvaapidisplay_glx.h>
|
# include <gst/vaapi/gstvaapidisplay_glx.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_EGL
|
#if GST_VAAPI_USE_EGL
|
||||||
# include <gst/vaapi/gstvaapidisplay_egl.h>
|
# include <gst/vaapi/gstvaapidisplay_egl.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
# include <gst/vaapi/gstvaapidisplay_wayland.h>
|
# include <gst/vaapi/gstvaapidisplay_wayland.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_GST_GL_HELPERS
|
#if USE_GST_GL_HELPERS
|
||||||
# include <gst/gl/gl.h>
|
# include <gst/gl/gl.h>
|
||||||
#if USE_EGL && GST_GL_HAVE_PLATFORM_EGL
|
#if GST_VAAPI_USE_EGL && GST_GL_HAVE_PLATFORM_EGL
|
||||||
# include <gst/gl/egl/gstgldisplay_egl.h>
|
# include <gst/gl/egl/gstgldisplay_egl.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -66,28 +66,28 @@ typedef struct
|
|||||||
|
|
||||||
/* *INDENT-OFF* */
|
/* *INDENT-OFF* */
|
||||||
static const DisplayMap g_display_map[] = {
|
static const DisplayMap g_display_map[] = {
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
{"wayland",
|
{"wayland",
|
||||||
GST_VAAPI_DISPLAY_TYPE_WAYLAND,
|
GST_VAAPI_DISPLAY_TYPE_WAYLAND,
|
||||||
gst_vaapi_display_wayland_new,
|
gst_vaapi_display_wayland_new,
|
||||||
(GstVaapiDisplayCreateFromHandleFunc)
|
(GstVaapiDisplayCreateFromHandleFunc)
|
||||||
gst_vaapi_display_wayland_new_with_display},
|
gst_vaapi_display_wayland_new_with_display},
|
||||||
#endif
|
#endif
|
||||||
#if USE_GLX
|
#if GST_VAAPI_USE_GLX
|
||||||
{"glx",
|
{"glx",
|
||||||
GST_VAAPI_DISPLAY_TYPE_GLX,
|
GST_VAAPI_DISPLAY_TYPE_GLX,
|
||||||
gst_vaapi_display_glx_new,
|
gst_vaapi_display_glx_new,
|
||||||
(GstVaapiDisplayCreateFromHandleFunc)
|
(GstVaapiDisplayCreateFromHandleFunc)
|
||||||
gst_vaapi_display_glx_new_with_display},
|
gst_vaapi_display_glx_new_with_display},
|
||||||
#endif
|
#endif
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
{"x11",
|
{"x11",
|
||||||
GST_VAAPI_DISPLAY_TYPE_X11,
|
GST_VAAPI_DISPLAY_TYPE_X11,
|
||||||
gst_vaapi_display_x11_new,
|
gst_vaapi_display_x11_new,
|
||||||
(GstVaapiDisplayCreateFromHandleFunc)
|
(GstVaapiDisplayCreateFromHandleFunc)
|
||||||
gst_vaapi_display_x11_new_with_display},
|
gst_vaapi_display_x11_new_with_display},
|
||||||
#endif
|
#endif
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
{"drm",
|
{"drm",
|
||||||
GST_VAAPI_DISPLAY_TYPE_DRM,
|
GST_VAAPI_DISPLAY_TYPE_DRM,
|
||||||
gst_vaapi_display_drm_new},
|
gst_vaapi_display_drm_new},
|
||||||
@ -140,26 +140,26 @@ gst_vaapi_get_display_type_from_gl (GstGLDisplayType gl_display_type,
|
|||||||
GstGLPlatform gl_platform)
|
GstGLPlatform gl_platform)
|
||||||
{
|
{
|
||||||
switch (gl_display_type) {
|
switch (gl_display_type) {
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
case GST_GL_DISPLAY_TYPE_X11:{
|
case GST_GL_DISPLAY_TYPE_X11:{
|
||||||
#if USE_GLX
|
#if GST_VAAPI_USE_GLX
|
||||||
if (gl_platform == GST_GL_PLATFORM_GLX)
|
if (gl_platform == GST_GL_PLATFORM_GLX)
|
||||||
return GST_VAAPI_DISPLAY_TYPE_GLX;
|
return GST_VAAPI_DISPLAY_TYPE_GLX;
|
||||||
#endif
|
#endif
|
||||||
return GST_VAAPI_DISPLAY_TYPE_X11;
|
return GST_VAAPI_DISPLAY_TYPE_X11;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
case GST_GL_DISPLAY_TYPE_WAYLAND:{
|
case GST_GL_DISPLAY_TYPE_WAYLAND:{
|
||||||
return GST_VAAPI_DISPLAY_TYPE_WAYLAND;
|
return GST_VAAPI_DISPLAY_TYPE_WAYLAND;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if USE_EGL
|
#if GST_VAAPI_USE_EGL
|
||||||
case GST_GL_DISPLAY_TYPE_EGL:{
|
case GST_GL_DISPLAY_TYPE_EGL:{
|
||||||
return GST_VAAPI_DISPLAY_TYPE_EGL;
|
return GST_VAAPI_DISPLAY_TYPE_EGL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
case GST_GL_DISPLAY_TYPE_GBM:{
|
case GST_GL_DISPLAY_TYPE_GBM:{
|
||||||
return GST_VAAPI_DISPLAY_TYPE_DRM;
|
return GST_VAAPI_DISPLAY_TYPE_DRM;
|
||||||
}
|
}
|
||||||
@ -178,23 +178,23 @@ gst_vaapi_get_display_type_from_gl_env (void)
|
|||||||
const gchar *const gl_window_type = g_getenv ("GST_GL_WINDOW");
|
const gchar *const gl_window_type = g_getenv ("GST_GL_WINDOW");
|
||||||
|
|
||||||
if (!gl_window_type) {
|
if (!gl_window_type) {
|
||||||
#if USE_X11 && GST_GL_HAVE_WINDOW_X11
|
#if GST_VAAPI_USE_X11 && GST_GL_HAVE_WINDOW_X11
|
||||||
return GST_VAAPI_DISPLAY_TYPE_X11;
|
return GST_VAAPI_DISPLAY_TYPE_X11;
|
||||||
#elif USE_WAYLAND && GST_GL_HAVE_WINDOW_WAYLAND
|
#elif GST_VAAPI_USE_WAYLAND && GST_GL_HAVE_WINDOW_WAYLAND
|
||||||
return GST_VAAPI_DISPLAY_TYPE_WAYLAND;
|
return GST_VAAPI_DISPLAY_TYPE_WAYLAND;
|
||||||
#elif USE_EGL && GST_GL_HAVE_PLATFORM_EGL
|
#elif GST_VAAPI_USE_EGL && GST_GL_HAVE_PLATFORM_EGL
|
||||||
return GST_VAAPI_DISPLAY_TYPE_EGL;
|
return GST_VAAPI_DISPLAY_TYPE_EGL;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
if (g_strcmp0 (gl_window_type, "x11") == 0)
|
if (g_strcmp0 (gl_window_type, "x11") == 0)
|
||||||
return GST_VAAPI_DISPLAY_TYPE_X11;
|
return GST_VAAPI_DISPLAY_TYPE_X11;
|
||||||
#endif
|
#endif
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
if (g_strcmp0 (gl_window_type, "wayland") == 0)
|
if (g_strcmp0 (gl_window_type, "wayland") == 0)
|
||||||
return GST_VAAPI_DISPLAY_TYPE_WAYLAND;
|
return GST_VAAPI_DISPLAY_TYPE_WAYLAND;
|
||||||
#endif
|
#endif
|
||||||
#if USE_EGL
|
#if GST_VAAPI_USE_EGL
|
||||||
{
|
{
|
||||||
const gchar *const gl_platform_type = g_getenv ("GST_GL_PLATFORM");
|
const gchar *const gl_platform_type = g_getenv ("GST_GL_PLATFORM");
|
||||||
if (g_strcmp0 (gl_platform_type, "egl") == 0)
|
if (g_strcmp0 (gl_platform_type, "egl") == 0)
|
||||||
@ -205,7 +205,7 @@ gst_vaapi_get_display_type_from_gl_env (void)
|
|||||||
return GST_VAAPI_DISPLAY_TYPE_ANY;
|
return GST_VAAPI_DISPLAY_TYPE_ANY;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if USE_EGL
|
#if GST_VAAPI_USE_EGL
|
||||||
static gint
|
static gint
|
||||||
gst_vaapi_get_gles_version_from_gl_api (GstGLAPI gl_api)
|
gst_vaapi_get_gles_version_from_gl_api (GstGLAPI gl_api)
|
||||||
{
|
{
|
||||||
@ -236,7 +236,7 @@ gst_vaapi_get_egl_handle_from_gl_display (GstGLDisplay * gl_display)
|
|||||||
}
|
}
|
||||||
return egl_handle;
|
return egl_handle;
|
||||||
}
|
}
|
||||||
#endif /* USE_EGL */
|
#endif /* GST_VAAPI_USE_EGL */
|
||||||
|
|
||||||
static GstVaapiDisplay *
|
static GstVaapiDisplay *
|
||||||
gst_vaapi_create_display_from_egl (GstGLDisplay * gl_display,
|
gst_vaapi_create_display_from_egl (GstGLDisplay * gl_display,
|
||||||
@ -244,7 +244,7 @@ gst_vaapi_create_display_from_egl (GstGLDisplay * gl_display,
|
|||||||
gpointer native_display)
|
gpointer native_display)
|
||||||
{
|
{
|
||||||
GstVaapiDisplay *display = NULL;
|
GstVaapiDisplay *display = NULL;
|
||||||
#if USE_EGL
|
#if GST_VAAPI_USE_EGL
|
||||||
GstGLAPI gl_api;
|
GstGLAPI gl_api;
|
||||||
gint gles_version;
|
gint gles_version;
|
||||||
guintptr egl_handler;
|
guintptr egl_handler;
|
||||||
@ -917,10 +917,10 @@ gst_vaapi_create_test_display (void)
|
|||||||
guint i;
|
guint i;
|
||||||
GstVaapiDisplay *display = NULL;
|
GstVaapiDisplay *display = NULL;
|
||||||
const GstVaapiDisplayType test_display_map[] = {
|
const GstVaapiDisplayType test_display_map[] = {
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
GST_VAAPI_DISPLAY_TYPE_DRM,
|
GST_VAAPI_DISPLAY_TYPE_DRM,
|
||||||
#endif
|
#endif
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
GST_VAAPI_DISPLAY_TYPE_X11,
|
GST_VAAPI_DISPLAY_TYPE_X11,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -72,7 +72,7 @@ static const char gst_vaapipostproc_sink_caps_str[] =
|
|||||||
static const char gst_vaapipostproc_src_caps_str[] =
|
static const char gst_vaapipostproc_src_caps_str[] =
|
||||||
GST_VAAPI_MAKE_SURFACE_CAPS ", "
|
GST_VAAPI_MAKE_SURFACE_CAPS ", "
|
||||||
GST_CAPS_INTERLACED_FALSE "; "
|
GST_CAPS_INTERLACED_FALSE "; "
|
||||||
#if (USE_GLX || USE_EGL)
|
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
|
||||||
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS "; "
|
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS "; "
|
||||||
#endif
|
#endif
|
||||||
GST_VIDEO_CAPS_MAKE (GST_VAAPI_FORMATS_ALL) ", "
|
GST_VIDEO_CAPS_MAKE (GST_VAAPI_FORMATS_ALL) ", "
|
||||||
|
@ -177,7 +177,7 @@ gst_vaapisink_render_surface (GstVaapiSink * sink, GstVaapiSurface * surface,
|
|||||||
/* --- DRM Backend --- */
|
/* --- DRM Backend --- */
|
||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
#include <gst/vaapi/gstvaapidisplay_drm.h>
|
#include <gst/vaapi/gstvaapidisplay_drm.h>
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -212,7 +212,7 @@ gst_vaapisink_backend_drm (void)
|
|||||||
/* --- X11 Backend --- */
|
/* --- X11 Backend --- */
|
||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
#include <gst/vaapi/gstvaapidisplay_x11.h>
|
#include <gst/vaapi/gstvaapidisplay_x11.h>
|
||||||
#include <gst/vaapi/gstvaapiwindow_x11.h>
|
#include <gst/vaapi/gstvaapiwindow_x11.h>
|
||||||
|
|
||||||
@ -528,7 +528,7 @@ gst_vaapisink_backend_x11 (void)
|
|||||||
/* --- Wayland Backend --- */
|
/* --- Wayland Backend --- */
|
||||||
/* ------------------------------------------------------------------------ */
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
#include <gst/vaapi/gstvaapidisplay_wayland.h>
|
#include <gst/vaapi/gstvaapidisplay_wayland.h>
|
||||||
#include <gst/vaapi/gstvaapiwindow_wayland.h>
|
#include <gst/vaapi/gstvaapiwindow_wayland.h>
|
||||||
|
|
||||||
@ -1021,22 +1021,22 @@ static void
|
|||||||
gst_vaapisink_ensure_backend (GstVaapiSink * sink)
|
gst_vaapisink_ensure_backend (GstVaapiSink * sink)
|
||||||
{
|
{
|
||||||
switch (GST_VAAPI_PLUGIN_BASE_DISPLAY_TYPE (sink)) {
|
switch (GST_VAAPI_PLUGIN_BASE_DISPLAY_TYPE (sink)) {
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
case GST_VAAPI_DISPLAY_TYPE_DRM:
|
case GST_VAAPI_DISPLAY_TYPE_DRM:
|
||||||
sink->backend = gst_vaapisink_backend_drm ();
|
sink->backend = gst_vaapisink_backend_drm ();
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
case GST_VAAPI_DISPLAY_TYPE_X11:
|
case GST_VAAPI_DISPLAY_TYPE_X11:
|
||||||
sink->backend = gst_vaapisink_backend_x11 ();
|
sink->backend = gst_vaapisink_backend_x11 ();
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if USE_GLX
|
#if GST_VAAPI_USE_GLX
|
||||||
case GST_VAAPI_DISPLAY_TYPE_GLX:
|
case GST_VAAPI_DISPLAY_TYPE_GLX:
|
||||||
sink->backend = gst_vaapisink_backend_x11 ();
|
sink->backend = gst_vaapisink_backend_x11 ();
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
case GST_VAAPI_DISPLAY_TYPE_WAYLAND:
|
case GST_VAAPI_DISPLAY_TYPE_WAYLAND:
|
||||||
sink->backend = gst_vaapisink_backend_wayland ();
|
sink->backend = gst_vaapisink_backend_wayland ();
|
||||||
break;
|
break;
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include "gstvaapivideobuffer.h"
|
#include "gstvaapivideobuffer.h"
|
||||||
#include "gstvaapivideomemory.h"
|
#include "gstvaapivideomemory.h"
|
||||||
#include "gstvaapipluginutil.h"
|
#include "gstvaapipluginutil.h"
|
||||||
#if (USE_GLX || USE_EGL)
|
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
|
||||||
#include "gstvaapivideometa_texture.h"
|
#include "gstvaapivideometa_texture.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -431,7 +431,7 @@ gst_vaapi_video_buffer_pool_alloc_buffer (GstBufferPool * pool,
|
|||||||
|
|
||||||
GST_META_FLAG_SET (vmeta, GST_META_FLAG_POOLED);
|
GST_META_FLAG_SET (vmeta, GST_META_FLAG_POOLED);
|
||||||
}
|
}
|
||||||
#if (USE_GLX || USE_EGL)
|
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
|
||||||
if (priv->options & GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_GL_TEXTURE_UPLOAD) {
|
if (priv->options & GST_VAAPI_VIDEO_BUFFER_POOL_OPTION_GL_TEXTURE_UPLOAD) {
|
||||||
GstMeta *tex_meta = gst_buffer_add_texture_upload_meta (buffer);
|
GstMeta *tex_meta = gst_buffer_add_texture_upload_meta (buffer);
|
||||||
if (tex_meta)
|
if (tex_meta)
|
||||||
|
@ -28,13 +28,13 @@
|
|||||||
#if USE_GST_GL_HELPERS
|
#if USE_GST_GL_HELPERS
|
||||||
# include <gst/gl/gl.h>
|
# include <gst/gl/gl.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
#include <gst/vaapi/gstvaapidisplay_x11.h>
|
#include <gst/vaapi/gstvaapidisplay_x11.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
#include <gst/vaapi/gstvaapidisplay_wayland.h>
|
#include <gst/vaapi/gstvaapidisplay_wayland.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
#include <gst/vaapi/gstvaapidisplay_drm.h>
|
#include <gst/vaapi/gstvaapidisplay_drm.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ gst_vaapi_video_context_get_display (GstContext * context, gboolean app_context,
|
|||||||
|
|
||||||
if (gst_structure_get (structure, "va-display", G_TYPE_POINTER, &va_display,
|
if (gst_structure_get (structure, "va-display", G_TYPE_POINTER, &va_display,
|
||||||
NULL)) {
|
NULL)) {
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
Display *x11_display = NULL;
|
Display *x11_display = NULL;
|
||||||
if (gst_structure_get (structure, "x11-display", G_TYPE_POINTER,
|
if (gst_structure_get (structure, "x11-display", G_TYPE_POINTER,
|
||||||
&x11_display, NULL)) {
|
&x11_display, NULL)) {
|
||||||
@ -112,7 +112,7 @@ gst_vaapi_video_context_get_display (GstContext * context, gboolean app_context,
|
|||||||
gst_vaapi_display_x11_new_with_va_display (va_display, x11_display);
|
gst_vaapi_display_x11_new_with_va_display (va_display, x11_display);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
if (!display) {
|
if (!display) {
|
||||||
struct wl_display *wl_display = NULL;
|
struct wl_display *wl_display = NULL;
|
||||||
if (gst_structure_get (structure, "wl-display", G_TYPE_POINTER,
|
if (gst_structure_get (structure, "wl-display", G_TYPE_POINTER,
|
||||||
@ -123,7 +123,7 @@ gst_vaapi_video_context_get_display (GstContext * context, gboolean app_context,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
if (!display) {
|
if (!display) {
|
||||||
gint fd = -1;
|
gint fd = -1;
|
||||||
if (gst_structure_get (structure, "drm-device-fd", G_TYPE_INT, &fd,
|
if (gst_structure_get (structure, "drm-device-fd", G_TYPE_INT, &fd,
|
||||||
|
@ -30,13 +30,13 @@
|
|||||||
#include "gstvaapivideometa_texture.h"
|
#include "gstvaapivideometa_texture.h"
|
||||||
#include "gstvaapipluginutil.h"
|
#include "gstvaapipluginutil.h"
|
||||||
|
|
||||||
#if USE_GLX
|
#if GST_VAAPI_USE_GLX
|
||||||
#include <gst/vaapi/gstvaapitexture_glx.h>
|
#include <gst/vaapi/gstvaapitexture_glx.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DEFAULT_FORMAT GST_VIDEO_FORMAT_RGBA
|
#define DEFAULT_FORMAT GST_VIDEO_FORMAT_RGBA
|
||||||
|
|
||||||
#if (USE_GLX || USE_EGL)
|
#if (GST_VAAPI_USE_GLX || GST_VAAPI_USE_EGL)
|
||||||
struct _GstVaapiVideoMetaTexture
|
struct _GstVaapiVideoMetaTexture
|
||||||
{
|
{
|
||||||
GstVaapiTexture *texture;
|
GstVaapiTexture *texture;
|
||||||
|
@ -188,14 +188,14 @@ cdata.set_quoted('PACKAGE_NAME', 'GStreamer VA-API Plug-ins')
|
|||||||
cdata.set_quoted('PACKAGE_STRING', 'GStreamer VA-API Plug-ins @0@'.format(gst_version))
|
cdata.set_quoted('PACKAGE_STRING', 'GStreamer VA-API Plug-ins @0@'.format(gst_version))
|
||||||
cdata.set_quoted('PACKAGE_BUGREPORT', get_option('package-origin'))
|
cdata.set_quoted('PACKAGE_BUGREPORT', get_option('package-origin'))
|
||||||
cdata.set_quoted('VA_DRIVERS_PATH', '@0@'.format(driverdir))
|
cdata.set_quoted('VA_DRIVERS_PATH', '@0@'.format(driverdir))
|
||||||
cdata.set10('USE_DRM', USE_DRM)
|
cdata.set10('GST_VAAPI_USE_DRM', USE_DRM)
|
||||||
cdata.set10('USE_EGL', USE_EGL)
|
cdata.set10('GST_VAAPI_USE_EGL', USE_EGL)
|
||||||
cdata.set10('USE_ENCODERS', USE_ENCODERS)
|
cdata.set10('GST_VAAPI_USE_ENCODERS', USE_ENCODERS)
|
||||||
cdata.set10('USE_GLX', USE_GLX)
|
cdata.set10('GST_VAAPI_USE_GLX', USE_GLX)
|
||||||
cdata.set10('USE_VP9_ENCODER', USE_VP9_ENCODER)
|
cdata.set10('GST_VAAPI_USE_VP9_ENCODER', USE_VP9_ENCODER)
|
||||||
cdata.set10('USE_AV1_DECODER', USE_AV1_DECODER)
|
cdata.set10('GST_VAAPI_USE_AV1_DECODER', USE_AV1_DECODER)
|
||||||
cdata.set10('USE_WAYLAND', USE_WAYLAND)
|
cdata.set10('GST_VAAPI_USE_WAYLAND', USE_WAYLAND)
|
||||||
cdata.set10('USE_X11', USE_X11)
|
cdata.set10('GST_VAAPI_USE_X11', USE_X11)
|
||||||
cdata.set10('HAVE_XKBLIB', cc.has_header('X11/XKBlib.h', dependencies: x11_dep))
|
cdata.set10('HAVE_XKBLIB', cc.has_header('X11/XKBlib.h', dependencies: x11_dep))
|
||||||
cdata.set10('HAVE_XRANDR', xrandr_dep.found())
|
cdata.set10('HAVE_XRANDR', xrandr_dep.found())
|
||||||
cdata.set10('USE_GST_GL_HELPERS', gstgl_dep.found())
|
cdata.set10('USE_GST_GL_HELPERS', gstgl_dep.found())
|
||||||
|
@ -22,23 +22,23 @@
|
|||||||
|
|
||||||
#include "gst/vaapi/sysdeps.h"
|
#include "gst/vaapi/sysdeps.h"
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
# include <gst/vaapi/gstvaapidisplay_drm.h>
|
# include <gst/vaapi/gstvaapidisplay_drm.h>
|
||||||
# include <gst/vaapi/gstvaapiwindow_drm.h>
|
# include <gst/vaapi/gstvaapiwindow_drm.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
# include <gst/vaapi/gstvaapidisplay_x11.h>
|
# include <gst/vaapi/gstvaapidisplay_x11.h>
|
||||||
# include <gst/vaapi/gstvaapiwindow_x11.h>
|
# include <gst/vaapi/gstvaapiwindow_x11.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_GLX
|
#if GST_VAAPI_USE_GLX
|
||||||
# include <gst/vaapi/gstvaapidisplay_glx.h>
|
# include <gst/vaapi/gstvaapidisplay_glx.h>
|
||||||
# include <gst/vaapi/gstvaapiwindow_glx.h>
|
# include <gst/vaapi/gstvaapiwindow_glx.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_EGL
|
#if GST_VAAPI_USE_EGL
|
||||||
# include <gst/vaapi/gstvaapidisplay_egl.h>
|
# include <gst/vaapi/gstvaapidisplay_egl.h>
|
||||||
# include <gst/vaapi/gstvaapiwindow_egl.h>
|
# include <gst/vaapi/gstvaapiwindow_egl.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
# include <gst/vaapi/gstvaapidisplay_wayland.h>
|
# include <gst/vaapi/gstvaapidisplay_wayland.h>
|
||||||
# include <gst/vaapi/gstvaapiwindow_wayland.h>
|
# include <gst/vaapi/gstvaapiwindow_wayland.h>
|
||||||
#endif
|
#endif
|
||||||
@ -47,22 +47,22 @@
|
|||||||
static const VideoOutputInfo *g_video_output;
|
static const VideoOutputInfo *g_video_output;
|
||||||
static const VideoOutputInfo g_video_outputs[] = {
|
static const VideoOutputInfo g_video_outputs[] = {
|
||||||
/* Video outputs are sorted in test order for automatic characterisation */
|
/* Video outputs are sorted in test order for automatic characterisation */
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
{"wayland",
|
{"wayland",
|
||||||
gst_vaapi_display_wayland_new,
|
gst_vaapi_display_wayland_new,
|
||||||
gst_vaapi_window_wayland_new},
|
gst_vaapi_window_wayland_new},
|
||||||
#endif
|
#endif
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
{"x11",
|
{"x11",
|
||||||
gst_vaapi_display_x11_new,
|
gst_vaapi_display_x11_new,
|
||||||
gst_vaapi_window_x11_new},
|
gst_vaapi_window_x11_new},
|
||||||
#endif
|
#endif
|
||||||
#if USE_GLX
|
#if GST_VAAPI_USE_GLX
|
||||||
{"glx",
|
{"glx",
|
||||||
gst_vaapi_display_glx_new,
|
gst_vaapi_display_glx_new,
|
||||||
gst_vaapi_window_glx_new},
|
gst_vaapi_window_glx_new},
|
||||||
#endif
|
#endif
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
{"drm",
|
{"drm",
|
||||||
gst_vaapi_display_drm_new,
|
gst_vaapi_display_drm_new,
|
||||||
gst_vaapi_window_drm_new},
|
gst_vaapi_window_drm_new},
|
||||||
@ -188,7 +188,7 @@ video_output_create_display (const gchar * display_name)
|
|||||||
display = o->create_display (display_name);
|
display = o->create_display (display_name);
|
||||||
|
|
||||||
if (g_egl_mode) {
|
if (g_egl_mode) {
|
||||||
#if USE_EGL
|
#if GST_VAAPI_USE_EGL
|
||||||
egl_display = gst_vaapi_display_egl_new (display, g_gles_version);
|
egl_display = gst_vaapi_display_egl_new (display, g_gles_version);
|
||||||
#else
|
#else
|
||||||
egl_display = NULL;
|
egl_display = NULL;
|
||||||
@ -211,7 +211,7 @@ video_output_create_window (GstVaapiDisplay * display, guint width,
|
|||||||
if (!g_video_output)
|
if (!g_video_output)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
#if USE_EGL
|
#if GST_VAAPI_USE_EGL
|
||||||
if (g_egl_mode)
|
if (g_egl_mode)
|
||||||
window = gst_vaapi_window_egl_new (display, width, height);
|
window = gst_vaapi_window_egl_new (display, width, height);
|
||||||
else
|
else
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#include "gst/vaapi/sysdeps.h"
|
#include "gst/vaapi/sysdeps.h"
|
||||||
#include <gst/video/video.h>
|
#include <gst/video/video.h>
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
# include <gst/vaapi/gstvaapidisplay_drm.h>
|
# include <gst/vaapi/gstvaapidisplay_drm.h>
|
||||||
# include <va/va_drm.h>
|
# include <va/va_drm.h>
|
||||||
# include <fcntl.h>
|
# include <fcntl.h>
|
||||||
@ -34,16 +34,16 @@
|
|||||||
# define DRM_DEVICE_PATH "/dev/dri/card0"
|
# define DRM_DEVICE_PATH "/dev/dri/card0"
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
# include <gst/vaapi/gstvaapidisplay_x11.h>
|
# include <gst/vaapi/gstvaapidisplay_x11.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_GLX
|
#if GST_VAAPI_USE_GLX
|
||||||
# include <gst/vaapi/gstvaapidisplay_glx.h>
|
# include <gst/vaapi/gstvaapidisplay_glx.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
# include <gst/vaapi/gstvaapidisplay_wayland.h>
|
# include <gst/vaapi/gstvaapidisplay_wayland.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_EGL
|
#if GST_VAAPI_USE_EGL
|
||||||
# include <gst/vaapi/gstvaapidisplay_egl.h>
|
# include <gst/vaapi/gstvaapidisplay_egl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -205,14 +205,14 @@ int
|
|||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
GstVaapiDisplay *display;
|
GstVaapiDisplay *display;
|
||||||
#if USE_GLX || USE_WAYLAND
|
#if GST_VAAPI_USE_GLX || GST_VAAPI_USE_WAYLAND
|
||||||
guint width, height;
|
guint width, height;
|
||||||
guint par_n, par_d;
|
guint par_n, par_d;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gst_init (&argc, &argv);
|
gst_init (&argc, &argv);
|
||||||
|
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
g_print ("#\n");
|
g_print ("#\n");
|
||||||
g_print ("# Create display with gst_vaapi_display_drm_new()\n");
|
g_print ("# Create display with gst_vaapi_display_drm_new()\n");
|
||||||
g_print ("#\n");
|
g_print ("#\n");
|
||||||
@ -273,7 +273,7 @@ main (int argc, char *argv[])
|
|||||||
g_print ("\n");
|
g_print ("\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
g_print ("#\n");
|
g_print ("#\n");
|
||||||
g_print ("# Create display with gst_vaapi_display_x11_new()\n");
|
g_print ("# Create display with gst_vaapi_display_x11_new()\n");
|
||||||
g_print ("#\n");
|
g_print ("#\n");
|
||||||
@ -331,7 +331,7 @@ main (int argc, char *argv[])
|
|||||||
g_print ("\n");
|
g_print ("\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_GLX
|
#if GST_VAAPI_USE_GLX
|
||||||
g_print ("#\n");
|
g_print ("#\n");
|
||||||
g_print ("# Create display with gst_vaapi_display_glx_new()\n");
|
g_print ("# Create display with gst_vaapi_display_glx_new()\n");
|
||||||
g_print ("#\n");
|
g_print ("#\n");
|
||||||
@ -400,7 +400,7 @@ main (int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
g_print ("#\n");
|
g_print ("#\n");
|
||||||
g_print ("# Create display with gst_vaapi_display_wayland_new()\n");
|
g_print ("# Create display with gst_vaapi_display_wayland_new()\n");
|
||||||
g_print ("#\n");
|
g_print ("#\n");
|
||||||
|
@ -25,19 +25,19 @@
|
|||||||
#include "gst/vaapi/sysdeps.h"
|
#include "gst/vaapi/sysdeps.h"
|
||||||
#include <gst/vaapi/gstvaapisurface.h>
|
#include <gst/vaapi/gstvaapisurface.h>
|
||||||
#include <gst/vaapi/gstvaapiimage.h>
|
#include <gst/vaapi/gstvaapiimage.h>
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
# include <gst/vaapi/gstvaapidisplay_drm.h>
|
# include <gst/vaapi/gstvaapidisplay_drm.h>
|
||||||
# include <gst/vaapi/gstvaapiwindow_drm.h>
|
# include <gst/vaapi/gstvaapiwindow_drm.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
# include <gst/vaapi/gstvaapidisplay_x11.h>
|
# include <gst/vaapi/gstvaapidisplay_x11.h>
|
||||||
# include <gst/vaapi/gstvaapiwindow_x11.h>
|
# include <gst/vaapi/gstvaapiwindow_x11.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
# include <gst/vaapi/gstvaapidisplay_wayland.h>
|
# include <gst/vaapi/gstvaapidisplay_wayland.h>
|
||||||
# include <gst/vaapi/gstvaapiwindow_wayland.h>
|
# include <gst/vaapi/gstvaapiwindow_wayland.h>
|
||||||
#endif
|
#endif
|
||||||
#if USE_EGL
|
#if GST_VAAPI_USE_EGL
|
||||||
# include <gst/vaapi/gstvaapidisplay_egl.h>
|
# include <gst/vaapi/gstvaapidisplay_egl.h>
|
||||||
# include <gst/vaapi/gstvaapiwindow_egl.h>
|
# include <gst/vaapi/gstvaapiwindow_egl.h>
|
||||||
#endif
|
#endif
|
||||||
@ -108,7 +108,7 @@ main (int argc, char *argv[])
|
|||||||
|
|
||||||
gst_init (&argc, &argv);
|
gst_init (&argc, &argv);
|
||||||
|
|
||||||
#if USE_DRM
|
#if GST_VAAPI_USE_DRM
|
||||||
display = gst_vaapi_display_drm_new (NULL);
|
display = gst_vaapi_display_drm_new (NULL);
|
||||||
if (!display)
|
if (!display)
|
||||||
g_error ("could not create Gst/VA (DRM) display");
|
g_error ("could not create Gst/VA (DRM) display");
|
||||||
@ -138,7 +138,7 @@ main (int argc, char *argv[])
|
|||||||
gst_object_unref (display);
|
gst_object_unref (display);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_X11
|
#if GST_VAAPI_USE_X11
|
||||||
display = gst_vaapi_display_x11_new (NULL);
|
display = gst_vaapi_display_x11_new (NULL);
|
||||||
if (!display)
|
if (!display)
|
||||||
g_error ("could not create Gst/VA display");
|
g_error ("could not create Gst/VA display");
|
||||||
@ -203,7 +203,7 @@ main (int argc, char *argv[])
|
|||||||
gst_object_unref (display);
|
gst_object_unref (display);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_WAYLAND
|
#if GST_VAAPI_USE_WAYLAND
|
||||||
display = gst_vaapi_display_wayland_new (NULL);
|
display = gst_vaapi_display_wayland_new (NULL);
|
||||||
if (!display)
|
if (!display)
|
||||||
g_error ("could not create Gst/VA (Wayland) display");
|
g_error ("could not create Gst/VA (Wayland) display");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user