From 530a7537cfd57f29497f8723f33b9f72622a357b Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 22 Feb 2018 11:27:03 +0100 Subject: [PATCH] omxvideoenc: add 'roi' qp-mode on zynqultrascaleplus New QP mode used to handle ROI metadata. https://bugzilla.gnome.org/show_bug.cgi?id=793696 --- omx/gstomxvideoenc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c index ff8efcf..da005e1 100644 --- a/omx/gstomxvideoenc.c +++ b/omx/gstomxvideoenc.c @@ -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; -- 2.7.4