summaryrefslogtreecommitdiff
path: root/gst-libs/gst/vaapi
diff options
context:
space:
mode:
Diffstat (limited to 'gst-libs/gst/vaapi')
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder.c7
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder.h2
-rw-r--r--gst-libs/gst/vaapi/gstvaapiprofilecaps.c16
-rw-r--r--gst-libs/gst/vaapi/gstvaapiprofilecaps.h3
4 files changed, 25 insertions, 3 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder.c b/gst-libs/gst/vaapi/gstvaapiencoder.c
index 1714707d..690caf77 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder.c
@@ -1533,6 +1533,7 @@ merge_profile_surface_attributes (GstVaapiEncoder * encoder,
attribs->min_height = MIN (attribs->min_height, attr.min_height);
attribs->max_width = MAX (attribs->max_width, attr.max_width);
attribs->max_height = MAX (attribs->max_height, attr.max_height);
+ attribs->mem_types &= attr.mem_types;
return TRUE;
}
@@ -1553,10 +1554,10 @@ merge_profile_surface_attributes (GstVaapiEncoder * encoder,
GArray *
gst_vaapi_encoder_get_surface_attributes (GstVaapiEncoder * encoder,
GArray * profiles, gint * min_width, gint * min_height,
- gint * max_width, gint * max_height)
+ gint * max_width, gint * max_height, guint * mem_types)
{
GstVaapiConfigSurfaceAttributes attribs = {
- G_MAXINT, G_MAXINT, 1, 1, 0, NULL
+ G_MAXINT, G_MAXINT, 1, 1, G_MAXUINT, NULL
};
GstVaapiProfile profile;
guint i;
@@ -1586,6 +1587,8 @@ gst_vaapi_encoder_get_surface_attributes (GstVaapiEncoder * encoder,
*max_width = attribs.max_width;
if (max_height)
*max_height = attribs.max_height;
+ if (mem_types)
+ *mem_types = attribs.mem_types;
return attribs.formats;
}
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder.h b/gst-libs/gst/vaapi/gstvaapiencoder.h
index 71da2be1..bf89df27 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder.h
+++ b/gst-libs/gst/vaapi/gstvaapiencoder.h
@@ -183,7 +183,7 @@ gst_vaapi_encoder_flush (GstVaapiEncoder * encoder);
GArray *
gst_vaapi_encoder_get_surface_attributes (GstVaapiEncoder * encoder,
GArray * profiles, gint * min_width, gint * min_height,
- gint * max_width, gint * max_height);
+ gint * max_width, gint * max_height, guint * mem_types);
GstVaapiProfile
gst_vaapi_encoder_get_profile (GstVaapiEncoder * encoder);
diff --git a/gst-libs/gst/vaapi/gstvaapiprofilecaps.c b/gst-libs/gst/vaapi/gstvaapiprofilecaps.c
index a98d0e0d..0e443935 100644
--- a/gst-libs/gst/vaapi/gstvaapiprofilecaps.c
+++ b/gst-libs/gst/vaapi/gstvaapiprofilecaps.c
@@ -117,3 +117,19 @@ gst_vaapi_profile_caps_append_decoder (GstVaapiDisplay * display,
return append_caps_with_context_info (display, &cip, structure);
}
+
+/**
+ * gst_vaapi_mem_type_supports:
+ * @va_mem_types: memory types from VA surface attributes
+ * @mem_type: the #GstVaapiBufferMemoryType to test
+ *
+ * Test if @va_mem_types handles @mem_type
+ *
+ * Returns: %TRUE if @mem_type is supported in @va_mem_types;
+ * otherwise %FALSE
+ **/
+gboolean
+gst_vaapi_mem_type_supports (guint va_mem_types, guint mem_type)
+{
+ return ((va_mem_types & from_GstVaapiBufferMemoryType (mem_type)) != 0);
+}
diff --git a/gst-libs/gst/vaapi/gstvaapiprofilecaps.h b/gst-libs/gst/vaapi/gstvaapiprofilecaps.h
index 24eb82ce..a33ebc92 100644
--- a/gst-libs/gst/vaapi/gstvaapiprofilecaps.h
+++ b/gst-libs/gst/vaapi/gstvaapiprofilecaps.h
@@ -33,6 +33,9 @@ gboolean
gst_vaapi_profile_caps_append_decoder (GstVaapiDisplay * display,
GstVaapiProfile profile, GstStructure * structure);
+gboolean
+gst_vaapi_mem_type_supports (guint va_mem_types, guint mem_type);
+
G_END_DECLS
#endif /* GST_VAAPI_PROFILE_CAPS_H */