...
 
Commits (47)
This diff is collapsed.
This diff is collapsed.
# gstreamer-vaapi package version number
m4_define([gst_vaapi_major_version], [1])
m4_define([gst_vaapi_minor_version], [14])
m4_define([gst_vaapi_micro_version], [0])
m4_define([gst_vaapi_micro_version], [5])
m4_define([gst_vaapi_nano_version], [0])
m4_define([gst_vaapi_version],
[gst_vaapi_major_version.gst_vaapi_minor_version.gst_vaapi_micro_version])
......@@ -16,17 +16,17 @@ dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
dnl - interfaces added -> increment AGE
dnl - interfaces removed -> AGE = 0
# gstreamer-vaapi library (libtool) version number
m4_define([gst_vaapi_lt_current], [1400])
m4_define([gst_vaapi_lt_current], [1405])
m4_define([gst_vaapi_lt_revision], [0])
m4_define([gst_vaapi_lt_age], [1400])
m4_define([gst_vaapi_lt_age], [1405])
# glib version number
m4_define([glib_version], [2.40])
# gstreamer version number
m4_define([gst_version], [1.14.0])
m4_define([gst_plugins_base_version], [1.14.0])
m4_define([gst_plugins_bad_version], [1.14.0])
m4_define([gst_version], [1.14.5])
m4_define([gst_plugins_base_version], [1.14.5])
m4_define([gst_plugins_bad_version], [1.14.5])
# Wayland minimum version number
m4_define([wayland_api_version], [1.0.2])
......
This diff is collapsed.
......@@ -12,8 +12,6 @@ gstvaapi_baseutils = static_library('gstvaapi-baseutils-@0@'.format(api_version)
gstvaapi_baseutils_sources,
c_args : gstreamer_vaapi_args,
include_directories: [configinc, libsinc],
version : libversion,
soversion : soversion,
dependencies : gstvaapi_baseutils_deps,
)
......
......@@ -469,8 +469,12 @@ ensure_profiles (GstVaapiDisplay * display)
VAStatus status;
gboolean success = FALSE;
if (priv->has_profiles)
GST_VAAPI_DISPLAY_LOCK (display);
if (priv->has_profiles) {
GST_VAAPI_DISPLAY_UNLOCK (display);
return TRUE;
}
priv->decoders = g_array_new (FALSE, FALSE, sizeof (GstVaapiConfig));
if (!priv->decoders)
......@@ -553,6 +557,7 @@ ensure_profiles (GstVaapiDisplay * display)
cleanup:
g_free (profiles);
g_free (entrypoints);
GST_VAAPI_DISPLAY_UNLOCK (display);
return success;
}
......@@ -654,8 +659,11 @@ ensure_image_formats (GstVaapiDisplay * display)
gint i, n;
gboolean success = FALSE;
if (priv->image_formats)
GST_VAAPI_DISPLAY_LOCK (display);
if (priv->image_formats) {
GST_VAAPI_DISPLAY_UNLOCK (display);
return TRUE;
}
priv->image_formats = g_array_new (FALSE, FALSE, sizeof (GstVaapiFormatInfo));
if (!priv->image_formats)
......@@ -681,6 +689,7 @@ ensure_image_formats (GstVaapiDisplay * display)
cleanup:
g_free (formats);
GST_VAAPI_DISPLAY_UNLOCK (display);
return success;
}
......@@ -695,8 +704,11 @@ ensure_subpicture_formats (GstVaapiDisplay * display)
guint i, n;
gboolean success = FALSE;
if (priv->subpicture_formats)
GST_VAAPI_DISPLAY_LOCK (display);
if (priv->subpicture_formats) {
GST_VAAPI_DISPLAY_UNLOCK (display);
return TRUE;
}
priv->subpicture_formats =
g_array_new (FALSE, FALSE, sizeof (GstVaapiFormatInfo));
......@@ -730,6 +742,7 @@ ensure_subpicture_formats (GstVaapiDisplay * display)
cleanup:
g_free (formats);
g_free (flags);
GST_VAAPI_DISPLAY_UNLOCK (display);
return success;
}
......@@ -832,7 +845,8 @@ gst_vaapi_display_destroy (GstVaapiDisplay * display)
}
if (priv->display) {
vaTerminate (priv->display);
if (!priv->parent)
vaTerminate (priv->display);
priv->display = NULL;
}
......@@ -847,6 +861,8 @@ gst_vaapi_display_destroy (GstVaapiDisplay * display)
g_free (priv->vendor_string);
priv->vendor_string = NULL;
gst_vaapi_display_replace_internal (&priv->parent, NULL);
}
static gboolean
......@@ -893,8 +909,10 @@ gst_vaapi_display_create_unlocked (GstVaapiDisplay * display,
if (!priv->display)
return FALSE;
if (!vaapi_initialize (priv->display))
return FALSE;
if (!priv->parent) {
if (!vaapi_initialize (priv->display))
return FALSE;
}
GST_INFO_OBJECT (display, "new display addr=%p", display);
g_free (priv->display_name);
......@@ -914,6 +932,8 @@ gst_vaapi_display_lock_default (GstVaapiDisplay * display)
{
GstVaapiDisplayPrivate *priv = GST_VAAPI_DISPLAY_GET_PRIVATE (display);
if (priv->parent)
priv = GST_VAAPI_DISPLAY_GET_PRIVATE (priv->parent);
g_rec_mutex_lock (&priv->mutex);
}
......@@ -922,6 +942,8 @@ gst_vaapi_display_unlock_default (GstVaapiDisplay * display)
{
GstVaapiDisplayPrivate *priv = GST_VAAPI_DISPLAY_GET_PRIVATE (display);
if (priv->parent)
priv = GST_VAAPI_DISPLAY_GET_PRIVATE (priv->parent);
g_rec_mutex_unlock (&priv->mutex);
}
......
......@@ -50,6 +50,7 @@ typedef struct
gpointer display;
guint display_type;
guint gles_version;
gpointer gl_display;
} InitParams;
static gboolean
......@@ -97,27 +98,34 @@ static gboolean
gst_vaapi_display_egl_bind_display (GstVaapiDisplay * base_display,
gpointer native_params)
{
GstVaapiDisplay *native_display = NULL;
GstVaapiDisplay *native_vaapi_display;
GstVaapiDisplayEGL *display = GST_VAAPI_DISPLAY_EGL (base_display);
EglDisplay *egl_display;
EGLDisplay *native_egl_display;
guint gl_platform = EGL_PLATFORM_UNKNOWN;
const InitParams *params = (InitParams *) native_params;
GstVaapiDisplayPrivate *const priv = GST_VAAPI_DISPLAY_GET_PRIVATE (display);
if (params->display) {
native_display = params->display;
} else {
native_vaapi_display = params->display;
native_egl_display = params->gl_display;
if (!native_vaapi_display) {
#if USE_X11
native_display = gst_vaapi_display_x11_new (NULL);
if (params->display_type == GST_VAAPI_DISPLAY_TYPE_ANY
|| params->display_type == GST_VAAPI_DISPLAY_TYPE_X11
|| params->display_type == GST_VAAPI_DISPLAY_TYPE_EGL)
native_vaapi_display = gst_vaapi_display_x11_new (NULL);
#endif
#if USE_WAYLAND
if (!native_display)
native_display = gst_vaapi_display_wayland_new (NULL);
if (!native_vaapi_display)
native_vaapi_display = gst_vaapi_display_wayland_new (NULL);
#endif
}
if (!native_display)
if (!native_vaapi_display)
return FALSE;
gst_vaapi_display_replace (&display->display, native_display);
gst_vaapi_display_replace (&display->display, native_vaapi_display);
priv->parent = native_vaapi_display;
switch (GST_VAAPI_DISPLAY_GET_CLASS_TYPE (display->display)) {
case GST_VAAPI_DISPLAY_TYPE_X11:
......@@ -130,8 +138,12 @@ gst_vaapi_display_egl_bind_display (GstVaapiDisplay * base_display,
break;
}
egl_display = egl_display_new (GST_VAAPI_DISPLAY_NATIVE (display->display),
gl_platform);
if (native_egl_display) {
egl_display = egl_display_new_wrapped (native_egl_display);
} else {
egl_display = egl_display_new (GST_VAAPI_DISPLAY_NATIVE (display->display),
gl_platform);
}
if (!egl_display)
return FALSE;
......@@ -351,16 +363,14 @@ gst_vaapi_display_egl_class_init (GstVaapiDisplayEGLClass * klass)
GstVaapiDisplay *
gst_vaapi_display_egl_new (GstVaapiDisplay * display, guint gles_version)
{
InitParams params;
InitParams params = {
.gles_version = gles_version,
};
if (display) {
params.display = display;
params.display = gst_object_ref (display);
params.display_type = GST_VAAPI_DISPLAY_VADISPLAY_TYPE (display);
} else {
params.display = NULL;
params.display_type = GST_VAAPI_DISPLAY_TYPE_ANY;
}
params.gles_version = gles_version;
return gst_vaapi_display_new (g_object_new (GST_TYPE_VAAPI_DISPLAY_EGL, NULL),
GST_VAAPI_DISPLAY_INIT_FROM_NATIVE_DISPLAY, &params);
}
......@@ -385,13 +395,14 @@ GstVaapiDisplay *
gst_vaapi_display_egl_new_with_native_display (gpointer native_display,
GstVaapiDisplayType display_type, guint gles_version)
{
InitParams params;
InitParams params = {
.display_type = display_type,
.gl_display = native_display,
.gles_version = gles_version,
};
g_return_val_if_fail (native_display != NULL, NULL);
params.display = native_display;
params.display_type = display_type;
params.gles_version = gles_version;
return gst_vaapi_display_new (g_object_new (GST_TYPE_VAAPI_DISPLAY_EGL, NULL),
GST_VAAPI_DISPLAY_INIT_FROM_NATIVE_DISPLAY, &params);
}
......
......@@ -109,6 +109,7 @@ typedef enum _GstVaapiDisplayInitType GstVaapiDisplayInitType;
struct _GstVaapiDisplayPrivate
{
GstVaapiDisplay *parent;
GRecMutex mutex;
gchar *display_name;
VADisplay display;
......
......@@ -329,6 +329,8 @@ gst_vaapi_encoder_ensure_param_roi_regions (GstVaapiEncoder * encoder,
roi = (GstVideoRegionOfInterestMeta *)
gst_buffer_iterate_meta_filtered (input, &state,
GST_VIDEO_REGION_OF_INTEREST_META_API_TYPE);
if (!roi)
continue;
/* ignore roi if overflow */
if ((roi->x > G_MAXINT16) || (roi->y > G_MAXINT16)
......
......@@ -2716,6 +2716,7 @@ reset_properties (GstVaapiEncoderH264 * encoder)
{
GstVaapiEncoder *const base_encoder = GST_VAAPI_ENCODER_CAST (encoder);
guint mb_size, i;
gboolean ret;
if (encoder->idr_period < base_encoder->keyframe_period)
encoder->idr_period = base_encoder->keyframe_period;
......@@ -2725,8 +2726,9 @@ reset_properties (GstVaapiEncoderH264 * encoder)
encoder->qp_i = encoder->init_qp;
mb_size = encoder->mb_width * encoder->mb_height;
g_assert (gst_vaapi_encoder_ensure_num_slices (base_encoder, encoder->profile,
encoder->entrypoint, (mb_size + 1) / 2, &encoder->num_slices));
ret = gst_vaapi_encoder_ensure_num_slices (base_encoder, encoder->profile,
encoder->entrypoint, (mb_size + 1) / 2, &encoder->num_slices);
g_assert (ret);
if (encoder->num_bframes > (base_encoder->keyframe_period + 1) / 2)
encoder->num_bframes = (base_encoder->keyframe_period + 1) / 2;
......
......@@ -181,8 +181,8 @@ h265_get_log2_max_pic_order_cnt (guint num)
}
if (ret <= 4)
ret = 4;
else if (ret > 10)
ret = 10;
else if (ret > 16)
ret = 16;
/* must be greater than 4 */
return ret;
}
......@@ -2023,6 +2023,7 @@ reset_properties (GstVaapiEncoderH265 * encoder)
GstVaapiH265ReorderPool *reorder_pool;
GstVaapiH265RefPool *ref_pool;
guint ctu_size;
gboolean ret;
if (encoder->idr_period < base_encoder->keyframe_period)
encoder->idr_period = base_encoder->keyframe_period;
......@@ -2032,9 +2033,10 @@ reset_properties (GstVaapiEncoderH265 * encoder)
encoder->qp_i = encoder->init_qp;
ctu_size = encoder->ctu_width * encoder->ctu_height;
g_assert (gst_vaapi_encoder_ensure_num_slices (base_encoder, encoder->profile,
GST_VAAPI_ENTRYPOINT_SLICE_ENCODE, (ctu_size + 1) / 2,
&encoder->num_slices));
ret = gst_vaapi_encoder_ensure_num_slices (base_encoder, encoder->profile,
GST_VAAPI_ENTRYPOINT_SLICE_ENCODE, (ctu_size + 1) / 2,
&encoder->num_slices);
g_assert (ret);
gst_vaapi_encoder_ensure_max_num_ref_frames (base_encoder, encoder->profile,
GST_VAAPI_ENTRYPOINT_SLICE_ENCODE);
......
......@@ -22,8 +22,11 @@
#include "sysdeps.h"
#include "gstvaapiutils_egl.h"
#if USE_GST_GL_HELPERS && GST_GL_HAVE_PLATFORM_EGL
# include <gst/gl/egl/gstgldisplay_egl.h>
#if USE_GST_GL_HELPERS
# include <gst/gl/gl.h>
# if GST_GL_HAVE_PLATFORM_EGL
# include <gst/gl/egl/gstgldisplay_egl.h>
# endif
#endif
#define DEBUG 1
......@@ -1114,11 +1117,15 @@ egl_context_new_wrapped (EglDisplay * display, EGLContext gl_context)
args.display = display;
args.config = config;
args.gl_parent_context = gl_context;
args.context = NULL;
success = egl_display_run (display, (EglContextRunFunc) do_egl_context_new,
&args);
egl_object_unref (config);
if (!success)
return NULL;
if (args.context)
args.context->base.is_wrapped = TRUE;
return args.context;
}
......
......@@ -853,8 +853,6 @@ gl_create_pixmap_object (Display * dpy, guint width, guint height)
/* Initialize FBConfig attributes */
for (attr = fbconfig_attrs; *attr != GL_NONE; attr += 2);
*attr++ = GLX_DEPTH_SIZE;
*attr++ = wattr.depth;
if (wattr.depth == 32) {
*attr++ = GLX_ALPHA_SIZE;
*attr++ = 8;
......
......@@ -137,13 +137,13 @@ gst_vaapi_utils_h265_get_profile (guint8 profile_idc)
GstVaapiProfile profile;
switch (profile_idc) {
case GST_H265_PROFILE_MAIN:
case GST_H265_PROFILE_IDC_MAIN:
profile = GST_VAAPI_PROFILE_H265_MAIN;
break;
case GST_H265_PROFILE_MAIN_10:
case GST_H265_PROFILE_IDC_MAIN_10:
profile = GST_VAAPI_PROFILE_H265_MAIN10;
break;
case GST_H265_PROFILE_MAIN_STILL_PICTURE:
case GST_H265_PROFILE_IDC_MAIN_STILL_PICTURE:
profile = GST_VAAPI_PROFILE_H265_MAIN_STILL_PICTURE;
break;
default:
......
......@@ -185,6 +185,11 @@ gst_vaapi_window_wayland_sync (GstVaapiWindow * window)
if (wl_display_flush (wl_display) < 0)
goto error;
if (g_atomic_int_get (&priv->num_frames_pending) == 0) {
wl_display_cancel_read (wl_display);
return TRUE;
}
again:
if (gst_poll_wait (priv->poll, GST_CLOCK_TIME_NONE) < 0) {
int saved_errno = errno;
......
......@@ -224,8 +224,6 @@ gstlibvaapi = static_library('gstlibvaapi-@0@'.format(api_version),
gstlibvaapi_sources,
c_args : gstreamer_vaapi_args + ['-DIN_LIBGSTVAAPI_CORE', '-DGST_USE_UNSTABLE_API', '-DGST_VAAPI_VERSION_ID="@0@"'.format(gst_version)],
include_directories: [configinc, libsinc],
version : libversion,
soversion : soversion,
dependencies : gstlibvaapi_deps,
)
......
......@@ -238,8 +238,9 @@ gst_vaapidecode_ensure_allowed_srcpad_caps (GstVaapiDecode * decode)
out_caps = gst_caps_make_writable (out_caps);
gst_caps_append (out_caps, gst_caps_from_string (GST_VAAPI_MAKE_DMABUF_CAPS));
raw_caps = gst_vaapi_plugin_base_get_allowed_raw_caps
(GST_VAAPI_PLUGIN_BASE (decode));
raw_caps = gst_vaapi_plugin_base_get_allowed_srcpad_raw_caps
(GST_VAAPI_PLUGIN_BASE (decode),
GST_VIDEO_INFO_FORMAT (&decode->decoded_info));
if (!raw_caps) {
gst_caps_unref (out_caps);
GST_WARNING_OBJECT (decode, "failed to create raw sink caps");
......@@ -760,6 +761,7 @@ error_decode:
ret = GST_FLOW_NOT_SUPPORTED;
break;
default:
ret = GST_FLOW_OK;
GST_VIDEO_DECODER_ERROR (vdec, 1, STREAM, DECODE, ("Decoding error"),
("Decode error %d", status), ret);
break;
......
......@@ -591,7 +591,6 @@ static gboolean
gst_vaapiencode_set_format (GstVideoEncoder * venc, GstVideoCodecState * state)
{
GstVaapiEncode *const encode = GST_VAAPIENCODE_CAST (venc);
gboolean ret;
g_return_val_if_fail (state->caps != NULL, FALSE);
......@@ -610,12 +609,6 @@ gst_vaapiencode_set_format (GstVideoEncoder * venc, GstVideoCodecState * state)
encode->input_state = gst_video_codec_state_ref (state);
encode->input_state_changed = TRUE;
ret = gst_pad_start_task (GST_VAAPI_PLUGIN_BASE_SRC_PAD (encode),
(GstTaskFunction) gst_vaapiencode_buffer_loop, encode, NULL);
if (!ret)
return FALSE;
/* Store some tags */
{
GstTagList *tags = gst_tag_list_new_empty ();
......@@ -650,16 +643,24 @@ gst_vaapiencode_handle_frame (GstVideoEncoder * venc,
GstVideoCodecFrame * frame)
{
GstVaapiEncode *const encode = GST_VAAPIENCODE_CAST (venc);
GstPad *const srcpad = GST_VAAPI_PLUGIN_BASE_SRC_PAD (encode);
GstVaapiEncoderStatus status;
GstVaapiVideoMeta *meta;
GstVaapiSurfaceProxy *proxy;
GstFlowReturn ret;
GstBuffer *buf;
GstTaskState task_state;
#if USE_H264_FEI_ENCODER
GstVaapiFeiVideoMeta *feimeta = NULL;
GstVaapiEncodeClass *const klass = GST_VAAPIENCODE_GET_CLASS (venc);
#endif
task_state = gst_pad_get_task_state (srcpad);
if (task_state == GST_TASK_STOPPED || task_state == GST_TASK_PAUSED)
if (!gst_pad_start_task (srcpad,
(GstTaskFunction) gst_vaapiencode_buffer_loop, encode, NULL))
goto error_task_failed;
buf = NULL;
ret = gst_vaapi_plugin_base_get_input_buffer (GST_VAAPI_PLUGIN_BASE (encode),
frame->input_buffer, &buf);
......@@ -697,6 +698,13 @@ gst_vaapiencode_handle_frame (GstVideoEncoder * venc,
return GST_FLOW_OK;
/* ERRORS */
error_task_failed:
{
GST_ELEMENT_ERROR (venc, RESOURCE, FAILED,
("Failed to start encoding thread."), (NULL));
gst_video_codec_frame_unref (frame);
return GST_FLOW_ERROR;
}
error_buffer_invalid:
{
if (buf)
......
......@@ -308,7 +308,7 @@ gst_vaapiencode_h264_set_config (GstVaapiEncode * base_encode)
const char *stream_format = NULL;
GstStructure *structure;
guint i, num_structures;
GstVaapiProfile profile;
GstVaapiProfile profile = GST_VAAPI_PROFILE_UNKNOWN;
GstCaps *available_caps;
available_caps = get_available_caps (encode);
......@@ -319,7 +319,18 @@ gst_vaapiencode_h264_set_config (GstVaapiEncode * base_encode)
}
if (!gst_caps_can_intersect (allowed_caps, available_caps)) {
GST_INFO_OBJECT (encode, "downstream requested an unsupported profile, "
"but encoder will output a compatible one");
"but encoder will try to output a compatible one");
/* Let's try the best profile in the allowed caps.
* The internal encoder will fail later if it can't handle it */
profile = find_best_profile (allowed_caps);
} else {
GstCaps *profile_caps;
profile_caps = gst_caps_intersect (allowed_caps, available_caps);
profile = find_best_profile (profile_caps);
gst_caps_unref (profile_caps);
}
/* Check whether "stream-format" is avcC mode */
......@@ -331,14 +342,14 @@ gst_vaapiencode_h264_set_config (GstVaapiEncode * base_encode)
continue;
stream_format = gst_structure_get_string (structure, "stream-format");
}
encode->is_avc = stream_format && strcmp (stream_format, "avc") == 0;
encode->is_avc = (g_strcmp0 (stream_format, "avc") == 0);
/* Check for the largest profile that is supported */
profile = find_best_profile (allowed_caps);
if (profile != GST_VAAPI_PROFILE_UNKNOWN) {
GST_INFO ("using %s profile as target decoder constraints",
gst_vaapi_utils_h264_get_profile_string (profile));
ret = gst_vaapi_encoder_h264_set_max_profile (encoder, profile);
} else {
ret = FALSE;
}
gst_caps_unref (allowed_caps);
......@@ -390,6 +401,8 @@ retry:
ret = TRUE;
}
GST_INFO_OBJECT (encode, "out caps %" GST_PTR_FORMAT, caps);
if (!ret)
GST_LOG ("There is no compatible profile in the requested caps.");
......
......@@ -60,21 +60,6 @@ plugin_set_display (GstVaapiPluginBase * plugin, GstVaapiDisplay * display)
gst_vaapi_display_unref (display);
}
#if USE_GST_GL_HELPERS
static void
plugin_set_gst_gl (GstVaapiPluginBase * plugin, GstGLDisplay * gl_display,
GstGLContext * gl_context, GstGLContext * gl_other_context)
{
gst_object_replace (&plugin->gl_display, NULL);
plugin->gl_display = (GstObject *) gl_display;
gst_object_replace (&plugin->gl_context, (GstObject *) gl_context);
gst_object_replace (&plugin->gl_other_context, NULL);
plugin->gl_other_context = (GstObject *) gl_other_context;
}
#endif
/**
* gst_vaapi_plugin_base_set_context:
* @plugin: a #GstVaapiPluginBase instance
......@@ -99,14 +84,9 @@ gst_vaapi_plugin_base_set_context (GstVaapiPluginBase * plugin,
plugin_set_display (plugin, display);
}
#if USE_GST_GL_HELPERS
{
GstGLDisplay *gl_display = NULL;
GstGLContext *gl_other_context = NULL;
GstElement *el = GST_ELEMENT_CAST (plugin);
if (gst_gl_handle_set_context (el, context, &gl_display, &gl_other_context))
plugin_set_gst_gl (plugin, gl_display, NULL, gl_other_context);
}
gst_gl_handle_set_context (GST_ELEMENT_CAST (plugin), context,
(GstGLDisplay **) & plugin->gl_display,
(GstGLContext **) & plugin->gl_other_context);
#endif
}
......@@ -1235,11 +1215,13 @@ gst_vaapi_plugin_base_create_gl_context (GstVaapiPluginBase * plugin)
GstGLContext *gl_other_context = NULL, *gl_context = NULL;
GstGLDisplay *gl_display = NULL;
if (!gst_gl_ensure_element_data (plugin, &gl_display, &gl_other_context))
goto no_valid_gl_display;
if (!plugin->gl_display)
return NULL;
gl_display = (GstGLDisplay *) plugin->gl_display;
if (gst_gl_display_get_handle_type (gl_display) == GST_GL_DISPLAY_TYPE_ANY)
goto no_valid_gl_display;
gl_other_context = (GstGLContext *) plugin->gl_other_context;
GST_INFO_OBJECT (plugin, "creating a new GstGL context");
......@@ -1256,15 +1238,14 @@ gst_vaapi_plugin_base_create_gl_context (GstVaapiPluginBase * plugin)
} while (!gst_gl_display_add_context (gl_display, gl_context));
GST_OBJECT_UNLOCK (gl_display);
plugin_set_gst_gl (plugin, gl_display, gl_context, gl_other_context);
return GST_OBJECT_CAST (gl_context);
/* ERRORS */
no_valid_gl_display:
{
gst_object_replace ((GstObject **) & gl_display, NULL);
gst_object_replace ((GstObject **) & gl_other_context, NULL);
GST_INFO_OBJECT (plugin, "No valid GL display found");
gst_object_replace (&plugin->gl_display, NULL);
gst_object_replace (&plugin->gl_other_context, NULL);
return NULL;
}
#else
......@@ -1272,51 +1253,96 @@ no_valid_gl_display:
#endif
}
static GArray *
extract_allowed_surface_formats (GstVaapiDisplay * display,
GArray * img_formats, GstVideoFormat specified_format,
GstPadDirection direction)
{
guint i;
GArray *out_formats;
GstVaapiSurface *surface = NULL;
g_assert (direction == GST_PAD_SRC || direction == GST_PAD_SINK);
out_formats =
g_array_sized_new (FALSE, FALSE, sizeof (GstVideoFormat),
img_formats->len);
if (!out_formats)
return NULL;
for (i = 0; i < img_formats->len; i++) {
const GstVideoFormat img_format =
g_array_index (img_formats, GstVideoFormat, i);
GstVaapiImage *image;
GstVideoInfo vi;
GstVideoFormat surface_format;
gboolean res;
if (img_format == GST_VIDEO_FORMAT_UNKNOWN)
continue;
surface_format =
(specified_format == GST_VIDEO_FORMAT_UNKNOWN) ?
img_format : specified_format;
if (!surface) {
gst_video_info_set_format (&vi, surface_format, 64, 64);
surface = gst_vaapi_surface_new_full (display, &vi, 0);
if (!surface)
continue;
}
image = gst_vaapi_image_new (display, img_format, 64, 64);
if (!image) {
/* Just reuse the surface if the format is specified */
if (specified_format == GST_VIDEO_FORMAT_UNKNOWN)
gst_vaapi_object_replace (&surface, NULL);
continue;
}
res = FALSE;
if (direction == GST_PAD_SRC) {
res = gst_vaapi_surface_get_image (surface, image);
} else {
res = gst_vaapi_surface_put_image (surface, image);
}
if (res)
g_array_append_val (out_formats, img_format);
gst_vaapi_object_unref (image);
/* Just reuse the surface if the format is specified */
if (specified_format == GST_VIDEO_FORMAT_UNKNOWN)
gst_vaapi_object_replace (&surface, NULL);
}
if (out_formats->len == 0) {
g_array_unref (out_formats);
return NULL;
}
return out_formats;
}
static gboolean
ensure_allowed_raw_caps (GstVaapiPluginBase * plugin)
ensure_allowed_raw_caps (GstVaapiPluginBase * plugin, GstVideoFormat format,
GstPadDirection direction)
{
GArray *formats, *out_formats;
GstVaapiSurface *surface;
GstVaapiDisplay *display;
guint i;
GstCaps *out_caps;
gboolean ret = FALSE;
if (plugin->allowed_raw_caps)
return TRUE;
out_formats = formats = NULL;
surface = NULL;
out_formats = NULL;
display = gst_vaapi_display_ref (plugin->display);
formats = gst_vaapi_display_get_image_formats (display);
if (!formats)
goto bail;
out_formats =
g_array_sized_new (FALSE, FALSE, sizeof (GstVideoFormat), formats->len);
extract_allowed_surface_formats (display, formats, format, direction);
if (!out_formats)
goto bail;
surface =
gst_vaapi_surface_new (display, GST_VAAPI_CHROMA_TYPE_YUV420, 64, 64);
if (!surface)
goto bail;
for (i = 0; i < formats->len; i++) {
const GstVideoFormat format = g_array_index (formats, GstVideoFormat, i);
GstVaapiImage *image;
if (format == GST_VIDEO_FORMAT_UNKNOWN)
continue;
image = gst_vaapi_image_new (display, format, 64, 64);
if (!image)
continue;
if (gst_vaapi_surface_put_image (surface, image))
g_array_append_val (out_formats, format);
gst_vaapi_object_unref (image);
}
out_caps = gst_vaapi_video_format_new_template_caps_from_list (out_formats);
if (!out_caps)
goto bail;
......@@ -1330,25 +1356,41 @@ bail:
g_array_unref (formats);
if (out_formats)
g_array_unref (out_formats);
if (surface)
gst_vaapi_object_unref (surface);
gst_vaapi_display_unref (display);
return ret;
}
/**
* gst_vaapi_plugin_base_get_allowed_raw_caps:
* gst_vaapi_plugin_base_get_allowed_sinkpad_raw_caps:
* @plugin: a #GstVaapiPluginBase
*
* Returns the raw #GstCaps allowed by the element.
*
* Returns: the allowed raw #GstCaps or %NULL
**/
GstCaps *
gst_vaapi_plugin_base_get_allowed_sinkpad_raw_caps (GstVaapiPluginBase * plugin)
{
if (!ensure_allowed_raw_caps (plugin, GST_VIDEO_FORMAT_UNKNOWN, GST_PAD_SINK))
return NULL;
return plugin->allowed_raw_caps;
}
/**
* gst_vaapi_plugin_base_get_allowed_srcpad_raw_caps:
* @plugin: a #GstVaapiPluginBase
* @format: a #GstVideoFormat, the format we need to check
*
* Returns the raw #GstCaps allowed by the element.
*
* Returns: the allowed raw #GstCaps or %NULL
**/
GstCaps *
gst_vaapi_plugin_base_get_allowed_raw_caps (GstVaapiPluginBase * plugin)
gst_vaapi_plugin_base_get_allowed_srcpad_raw_caps (GstVaapiPluginBase *
plugin, GstVideoFormat format)
{
if (!ensure_allowed_raw_caps (plugin))
if (!ensure_allowed_raw_caps (plugin, format, GST_PAD_SRC))
return NULL;
return plugin->allowed_raw_caps;
}
......
......@@ -251,7 +251,12 @@ gst_vaapi_plugin_base_create_gl_context (GstVaapiPluginBase * plugin);
G_GNUC_INTERNAL
GstCaps *
gst_vaapi_plugin_base_get_allowed_raw_caps (GstVaapiPluginBase * plugin);
gst_vaapi_plugin_base_get_allowed_sinkpad_raw_caps (GstVaapiPluginBase * plugin);
G_GNUC_INTERNAL
GstCaps *
gst_vaapi_plugin_base_get_allowed_srcpad_raw_caps (
GstVaapiPluginBase * plugin, GstVideoFormat format);
G_GNUC_INTERNAL
void
......
......@@ -41,6 +41,9 @@
#endif
#if USE_GST_GL_HELPERS
# include <gst/gl/gl.h>
#if USE_EGL && GST_GL_HAVE_PLATFORM_EGL
# include <gst/gl/egl/gstgldisplay_egl.h>
#endif
#endif
#include "gstvaapipluginutil.h"
#include "gstvaapipluginbase.h"
......@@ -140,7 +143,7 @@ gst_vaapi_create_display_from_gl_context (GstObject * gl_context_object)
gpointer native_display =
GSIZE_TO_POINTER (gst_gl_display_get_handle (gl_display));
GstGLPlatform platform = gst_gl_context_get_gl_platform (gl_context);
GstVaapiDisplay *display, *out_display;
GstVaapiDisplay *display = NULL, *out_display = NULL;
GstVaapiDisplayType display_type;
switch (gst_gl_display_get_handle_type (gl_display)) {
......@@ -159,6 +162,12 @@ gst_vaapi_create_display_from_gl_context (GstObject * gl_context_object)
case GST_GL_DISPLAY_TYPE_WAYLAND:
display_type = GST_VAAPI_DISPLAY_TYPE_WAYLAND;
break;
#endif
#if USE_EGL
case GST_GL_DISPLAY_TYPE_EGL:
display_type = GST_VAAPI_DISPLAY_TYPE_EGL;
goto egl_display;
break;
#endif
case GST_GL_DISPLAY_TYPE_ANY:{
/* Derive from the active window */
......@@ -195,16 +204,26 @@ gst_vaapi_create_display_from_gl_context (GstObject * gl_context_object)
display_type = GST_VAAPI_DISPLAY_TYPE_ANY;
break;
}
gst_object_unref (gl_display);
display = gst_vaapi_create_display_from_handle (display_type, native_display);
if (!display)
return NULL;
goto bail;
egl_display:
switch (platform) {
#if USE_EGL
case GST_GL_PLATFORM_EGL:{
guint gles_version;
guintptr egl_handle = 0;
#if GST_GL_HAVE_PLATFORM_EGL
GstGLDisplayEGL *egl_display;
egl_display = gst_gl_display_egl_from_gl_display (gl_display);
if (egl_display) {
egl_handle = gst_gl_display_get_handle (GST_GL_DISPLAY (egl_display));
gst_object_unref (egl_display);
}
#endif
switch (gst_gl_context_get_gl_api (gl_context)) {
case GST_GL_API_GLES1:
......@@ -217,16 +236,22 @@ gst_vaapi_create_display_from_gl_context (GstObject * gl_context_object)
case GST_GL_API_OPENGL3:
gles_version = 0;
create_egl_display:
out_display = gst_vaapi_display_egl_new (display, gles_version);
if (egl_handle != 0) {
out_display =
gst_vaapi_display_egl_new_with_native_display
(GSIZE_TO_POINTER (egl_handle), display_type, gles_version);
} else {
out_display = gst_vaapi_display_egl_new (display, gles_version);
}
break;
default:
out_display = NULL;
break;
}
if (!out_display) {
gst_vaapi_display_unref (display);
return NULL;
}
if (!out_display)
goto bail;
gst_vaapi_display_egl_set_gl_context (GST_VAAPI_DISPLAY_EGL (out_display),
GSIZE_TO_POINTER (gst_gl_context_get_gl_context (gl_context)));
break;
......@@ -236,7 +261,13 @@ gst_vaapi_create_display_from_gl_context (GstObject * gl_context_object)
out_display = gst_vaapi_display_ref (display);
break;
}
gst_vaapi_display_unref (display);
bail:
if (display)
gst_vaapi_display_unref (display);
if (gl_display)
gst_object_unref (gl_display);
return out_display;
#endif
GST_ERROR ("unsupported GStreamer version %s", GST_API_VERSION_S);
......@@ -246,9 +277,8 @@ gst_vaapi_create_display_from_gl_context (GstObject * gl_context_object)
static void
gst_vaapi_find_gl_context (GstElement * element)
{
GstObject *gl_context;
#if USE_GST_GL_HELPERS
GstVaapiPluginBase *const plugin = GST_VAAPI_PLUGIN_BASE (element);
GstPadDirection direction = GST_PAD_UNKNOWN;
/* if the element is vaapisink or any vaapi encoder it doesn't need
* to know a GstGLContext in order to create an appropriate
......@@ -257,16 +287,34 @@ gst_vaapi_find_gl_context (GstElement * element)
if (GST_IS_VIDEO_SINK (element) || GST_IS_VIDEO_ENCODER (element))
return;
gl_context = NULL;
if (!gst_vaapi_find_gl_local_context (element, &gl_context, &direction))
if (!gst_gl_ensure_element_data (plugin,
(GstGLDisplay **) & plugin->gl_display,
(GstGLContext **) & plugin->gl_other_context))
goto no_valid_gl_display;
gst_vaapi_find_gl_local_context (element, &plugin->gl_context);
if (plugin->gl_context) {
gst_vaapi_plugin_base_set_srcpad_can_dmabuf (plugin, plugin->gl_context);
} else {
GstObject *gl_context;
gl_context = gst_vaapi_plugin_base_create_gl_context (plugin);
if (gl_context) {
gst_vaapi_plugin_base_set_gl_context (plugin, gl_context);
gst_object_unref (gl_context);
}
}
if (gl_context) {
gst_vaapi_plugin_base_set_gl_context (plugin, gl_context);
if (direction == GST_PAD_SRC)
gst_vaapi_plugin_base_set_srcpad_can_dmabuf (plugin, gl_context);
gst_object_unref (gl_context);
/* ERRORS */
no_valid_gl_display:
{
GST_INFO_OBJECT (plugin, "No valid GL display found");
gst_object_replace (&plugin->gl_display, NULL);
gst_object_replace (&plugin->gl_other_context, NULL);
return;
}
#endif
}
gboolean
......@@ -543,21 +591,31 @@ gst_vaapi_find_preferred_caps_feature (GstPad * pad, GstCaps * allowed_caps,
{
GstVaapiCapsFeature feature = GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED;
guint i, j, num_structures;
GstCaps *out_caps, *caps = NULL;
GstCaps *peer_caps, *out_caps = NULL, *caps = NULL;
static const guint feature_list[] = { GST_VAAPI_CAPS_FEATURE_VAAPI_SURFACE,
GST_VAAPI_CAPS_FEATURE_DMABUF,
GST_VAAPI_CAPS_FEATURE_GL_TEXTURE_UPLOAD_META,
GST_VAAPI_CAPS_FEATURE_SYSTEM_MEMORY,
};
out_caps = gst_pad_peer_query_caps (pad, allowed_caps);
if (!out_caps)
/* query with no filter */
peer_caps = gst_pad_peer_query_caps (pad, NULL);
if (!peer_caps)
goto cleanup;
if (gst_caps_is_any (out_caps) || gst_caps_is_empty (out_caps))
if (gst_caps_is_empty (peer_caps))
goto cleanup;
/* filter against our allowed caps */
out_caps = gst_caps_intersect_full (allowed_caps, peer_caps,
GST_CAPS_INTERSECT_FIRST);
/* default feature */
feature = GST_VAAPI_CAPS_FEATURE_SYSTEM_MEMORY;
/* if downstream requests caps ANY, system memory is preferred */
if (gst_caps_is_any (peer_caps))
goto find_format;
num_structures = gst_caps_get_size (out_caps);
for (i = 0; i < num_structures; i++) {
GstCapsFeatures *const features = gst_caps_get_features (out_caps, i);
......@@ -590,13 +648,14 @@ gst_vaapi_find_preferred_caps_feature (GstPad * pad, GstCaps * allowed_caps,
if (!caps)
goto cleanup;
find_format:
if (out_format_ptr) {
GstVideoFormat out_format;
GstStructure *structure;
const GValue *format_list;
/* if the best feature is SystemMemory, we should use the first
* caps in the peer caps set, which is the preferred by
* caps in the filtered peer caps set, which is the preferred by
* downstream. */
if (feature == GST_VAAPI_CAPS_FEATURE_SYSTEM_MEMORY)
gst_caps_replace (&caps, out_caps);
......@@ -618,6 +677,7 @@ gst_vaapi_find_preferred_caps_feature (GstPad * pad, GstCaps * allowed_caps,
cleanup:
gst_caps_replace (&caps, NULL);
gst_caps_replace (&out_caps, NULL);
gst_caps_replace (&peer_caps, NULL);
return feature;
}
......
......@@ -318,6 +318,7 @@ gst_vaapipostproc_stop (GstBaseTransform * trans)
{
GstVaapiPostproc *const postproc = GST_VAAPIPOSTPROC (trans);
g_mutex_lock (&postproc->postproc_lock);
ds_reset (&postproc->deinterlace_state);
gst_vaapi_plugin_base_close (GST_VAAPI_PLUGIN_BASE (postproc));
......@@ -325,6 +326,7 @@ gst_vaapipostproc_stop (GstBaseTransform * trans)
gst_video_info_init (&postproc->sinkpad_info);
gst_video_info_init (&postproc->srcpad_info);
gst_video_info_init (&postproc->filter_pool_info);
g_mutex_unlock (&postproc->postproc_lock);
return TRUE;
}
......@@ -721,13 +723,15 @@ gst_vaapipostproc_process_vpp (GstBaseTransform * trans, GstBuffer * inbuf,
if (!outbuf_meta)
goto error_create_meta;
proxy =
gst_vaapi_surface_proxy_new_from_pool (GST_VAAPI_SURFACE_POOL
(postproc->filter_pool));
if (!proxy)
goto error_create_proxy;
gst_vaapi_video_meta_set_surface_proxy (outbuf_meta, proxy);
gst_vaapi_surface_proxy_unref (proxy);
if (!gst_vaapi_video_meta_get_surface_proxy (outbuf_meta)) {
proxy =
gst_vaapi_surface_proxy_new_from_pool (GST_VAAPI_SURFACE_POOL
(postproc->filter_pool));
if (!proxy)
goto error_create_proxy;
gst_vaapi_video_meta_set_surface_proxy (outbuf_meta, proxy);
gst_vaapi_surface_proxy_unref (proxy);
}
if (deint) {
deint_flags = (tff ? GST_VAAPI_DEINTERLACE_FLAG_TOPFIELD : 0);
......@@ -1066,7 +1070,7 @@ gst_vaapipostproc_update_src_caps (GstVaapiPostproc * postproc, GstCaps * caps,
if (GST_VIDEO_INFO_WIDTH (&postproc->srcpad_info) !=
GST_VIDEO_INFO_WIDTH (&postproc->sinkpad_info)
&& GST_VIDEO_INFO_HEIGHT (&postproc->srcpad_info) !=
|| GST_VIDEO_INFO_HEIGHT (&postproc->srcpad_info) !=
GST_VIDEO_INFO_HEIGHT (&postproc->sinkpad_info))
postproc->flags |= GST_VAAPI_POSTPROC_FLAG_SIZE;
......@@ -1092,7 +1096,7 @@ ensure_allowed_sinkpad_caps (GstVaapiPostproc * postproc)
return FALSE;
}
raw_caps = gst_vaapi_plugin_base_get_allowed_raw_caps
raw_caps = gst_vaapi_plugin_base_get_allowed_sinkpad_raw_caps
(GST_VAAPI_PLUGIN_BASE (postproc));
if (!raw_caps) {
gst_caps_unref (out_caps);
......
......@@ -709,9 +709,11 @@ _get_preferred_caps (GstVaapiPostproc * postproc, GstVideoInfo * vinfo,
/* we don't need to do format conversion if GL_TEXTURE_UPLOAD_META
* is negotiated */
if (f != GST_VAAPI_CAPS_FEATURE_GL_TEXTURE_UPLOAD_META
&& postproc->format != format)
if (f == GST_VAAPI_CAPS_FEATURE_GL_TEXTURE_UPLOAD_META) {
postproc->format = DEFAULT_FORMAT;
} else if (postproc->format != format) {
postproc->format = format;
}
return outcaps;
......
......@@ -452,7 +452,7 @@ gst_vaapisink_x11_pre_start_event_thread (GstVaapiSink * sink)
PointerMotionMask | ExposureMask | StructureNotifyMask);
if (!sink->foreign_window)
x11_event_mask |= ButtonPressMask | ButtonReleaseMask;
x11_event_mask |= ButtonPressMask | ButtonReleaseMask;
if (sink->window) {
gst_vaapi_display_lock (GST_VAAPI_DISPLAY (display));
......@@ -1215,7 +1215,7 @@ gst_vaapisink_start (GstBaseSink * base_sink)
/* Ensures possible raw caps earlier to avoid race conditions at
* get_caps() */
if (!gst_vaapi_plugin_base_get_allowed_raw_caps (plugin))
if (!gst_vaapi_plugin_base_get_allowed_sinkpad_raw_caps (plugin))
return FALSE;
return TRUE;
......@@ -1251,7 +1251,8 @@ gst_vaapisink_get_caps_impl (GstBaseSink * base_sink)
out_caps = gst_caps_from_string (surface_caps_str);
raw_caps =
gst_vaapi_plugin_base_get_allowed_raw_caps (GST_VAAPI_PLUGIN_BASE (sink));
gst_vaapi_plugin_base_get_allowed_sinkpad_raw_caps (GST_VAAPI_PLUGIN_BASE
(sink));
if (!raw_caps)
return out_caps;
......
......@@ -77,7 +77,7 @@ gst_vaapi_video_buffer_pool_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case PROP_DISPLAY:
priv->display = gst_vaapi_display_ref (g_value_get_pointer (value));
priv->display = g_value_dup_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......@@ -516,10 +516,9 @@ gst_vaapi_video_buffer_pool_class_init (GstVaapiVideoBufferPoolClass * klass)
g_object_class_install_property
(object_class,
PROP_DISPLAY,
g_param_spec_pointer ("display",
"Display",
g_param_spec_object ("display", "Display",
"The GstVaapiDisplay to use for this video pool",
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
GST_TYPE_VAAPI_DISPLAY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
}
static void
......
......@@ -307,8 +307,6 @@ gst_vaapi_video_context_propagate (GstElement * element,
* @element: the #GstElement where the search begins
* @gl_context_ptr: the pointer where the GstGL context is going to be
* stored
* @direction_ptr: the pointer of the #GstPadDirection where the GstGL
* context was found
*
* Query the pipeline, downstream and upstream for a GstGL context
*
......@@ -316,42 +314,15 @@ gst_vaapi_video_context_propagate (GstElement * element,
**/
gboolean
gst_vaapi_find_gl_local_context (GstElement * element,
GstObject ** gl_context_ptr, GstPadDirection * direction_ptr)
GstObject ** gl_context_ptr)
{
#if USE_GST_GL_HELPERS
GstQuery *query;
GstContext *context;
const GstStructure *s;
GstObject *gl_context;
GstPadDirection direction;
g_return_val_if_fail (gl_context_ptr, FALSE);
direction = GST_PAD_UNKNOWN;
gl_context = NULL;
query = gst_query_new_context ("gst.gl.local_context");
if (_gst_context_run_query (element, query, GST_PAD_SRC)) {
gst_query_parse_context (query, &context);
if (context) {
s = gst_context_get_structure (context);
gst_structure_get (s, "context", GST_TYPE_GL_CONTEXT, &gl_context, NULL);
direction = GST_PAD_SRC;
}
}
if (!gl_context && _gst_context_run_query (element, query, GST_PAD_SINK)) {
gst_query_parse_context (query, &context);
if (context) {
s = gst_context_get_structure (context);
gst_structure_get (s, "context", GST_TYPE_GL_CONTEXT, &gl_context, NULL);
direction = GST_PAD_SINK;
}
}
gst_query_unref (query);
if (gl_context) {
*gl_context_ptr = gl_context;
*direction_ptr = direction;
GstGLContext **context_ptr = (GstGLContext **) gl_context_ptr;
if (gst_gl_query_local_gl_context (element, GST_PAD_SRC, context_ptr))
return TRUE;
if (gst_gl_query_local_gl_context (element, GST_PAD_SINK, context_ptr))
return TRUE;
}
#endif
return FALSE;
}
......@@ -60,6 +60,6 @@ gst_vaapi_video_context_propagate (GstElement * element,
G_GNUC_INTERNAL
gboolean
gst_vaapi_find_gl_local_context (GstElement * element,
GstObject ** gl_context_ptr, GstPadDirection * direction);
GstObject ** gl_context_ptr);
#endif /* GST_VAAPI_VIDEO_CONTEXT_H */
......@@ -1060,6 +1060,7 @@ error_create_dmabuf_handle:
error_create_dmabuf_memory:
{
GST_ERROR ("failed to create DMABUF memory");
close (dmabuf_fd);
gst_vaapi_buffer_proxy_unref (dmabuf_proxy);
return NULL;
}
......
......@@ -25,6 +25,56 @@
</GitRepository>
</repository>
<release>
<Version>
<revision>1.14.5</revision>
<branch>1.14</branch>
<name></name>
<created>2019-05-29</created>
<file-release rdf:resource="https://gstreamer.freedesktop.org/src/gstreamer-vaapi/gstreamer-vaapi-1.14.5.tar.xz" />
</Version>
</release>
<release>
<Version>
<revision>1.14.4</revision>
<branch>1.14</branch>
<name></name>
<created>2018-10-02</created>
<file-release rdf:resource="https://gstreamer.freedesktop.org/src/gstreamer-vaapi/gstreamer-vaapi-1.14.4.tar.xz" />
</Version>
</release>
<release>
<Version>
<revision>1.14.3</revision>
<branch>1.14</branch>
<name></name>
<created>2018-09-16</created>
<file-release rdf:resource="https://gstreamer.freedesktop.org/src/gstreamer-vaapi/gstreamer-vaapi-1.14.3.tar.xz" />
</Version>
</release>
<release>
<Version>
<revision>1.14.2</revision>
<branch>1.14</branch>
<name></name>
<created>2018-07-20</created>
<file-release rdf:resource="https://gstreamer.freedesktop.org/src/gstreamer-vaapi/gstreamer-vaapi-1.14.2.tar.xz" />
</Version>
</release>
<release>
<Version>
<revision>1.14.1</revision>
<branch>1.14</branch>
<name></name>
<created>2018-05-17</created>
<file-release rdf:resource="https://gstreamer.freedesktop.org/src/gstreamer-vaapi/gstreamer-vaapi-1.14.1.tar.xz" />
</Version>
</release>
<release>
<Version>
<revision>1.14.0</revision>
......
project('gstreamer-vaapi', 'c',
version : '1.14.0',
meson_version : '>= 0.36.0',
version : '1.14.5',
meson_version : '>= 0.40.1',
default_options : [ 'warning_level=1',
'buildtype=debugoptimized' ])
......@@ -58,17 +58,24 @@ libudev_dep = dependency('libudev', required: false)
egl_dep = dependency('egl', required: false)
gl_dep = dependency('gl', required: false)
glesv2_dep = dependency('glesv2', required: false)
glesv3_dep = dependency('glesv3', required: false)
libdl_dep = cc.find_library('dl', rqeuired: false)
libdl_dep = cc.find_library('dl', required: false)
wayland_client_dep = dependency('wayland-client', required: false)
x11_dep = dependency('x11', required: false)
xrandr_dep = dependency('xrandr', required: false)
xrender_dep = dependency('xrender', required: false)
GLES_VERSION_MASK = 0
GLES_VERSION_MASK += gl_dep.found() ? 1 : 0
GLES_VERSION_MASK += glesv2_dep.found() ? 4 : 0
GLES_VERSION_MASK += glesv3_dep.found() ? 8 : 0
GLES_VERSION_MASK = gl_dep.found() ? 1 : 0
if glesv2_dep.found()
if (cc.has_header('GLES2/gl2.h', dependencies: glesv2_dep) and
cc.has_header('GLES2/gl2ext.h', dependencies: glesv2_dep))
GLES_VERSION_MASK += 4
endif
if (cc.has_header('GLES3/gl3.h', dependencies: glesv2_dep) and
cc.has_header('GLES3/gl3ext.h', dependencies: glesv2_dep) and
cc.has_header('GLES2/gl2ext.h', dependencies: glesv2_dep))
GLES_VERSION_MASK += 8
endif
endif
USE_ENCODERS = libva_dep.version().version_compare('>= 0.34.0') and get_option('with_encoders') != 'no'
USE_H265_DECODER = cc.has_header('va/va_dec_hevc.h', dependencies: libva_dep, prefix: '#include <va/va.h>')
......@@ -115,7 +122,7 @@ cdata.set10('HAVE_XRANDR', xrandr_dep.found())
cdata.set10('HAVE_XRENDER', xrender_dep.found())
cdata.set10('USE_VA_VPP', USE_VPP)
cdata.set10('USE_GST_GL_HELPERS', gstgl_dep.found())
cdata.set('GLES_VERSION_MASK', GLES_VERSION_MASK)
cdata.set('USE_GLES_VERSION_MASK', GLES_VERSION_MASK)
runcmd = run_command('pkg-config', '--variable=driverdir', 'libva')
if runcmd.returncode() == 0
cdata.set('VA_DRIVERS_PATH', '"@0@"'.format(runcmd.stdout().strip()))
......