mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
x(v)imagesink: pass the xwindow along to not look at the yet unset var.
When we call this from xwindow_new, x(v)imagesink->xwindow is not yet set.
This commit is contained in:
parent
8946be1f0b
commit
8b0da4bfe8
2 changed files with 14 additions and 14 deletions
|
@ -803,15 +803,15 @@ gst_ximagesink_xwindow_decorate (GstXImageSink * ximagesink,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_ximagesink_xwindow_set_title (GstXImageSink * ximagesink,
|
gst_ximagesink_xwindow_set_title (GstXImageSink * ximagesink,
|
||||||
const gchar * media_title)
|
GstXWindow * xwindow, const gchar * media_title)
|
||||||
{
|
{
|
||||||
if (media_title) {
|
if (media_title) {
|
||||||
g_free (ximagesink->media_title);
|
g_free (ximagesink->media_title);
|
||||||
ximagesink->media_title = g_strdup (media_title);
|
ximagesink->media_title = g_strdup (media_title);
|
||||||
}
|
}
|
||||||
if (ximagesink->xwindow) {
|
if (xwindow) {
|
||||||
/* we have a window */
|
/* we have a window */
|
||||||
if (ximagesink->xwindow->internal) {
|
if (xwindow->internal) {
|
||||||
XTextProperty xproperty;
|
XTextProperty xproperty;
|
||||||
const gchar *app_name;
|
const gchar *app_name;
|
||||||
const gchar *title = NULL;
|
const gchar *title = NULL;
|
||||||
|
@ -832,8 +832,7 @@ gst_ximagesink_xwindow_set_title (GstXImageSink * ximagesink,
|
||||||
if (title) {
|
if (title) {
|
||||||
if ((XStringListToTextProperty (((char **) &title), 1,
|
if ((XStringListToTextProperty (((char **) &title), 1,
|
||||||
&xproperty)) != 0)
|
&xproperty)) != 0)
|
||||||
XSetWMName (ximagesink->xcontext->disp, ximagesink->xwindow->win,
|
XSetWMName (ximagesink->xcontext->disp, xwindow->win, &xproperty);
|
||||||
&xproperty);
|
|
||||||
|
|
||||||
g_free (title_mem);
|
g_free (title_mem);
|
||||||
}
|
}
|
||||||
|
@ -867,7 +866,7 @@ gst_ximagesink_xwindow_new (GstXImageSink * ximagesink, gint width, gint height)
|
||||||
XSetWindowBackgroundPixmap (ximagesink->xcontext->disp, xwindow->win, None);
|
XSetWindowBackgroundPixmap (ximagesink->xcontext->disp, xwindow->win, None);
|
||||||
|
|
||||||
/* set application name as a title */
|
/* set application name as a title */
|
||||||
gst_ximagesink_xwindow_set_title (ximagesink, NULL);
|
gst_ximagesink_xwindow_set_title (ximagesink, xwindow, NULL);
|
||||||
|
|
||||||
if (ximagesink->handle_events) {
|
if (ximagesink->handle_events) {
|
||||||
Atom wm_delete;
|
Atom wm_delete;
|
||||||
|
@ -1697,7 +1696,8 @@ gst_ximagesink_event (GstBaseSink * sink, GstEvent * event)
|
||||||
|
|
||||||
if (title) {
|
if (title) {
|
||||||
GST_DEBUG_OBJECT (ximagesink, "got tags, title='%s'", title);
|
GST_DEBUG_OBJECT (ximagesink, "got tags, title='%s'", title);
|
||||||
gst_ximagesink_xwindow_set_title (ximagesink, title);
|
gst_ximagesink_xwindow_set_title (ximagesink, ximagesink->xwindow,
|
||||||
|
title);
|
||||||
|
|
||||||
g_free (title);
|
g_free (title);
|
||||||
}
|
}
|
||||||
|
|
|
@ -908,15 +908,15 @@ gst_xvimagesink_xwindow_decorate (GstXvImageSink * xvimagesink,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_xvimagesink_xwindow_set_title (GstXvImageSink * xvimagesink,
|
gst_xvimagesink_xwindow_set_title (GstXvImageSink * xvimagesink,
|
||||||
const gchar * media_title)
|
GstXWindow * xwindow, const gchar * media_title)
|
||||||
{
|
{
|
||||||
if (media_title) {
|
if (media_title) {
|
||||||
g_free (xvimagesink->media_title);
|
g_free (xvimagesink->media_title);
|
||||||
xvimagesink->media_title = g_strdup (media_title);
|
xvimagesink->media_title = g_strdup (media_title);
|
||||||
}
|
}
|
||||||
if (xvimagesink->xwindow) {
|
if (xwindow) {
|
||||||
/* we have a window */
|
/* we have a window */
|
||||||
if (xvimagesink->xwindow->internal) {
|
if (xwindow->internal) {
|
||||||
XTextProperty xproperty;
|
XTextProperty xproperty;
|
||||||
const gchar *app_name;
|
const gchar *app_name;
|
||||||
const gchar *title = NULL;
|
const gchar *title = NULL;
|
||||||
|
@ -937,8 +937,7 @@ gst_xvimagesink_xwindow_set_title (GstXvImageSink * xvimagesink,
|
||||||
if (title) {
|
if (title) {
|
||||||
if ((XStringListToTextProperty (((char **) &title), 1,
|
if ((XStringListToTextProperty (((char **) &title), 1,
|
||||||
&xproperty)) != 0)
|
&xproperty)) != 0)
|
||||||
XSetWMName (xvimagesink->xcontext->disp, xvimagesink->xwindow->win,
|
XSetWMName (xvimagesink->xcontext->disp, xwindow->win, &xproperty);
|
||||||
&xproperty);
|
|
||||||
|
|
||||||
g_free (title_mem);
|
g_free (title_mem);
|
||||||
}
|
}
|
||||||
|
@ -975,7 +974,7 @@ gst_xvimagesink_xwindow_new (GstXvImageSink * xvimagesink,
|
||||||
XSetWindowBackgroundPixmap (xvimagesink->xcontext->disp, xwindow->win, None);
|
XSetWindowBackgroundPixmap (xvimagesink->xcontext->disp, xwindow->win, None);
|
||||||
|
|
||||||
/* set application name as a title */
|
/* set application name as a title */
|
||||||
gst_xvimagesink_xwindow_set_title (xvimagesink, NULL);
|
gst_xvimagesink_xwindow_set_title (xvimagesink, xwindow, NULL);
|
||||||
|
|
||||||
if (xvimagesink->handle_events) {
|
if (xvimagesink->handle_events) {
|
||||||
Atom wm_delete;
|
Atom wm_delete;
|
||||||
|
@ -2390,7 +2389,8 @@ gst_xvimagesink_event (GstBaseSink * sink, GstEvent * event)
|
||||||
|
|
||||||
if (title) {
|
if (title) {
|
||||||
GST_DEBUG_OBJECT (xvimagesink, "got tags, title='%s'", title);
|
GST_DEBUG_OBJECT (xvimagesink, "got tags, title='%s'", title);
|
||||||
gst_xvimagesink_xwindow_set_title (xvimagesink, title);
|
gst_xvimagesink_xwindow_set_title (xvimagesink, xvimagesink->xwindow,
|
||||||
|
title);
|
||||||
|
|
||||||
g_free (title);
|
g_free (title);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue