diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-08-14 08:40:47 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-08-14 08:40:47 +0200 |
commit | 77f6d6dc59ca04f9aaebad80e9e699d406aafb98 (patch) | |
tree | 6a7c2885f3b2b68886661767c3f788d1fac57f8f | |
parent | 3cf8f5ebc489ff009f163aa9e5f5c4b84052d182 (diff) |
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.
-rw-r--r-- | samples/AppSrc.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/samples/AppSrc.cs b/samples/AppSrc.cs index 7cdead9..13d5ff2 100644 --- a/samples/AppSrc.cs +++ b/samples/AppSrc.cs @@ -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; |