From 740c3101ac538a4a3f7e502aa2d8ceea54c2dca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Fri, 2 Mar 2012 21:41:39 +0400 Subject: [PATCH] d3dvideosink: fix compiler warnings and build failure with mingw shared.d3ddev was removed a while back, not sure how this still compiles for anyone (tpm). https://bugzilla.gnome.org/show_bug.cgi?id=653718 https://bugzilla.gnome.org/show_bug.cgi?id=670143 https://bugzilla.gnome.org/show_bug.cgi?id=656905 --- sys/d3dvideosink/d3dvideosink.c | 14 ++++++++------ sys/d3dvideosink/directx/d3d.h | 6 +++--- sys/d3dvideosink/directx/dx.h | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/sys/d3dvideosink/d3dvideosink.c b/sys/d3dvideosink/d3dvideosink.c index 1bca84703b..504d8104f5 100644 --- a/sys/d3dvideosink/d3dvideosink.c +++ b/sys/d3dvideosink/d3dvideosink.c @@ -63,7 +63,7 @@ struct _GstD3DVideoSinkHookData static GstD3DVideoSinkShared shared; /* Define a shared lock to synchronize the creation/destruction of the d3d device */ static GStaticMutex shared_d3d_lock = G_STATIC_MUTEX_INIT; -static GStaticMutex shared_d3d_dev_lock = G_STATIC_MUTEX_INIT; +static G_GNUC_UNUSED GStaticMutex shared_d3d_dev_lock = G_STATIC_MUTEX_INIT; static GStaticMutex shared_d3d_hook_lock = G_STATIC_MUTEX_INIT; /* Hold a reference to our dll's HINSTANCE */ static HINSTANCE g_hinstDll = NULL; @@ -156,7 +156,7 @@ static void gst_d3dvideosink_remove_window_for_renderer (GstD3DVideoSink * static gboolean gst_d3dvideosink_initialize_direct3d (GstD3DVideoSink * sink); static gboolean gst_d3dvideosink_initialize_d3d_device (GstD3DVideoSink * sink); static gboolean gst_d3dvideosink_resize_swap_chain (GstD3DVideoSink * sink, - gint width, gint height); + gint width, gint height) G_GNUC_UNUSED; static gboolean gst_d3dvideosink_notify_device_init (GstD3DVideoSink * sink); static gboolean gst_d3dvideosink_notify_device_lost (GstD3DVideoSink * sink); static gboolean gst_d3dvideosink_notify_device_reset (GstD3DVideoSink * sink); @@ -468,11 +468,13 @@ gst_d3dvideosink_get_caps (GstBaseSink * basesink) GstStructure *stru = gst_caps_get_structure (c, i); if (!gst_structure_has_name (stru, "video/x-raw-rgb")) { gst_structure_get_fourcc (stru, "format", (guint32 *) & d3dfourcc); - switch (d3dfourcc) { + switch ((guint32) d3dfourcc) { case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): case GST_MAKE_FOURCC ('I', '4', '2', '0'): d3dfourcc = (D3DFORMAT) MAKEFOURCC ('Y', 'V', '1', '2'); break; + default: + break; } if (d3dfourcc && SUCCEEDED (IDirect3D9_CheckDeviceFormat (shared.d3d, D3DADAPTER_DEFAULT, @@ -529,10 +531,10 @@ gst_d3dvideosink_create_shared_hidden_window (GstD3DVideoSink * sink) goto failed; CloseHandle (shared.hidden_window_created_signal); - +/* if (!shared.d3ddev) goto failed; - +*/ GST_DEBUG ("Successfully created Direct3D hidden window, handle: %p", shared.hidden_window_handle); @@ -1567,7 +1569,7 @@ gst_d3dvideosink_flush_gpu (GstD3DVideoSink * sink) } } -static void +static G_GNUC_UNUSED void gst_d3dvideosink_wait_for_vsync (GstD3DVideoSink * sink) { if (sink->d3dpp.PresentationInterval == D3DPRESENT_INTERVAL_IMMEDIATE) { diff --git a/sys/d3dvideosink/directx/d3d.h b/sys/d3dvideosink/directx/d3d.h index c58310fd9f..238349c27c 100644 --- a/sys/d3dvideosink/directx/d3d.h +++ b/sys/d3dvideosink/directx/d3d.h @@ -33,8 +33,8 @@ G_BEGIN_DECLS #define WM_DIRECTX_D3D_RESIZE WM_DIRECTX + 5 #define DIRECTX_D3D_API(version, dispatch_table, init_function, create_function, resize_function, device_lost_function, notify_device_reset_function, release_function) \ - static gpointer DIRECTX_API_COMPONENT_D3D_ ## version ## _DISPATCH_TABLE = &dispatch_table; \ - static DirectXAPIComponentD3D DIRECTX_API_COMPONENT_D3D_ ## version ## _INIT = { \ + static gpointer G_GNUC_UNUSED DIRECTX_API_COMPONENT_D3D_ ## version ## _DISPATCH_TABLE = &dispatch_table; \ + static DirectXAPIComponentD3D G_GNUC_UNUSED DIRECTX_API_COMPONENT_D3D_ ## version ## _INIT = { \ create_function /*create_function*/ \ , resize_function /*resize_function*/ \ , device_lost_function /*device_lost_function*/ \ @@ -42,7 +42,7 @@ G_BEGIN_DECLS , release_function /*release_function*/ \ , NULL /*private_data*/ \ }; \ - static void init_directx_api_component_d3d_ ## version ## _(const DirectXAPI* api) { \ + static void G_GNUC_UNUSED init_directx_api_component_d3d_ ## version ## _(const DirectXAPI* api) { \ gpointer private_data = &DIRECTX_API_COMPONENT_D3D_ ## version ## _INIT; \ gpointer vtable = DIRECTX_API_COMPONENT_D3D_ ## version ## _DISPATCH_TABLE; \ DIRECTX_SET_COMPONENT_INIT(DIRECTX_D3D(api), init_function); \ diff --git a/sys/d3dvideosink/directx/dx.h b/sys/d3dvideosink/directx/dx.h index 60dd6d869c..dcf7c05dbc 100644 --- a/sys/d3dvideosink/directx/dx.h +++ b/sys/d3dvideosink/directx/dx.h @@ -111,7 +111,7 @@ typedef enum , &DIRECTX_ ## version ## _DIRECTCOMPUTE_COMPONENT \ , {NULL, NULL, NULL} /*reserved*/ \ }; \ - static void init_directx_ ## version ## _supported_api(void) { \ + static void G_GNUC_UNUSED init_directx_ ## version ## _supported_api(void) { \ DirectXAPI* api; \ api = &DIRECTX_ ## version ## _API; \ api->d3d->api = api; \