[prev in list] [next in list] [prev in thread] [next in thread]
List: xine-devel
Subject: [xine-devel] [PATCH] Pass native HWND through xine to SDL
From: Matthias Ringwald <mringwal () inf ! ethz ! ch>
Date: 2008-10-19 15:00:23
Message-ID: 4A45DE42-3E23-4E6E-91F3-303D21D8744A () inf ! ethz ! ch
[Download RAW message or body]
# HG changeset patch
# User Matthias Ringwald <mringwal@inf.ethz.ch>
# Date 1224428134 -7200
# Node ID 15453fe24c4bd590d017d9cddd213e716eb947be
# Parent c00be186074eb83b7a2a9174941c311b79ca4933
Pass native HWND through xine to SDL
To place SDL output inside an existing window, the SDL_WINDOWID
environement
variable has to be set. This was done by the SDL video out pluging if
HAVE_X11 was defined, but not for WIN32, where it works as well.
diff -r c00be186074e -r 15453fe24c4b src/video_out/video_out_sdl.c
--- a/src/video_out/video_out_sdl.c Thu Oct 16 00:15:12 2008 +0200
+++ b/src/video_out/video_out_sdl.c Sun Oct 19 16:55:34 2008 +0200
@@ -469,9 +469,11 @@
sdl_driver_t *this;
const SDL_VideoInfo *vidInfo;
-#ifdef HAVE_X11
+#if defined(HAVE_X11) || defined(WIN32)
static char SDL_windowhack[32];
x11_visual_t *visual = (x11_visual_t *) visual_gen;
+#endif
+#ifdef HAVE_X11
XWindowAttributes window_attributes;
#endif
@@ -502,12 +504,16 @@
_x_vo_scale_init( &this->sc, 0, 0, config);
this->sc.frame_output_cb = visual->frame_output_cb;
this->sc.user_data = visual->user_data;
-
- /* set SDL to use our existing X11 window */
- sprintf(SDL_windowhack,"SDL_WINDOWID=0x%x", (uint32_t) this-
>drawable );
- putenv(SDL_windowhack);
#else
_x_vo_scale_init( &this->sc, 0, 0, config );
+#endif
+
+#if defined(HAVE_X11) || defined(WIN32)
+ /* set SDL to use our existing X11/win32 window */
+ if (visual->d){
+ sprintf(SDL_windowhack,"SDL_WINDOWID=0x%x", (uint32_t) visual->d);
+ putenv(SDL_windowhack);
+ }
#endif
if ((SDL_Init (SDL_INIT_VIDEO)) < 0) {
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
xine-devel mailing list
xine-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xine-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic