sys/: Actually only create a new toplevel window if we're not gonna embed it right after.

Original commit message from CVS:
* sys/ximage/ximagesink.c: (gst_ximagesink_sink_link),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_sink_link),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Actually only create a new toplevel window if we're not gonna
embed it right after.
This commit is contained in:
Ronald S. Bultje 2004-10-07 16:22:30 +00:00
parent 72570f800a
commit b91e99d910
5 changed files with 27 additions and 4 deletions

View file

@ -1,3 +1,14 @@
2004-10-07 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_sink_link),
(gst_ximagesink_set_xwindow_id), (gst_ximagesink_init):
* sys/ximage/ximagesink.h:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_sink_link),
(gst_xvimagesink_set_xwindow_id), (gst_xvimagesink_init):
* sys/xvimage/xvimagesink.h:
Actually only create a new toplevel window if we're not gonna
embed it right after.
2004-10-07 Wim Taymans <wim@fluendo.com> 2004-10-07 Wim Taymans <wim@fluendo.com>
* gst/playback/gstplaybasebin.c: (play_base_bin_mute_pad), * gst/playback/gstplaybasebin.c: (play_base_bin_mute_pad),

View file

@ -49,6 +49,9 @@ static void gst_ximagesink_buffer_free (GstBuffer * buffer);
static void gst_ximagesink_ximage_destroy (GstXImageSink * ximagesink, static void gst_ximagesink_ximage_destroy (GstXImageSink * ximagesink,
GstXImage * ximage); GstXImage * ximage);
static void gst_ximagesink_set_xwindow_id (GstXOverlay * overlay,
XID xwindow_id);
/* ElementFactory information */ /* ElementFactory information */
static GstElementDetails gst_ximagesink_details = static GstElementDetails gst_ximagesink_details =
GST_ELEMENT_DETAILS ("Video sink", GST_ELEMENT_DETAILS ("Video sink",
@ -988,8 +991,8 @@ gst_ximagesink_sink_link (GstPad * pad, const GstCaps * caps)
g_assert (GST_VIDEOSINK_WIDTH (ximagesink) > 0); g_assert (GST_VIDEOSINK_WIDTH (ximagesink) > 0);
g_assert (GST_VIDEOSINK_HEIGHT (ximagesink) > 0); g_assert (GST_VIDEOSINK_HEIGHT (ximagesink) > 0);
if (!ximagesink->xwindow) { if (!ximagesink->xwindow) {
ximagesink->xwindow = gst_ximagesink_xwindow_new (ximagesink, gst_ximagesink_set_xwindow_id (GST_X_OVERLAY (ximagesink),
GST_VIDEOSINK_WIDTH (ximagesink), GST_VIDEOSINK_HEIGHT (ximagesink)); ximagesink->parent);
} else { } else {
if (ximagesink->xwindow->internal) { if (ximagesink->xwindow->internal) {
gst_ximagesink_xwindow_resize (ximagesink, ximagesink->xwindow, gst_ximagesink_xwindow_resize (ximagesink, ximagesink->xwindow,
@ -1380,6 +1383,8 @@ gst_ximagesink_set_xwindow_id (GstXOverlay * overlay, XID xwindow_id)
if (xwindow) if (xwindow)
ximagesink->xwindow = xwindow; ximagesink->xwindow = xwindow;
ximagesink->parent = xwindow_id;
} }
static void static void
@ -1534,6 +1539,7 @@ gst_ximagesink_init (GstXImageSink * ximagesink)
gst_ximagesink_buffer_alloc); gst_ximagesink_buffer_alloc);
ximagesink->display_name = NULL; ximagesink->display_name = NULL;
ximagesink->parent = 0;
ximagesink->xcontext = NULL; ximagesink->xcontext = NULL;
ximagesink->xwindow = NULL; ximagesink->xwindow = NULL;
ximagesink->ximage = NULL; ximagesink->ximage = NULL;

View file

@ -112,6 +112,7 @@ struct _GstXImageSink {
char *display_name; char *display_name;
Drawable parent;
GstXContext *xcontext; GstXContext *xcontext;
GstXWindow *xwindow; GstXWindow *xwindow;
GstXImage *ximage; GstXImage *ximage;

View file

@ -50,6 +50,8 @@ static void gst_xvimagesink_buffer_free (GstBuffer * buffer);
static void gst_xvimagesink_xvimage_destroy (GstXvImageSink * xvimagesink, static void gst_xvimagesink_xvimage_destroy (GstXvImageSink * xvimagesink,
GstXvImage * xvimage); GstXvImage * xvimage);
static void gst_xvimagesink_set_xwindow_id (GstXOverlay * overlay,
XID xwindow_id);
/* ElementFactory information */ /* ElementFactory information */
static GstElementDetails gst_xvimagesink_details = static GstElementDetails gst_xvimagesink_details =
@ -1278,8 +1280,8 @@ gst_xvimagesink_sink_link (GstPad * pad, const GstCaps * caps)
g_assert (GST_VIDEOSINK_WIDTH (xvimagesink) > 0); g_assert (GST_VIDEOSINK_WIDTH (xvimagesink) > 0);
g_assert (GST_VIDEOSINK_HEIGHT (xvimagesink) > 0); g_assert (GST_VIDEOSINK_HEIGHT (xvimagesink) > 0);
if (!xvimagesink->xwindow) if (!xvimagesink->xwindow)
xvimagesink->xwindow = gst_xvimagesink_xwindow_new (xvimagesink, gst_xvimagesink_set_xwindow_id (GST_X_OVERLAY (xvimagesink),
GST_VIDEOSINK_WIDTH (xvimagesink), GST_VIDEOSINK_HEIGHT (xvimagesink)); xvimagesink->parent);
else { else {
if (xvimagesink->xwindow->internal) if (xvimagesink->xwindow->internal)
gst_xvimagesink_xwindow_resize (xvimagesink, xvimagesink->xwindow, gst_xvimagesink_xwindow_resize (xvimagesink, xvimagesink->xwindow,
@ -1642,6 +1644,7 @@ gst_xvimagesink_set_xwindow_id (GstXOverlay * overlay, XID xwindow_id)
if (xwindow) if (xwindow)
xvimagesink->xwindow = xwindow; xvimagesink->xwindow = xwindow;
xvimagesink->parent = xwindow_id;
} }
static void static void
@ -1915,6 +1918,7 @@ gst_xvimagesink_init (GstXvImageSink * xvimagesink)
gst_xvimagesink_buffer_alloc); gst_xvimagesink_buffer_alloc);
xvimagesink->display_name = NULL; xvimagesink->display_name = NULL;
xvimagesink->parent = 0;
xvimagesink->xcontext = NULL; xvimagesink->xcontext = NULL;
xvimagesink->xwindow = NULL; xvimagesink->xwindow = NULL;
xvimagesink->xvimage = NULL; xvimagesink->xvimage = NULL;

View file

@ -128,6 +128,7 @@ struct _GstXvImageSink {
char *display_name; char *display_name;
Drawable parent;
GstXContext *xcontext; GstXContext *xcontext;
GstXWindow *xwindow; GstXWindow *xwindow;
GstXvImage *xvimage; GstXvImage *xvimage;