summaryrefslogtreecommitdiff
path: root/gst-libs/gst/vaapi/gstvaapiprofilecaps.c
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2019-08-16 19:26:36 +0200
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2019-08-19 17:26:55 +0000
commitbd3d347fd70fb1587ca06086bc572182e8ff3699 (patch)
tree5fe22236edeca4c081a3a18fb013e91f6dc8699c /gst-libs/gst/vaapi/gstvaapiprofilecaps.c
parentab4ba47bbf6ae3370d0e739c1f75a30c4dcd581a (diff)
libs: profilecaps: defines gst_vaapi_profile_caps_append_encoder()
Previously it was just a boilerplate. Now it is real implementation.
Diffstat (limited to 'gst-libs/gst/vaapi/gstvaapiprofilecaps.c')
-rw-r--r--gst-libs/gst/vaapi/gstvaapiprofilecaps.c36
1 files changed, 33 insertions, 3 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiprofilecaps.c b/gst-libs/gst/vaapi/gstvaapiprofilecaps.c
index b786b77b..83dc712b 100644
--- a/gst-libs/gst/vaapi/gstvaapiprofilecaps.c
+++ b/gst-libs/gst/vaapi/gstvaapiprofilecaps.c
@@ -81,7 +81,7 @@ append_caps (GstVaapiContext * context, GstStructure * structure)
* @profile: a #GstVaapiProfile
* @structure: a #GstStructure
*
- * Extracts the config's surface attributes, from @profile, in an
+ * Extracts the config's surface attributes, from @profile, in a
* decoder context, and transforms it into a caps formats and appended
* into @structure.
*
@@ -110,9 +110,39 @@ gst_vaapi_profile_caps_append_decoder (GstVaapiDisplay * display,
return ret;
}
+/**
+ * gst_vaapi_profile_caps_append_encoder:
+ * @display: a #GstVaapiDisplay
+ * @profile: a #GstVaapiProfile
+ * @entrypoint: a #GstVaapiEntryPoint
+ * @structure: a #GstStructure
+ *
+ * Extracts the config's surface attributes, from @profile and
+ * @entrypoint, in an encoder context, and transforms it into a caps
+ * formats and appended into @structure.
+ *
+ * Returns: %TRUE if the capabilities could be extracted and appended
+ * into @structure; otherwise %FALSE
+ **/
gboolean
gst_vaapi_profile_caps_append_encoder (GstVaapiDisplay * display,
- GstVaapiProfile profile, GstStructure * structure)
+ GstVaapiProfile profile, GstVaapiEntrypoint entrypoint,
+ GstStructure * structure)
{
- return TRUE;
+ GstVaapiContext *context;
+ GstVaapiContextInfo cip = {
+ GST_VAAPI_CONTEXT_USAGE_ENCODE, profile, entrypoint, 0,
+ };
+ gboolean ret;
+
+ g_return_val_if_fail (display != NULL, FALSE);
+ g_return_val_if_fail (structure != NULL, FALSE);
+
+ context = create_context (display, &cip);
+ if (!context)
+ return FALSE;
+
+ ret = append_caps (context, structure);
+ gst_vaapi_object_unref (context);
+ return ret;
}