Commit 2fc01d78 authored by Andrés G. Aragoneses's avatar Andrés G. Aragoneses

GStreamerSharp: use Hyena for platform detection

This way we avoid the horrible System.Environment.OSVersion API.
parent 581d1028
......@@ -4,7 +4,7 @@
// Authors:
// Olivier Dufour <olivier.duff@gmail.com>
// Andrés G. Aragoneses <knocte@gmail.com>
// Stephan Sundermann <stephansundermann@gmail.com>
// Stephan Sundermann <stephansundermann@gmail.com>
//
// Copyright (C) 2011 Olivier Dufour
// Copyright (C) 2013 Andrés G. Aragoneses
......@@ -294,21 +294,14 @@ namespace Banshee.GStreamerSharp
public void WindowRealize (IntPtr window)
{
switch (System.Environment.OSVersion.Platform) {
case PlatformID.Unix:
if (PlatformDetection.IsWindows) {
video_window_xid = (ulong)gdk_win32_drawable_get_handle (window);
} else if (PlatformDetection.IsUnix) {
//FIXME: we should maybe stop relying on x11 http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstvideooverlay.html#GstVideoOverlay
video_window_xid = (ulong)gdk_x11_window_get_xid (window);
break;
case PlatformID.Win32NT:
case PlatformID.Win32S:
case PlatformID.Win32Windows:
case PlatformID.WinCE:
video_window_xid = (ulong)gdk_win32_drawable_get_handle (window);
break;
video_window_xid = (ulong)gdk_x11_window_get_xid (window);
}
}
[DllImport ("libgdk-3-0.dll")]
private static extern IntPtr gdk_x11_window_get_xid (IntPtr drawable);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment