summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@mad.scientist.com>2008-06-24 01:14:40 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2008-06-24 01:14:40 +0000
commit4b5e729246db15578924a4ab636835177065668f (patch)
tree48e314990b1f921590124f663df25bc90f646d73 /sys
parent540a3816e4024f809a7bc9c37a9f62344e6a8a7f (diff)
sys/ximage/ximagesink.h: When the caps change, make sure to re-draw borders in force-aspect-ratio=true mode.
Original commit message from CVS: * sys/ximage/ximagesink.c (gst_ximagesink_ximage_put), (gst_ximagesink_setcaps): * sys/ximage/ximagesink.h: When the caps change, make sure to re-draw borders in force-aspect-ratio=true mode. * sys/xvimage/xvimagesink.c (gst_xvimagesink_xvimage_put): Don't clear the border_draw flag until we actually draw the border. * tests/check/Makefile.am: Ignore alsasink/src during the states test too, so it doesn't fail when running without access to the sound device.
Diffstat (limited to 'sys')
-rw-r--r--sys/ximage/ximagesink.c7
-rw-r--r--sys/ximage/ximagesink.h1
-rw-r--r--sys/xvimage/xvimagesink.c2
3 files changed, 7 insertions, 3 deletions
diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c
index c6dea4c0..0b527028 100644
--- a/sys/ximage/ximagesink.c
+++ b/sys/ximage/ximagesink.c
@@ -694,8 +694,8 @@ gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstXImageBuffer * ximage)
}
/* Draw borders when displaying the first frame. After this
- draw borders only on expose event. */
- if (!ximagesink->cur_image) {
+ draw borders only on expose event or caps change (ximagesink->draw_border = TRUE). */
+ if (!ximagesink->cur_image || ximagesink->draw_border) {
draw_border = TRUE;
}
@@ -735,6 +735,7 @@ gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstXImageBuffer * ximage)
if (draw_border) {
gst_ximagesink_xwindow_draw_borders (ximagesink, ximagesink->xwindow,
result);
+ ximagesink->draw_border = FALSE;
}
#ifdef HAVE_XSHM
if (ximagesink->xcontext->use_xshm) {
@@ -1465,6 +1466,8 @@ gst_ximagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
ximagesink->xwindow = gst_ximagesink_xwindow_new (ximagesink,
GST_VIDEO_SINK_WIDTH (ximagesink), GST_VIDEO_SINK_HEIGHT (ximagesink));
}
+ /* Remember to draw borders for next frame */
+ ximagesink->draw_border = TRUE;
g_mutex_unlock (ximagesink->flow_lock);
/* If our ximage has changed we destroy it, next chain iteration will create
diff --git a/sys/ximage/ximagesink.h b/sys/ximage/ximagesink.h
index a974b5e4..a471e795 100644
--- a/sys/ximage/ximagesink.h
+++ b/sys/ximage/ximagesink.h
@@ -214,6 +214,7 @@ struct _GstXImageSink {
gboolean keep_aspect;
gboolean handle_events;
gboolean handle_expose;
+ gboolean draw_border;
};
struct _GstXImageSinkClass {
diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c
index 135c1ff2..c9e7a3ce 100644
--- a/sys/xvimage/xvimagesink.c
+++ b/sys/xvimage/xvimagesink.c
@@ -763,7 +763,6 @@ gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink,
draw borders only on expose event or after a size change. */
if (!xvimagesink->cur_image || xvimagesink->draw_border) {
draw_border = TRUE;
- xvimagesink->draw_border = FALSE;
}
/* Store a reference to the last image we put, lose the previous one */
@@ -810,6 +809,7 @@ gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink,
if (draw_border) {
gst_xvimagesink_xwindow_draw_borders (xvimagesink, xvimagesink->xwindow,
result);
+ xvimagesink->draw_border = FALSE;
}
/* We scale to the window's geometry */