summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@hotmail.com>2019-03-29 13:33:41 +0800
committerHe Junyan <junyan.he@hotmail.com>2019-03-29 13:33:41 +0800
commit6669a7fc575fbbb6dc82fcbcd4d4491e75049e51 (patch)
tree6bdc3668cbfc605db0e0028103ecbe962a84b2c1
parent871aecb0d4abd0d3c770572f01a66545077655bd (diff)
libs: Change the parameter setting order when encode picture.
The order in gst_vaapi_enc_picture_encode when encoding one picture is not very correct. The misc parameters are set before the picture parameters. Some of the misc parameters such as ROI may change the current picture parameters. But the later setting of picture parameter will re-init all picture related parameters and clear the previous setting. The right order should be picture parameter first and then misc parameters. Signed-off-by: He Junyan <junyan.he@hotmail.com>
-rw-r--r--gst-libs/gst/vaapi/gstvaapiencoder_objects.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiencoder_objects.c b/gst-libs/gst/vaapi/gstvaapiencoder_objects.c
index f31181e7..3227607c 100644
--- a/gst-libs/gst/vaapi/gstvaapiencoder_objects.c
+++ b/gst-libs/gst/vaapi/gstvaapiencoder_objects.c
@@ -555,6 +555,10 @@ gst_vaapi_enc_picture_encode (GstVaapiEncPicture * picture)
return FALSE;
}
+ /* Submit Picture parameter */
+ if (!do_encode (va_display, va_context, &picture->param_id, &picture->param))
+ return FALSE;
+
/* Submit Misc Params */
for (i = 0; i < picture->misc_params->len; i++) {
GstVaapiEncMiscParam *const misc =
@@ -563,10 +567,6 @@ gst_vaapi_enc_picture_encode (GstVaapiEncPicture * picture)
return FALSE;
}
- /* Submit Picture parameter */
- if (!do_encode (va_display, va_context, &picture->param_id, &picture->param))
- return FALSE;
-
/* Submit Slice parameters */
for (i = 0; i < picture->slices->len; i++) {
GstVaapiEncSlice *const slice = g_ptr_array_index (picture->slices, i);