diff --git a/gst-libs/gst/gl/gstgldisplay.c b/gst-libs/gst/gl/gstgldisplay.c index 9c3cce9a13..a2a060ee33 100644 --- a/gst-libs/gst/gl/gstgldisplay.c +++ b/gst-libs/gst/gl/gstgldisplay.c @@ -2088,7 +2088,7 @@ gst_gl_display_new (void) * Called by the first gl element of a video/x-raw-gl flow */ void 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); diff --git a/gst-libs/gst/gl/gstgldisplay.h b/gst-libs/gst/gl/gstgldisplay.h index 74a72e6878..f737e8b930 100644 --- a/gst-libs/gst/gl/gstgldisplay.h +++ b/gst-libs/gst/gl/gstgldisplay.h @@ -137,7 +137,7 @@ struct _GstGLDisplay gpointer upload_data; //foreign gl context - guint64 external_gl_context; + gulong external_gl_context; //filter gen fbo GLuint gen_fbo_width; @@ -240,7 +240,7 @@ GType gst_gl_display_get_type (void); GstGLDisplay *gst_gl_display_new (void); 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, gint width, gint height, gboolean keep_aspect_ratio); diff --git a/gst-libs/gst/gl/gstglwindow.h b/gst-libs/gst/gl/gstglwindow.h index 928b028622..9904eb8e22 100644 --- a/gst-libs/gst/gl/gstglwindow.h +++ b/gst-libs/gst/gl/gstglwindow.h @@ -79,9 +79,9 @@ struct _GstGLWindowClass { GQuark gst_gl_window_error_quark (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_resize_callback (GstGLWindow *window, GstGLWindowCB2 callback, gpointer data); void gst_gl_window_set_close_callback (GstGLWindow *window, GstGLWindowCB callback, gpointer data); diff --git a/gst-libs/gst/gl/gstglwindow_win32.c b/gst-libs/gst/gl/gstglwindow_win32.c index dd45a8a078..566a315dc2 100644 --- a/gst-libs/gst/gl/gstglwindow_win32.c +++ b/gst-libs/gst/gl/gstglwindow_win32.c @@ -75,9 +75,6 @@ HHOOK hHook; static void 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); } @@ -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 gst_gl_window_class_init (GstGLWindowClass * klass) { @@ -126,7 +118,7 @@ gst_gl_window_class_init (GstGLWindowClass * klass) atom = RegisterClass (&wc); 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 */ 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); GstGLWindowPrivate *priv = window->priv; - GstGLWindowClass *klass = GST_GL_WINDOW_GET_CLASS (window); 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); 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; } - 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 g_assert (priv->device); @@ -203,11 +194,11 @@ gst_gl_window_error_quark (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; WNDPROC window_parent_proc = - (WNDPROC) (guint64) GetWindowLongPtr ((HWND) id, GWL_WNDPROC); + (WNDPROC) GetWindowLongPtr ((HWND) id, GWL_WNDPROC); RECT rect; SetProp (priv->internal_win_id, "gl_window_parent_id", (HWND) id); @@ -285,7 +276,6 @@ gst_gl_window_draw (GstGLWindow * window) void gst_gl_window_run_loop (GstGLWindow * window) { - GstGLWindowPrivate *priv = window->priv; gboolean running = TRUE; gboolean bRet = FALSE; MSG msg; @@ -294,7 +284,7 @@ gst_gl_window_run_loop (GstGLWindow * window) while (running && (bRet = GetMessage (&msg, NULL, 0, 0)) != 0) { if (bRet == -1) { - g_error ("Failed to get message %x\r\n", GetLastError ()); + g_error ("Failed to get message %lud\n", GetLastError ()); running = FALSE; } else { TranslateMessage (&msg); @@ -398,20 +388,20 @@ window_proc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) gst_gl_window_set_pixel_format (window); priv->gl_context = wglCreateContext (priv->device); 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 - g_debug ("failed to create glcontext %d, %x\r\n", hWnd, + g_debug ("failed to create glcontext %lud, %lud\n", (gulong) hWnd, GetLastError ()); g_assert (priv->gl_context); ReleaseDC (hWnd, priv->device); 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 ()); if (priv->external_gl_context) { if (!wglShareLists (priv->gl_context, priv->external_gl_context)) 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 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); SetWindowLongPtr (parent_id, GWL_WNDPROC, - (LONG) (guint64) parent_proc); + (LONG) parent_proc); SetParent (hWnd, NULL); 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"); 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 (!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 ()); } if (priv->internal_win_id) { - g_debug ("BEFORE\n"); 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 ()); - g_debug ("AFTER\n"); } PostQuitMessage (0); diff --git a/gst-libs/gst/gl/gstglwindow_winCE.c b/gst-libs/gst/gl/gstglwindow_winCE.c index b075a351cd..068981d417 100644 --- a/gst-libs/gst/gl/gstglwindow_winCE.c +++ b/gst-libs/gst/gl/gstglwindow_winCE.c @@ -123,7 +123,7 @@ gst_gl_window_class_init (GstGLWindowClass * klass) atom = RegisterClass (&wc); 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 */ 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); GstGLWindowPrivate *priv = window->priv; @@ -201,7 +201,7 @@ gst_gl_window_error_quark (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; WNDPROC window_parent_proc = @@ -292,7 +292,7 @@ gst_gl_window_run_loop (GstGLWindow * window) while (running && (bRet = GetMessage (&msg, NULL, 0, 0)) != 0) { if (bRet == -1) { - g_error ("Failed to get message %x\r\n", GetLastError ()); + g_error ("Failed to get message %lud\n", GetLastError ()); running = FALSE; } else { TranslateMessage (&msg); @@ -521,7 +521,7 @@ window_proc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if (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 ()); }