+gst_d3d11_window_win32_set_render_rectangle (GstD3D11Window * window,
+ const GstVideoRectangle * rect)
+{
+ GstD3D11WindowWin32 *self = GST_D3D11_WINDOW_WIN32 (window);
+
+ if (self->external_hwnd && self->internal_hwnd) {
+ g_atomic_int_add (&self->pending_move_window, 1);
+ self->render_rect = *rect;
+
+ if (self->internal_hwnd_thread == g_thread_self ()) {
+ /* We are on message pumping thread already, handle this synchroniously */
+ SendMessage (self->internal_hwnd, WM_GST_D3D11_MOVE_WINDOW, 0, 0);
+ } else {
+ /* Post message to message pumping thread. Handling HWND specific message
+ * on message pumping thread is not a worst idea in generall */
+ PostMessage (self->internal_hwnd, WM_GST_D3D11_MOVE_WINDOW, 0, 0);
+ }
+ } else {
+ /* XXX: Not sure what's expected behavior if we are drawing on internal
+ * HWND but user wants to specify rectangle.
+ *
+ * - Should we move window to corresponding desktop coordinates ?
+ * - Or should crop correspondingly by modifying viewport of
+ * render target view of swapchian's backbuffer or so ?
+ * - Or should we ignore set_render_rectangle if we are drawing on
+ * internal HWND without external HWND ?
+ */
+ }
+}
+
+static void