omxvidee{enc,dec}: refresh input port definition after setting format
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 28 May 2018 13:02:13 +0000 (15:02 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 8 Jun 2018 07:38:57 +0000 (09:38 +0200)
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

omx/gstomxvideodec.c
omx/gstomxvideoenc.c

index 29b8fce..1d94cce 100644 (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);
index 20e5108..8a0ed3f 100644 (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 */