omxvideoenc: add 'roi' qp-mode on zynqultrascaleplus

New QP mode used to handle ROI metadata.

https://bugzilla.gnome.org/show_bug.cgi?id=793696
This commit is contained in:
Guillaume Desmottes 2018-02-22 11:27:03 +01:00
parent 6b6ea6fdf7
commit 530a7537cf

View file

@ -80,6 +80,9 @@ gst_omx_video_enc_qp_mode_get_type (void)
{OMX_ALG_AUTO_QP,
"Let the VCU encoder change the QP for each coding unit according to its content",
"auto"},
{OMX_ALG_ROI_QP,
"Adjust QP according to the regions of interest defined on each frame. Must be set to handle ROI metadata.",
"roi"},
{0xffffffff, "Component Default", "default"},
{0, NULL, NULL}
};
@ -2498,6 +2501,13 @@ handle_roi_metadata (GstOMXVideoEnc * self, GstBuffer * input)
g_quark_to_string (roi->roi_type), roi->id, roi->x, roi->y, roi->w,
roi->h);
if (self->qp_mode != OMX_ALG_ROI_QP) {
GST_WARNING_OBJECT (self,
"Need qp-mode=roi to handle ROI metadata (current: %d); ignoring",
self->qp_mode);
continue;
}
GST_OMX_INIT_STRUCT (&roi_param);
roi_param.nPortIndex = self->enc_in_port->index;
roi_param.nLeft = roi->x;