omxvidee{enc,dec}: refresh input port definition after setting format

Setting the input format and the associated encoder/decoder settings
may also affect the nBufferCountMin of the input port.
Refresh the input port so we'll use up to date values in propose/decide
allocation.

https://bugzilla.gnome.org/show_bug.cgi?id=796445
This commit is contained in:
Guillaume Desmottes 2018-05-28 15:02:13 +02:00
parent 3498f81d1f
commit 338ff34e5e
2 changed files with 8 additions and 2 deletions

View file

@ -2597,10 +2597,13 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder,
}
}
GST_DEBUG_OBJECT (self, "Updating outport port definition");
GST_DEBUG_OBJECT (self, "Updating ports definition");
if (gst_omx_port_update_port_definition (self->dec_out_port,
NULL) != OMX_ErrorNone)
return FALSE;
if (gst_omx_port_update_port_definition (self->dec_in_port,
NULL) != OMX_ErrorNone)
return FALSE;
gst_buffer_replace (&self->codec_data, state->codec_data);
self->input_state = gst_video_codec_state_ref (state);

View file

@ -2224,10 +2224,13 @@ gst_omx_video_enc_set_format (GstVideoEncoder * encoder,
}
}
GST_DEBUG_OBJECT (self, "Updating outport port definition");
GST_DEBUG_OBJECT (self, "Updating ports definition");
if (gst_omx_port_update_port_definition (self->enc_out_port,
NULL) != OMX_ErrorNone)
return FALSE;
if (gst_omx_port_update_port_definition (self->enc_in_port,
NULL) != OMX_ErrorNone)
return FALSE;
/* Some OMX implementations reset the bitrate after setting the compression
* format, see bgo#698049, so re-set it */