[334/906] [win32/winCE] fix some pointer cast warnings with mingw

And turn off deprecated Wp64 msvc compiler option.
This commit is contained in:
Julien Isorce 2009-04-20 23:48:15 +02:00 committed by Tim-Philipp Müller
parent d43fdd3daf
commit f631cf4976
5 changed files with 25 additions and 37 deletions

View file

@ -2088,7 +2088,7 @@ gst_gl_display_new (void)
* Called by the first gl element of a video/x-raw-gl flow */ * Called by the first gl element of a video/x-raw-gl flow */
void void
gst_gl_display_create_context (GstGLDisplay * display, gst_gl_display_create_context (GstGLDisplay * display,
GLint width, GLint height, guint64 external_gl_context) GLint width, GLint height, gulong external_gl_context)
{ {
gst_gl_display_lock (display); gst_gl_display_lock (display);

View file

@ -137,7 +137,7 @@ struct _GstGLDisplay
gpointer upload_data; gpointer upload_data;
//foreign gl context //foreign gl context
guint64 external_gl_context; gulong external_gl_context;
//filter gen fbo //filter gen fbo
GLuint gen_fbo_width; GLuint gen_fbo_width;
@ -240,7 +240,7 @@ GType gst_gl_display_get_type (void);
GstGLDisplay *gst_gl_display_new (void); GstGLDisplay *gst_gl_display_new (void);
void gst_gl_display_create_context (GstGLDisplay * display, void gst_gl_display_create_context (GstGLDisplay * display,
GLint width, GLint height, guint64 external_gl_context); GLint width, GLint height, gulong external_gl_context);
gboolean gst_gl_display_redisplay (GstGLDisplay * display, GLuint texture, gboolean gst_gl_display_redisplay (GstGLDisplay * display, GLuint texture,
gint width, gint height, gboolean keep_aspect_ratio); gint width, gint height, gboolean keep_aspect_ratio);

View file

@ -79,9 +79,9 @@ struct _GstGLWindowClass {
GQuark gst_gl_window_error_quark (void); GQuark gst_gl_window_error_quark (void);
GType gst_gl_window_get_type (void); GType gst_gl_window_get_type (void);
GstGLWindow * gst_gl_window_new (gint width, gint height, guint64 external_gl_context); GstGLWindow * gst_gl_window_new (gint width, gint height, gulong external_gl_context);
void gst_gl_window_set_external_window_id (GstGLWindow *window, guint64 id); void gst_gl_window_set_external_window_id (GstGLWindow *window, gulong id);
void gst_gl_window_set_draw_callback (GstGLWindow *window, GstGLWindowCB callback, gpointer data); void gst_gl_window_set_draw_callback (GstGLWindow *window, GstGLWindowCB callback, gpointer data);
void gst_gl_window_set_resize_callback (GstGLWindow *window, GstGLWindowCB2 callback, gpointer data); void gst_gl_window_set_resize_callback (GstGLWindow *window, GstGLWindowCB2 callback, gpointer data);
void gst_gl_window_set_close_callback (GstGLWindow *window, GstGLWindowCB callback, gpointer data); void gst_gl_window_set_close_callback (GstGLWindow *window, GstGLWindowCB callback, gpointer data);

View file

@ -75,9 +75,6 @@ HHOOK hHook;
static void static void
gst_gl_window_finalize (GObject * object) gst_gl_window_finalize (GObject * object)
{ {
GstGLWindow *window = GST_GL_WINDOW (object);
GstGLWindowPrivate *priv = window->priv;
G_OBJECT_CLASS (gst_gl_window_parent_class)->finalize (object); G_OBJECT_CLASS (gst_gl_window_parent_class)->finalize (object);
} }
@ -90,11 +87,6 @@ gst_gl_window_log_handler (const gchar * domain, GLogLevelFlags flags,
} }
} }
static void
gst_gl_window_base_init (gpointer g_class)
{
}
static void static void
gst_gl_window_class_init (GstGLWindowClass * klass) gst_gl_window_class_init (GstGLWindowClass * klass)
{ {
@ -126,7 +118,7 @@ gst_gl_window_class_init (GstGLWindowClass * klass)
atom = RegisterClass (&wc); atom = RegisterClass (&wc);
if (atom == 0) if (atom == 0)
g_error ("Failed to register window class %x\r\n", GetLastError ()); g_error ("Failed to register window class %lud\n", GetLastError ());
} }
} }
@ -144,11 +136,10 @@ gst_gl_window_init (GstGLWindow * window)
/* Must be called in the gl thread */ /* Must be called in the gl thread */
GstGLWindow * GstGLWindow *
gst_gl_window_new (gint width, gint height, guint64 external_gl_context) gst_gl_window_new (gint width, gint height, DWORD_PTR external_gl_context)
{ {
GstGLWindow *window = g_object_new (GST_GL_TYPE_WINDOW, NULL); GstGLWindow *window = g_object_new (GST_GL_TYPE_WINDOW, NULL);
GstGLWindowPrivate *priv = window->priv; GstGLWindowPrivate *priv = window->priv;
GstGLWindowClass *klass = GST_GL_WINDOW_GET_CLASS (window);
HINSTANCE hinstance = GetModuleHandle (NULL); HINSTANCE hinstance = GetModuleHandle (NULL);
@ -182,11 +173,11 @@ gst_gl_window_new (gint width, gint height, guint64 external_gl_context)
x, y, width, height, (HWND) NULL, (HMENU) NULL, hinstance, window); x, y, width, height, (HWND) NULL, (HMENU) NULL, hinstance, window);
if (!priv->internal_win_id) { if (!priv->internal_win_id) {
g_debug ("failed to create gl window: %d\n", priv->internal_win_id); g_debug ("failed to create gl window: %lud\n", (gulong) priv->internal_win_id);
return NULL; return NULL;
} }
g_debug ("gl window created: %d\n", priv->internal_win_id); g_debug ("gl window created: %lud\n", (gulong) priv->internal_win_id);
//device is set in the window_proc //device is set in the window_proc
g_assert (priv->device); g_assert (priv->device);
@ -203,11 +194,11 @@ gst_gl_window_error_quark (void)
} }
void void
gst_gl_window_set_external_window_id (GstGLWindow * window, guint64 id) gst_gl_window_set_external_window_id (GstGLWindow * window, gulong id)
{ {
GstGLWindowPrivate *priv = window->priv; GstGLWindowPrivate *priv = window->priv;
WNDPROC window_parent_proc = WNDPROC window_parent_proc =
(WNDPROC) (guint64) GetWindowLongPtr ((HWND) id, GWL_WNDPROC); (WNDPROC) GetWindowLongPtr ((HWND) id, GWL_WNDPROC);
RECT rect; RECT rect;
SetProp (priv->internal_win_id, "gl_window_parent_id", (HWND) id); SetProp (priv->internal_win_id, "gl_window_parent_id", (HWND) id);
@ -285,7 +276,6 @@ gst_gl_window_draw (GstGLWindow * window)
void void
gst_gl_window_run_loop (GstGLWindow * window) gst_gl_window_run_loop (GstGLWindow * window)
{ {
GstGLWindowPrivate *priv = window->priv;
gboolean running = TRUE; gboolean running = TRUE;
gboolean bRet = FALSE; gboolean bRet = FALSE;
MSG msg; MSG msg;
@ -294,7 +284,7 @@ gst_gl_window_run_loop (GstGLWindow * window)
while (running && (bRet = GetMessage (&msg, NULL, 0, 0)) != 0) { while (running && (bRet = GetMessage (&msg, NULL, 0, 0)) != 0) {
if (bRet == -1) { if (bRet == -1) {
g_error ("Failed to get message %x\r\n", GetLastError ()); g_error ("Failed to get message %lud\n", GetLastError ());
running = FALSE; running = FALSE;
} else { } else {
TranslateMessage (&msg); TranslateMessage (&msg);
@ -398,20 +388,20 @@ window_proc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
gst_gl_window_set_pixel_format (window); gst_gl_window_set_pixel_format (window);
priv->gl_context = wglCreateContext (priv->device); priv->gl_context = wglCreateContext (priv->device);
if (priv->gl_context) if (priv->gl_context)
g_debug ("gl context created: %d\n", priv->gl_context); g_debug ("gl context created: %lud\n", (gulong) priv->gl_context);
else else
g_debug ("failed to create glcontext %d, %x\r\n", hWnd, g_debug ("failed to create glcontext %lud, %lud\n", (gulong) hWnd,
GetLastError ()); GetLastError ());
g_assert (priv->gl_context); g_assert (priv->gl_context);
ReleaseDC (hWnd, priv->device); ReleaseDC (hWnd, priv->device);
if (!wglMakeCurrent (priv->device, priv->gl_context)) if (!wglMakeCurrent (priv->device, priv->gl_context))
g_debug ("failed to make opengl context current %d, %x\r\n", hWnd, g_debug ("failed to make opengl context current %lud, %lud\n", (gulong) hWnd,
GetLastError ()); GetLastError ());
if (priv->external_gl_context) { if (priv->external_gl_context) {
if (!wglShareLists (priv->gl_context, priv->external_gl_context)) if (!wglShareLists (priv->gl_context, priv->external_gl_context))
g_debug ("failed to share opengl context %lud with %lud\n", g_debug ("failed to share opengl context %lud with %lud\n",
priv->gl_context, priv->external_gl_context); (gulong) priv->gl_context, (gulong) priv->external_gl_context);
else else
g_debug ("share opengl context succeed\n"); g_debug ("share opengl context succeed\n");
} }
@ -488,7 +478,7 @@ window_proc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
g_assert (parent_proc); g_assert (parent_proc);
SetWindowLongPtr (parent_id, GWL_WNDPROC, SetWindowLongPtr (parent_id, GWL_WNDPROC,
(LONG) (guint64) parent_proc); (LONG) parent_proc);
SetParent (hWnd, NULL); SetParent (hWnd, NULL);
RemoveProp (parent_id, "gl_window_parent_proc"); RemoveProp (parent_id, "gl_window_parent_proc");
@ -499,20 +489,18 @@ window_proc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
RemoveProp (hWnd, "gl_window"); RemoveProp (hWnd, "gl_window");
if (!wglMakeCurrent (NULL, NULL)) if (!wglMakeCurrent (NULL, NULL))
g_debug ("failed to make current %d, %x\r\n", hWnd, GetLastError ()); g_debug ("failed to make current %lud, %lud\n", (gulong) hWnd, GetLastError ());
if (priv->gl_context) { if (priv->gl_context) {
if (!wglDeleteContext (priv->gl_context)) if (!wglDeleteContext (priv->gl_context))
g_debug ("failed to destroy context %d, %x\r\n", priv->gl_context, g_debug ("failed to destroy context %lud, %lud\n", (gulong) priv->gl_context,
GetLastError ()); GetLastError ());
} }
if (priv->internal_win_id) { if (priv->internal_win_id) {
g_debug ("BEFORE\n");
if (!DestroyWindow (priv->internal_win_id)) if (!DestroyWindow (priv->internal_win_id))
g_debug ("failed to destroy window %d, %x\r\n", hWnd, g_debug ("failed to destroy window %lud, %lud\n", (gulong) hWnd,
GetLastError ()); GetLastError ());
g_debug ("AFTER\n");
} }
PostQuitMessage (0); PostQuitMessage (0);

View file

@ -123,7 +123,7 @@ gst_gl_window_class_init (GstGLWindowClass * klass)
atom = RegisterClass (&wc); atom = RegisterClass (&wc);
if (atom == 0) if (atom == 0)
g_error ("Failed to register window class %x\r\n", GetLastError ()); g_error ("Failed to register window class %lud\n", GetLastError ());
} }
} }
@ -141,7 +141,7 @@ gst_gl_window_init (GstGLWindow * window)
/* Must be called in the gl thread */ /* Must be called in the gl thread */
GstGLWindow * GstGLWindow *
gst_gl_window_new (gint width, gint height, guint64 external_gl_context) gst_gl_window_new (gint width, gint height, gulong external_gl_context)
{ {
GstGLWindow *window = g_object_new (GST_GL_TYPE_WINDOW, NULL); GstGLWindow *window = g_object_new (GST_GL_TYPE_WINDOW, NULL);
GstGLWindowPrivate *priv = window->priv; GstGLWindowPrivate *priv = window->priv;
@ -201,7 +201,7 @@ gst_gl_window_error_quark (void)
} }
void void
gst_gl_window_set_external_window_id (GstGLWindow * window, guint64 id) gst_gl_window_set_external_window_id (GstGLWindow * window, gulong id)
{ {
GstGLWindowPrivate *priv = window->priv; GstGLWindowPrivate *priv = window->priv;
WNDPROC window_parent_proc = WNDPROC window_parent_proc =
@ -292,7 +292,7 @@ gst_gl_window_run_loop (GstGLWindow * window)
while (running && (bRet = GetMessage (&msg, NULL, 0, 0)) != 0) { while (running && (bRet = GetMessage (&msg, NULL, 0, 0)) != 0) {
if (bRet == -1) { if (bRet == -1) {
g_error ("Failed to get message %x\r\n", GetLastError ()); g_error ("Failed to get message %lud\n", GetLastError ());
running = FALSE; running = FALSE;
} else { } else {
TranslateMessage (&msg); TranslateMessage (&msg);
@ -521,7 +521,7 @@ window_proc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (priv->internal_win_id) { if (priv->internal_win_id) {
if (!DestroyWindow (priv->internal_win_id)) if (!DestroyWindow (priv->internal_win_id))
g_debug ("failed to destroy window %d, 0x%x\n", hWnd, g_debug ("failed to destroy window %lud, %lud\n", (gulong) hWnd,
GetLastError ()); GetLastError ());
} }