diff options
author | Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> | 2015-11-04 20:29:03 +0100 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> | 2015-11-09 16:18:19 +0100 |
commit | ed280f5b84cce8c46a529acff5c30692834d5bc5 (patch) | |
tree | df67cdd752fc21abd6258e65864822adf619e1b6 /gst | |
parent | ef3fb4afaf38fbfd52e5b8b7bc7008b3f0e1cdaa (diff) | |
download | gst-vaapi-ed280f5b84cce8c46a529acff5c30692834d5bc5.tar.gz |
vaapivideocontext: add gst_vaapi_video_context_set_display()
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
Diffstat (limited to 'gst')
-rw-r--r-- | gst/vaapi/gstvaapivideocontext.c | 18 | ||||
-rw-r--r-- | gst/vaapi/gstvaapivideocontext.h | 5 |
2 files changed, 19 insertions, 4 deletions
diff --git a/gst/vaapi/gstvaapivideocontext.c b/gst/vaapi/gstvaapivideocontext.c index f049273e..c90ede7d 100644 --- a/gst/vaapi/gstvaapivideocontext.c +++ b/gst/vaapi/gstvaapivideocontext.c @@ -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; } diff --git a/gst/vaapi/gstvaapivideocontext.h b/gst/vaapi/gstvaapivideocontext.h index 95e134b6..2d56183d 100644 --- a/gst/vaapi/gstvaapivideocontext.h +++ b/gst/vaapi/gstvaapivideocontext.h @@ -32,6 +32,11 @@ #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); |