GNOME Bugzilla – Bug 782418
omxvideodec : added to get port definition during reconfigure process
Last modified: 2017-07-05 09:53:48 UTC
Created attachment 351505 [details] [review] added to get port definition during recofigure process. If the port is reconfigured with GST_OMX_HACK_NO_COMPONENT_RECONFIGURE enabled, the port definition will not be updated and you need to add the same code as the patch.
Created attachment 351506 [details] [review] added to get port definition during recofigure process
Comment on attachment 351506 [details] [review] added to get port definition during recofigure process Need to do the same thing in the video encoder, audio encoder, audio decoder. And maybe this should just be part of gst_omx_video_dec_open() instead?
I have encountered a crash during video decoding, but it seems to be a problem in other cases. add to patch?
(In reply to Sejun Park from comment #3) > I have encountered a crash during video decoding, but it seems to be a > problem in other cases. add to patch? Hi, thx for the patch but it looks to me to be already part of gst_omx_video_dec_open() (and others) because it calls gst_omx_component_add_port ? (see https://cgit.freedesktop.org/gstreamer/gst-omx/tree/omx/gstomx.c#n936)
thank you for your feedback. After the reconfigure process, the port definition needs to be updated. How do I update the port by calling gst_omx_component_add_port()? (see https://cgit.freedesktop.org/gstreamer/gst-omx/tree/omx/gstomxvideodec.c#n1978) Below is a callstack that crashes when the core is destroyed because the port is not updated.
+ Trace 237614
Correct. This is not a reconfiguration process, but it is the point at which the omx core is reloaded when the resolution is changed. So the port definition needs to be updated.
I understand now your patch now, in fact in gst_omx_video_dec_set_format it maintains a local copy of the port_def. So this local copy becomes obsolete when doing close/open. Indeed open will only update port->port_def but not the local copy. So I will push your patch and I will apply the same change to audio_enc, video_enc too. (not needed for audio_dec because no local port_def copy somehow)
Comment on attachment 351506 [details] [review] added to get port definition during recofigure process commit c7e66b473fb45cbea49fe5348dd50a21b16d5be4 Author: Julien Isorce <jisorce@oblong.com> Date: Wed Jul 5 10:47:41 2017 +0100 omxaudioenc: update local port_def after reopening the component gst_omx_audio_enc_open will only update GstOMXAudioEnc->port->port_def. Note that the component is reopen only if the flag GST_OMX_HACK_NO_COMPONENT_RECONFIGURE is set. https://bugzilla.gnome.org/show_bug.cgi?id=782418 commit 786a2617b2f90dbfaff3e47a9e49ca7b3f0397c2 Author: Julien Isorce <jisorce@oblong.com> Date: Wed Jul 5 10:48:52 2017 +0100 omxvideoenc: update local port_def after reopening the component gst_omx_video_enc_open will only update GstOMXVideoEnc->port->port_def. Note that the component is reopen only if the flag GST_OMX_HACK_NO_COMPONENT_RECONFIGURE is set. https://bugzilla.gnome.org/show_bug.cgi?id=782418 commit ebc9b4903cbdac2793c24b05a1bb7acc3b67fae5 Author: Sejun Park <sejun79.park@samsung.com> Date: Wed May 10 12:38:39 2017 +0900 omxvideodec: update local port_def after reopening the component gst_omx_video_dec_open will only update GstOMXVideoDec->port->port_def. Note that the component is reopen only if the flag GST_OMX_HACK_NO_COMPONENT_RECONFIGURE is set. https://bugzilla.gnome.org/show_bug.cgi?id=782418