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:
Sebastian Dröge 2009-08-14 08:40:47 +02:00
parent 3cf8f5ebc4
commit 77f6d6dc59

View file

@ -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;