diff --git a/ChangeLog b/ChangeLog index c9ed0be426..e9512c5c09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2008-06-24 Jan Schmidt + + * 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. + 2008-06-22 Stefan Kost * tests/examples/seek/seek.c: diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index c6dea4c0db..0b527028df 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 a974b5e44e..a471e795c7 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 135c1ff2e7..c9e7a3ce6c 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 */ diff --git a/tests/check/Makefile.am b/tests/check/Makefile.am index e82273b2b9..907016cd3f 100644 --- a/tests/check/Makefile.am +++ b/tests/check/Makefile.am @@ -21,7 +21,7 @@ $(CHECK_REGISTRY): $(TESTS_ENVIRONMENT) # elements to ignore for the state tests -STATE_IGNORE_ELEMENTS = cdio cdparanoiasrc libvisual_ +STATE_IGNORE_ELEMENTS = cdio cdparanoiasrc libvisual_ alsasrc alsasink TESTS = $(check_PROGRAMS)