After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 782418 - omxvideodec : added to get port definition during reconfigure process
omxvideodec : added to get port definition during reconfigure process
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-omx
unspecified
Other All
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-05-10 03:40 UTC by Sejun Park
Modified: 2017-07-05 09:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
added to get port definition during recofigure process. (1.25 KB, patch)
2017-05-10 03:40 UTC, Sejun Park
none Details | Review
added to get port definition during recofigure process (892 bytes, patch)
2017-05-10 03:46 UTC, Sejun Park
committed Details | Review

Description Sejun Park 2017-05-10 03:40:06 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.
Comment 1 Sejun Park 2017-05-10 03:46:10 UTC
Created attachment 351506 [details] [review]
added to get port definition during recofigure process
Comment 2 Sebastian Dröge (slomo) 2017-05-19 09:03:10 UTC
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?
Comment 3 Sejun Park 2017-05-22 03:40:23 UTC
I have encountered a crash during video decoding, but it seems to be a problem in other cases. add to patch?
Comment 4 Julien Isorce 2017-06-19 22:50:52 UTC
(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)
Comment 5 Sejun Park 2017-07-05 02:49:21 UTC
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.

  • #0 __GI_raise
    at ../sysdeps/unix/sysv/linux/raise.c line 58
  • #1 __GI_abort
    at abort.c line 89
  • #2 __libc_message
    at ../sysdeps/posix/libc_fatal.c line 175
  • #3 malloc_printerr
  • #4 _int_free
    at malloc.c line 3902
  • #5 Exynos_OMX_VideoDecodeComponentDeinit
    at Exynos_OMX_Vdec.c line 1319
  • #6 Exynos_OMX_ComponentDeinit
    at Exynos_OMX_H264dec.c line 2852

Comment 6 Sejun Park 2017-07-05 02:56:41 UTC
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.
Comment 7 Julien Isorce 2017-07-05 09:00:33 UTC
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 8 Julien Isorce 2017-07-05 09:51:42 UTC
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