After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 439914 - [directdraw] Warnings when using MinGW
[directdraw] Warnings when using MinGW
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Windows
: Normal normal
: 0.10.5
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-05-20 10:41 UTC by Vincent Torri
Modified: 2007-05-24 08:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
remove unused variable and label (1.67 KB, patch)
2007-05-21 04:58 UTC, Vincent Torri
none Details | Review
fix warnings (6.94 KB, patch)
2007-05-24 06:42 UTC, Vincent Torri
committed Details | Review

Description Vincent Torri 2007-05-20 10:41:24 UTC
I have those warnings when I try to compile directdrawsink with MinGW (and my core2 duo:

gstdirectdrawsink.c: In function `gst_ddrawsurface_class_init':
gstdirectdrawsink.c:225: warning: assignment from incompatible pointer type
gstdirectdrawsink.c: In function `gst_ddrawsurface_finalize':
gstdirectdrawsink.c:291: warning: passing arg 7 of `gst_debug_log' from incompatible pointer type
gstdirectdrawsink.c: In function `gst_directdraw_sink_buffer_alloc':
gstdirectdrawsink.c:597: warning: passing arg 2 of pointer to function from incompatible pointer type
gstdirectdrawsink.c:599: warning: int format, long int arg (arg 8)
gstdirectdrawsink.c:604: warning: implicit declaration of function `gst_directdraw_sink_get_depth'
gstdirectdrawsink.c: In function `gst_directdraw_sink_show_frame':
gstdirectdrawsink.c:753: warning: passing arg 3 of pointer to function from incompatible pointer type
gstdirectdrawsink.c: In function `gst_directdraw_sink_check_primary_surface':
gstdirectdrawsink.c:1323: warning: passing arg 2 of pointer to function from incompatible pointer type
gstdirectdrawsink.c: In function `gst_directdraw_sink_check_offscreen_surface':
gstdirectdrawsink.c:1383: warning: passing arg 2 of pointer to function from incompatible pointer type
gstdirectdrawsink.c: At top level:
gstdirectdrawsink.c:1399: warning: static declaration of 'gst_directdraw_sink_get_depth' follows non-static declaration
gstdirectdrawsink.c:604: warning: previous implicit declaration of 'gst_directdraw_sink_get_depth' was here
gstdirectdrawsink.c: In function `gst_directdraw_sink_get_ddrawcaps':
gstdirectdrawsink.c:1518: warning: passing arg 2 of pointer to function from incompatible pointer type
gstdirectdrawsink.c:1547: warning: passing arg 5 of pointer to function from incompatible pointer type
gstdirectdrawsink.c:1489: warning: unused variable `dwFourccCodeIndex'
gstdirectdrawsink.c:1490: warning: unused variable `pdwFourccCodes'
gstdirectdrawsink.c:1491: warning: unused variable `dwNbFourccCodes'
gstdirectdrawsink.c: In function `gst_directdraw_sink_surface_create':
gstdirectdrawsink.c:1628: warning: passing arg 2 of pointer to function from incompatible pointer type
gstdirectdrawsink.c:1638: warning: passing arg 3 of pointer to function from incompatible pointer type
gstdirectdrawsink.c: At top level:
gstdirectdrawsink.c:103: warning: 'gst_directdraw_sink_ddraw_put' declared `static' but never defined
Comment 1 Tim-Philipp Müller 2007-05-20 15:03:09 UTC
Should be partially fixed in CVS:

 2007-05-20  Tim-Philipp Müller  <tim at centricular dot net>

        * sys/directdraw/gstdirectdrawsink.c: (gst_ddrawsurface_finalize),
        (gst_directdraw_sink_buffer_alloc),
        (gst_directdraw_sink_get_ddrawcaps),
        (gst_directdraw_sink_surface_create):
          Bunch of small fixes: remove static function that doesn't exist;
          declare another one that does; printf format fix; use right macro
          when specifying debug category; remove a bunch of unused variables;
          #if 0 out an unused chunk of code (partially fixes #439914).

Not sure what's up with the warnings where there's a DDSURFACEDESC2 surface and &surface is passed to the function though.
Comment 2 Vincent Torri 2007-05-21 04:57:28 UTC
I've tried to replace DDSURFACEDESC2 by DDSURFACEDESC to remove the warnings (and there were no warnings), but the plugin didn't work, then. So I think that I can live with these warnings.

Nevertheless, there were a warning about an unsued variable and an unused label (after you commented a part of code with a #if 0). Patch below
Comment 3 Vincent Torri 2007-05-21 04:58:23 UTC
Created attachment 88527 [details] [review]
remove unused variable and label
Comment 4 Vincent Torri 2007-05-24 06:42:13 UTC
Created attachment 88713 [details] [review]
fix warnings

* Remove unused variable and label
* fix the DDSURFACEDESC / DDSURFACEDESC2 horror warnings
Comment 5 Vincent Torri 2007-05-24 06:46:57 UTC
Comment on attachment 88713 [details] [review]
fix warnings

* Remove unused variable and label
* fix the DDSURFACEDESC / DDSURFACEDESC2 horror warnings
* fix spelling of gst_directdraw_sink_get_type in gstdirectdrawsink.h
Comment 6 Tim-Philipp Müller 2007-05-24 08:38:17 UTC
Thanks, committed:

  2007-05-24  Tim-Philipp Müller  <tim at centricular dot net>

        Patch by: Vincent Torri  <vtorri at univ-evry fr>

        * sys/directdraw/gstdirectdrawsink.c:
        (gst_directdraw_sink_buffer_alloc),
        (gst_directdraw_sink_show_frame),
        (gst_directdraw_sink_check_primary_surface),
        (gst_directdraw_sink_check_offscreen_surface),
        (EnumModesCallback2), (gst_directdraw_sink_get_ddrawcaps),
        (gst_directdraw_sink_surface_create):
        * sys/directdraw/gstdirectdrawsink.h:
          Fix more warnings when compiling with MingW (#439914).



Just to make sure: there are one or two places where you changed

     DDSURFACEDESC2 surface_desc;
-    surface_desc.dwSize = sizeof (DDSURFACEDESC);
+    surface_desc.dwSize = sizeof (surface_desc);

ie. changed it from sizeof (DDSURFACEDESC) to sizeof (DDSURFACEDESC2). I presume this was on purpose and the sink still works just fine as you said on IRC, right?
Comment 7 Vincent Torri 2007-05-24 08:46:32 UTC
It is on purpose. You must set the dwSize field to the size of the structure. I could just have added a '2', but I prefer using the varable. If the type of surface_desc changes later (I doubt, though), there will be no error in the size of the structure.

And yes, I've tested the sink with : 

gst-launch-0.10.exe --gst-plugins-path=/usr/local/lib/gstreamer-0.10 videotestsrc ! ffmpegcolorspace ! directdrawsink