mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-04 22:48:54 +00:00
Make it possible to use the GtkVideoPlayer example on Win32 too
This commit is contained in:
parent
2793937d48
commit
3cf8f5ebc4
1 changed files with 15 additions and 2 deletions
|
@ -106,7 +106,17 @@ public class MainWindow : Gtk.Window {
|
||||||
|
|
||||||
_pipeline.Add (playbin);
|
_pipeline.Add (playbin);
|
||||||
|
|
||||||
|
switch (System.Environment.OSVersion.Platform) {
|
||||||
|
case PlatformID.Unix:
|
||||||
(sink as XOverlay).XwindowId = gdk_x11_drawable_get_xid (_da.GdkWindow.Handle);
|
(sink as XOverlay).XwindowId = gdk_x11_drawable_get_xid (_da.GdkWindow.Handle);
|
||||||
|
break;
|
||||||
|
case PlatformID.Win32NT:
|
||||||
|
case PlatformID.Win32S:
|
||||||
|
case PlatformID.Win32Windows:
|
||||||
|
case PlatformID.WinCE:
|
||||||
|
(sink as XOverlay).XwindowId = (ulong) gdk_win32_drawable_get_handle (_da.GdkWindow.Handle);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
playbin["video-sink"] = sink;
|
playbin["video-sink"] = sink;
|
||||||
playbin["uri"] = "file://" + dialog.Filename;
|
playbin["uri"] = "file://" + dialog.Filename;
|
||||||
|
@ -183,6 +193,9 @@ public class MainWindow : Gtk.Window {
|
||||||
return string.Format ("{0}:{1:d2}", mins, secs);
|
return string.Format ("{0}:{1:d2}", mins, secs);
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport ("libgdk-x11-2.0") ]
|
[DllImport ("libgdk-x11-2.0.so.0") ]
|
||||||
static extern uint gdk_x11_drawable_get_xid (IntPtr handle);
|
static extern uint gdk_x11_drawable_get_xid (IntPtr handle);
|
||||||
|
|
||||||
|
[DllImport ("libgdk-win32-2.0-0.dll") ]
|
||||||
|
static extern IntPtr gdk_win32_drawable_get_handle (IntPtr handle);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue