vaapivideocontext: refactor gst_vaapi_video_context_prepare()
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Wed, 4 Nov 2015 18:02:34 +0000 (19:02 +0100)
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Mon, 9 Nov 2015 15:18:19 +0000 (16:18 +0100)
commit5d0ab369248672d338e1ff5a50e91d9d704fd9e3
treedd43f2539137e7aabe1cebe7671f5f533b3fe3f5
parent7e9ee7f66d490ab11e0c1ba64bca97b71554b80d
vaapivideocontext: refactor gst_vaapi_video_context_prepare()

First, refactorized run_context_query() into _gst_context_run_query(), adding
a new parameter: the pad direction, in order to simplify the code.

Second, added a new helper function: _gst_context_query(), which is a generic
context query function.  It isolates the operation of running the query and
sets the context if found, also it enhances the logs.

_gst_context_query() is similar to the one used in GstGL. Perhaps, in the
future this helper function will be merged into the core libraries of
GStreamer.

Finally, gst_vaapi_video_context_prepare() was rewritten to use
_gst_context_query().

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