mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-30 11:08:34 +00:00
Make the AppSrc example work on big endian architectures too
Cairo's ARGB32 format is defined to be native endianness, i.e. we have to use GST_VIDEO_FORMAT_ARGB or _BGRA depending on endianness.
This commit is contained in:
parent
3cf8f5ebc4
commit
77f6d6dc59
1 changed files with 2 additions and 1 deletions
|
@ -36,7 +36,8 @@ public class AppSrcDemo
|
|||
Element.Link(appsrc, color, sink);
|
||||
|
||||
// Set the caps on the AppSrc to RGBA, 640x480, 4 fps, square pixels
|
||||
appsrc.Caps = Gst.Video.VideoUtil.FormatNewCaps(Gst.Video.VideoFormat.BGRA, 640, 480, 4, 1, 1, 1);
|
||||
Gst.Video.VideoFormat fmt = (BitConverter.IsLittleEndian) ? Gst.Video.VideoFormat.BGRA : Gst.Video.VideoFormat.ARGB;
|
||||
appsrc.Caps = Gst.Video.VideoUtil.FormatNewCaps(fmt, 640, 480, 4, 1, 1, 1);
|
||||
|
||||
// Connect the handlers
|
||||
appsrc.NeedData += PushAppData;
|
||||
|
|
Loading…
Reference in a new issue