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 520885 - directdrawsink has some issues
directdrawsink has some issues
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other All
: Normal critical
: 0.10.9
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-03-07 00:36 UTC by Ole André Vadla Ravnås
Modified: 2008-05-13 13:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
directdrawsink_buffer_alloc_clear_flags_fix (510 bytes, patch)
2008-03-07 00:37 UTC, Ole André Vadla Ravnås
committed Details | Review
directdrawsink_res_change_buffer_alloc_fix (2.53 KB, patch)
2008-03-07 00:40 UTC, Ole André Vadla Ravnås
committed Details | Review
directdrawsink_res_change_set_caps_fix (732 bytes, patch)
2008-03-07 00:41 UTC, Ole André Vadla Ravnås
committed Details | Review
directdrawsink_surface_lost_fix (748 bytes, patch)
2008-03-07 00:43 UTC, Ole André Vadla Ravnås
none Details | Review
directdrawsink_user_hwnd_clipper_fix (661 bytes, patch)
2008-03-07 00:44 UTC, Ole André Vadla Ravnås
committed Details | Review
directdrawsink_window_destruction_fix (2.54 KB, patch)
2008-03-07 00:46 UTC, Ole André Vadla Ravnås
none Details | Review
directdrawsink_surface_lost_fix (736 bytes, patch)
2008-03-07 01:08 UTC, Ole André Vadla Ravnås
committed Details | Review
directdrawsink_window_destruction_fix (2.52 KB, patch)
2008-05-07 12:17 UTC, Ole André Vadla Ravnås
committed Details | Review

Description Ole André Vadla Ravnås 2008-03-07 00:36:47 UTC
Please describe the problem:
and here come the patches...

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Ole André Vadla Ravnås 2008-03-07 00:37:58 UTC
Created attachment 106731 [details] [review]
directdrawsink_buffer_alloc_clear_flags_fix
Comment 2 Ole André Vadla Ravnås 2008-03-07 00:38:30 UTC
Comment on attachment 106731 [details] [review]
directdrawsink_buffer_alloc_clear_flags_fix

Clear the flags on recycled buffers from buffer_alloc.
Comment 3 Ole André Vadla Ravnås 2008-03-07 00:40:39 UTC
Created attachment 106732 [details] [review]
directdrawsink_res_change_buffer_alloc_fix

Make it so that gst_directdraw_sink_buffer_alloc uses the right width/height.

Especially when looking through the pool of buffers, make sure that the
width/height of caps is used instead of the already negotiated dimensions.
For example if a buffer with different caps is requested, i.e. higher
resolution, the caller would get a buffer with the old dimensions and
thus corrupt the heap.
Comment 4 Ole André Vadla Ravnås 2008-03-07 00:41:58 UTC
Created attachment 106733 [details] [review]
directdrawsink_res_change_set_caps_fix

Fixed mid stream resolution change bug, the offscreen surface is now released when set_caps is called.
Comment 5 Ole André Vadla Ravnås 2008-03-07 00:43:01 UTC
Created attachment 106734 [details] [review]
directdrawsink_surface_lost_fix

Added checking of surface lost case after an unsuccessfull IDirectDrawSurface7_Lock(...) call. If surface is lost, then return GST_FLOW_CUSTOM_SUCCESS.
Comment 6 Ole André Vadla Ravnås 2008-03-07 00:44:36 UTC
Created attachment 106735 [details] [review]
directdrawsink_user_hwnd_clipper_fix

Fixed IDirectDrawClipper_SetHWnd(...) bug when window ID set by user.

Now setting IDirectDrawClipper_SetHWnd(...) if window id already after creating IDirectDrawClipper.
Comment 7 Ole André Vadla Ravnås 2008-03-07 00:46:10 UTC
Created attachment 106736 [details] [review]
directdrawsink_window_destruction_fix

Improved Windows message loop in directdrawsink and fixed destroy window issue.

When the window which DirectDraw is rendering to is destroyed, the render/show_frame function will return GST_FLOW_ERROR.
Comment 8 Ole André Vadla Ravnås 2008-03-07 01:08:27 UTC
Created attachment 106739 [details] [review]
directdrawsink_surface_lost_fix

Return GST_FLOW_OK instead of GST_FLOW_CUSTOM_SUCCESS. Thanks Jan!
Comment 9 Ole André Vadla Ravnås 2008-05-07 12:17:31 UTC
Created attachment 110517 [details] [review]
directdrawsink_window_destruction_fix

Updated version that passes the HWND to GetMessage().
Comment 10 Ole André Vadla Ravnås 2008-05-07 12:22:56 UTC
Oops, correction:
Updated version that does not pass the HWND to GetMessage(), as we want messages
for the current UI thread and not just the window.
Comment 11 Ole André Vadla Ravnås 2008-05-13 13:44:00 UTC
2008-05-07  Ole André Vadla Ravnås  <ole.andre.ravnas at tandberg com>

	patch by: Haakon Sporsheim <haakon.sporsheim at tandberg com>

	* sys/directdraw/gstdirectdrawsink.c (gst_directdraw_sink_setup_ddraw):
	  Do IDirectDrawClipper_SetHWnd() if the window ID has already been
	  set after creating the clipper.

2008-05-07  Ole André Vadla Ravnås  <ole.andre.ravnas at tandberg com>

	patch by: Haakon Sporsheim <haakon.sporsheim at tandberg com>

	* sys/directdraw/gstdirectdrawsink.c (gst_directdraw_sink_show_frame):
	  Added checking of surface lost case after an unsuccessful
	  IDirectDrawSurface7_Lock() call.
	  If surface is lost, return GST_FLOW_OK.

2008-05-07  Ole André Vadla Ravnås  <ole.andre.ravnas at tandberg com>

	patch by: Haakon Sporsheim <haakon.sporsheim at tandberg com>

	* sys/directdraw/gstdirectdrawsink.c (gst_directdraw_sink_show_frame,
	  WndProc, gst_directdraw_sink_window_thread):
	  Improved Windows message loop and fixed window destruction issue.
	  When the window which DirectDraw is rendering to is destroyed, the
	  render/show_frame function will return GST_FLOW_ERROR.
	  Partially fixes #520885.

2008-05-07  Ole André Vadla Ravnås  <ole.andre.ravnas at tandberg com>

	patch by: Haakon Sporsheim <haakon.sporsheim at tandberg com>

	* sys/directdraw/gstdirectdrawsink.c (gst_directdraw_sink_set_caps):
	  Fixed mid stream resolution change bug, the offscreen surface is now
	  released when set_caps is called.
	  Partially fixes #520885.

2008-05-07  Ole André Vadla Ravnås  <ole.andre.ravnas at tandberg com>

	* sys/directdraw/gstdirectdrawsink.c
	  (gst_directdraw_sink_buffer_alloc):
	  Make it so that gst_directdraw_sink_buffer_alloc uses the right
	  width/height.

	  Especially when looking through the pool of buffers, make sure that
	  the width/height of caps is used instead of the already negotiated
	  dimensions.
	  For example if a buffer with different caps is requested, i.e.
	  higher resolution, the caller would get a buffer with the old
	  dimensions and thus corrupt the heap.

2008-05-07  Ole André Vadla Ravnås  <ole.andre.ravnas at tandberg com>

	* sys/directdraw/gstdirectdrawsink.c
	  (gst_directdraw_sink_buffer_alloc):
	  Clear the flags on recycled buffers from buffer_alloc.
	  Partially fixes #520885.