d3d11window: Remove timeout and wait a task if possible

Merged Seungha Yang requested to merge seungha.yang/gst-plugins-bad:d3d11window-timeout into master
d3d11window: Remove timeout and wait a task if possible

If the run_async() method is expected to be called from streaming
thread and not from application thread, use INFINITE as timeout value
so that d3d11window can wait UI dispatcher thread in any case.

There is no way to get a robust timeout value from library side.
So the fixed timeout value might not be optimal and therefore
we should avoid it as much as possible.

Rule whether a timeout value can be INFINITE or not is,
* If the waiting can be cancelled by GstBaseSink:unlock(), use INFINITE.
  GstD3D11Window:on_resize() is one case for example.
* Otherwise, use timeout value
  Some details are, GstBaseSink:start() and GstBaseSink:stop() will be called
  when NULL to READY or READY to NULL state change, so there will be no
  chance for GstBaseSink:unlock() and GstBaseSink:unlock_stop()
  to be called around them. So there is no other way then timeout way.
  GstD3D11Window:consturcted() and GstD3D11Window:unprepare() are the case.
d3d11window: Increase timeout to 10 sec for WinRT window implementations

No strong reason for this number, but we can follow other well known
UWP implementation ANGLE.

cc @nirbheek

Merge request reports