summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorHyunjun Ko <zzoon@igalia.com>2016-12-02 09:30:52 +0900
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-12-07 16:47:01 +0100
commit41d27b5e2ec3fab6cebbe92569dd6e29428f1033 (patch)
treef37caf20520e5da86893972ec6be08cb432609e2 /gst-libs
parent059cc59a29c5df1cba55bee8d8c4a25002e9f973 (diff)
libs: context: skip VAContext if no frame size
If GstVaapiContextInfo has just initial information, without frame's width and height, skip the creation of the VAContext, just keep the VAConfig. https://bugzilla.gnome.org/show_bug.cgi?id=769266 Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/vaapi/gstvaapicontext.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapicontext.c b/gst-libs/gst/vaapi/gstvaapicontext.c
index e6410dc1..9a3e0abd 100644
--- a/gst-libs/gst/vaapi/gstvaapicontext.c
+++ b/gst-libs/gst/vaapi/gstvaapicontext.c
@@ -389,8 +389,6 @@ gst_vaapi_context_new (GstVaapiDisplay * display,
g_return_val_if_fail (cip->profile, NULL);
g_return_val_if_fail (cip->entrypoint, NULL);
- g_return_val_if_fail (cip->width > 0, NULL);
- g_return_val_if_fail (cip->height > 0, NULL);
context = gst_vaapi_object_new (gst_vaapi_context_class (), display);
if (!context)
@@ -401,8 +399,18 @@ gst_vaapi_context_new (GstVaapiDisplay * display,
if (!config_create (context))
goto error;
+ /* this means we don't want to create a VAcontext */
+ if (cip->width == 0 && cip->height == 0)
+ goto done;
+
+ /* this is not valid */
+ if (cip->width == 0 || cip->height == 0)
+ goto error;
+
if (!context_create (context))
goto error;
+
+done:
return context;
/* ERRORS */