sys/xvimage/xvimagesink.*: After a caps change, redraw our borders to avoid garbage left there when the image format ...

Original commit message from CVS:
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_setcaps):
* sys/xvimage/xvimagesink.h:
After a caps change, redraw our borders to avoid garbage left there
when the image format changes to a smaller size, like 16:9 -> 4:3
Also, hold the flow_lock a bit longer in the set_caps while we're
fiddling with the xcontext.
This commit is contained in:
Jan Schmidt 2007-07-13 16:05:17 +00:00
parent 2b8d07bac0
commit 476361497d
3 changed files with 20 additions and 3 deletions

View file

@ -1,3 +1,13 @@
2007-07-13 Jan Schmidt <thaytan@mad.scientist.com>
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put),
(gst_xvimagesink_setcaps):
* sys/xvimage/xvimagesink.h:
After a caps change, redraw our borders to avoid garbage left there
when the image format changes to a smaller size, like 16:9 -> 4:3
Also, hold the flow_lock a bit longer in the set_caps while we're
fiddling with the xcontext.
2007-07-13 Jan Schmidt <thaytan@mad.scientist.com>
* Makefile.am:

View file

@ -740,9 +740,10 @@ gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink,
}
/* Draw borders when displaying the first frame. After this
draw borders only on expose event. */
if (!xvimagesink->cur_image) {
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 */
@ -2025,7 +2026,10 @@ gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
GST_VIDEO_SINK_WIDTH (xvimagesink),
GST_VIDEO_SINK_HEIGHT (xvimagesink));
}
g_mutex_unlock (xvimagesink->flow_lock);
/* After a resize, we want to redraw the borders in case the new frame size
* doesn't cover the same area */
xvimagesink->draw_border = TRUE;
/* We renew our xvimage only if size or format changed;
* the xvimage is the same size as the video pixel size */
@ -2044,6 +2048,8 @@ gst_xvimagesink_setcaps (GstBaseSink * bsink, GstCaps * caps)
xvimagesink->xcontext->im_format = im_format;
g_mutex_unlock (xvimagesink->flow_lock);
return TRUE;
}

View file

@ -252,6 +252,7 @@ struct _GstXvImageSink {
gboolean synchronous;
gboolean keep_aspect;
gboolean draw_border;
gboolean handle_events;
gint brightness;