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 723289 - cairooverlay: add RGB16 support
cairooverlay: add RGB16 support
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.x
Other All
: Normal enhancement
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-01-30 14:38 UTC by Julien Isorce
Modified: 2014-02-02 13:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
cairooverlay: add support for RGB16 (1.90 KB, patch)
2014-01-30 14:38 UTC, Julien Isorce
needs-work Details | Review
cairooverlay: add support for RGB16 (1.85 KB, patch)
2014-01-31 11:54 UTC, Julien Isorce
accepted-commit_now Details | Review

Description Julien Isorce 2014-01-30 14:38:44 UTC
Created attachment 267646 [details] [review]
cairooverlay: add support for RGB16

* actual result:

On RPI it's currently not possible to do gst-launch-1.0 videotestsrc ! "video/x-raw, format=RGB16" ! cairooverlay ! "video/x-raw, format=RGB16" ! ximagesink

and ximagesink reports to support GST_VIDEO_FORMAT_RGB16

(It's intended to work with gst-omx+resize component but easier to report something with videotestsrc)

* other infos:

In the following patch that's a bit weird to have:

#if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define TEMPLATE_CAPS GST_VIDEO_CAPS_MAKE("{ RGB16, BGRx, BGRA }")
#else
#define TEMPLATE_CAPS GST_VIDEO_CAPS_MAKE("{ BGR16, xRGB, ARGB }")


Shouldn't be BGR16 on the first line and RGB16 on the second ? But ximagesink report RGB16 and videotestsrc ! ximagesink  shows the right color. (if ximagesink reports wrong then that would mean videotestsrc generates the wrong image)

Let me know what you think. Also format like RGBx and xBGR have no equivalent in cairo ?
Comment 1 Sebastian Dröge (slomo) 2014-01-30 19:42:14 UTC
Review of attachment 267646 [details] [review]:

::: ext/cairo/gstcairooverlay.c
@@ +101,2 @@
 #else
+#define TEMPLATE_CAPS GST_VIDEO_CAPS_MAKE("{ BGR16, xRGB, ARGB }")

It's RGB16 for both cases because RGB16 is native-endianness in GStreamer. For the other two it's correct this way. And there are no other formats in cairo.
Comment 2 Tim-Philipp Müller 2014-01-30 19:50:18 UTC
Also, please make it the last format in the list since it's the lowest quality one and the least common one.
Comment 3 Julien Isorce 2014-01-31 11:54:11 UTC
Created attachment 267719 [details] [review]
cairooverlay: add support for RGB16

(In reply to comment #1)
(In reply to comment #2)

Done

I also changed the default case (in the switch ) as I think it's better to just fail at this point. But then I wonder if I should use GST_ELEMENT_ERROR here instead of a GST_WARNING.
Comment 4 Sebastian Dröge (slomo) 2014-01-31 13:30:18 UTC
I think an assertion would also be fine. If you get in the default case, GStreamer core did something wrong or there's a really bad bug in the element.
Comment 5 Sebastian Dröge (slomo) 2014-01-31 13:31:09 UTC
Review of attachment 267719 [details] [review]:

::: ext/cairo/gstcairooverlay.c
@@ +166,3 @@
+      GST_WARNING ("No matching cairo format for %s",
+          gst_video_format_to_string (GST_VIDEO_FRAME_FORMAT (frame)));
+      return GST_FLOW_ERROR;

So I think this is ok, but could as well be an assertion. It just must not happen unless something is really really wrong elsewhere already :)
Comment 6 Julien Isorce 2014-01-31 14:14:07 UTC
(In reply to comment #5)
> Review of attachment 267719 [details] [review]:
> 
> ::: ext/cairo/gstcairooverlay.c
> @@ +166,3 @@
> +      GST_WARNING ("No matching cairo format for %s",
> +          gst_video_format_to_string (GST_VIDEO_FRAME_FORMAT (frame)));
> +      return GST_FLOW_ERROR;
> 
> So I think this is ok, but could as well be an assertion. It just must not
> happen unless something is really really wrong elsewhere already :)
ok
Comment 7 Tim-Philipp Müller 2014-02-02 13:23:48 UTC
Looks like this was committed:

commit 90b01fce6156359b0787172b380f51cb63c15c98
Author: Julien Isorce <julien.isorce@collabora.co.uk>
Date:   Fri Jan 31 14:17:54 2014 +0000

    cairooverlay: add support for RGB16
    
    https://bugzilla.gnome.org/show_bug.cgi?id=723289