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 740111 - omxvideodec: renders video flipped upside down when using egl_render
omxvideodec: renders video flipped upside down when using egl_render
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-omx
git master
Other Linux
: Normal normal
: 1.11.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-11-14 09:38 UTC by George Kiagiadakis
Modified: 2016-12-01 17:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description George Kiagiadakis 2014-11-14 09:38:04 UTC
When using egl_render, video is rendered upside down. Apparently, there is a line of code in gstomxvideodec.c that reads:

gst_egl_image_memory_set_orientation (mem,
    GST_VIDEO_GL_TEXTURE_ORIENTATION_X_NORMAL_Y_FLIP);

I assume this was some kind of workaround for some firmware bug, but it no longer is necessary. This line should be removed.
Comment 1 Sebastian Dröge (slomo) 2014-11-14 11:08:11 UTC
This was needed for the Raspberry Pi because the decoder renderers (or rendered?) the video frames in GL orientation (0,0 is bottom left corner). Unfortunately the expected coordinate system for the EGLImages is not defined by the OMX spec or anything IIRC, so we will have to use different values here depending on what the hardware does.
Comment 2 Nicolas Dufresne (ndufresne) 2014-11-14 15:44:21 UTC
That should make it to the config I think. Default code should assume things are rendered streight, and then config quirks should fix it.

Are you running this on Raspberry Pi ?
Comment 3 George Kiagiadakis 2014-11-15 21:49:54 UTC
Yes, I am testing this on the RPi, and currently any video playing through egl_render -> eglglessink is rendered upside down. This is why I said, this was probably some firmware bug that has been fixed now.
Comment 4 Julien Isorce 2014-11-16 11:05:26 UTC
Which gst-omx version are you using ? ( just to know, I can see the line you pointed is still there in upstream)

Have you tried with glimagesink ?
Comment 5 Nicolas Dufresne (ndufresne) 2014-11-16 15:16:07 UTC
FYI Raspbian still ship 1.2.0.
Comment 6 George Kiagiadakis 2014-12-02 09:16:13 UTC
I'm using the version from raspbian (gst-omx 1.0.0 + patches / gstreamer 1.2.x).
I tried to use glimagesink (by compiling gst 1.4 / gst-omx 1.2.0), but it crashed and I didn't have the time to investigate.
Comment 7 Julien Isorce 2014-12-03 07:43:06 UTC
Could you try with glimagesink from gst-plugins-bad 1.4.0 and 1.4.1 ? (Last time I had a Pi it was just before 1.4.0 released)
Comment 8 Philippe Normand 2015-03-24 13:48:13 UTC
I can't reproduce this issue with current git master and glimagesink on my RPi2.
Comment 9 Julien Isorce 2015-03-24 13:56:41 UTC
Philippe could you try to remove the line:

gst_egl_image_memory_set_orientation (mem,
    GST_VIDEO_GL_TEXTURE_ORIENTATION_X_NORMAL_Y_FLIP);

in gstomxvideodec.c ?

I am pretty sure it is obsolete as George said.
Also in -bad/gst-libs/gst/gl/egl/gsteglimagememory.c I can see:

GstVideoGLTextureOrientation
gst_egl_image_memory_get_orientation (GstMemory * mem)
{
  g_return_val_if_fail (gst_is_egl_image_memory (mem),
      GST_VIDEO_GL_TEXTURE_ORIENTATION_X_NORMAL_Y_NORMAL);


Thx!
Comment 10 Philippe Normand 2015-03-24 14:09:00 UTC
Can be safely removed indeed :)
Comment 11 Julien Isorce 2015-03-24 16:55:18 UTC
George feel free to make the patch and push it.
Comment 12 Philippe Normand 2016-12-01 17:36:38 UTC
commit baaf404f2be936dff082e179521f0cb468375135
Author: Matthew Waters <matthew@centricular.com>
Date:   Thu Nov 17 19:56:35 2016 +1100

    videodecoder: remove use of EGLImage orientation

    New code should use GstVideoTransformationMeta

    (The defaults do the right thing here though).