mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
gtk: Cairo color formats are in native endianness, GStreamer's in memory order
CAIRO_FORMAT_ARGB32 is ARGB on big endian and BGRA on little endian.
This commit is contained in:
parent
05fa796c25
commit
bd9ec0f333
2 changed files with 12 additions and 1 deletions
|
@ -51,11 +51,17 @@ static gboolean gst_gtk_sink_set_caps (GstBaseSink * bsink, GstCaps * caps);
|
|||
static GstFlowReturn gst_gtk_sink_show_frame (GstVideoSink * bsink,
|
||||
GstBuffer * buf);
|
||||
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
#define FORMATS "BGRA"
|
||||
#else
|
||||
#define FORMATS "ARGB"
|
||||
#endif
|
||||
|
||||
static GstStaticPadTemplate gst_gtk_sink_template =
|
||||
GST_STATIC_PAD_TEMPLATE ("sink",
|
||||
GST_PAD_SINK,
|
||||
GST_PAD_ALWAYS,
|
||||
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("BGRA"))
|
||||
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (FORMATS))
|
||||
);
|
||||
|
||||
#define DEFAULT_FORCE_ASPECT_RATIO TRUE
|
||||
|
|
|
@ -431,8 +431,13 @@ gtk_gst_widget_set_caps (GtkGstWidget * widget, GstCaps * caps)
|
|||
return FALSE;
|
||||
|
||||
/* FIXME: support other formats */
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
g_return_val_if_fail (GST_VIDEO_INFO_FORMAT (&v_info) ==
|
||||
GST_VIDEO_FORMAT_BGRA, FALSE);
|
||||
#else
|
||||
g_return_val_if_fail (GST_VIDEO_INFO_FORMAT (&v_info) ==
|
||||
GST_VIDEO_FORMAT_ARGB, FALSE);
|
||||
#endif
|
||||
|
||||
g_mutex_lock (&widget->priv->lock);
|
||||
|
||||
|
|
Loading…
Reference in a new issue