summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2017-04-04 14:39:59 +0200
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2017-04-06 22:00:05 +0200
commit31d326c9ee12e6c8da7b765c9968ac52ac29239f (patch)
tree84db6134375ca7e4930abf2a84092ea989560297 /gst-libs
parentdb7268117d804a54f8be60c1046b9969ac112950 (diff)
libs: encoder: refactor init_context_info()
In order to generate vaapi contexts iterative, the function init_context_info() is refactored to pass, as parameters the GstVaapiContextInfo and the GstVaapiProfile. https://bugzilla.gnome.org/show_bug.cgi?id=771291
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder.c b/gst-libs/gst/vaapi/gstvaapiencoder.c
index a1ec7913..f4836e39 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder.c
@@ -604,14 +604,14 @@ get_default_chroma_type (GstVaapiEncoder * encoder,
}
static void
-init_context_info (GstVaapiEncoder * encoder)
+init_context_info (GstVaapiEncoder * encoder, GstVaapiContextInfo * cip,
+ GstVaapiProfile profile)
{
- GstVaapiContextInfo *const cip = &encoder->context_info;
const GstVaapiEncoderClassData *const cdata =
GST_VAAPI_ENCODER_GET_CLASS (encoder)->class_data;
cip->usage = GST_VAAPI_CONTEXT_USAGE_ENCODE;
- cip->profile = get_profile (encoder);
+ cip->profile = profile;
if (cdata->codec == GST_VAAPI_CODEC_JPEG) {
cip->entrypoint = GST_VAAPI_ENTRYPOINT_PICTURE_ENCODE;
} else {
@@ -633,7 +633,7 @@ set_context_info (GstVaapiEncoder * encoder)
const GstVideoFormat format =
GST_VIDEO_INFO_FORMAT (GST_VAAPI_ENCODER_VIDEO_INFO (encoder));
- init_context_info (encoder);
+ init_context_info (encoder, cip, get_profile (encoder));
cip->chroma_type = gst_vaapi_video_format_get_chroma_type (format);
cip->width = GST_VAAPI_ENCODER_WIDTH (encoder);
@@ -1168,7 +1168,7 @@ gst_vaapi_encoder_ensure_context_config (GstVaapiEncoder * encoder)
if (encoder->context)
return TRUE;
- init_context_info (encoder);
+ init_context_info (encoder, cip, get_profile (encoder));
encoder->context = gst_vaapi_context_new (encoder->display, cip);
return (encoder->context != NULL);
}