From 1b7d0b8599010172d8ee313930f0f9db0629572b Mon Sep 17 00:00:00 2001 From: Julien Isorce Date: Mon, 19 Jun 2017 23:56:02 +0100 Subject: [PATCH] omxvideodec: handle IL 1.2 behavior for OMX_SetParameter It triggers SettingsChanged on the other port and it is up to the client to decide if it should lead to a port reconfiguration. Settings are propagated to the other port for fields they have in common. But this event is only triggered on the other port if it actually change a setting. https://bugzilla.gnome.org/show_bug.cgi?id=783976 --- omx/gstomxvideodec.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index b0b4e0203b..0cb984a036 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -775,6 +775,24 @@ gst_omx_video_dec_allocate_output_buffers (GstOMXVideoDec * self) gst_omx_error_to_string (err), err); goto done; } +#if OMX_VERSION_MINOR == 2 + /* In OMX-IL 1.2.0, the nBufferCountActual change is propagated to the + * the input port upon call to the SetParameter on out port above. This + * propagation triggers a SettingsChanged event. It is up to the client + * to decide if this event should lead to reconfigure the port. Here + * this is clearly informal so lets just acknowledge the event to avoid + * input port reconfiguration. Note that the SettingsChanged event will + * be sent in-context of the SetParameter call above. So the event is + * garantie to be proceeded in the handle_message call below. */ + err = gst_omx_port_mark_reconfigured (self->dec_in_port); + + if (err != OMX_ErrorNone) { + GST_ERROR_OBJECT (self, + "Failed to acknowledge port settings changed: %s (0x%08x)", + gst_omx_error_to_string (err), err); + goto done; + } +#endif } if (!gst_omx_port_is_enabled (port)) { @@ -2070,11 +2088,23 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder, return FALSE; } } - +#if OMX_VERSION_MINOR == 2 + /* In OMX-IL 1.2.0, the nFrameWidth/Height changes are propagated to the + * the output port upon call to the SetParameter on in port above. This + * propagation triggers a SettingsChanged event. It is up to the client + * to decide if this event should lead to reconfigure the port. Here + * this is clearly informal so lets just acknowledge the event to avoid + * output port reconfiguration. Note that the SettingsChanged event will + * be sent in-context of the SetParameter call above. So the event is + * garantie to be proceeded in the handle_message call below. */ + if (gst_omx_port_mark_reconfigured (self->dec_out_port) != OMX_ErrorNone) + return FALSE; +#else GST_DEBUG_OBJECT (self, "Updating outport port definition"); if (gst_omx_port_update_port_definition (self->dec_out_port, NULL) != OMX_ErrorNone) return FALSE; +#endif gst_buffer_replace (&self->codec_data, state->codec_data); self->input_state = gst_video_codec_state_ref (state);