summaryrefslogtreecommitdiff
path: root/sys/d3d11/gstd3d11window_win32.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sys/d3d11/gstd3d11window_win32.cpp')
-rw-r--r--sys/d3d11/gstd3d11window_win32.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/d3d11/gstd3d11window_win32.cpp b/sys/d3d11/gstd3d11window_win32.cpp
index 644839129..6261c97f6 100644
--- a/sys/d3d11/gstd3d11window_win32.cpp
+++ b/sys/d3d11/gstd3d11window_win32.cpp
@@ -129,6 +129,8 @@ static void gst_d3d11_window_win32_unprepare (GstD3D11Window * window);
static void
gst_d3d11_window_win32_set_render_rectangle (GstD3D11Window * window,
const GstVideoRectangle * rect);
+static void gst_d3d11_window_win32_set_title (GstD3D11Window * window,
+ const gchar * title);
static void
gst_d3d11_window_win32_class_init (GstD3D11WindowWin32Class * klass)
@@ -154,6 +156,8 @@ gst_d3d11_window_win32_class_init (GstD3D11WindowWin32Class * klass)
GST_DEBUG_FUNCPTR (gst_d3d11_window_win32_unprepare);
window_class->set_render_rectangle =
GST_DEBUG_FUNCPTR (gst_d3d11_window_win32_set_render_rectangle);
+ window_class->set_title =
+ GST_DEBUG_FUNCPTR (gst_d3d11_window_win32_set_title);
}
static void
@@ -281,6 +285,22 @@ gst_d3d11_window_win32_set_render_rectangle (GstD3D11Window * window,
}
static void
+gst_d3d11_window_win32_set_title (GstD3D11Window * window, const gchar * title)
+{
+ GstD3D11WindowWin32 *self = GST_D3D11_WINDOW_WIN32 (window);
+
+ /* Do this only when we are rendring on our own HWND */
+ if (!self->external_hwnd && self->internal_hwnd) {
+ gunichar2 *str = g_utf8_to_utf16 (title, -1, nullptr, nullptr, nullptr);
+
+ if (str) {
+ SetWindowTextW (self->internal_hwnd, (LPCWSTR) str);
+ g_free (str);
+ }
+ }
+}
+
+static void
gst_d3d11_window_win32_finalize (GObject * object)
{
GstD3D11WindowWin32 *self = GST_D3D11_WINDOW_WIN32 (object);