vaapivideocontext: add gst_vaapi_video_context_set_display()
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Wed, 4 Nov 2015 19:29:03 +0000 (20:29 +0100)
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Mon, 9 Nov 2015 15:18:19 +0000 (16:18 +0100)
This function set the display to an already created context. This function is
going to be used later.

Also, gst_vaapi_video_context_new_with_display() now uses this function.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=757598

gst/vaapi/gstvaapivideocontext.c
gst/vaapi/gstvaapivideocontext.h

index f049273..c90ede7 100644 (file)
@@ -52,17 +52,27 @@ _init_context_debug (void)
 #endif
 }
 
+void
+gst_vaapi_video_context_set_display (GstContext * context,
+    GstVaapiDisplay * display)
+{
+  GstStructure *structure;
+
+  g_return_if_fail (context != NULL);
+
+  structure = gst_context_writable_structure (context);
+  gst_structure_set (structure, GST_VAAPI_DISPLAY_CONTEXT_TYPE_NAME,
+      GST_VAAPI_TYPE_DISPLAY, display, NULL);
+}
+
 GstContext *
 gst_vaapi_video_context_new_with_display (GstVaapiDisplay * display,
     gboolean persistent)
 {
   GstContext *context;
-  GstStructure *structure;
 
   context = gst_context_new (GST_VAAPI_DISPLAY_CONTEXT_TYPE_NAME, persistent);
-  structure = gst_context_writable_structure (context);
-  gst_structure_set (structure, GST_VAAPI_DISPLAY_CONTEXT_TYPE_NAME,
-      GST_VAAPI_TYPE_DISPLAY, display, NULL);
+  gst_vaapi_video_context_set_display (context, display);
   return context;
 }
 
index 95e134b..2d56183 100644 (file)
 #define GST_VAAPI_DISPLAY_CONTEXT_TYPE_NAME "gst.vaapi.Display"
 
 G_GNUC_INTERNAL
+void
+gst_vaapi_video_context_set_display (GstContext * context,
+    GstVaapiDisplay * display);
+
+G_GNUC_INTERNAL
 GstContext *
 gst_vaapi_video_context_new_with_display (GstVaapiDisplay * display,
     gboolean persistent);