GNOME Bugzilla – Bug 520885
directdrawsink has some issues
Last modified: 2008-05-13 13:44:00 UTC
Please describe the problem: and here come the patches... Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
Created attachment 106731 [details] [review] directdrawsink_buffer_alloc_clear_flags_fix
Comment on attachment 106731 [details] [review] directdrawsink_buffer_alloc_clear_flags_fix Clear the flags on recycled buffers from buffer_alloc.
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.
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.
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.
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.
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.
Created attachment 106739 [details] [review] directdrawsink_surface_lost_fix Return GST_FLOW_OK instead of GST_FLOW_CUSTOM_SUCCESS. Thanks Jan!
Created attachment 110517 [details] [review] directdrawsink_window_destruction_fix Updated version that passes the HWND to GetMessage().
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.
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.