summaryrefslogtreecommitdiff
path: root/gst-libs/gst
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2017-04-06 12:49:24 +0200
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2017-04-06 22:00:05 +0200
commit7153b4597d24af67508b0f20c20f34c8a56b1675 (patch)
tree1de823857de11d082edb68d410f057d689f92a5b /gst-libs/gst
parent9aa63e4595105ac035663a22360d75c52b74b4b8 (diff)
libs: encoder: pass profile to get_surface_formats()
In order to get the supported surface formats within a specific profile this patch adds the GstVaapiProfile as property to gst_vaapi_encoder_get_surface_formats(). Currently the extracted formats are only those related with the default profile of the element's codec. https://bugzilla.gnome.org/show_bug.cgi?id=771291
Diffstat (limited to 'gst-libs/gst')
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder.c13
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder.h3
2 files changed, 11 insertions, 5 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder.c b/gst-libs/gst/vaapi/gstvaapiencoder.c
index 3ecd2c45..cfbdfc84 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder.c
@@ -1161,7 +1161,7 @@ error:
}
static GstVaapiContext *
-create_test_context_config (GstVaapiEncoder * encoder)
+create_test_context_config (GstVaapiEncoder * encoder, GstVaapiProfile profile)
{
GstVaapiContextInfo cip = { 0, };
GstVaapiContext *ctxt;
@@ -1169,7 +1169,11 @@ create_test_context_config (GstVaapiEncoder * encoder)
if (encoder->context)
return gst_vaapi_object_ref (encoder->context);
- init_context_info (encoder, &cip, get_profile (encoder));
+ /* if there is no profile, let's figure out one */
+ if (profile == GST_VAAPI_PROFILE_UNKNOWN)
+ profile = get_profile (encoder);
+
+ init_context_info (encoder, &cip, profile);
ctxt = gst_vaapi_context_new (encoder->display, &cip);
return ctxt;
}
@@ -1183,12 +1187,13 @@ create_test_context_config (GstVaapiEncoder * encoder)
* Returns: a #GArray of valid formats for the current VAConfig
**/
GArray *
-gst_vaapi_encoder_get_surface_formats (GstVaapiEncoder * encoder)
+gst_vaapi_encoder_get_surface_formats (GstVaapiEncoder * encoder,
+ GstVaapiProfile profile)
{
GstVaapiContext *ctxt;
GArray *formats;
- ctxt = create_test_context_config (encoder);
+ ctxt = create_test_context_config (encoder, profile);
if (!ctxt)
return NULL;
formats = gst_vaapi_context_get_surface_formats (ctxt);
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder.h b/gst-libs/gst/vaapi/gstvaapiencoder.h
index 3160036d..1c7cd473 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder.h
+++ b/gst-libs/gst/vaapi/gstvaapiencoder.h
@@ -174,7 +174,8 @@ GstVaapiEncoderStatus
gst_vaapi_encoder_flush (GstVaapiEncoder * encoder);
GArray *
-gst_vaapi_encoder_get_surface_formats (GstVaapiEncoder * encoder);
+gst_vaapi_encoder_get_surface_formats (GstVaapiEncoder * encoder,
+ GstVaapiProfile profile);
G_END_DECLS
#endif /* GST_VAAPI_ENCODER_H */