omxvideoenc: validate cpb-size and initial-delay

cpb-size cannot be smaller than initial-delay.
This commit is contained in:
Guillaume Desmottes 2018-06-04 12:20:03 +02:00 committed by Guillaume Desmottes
parent aff131dcee
commit 09bc1d630f

View file

@ -612,6 +612,13 @@ set_zynqultrascaleplus_props (GstOMXVideoEnc * self)
}
if (self->control_rate != OMX_Video_ControlRateDisable) {
if (self->cpb_size < self->initial_delay) {
GST_ERROR_OBJECT (self,
"cpb-size (%d) cannot be smaller than initial-delay (%d)",
self->cpb_size, self->initial_delay);
g_critical ("cpb-size (%d) cannot be smaller than initial-delay (%d)",
self->cpb_size, self->initial_delay);
} else {
OMX_ALG_VIDEO_PARAM_CODED_PICTURE_BUFFER cpb;
GST_OMX_INIT_STRUCT (&cpb);
@ -627,6 +634,7 @@ set_zynqultrascaleplus_props (GstOMXVideoEnc * self)
(OMX_INDEXTYPE) OMX_ALG_IndexParamVideoCodedPictureBuffer, &cpb);
CHECK_ERR ("cpb size & initial delay");
}
}
{
OMX_ALG_VIDEO_PARAM_SCALING_LIST scaling_list;