summaryrefslogtreecommitdiff
path: root/src/video_out/video_out_sdl.c
diff options
context:
space:
mode:
authorMatthias Ringwald <mringwal@inf.ethz.ch>2008-10-19 16:55:34 +0200
committerMatthias Ringwald <mringwal@inf.ethz.ch>2008-10-19 16:55:34 +0200
commit2c5aa1b2a0964a6df110d3cad0946b0870c62c0c (patch)
treee555777a3a7057d1a96d854df4346e54fc5659fb /src/video_out/video_out_sdl.c
parent3186621e53a1c78ea093cf6ae9672cc7166b6ac7 (diff)
downloadxine-lib-2c5aa1b2a0964a6df110d3cad0946b0870c62c0c.tar.gz
xine-lib-2c5aa1b2a0964a6df110d3cad0946b0870c62c0c.tar.bz2
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. --HG-- extra : transplant_source : E%169%A2%B4%93%3CY%07%A9%9F%1C%E0%B8-%14m4%A2%11
Diffstat (limited to 'src/video_out/video_out_sdl.c')
-rw-r--r--src/video_out/video_out_sdl.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/video_out/video_out_sdl.c b/src/video_out/video_out_sdl.c
index b53d1d31c..89150f5d0 100644
--- a/src/video_out/video_out_sdl.c
+++ b/src/video_out/video_out_sdl.c
@@ -469,9 +469,11 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
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,14 +504,18 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
_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) {
xprintf (this->xine, XINE_VERBOSITY_DEBUG, "video_out_sdl: open_plugin - sdl video initialization failed.\n");
return NULL;