Commit 776911ec authored by Stefan Kost's avatar Stefan Kost Committed by Julien Moutte
Browse files

sys/: Try to redraw borders only when needed. Apparently this consumes...

sys/: Try to redraw borders only when needed. Apparently this consumes resources on small devices... :-O (#363607)

Original commit message from CVS:
2006-10-20  Julien MOUTTE  <julien@moutte.net>

* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put):
Patch by: Stefan Kost  <ensonic@users.sf.net>
Try to redraw borders only when needed. Apparently this consumes
resources on small devices... :-O (#363607)
parent 0b8488ee
2006-10-20 Julien MOUTTE <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_ximage_put):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_put):
Patch by: Stefan Kost <ensonic@users.sf.net>
Try to redraw borders only when needed. Apparently this consumes
resources on small devices... :-O (#363607)
2006-10-20 Michael Smith <msmith@fluendo.com>
 
* gst/tcp/gstmultifdsink.c:
......@@ -628,6 +628,7 @@ static void
gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstXImageBuffer * ximage)
{
GstVideoRectangle src, dst, result;
gboolean draw_border = FALSE;
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
......@@ -635,6 +636,12 @@ gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstXImageBuffer * ximage)
concurrently from the data flow thread */
g_mutex_lock (ximagesink->flow_lock);
/* Draw borders when displaying the first frame. After this
draw borders only on expose event. */
if (!ximagesink->cur_image) {
draw_border = TRUE;
}
/* Store a reference to the last image we put, lose the previous one */
if (ximage && ximagesink->cur_image != ximage) {
if (ximagesink->cur_image) {
......@@ -648,6 +655,7 @@ gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstXImageBuffer * ximage)
/* Expose sends a NULL image, we take the latest frame */
if (!ximage) {
draw_border = TRUE;
if (ximagesink->cur_image) {
ximage = ximagesink->cur_image;
} else {
......@@ -667,8 +675,10 @@ gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstXImageBuffer * ximage)
g_mutex_lock (ximagesink->x_lock);
gst_ximagesink_xwindow_draw_borders (ximagesink, ximagesink->xwindow, result);
if (draw_border) {
gst_ximagesink_xwindow_draw_borders (ximagesink, ximagesink->xwindow,
result);
}
#ifdef HAVE_XSHM
if (ximagesink->xcontext->use_xshm) {
GST_LOG_OBJECT (ximagesink,
......
......@@ -671,6 +671,7 @@ gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink,
GstXvImageBuffer * xvimage)
{
GstVideoRectangle src, dst, result;
gboolean draw_border = FALSE;
g_return_if_fail (GST_IS_XVIMAGESINK (xvimagesink));
g_return_if_fail (xvimagesink->xwindow != NULL);
......@@ -679,6 +680,12 @@ gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink,
concurrently from the data flow thread */
g_mutex_lock (xvimagesink->flow_lock);
/* Draw borders when displaying the first frame. After this
draw borders only on expose event. */
if (!xvimagesink->cur_image) {
draw_border = TRUE;
}
/* Store a reference to the last image we put, lose the previous one */
if (xvimage && xvimagesink->cur_image != xvimage) {
if (xvimagesink->cur_image) {
......@@ -692,6 +699,7 @@ gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink,
/* Expose sends a NULL image, we take the latest frame */
if (!xvimage) {
draw_border = TRUE;
if (xvimagesink->cur_image) {
xvimage = xvimagesink->cur_image;
} else {
......@@ -719,8 +727,10 @@ gst_xvimagesink_xvimage_put (GstXvImageSink * xvimagesink,
g_mutex_lock (xvimagesink->x_lock);
gst_xvimagesink_xwindow_draw_borders (xvimagesink, xvimagesink->xwindow,
result);
if (draw_border) {
gst_xvimagesink_xwindow_draw_borders (xvimagesink, xvimagesink->xwindow,
result);
}
/* We scale to the window's geometry */
#ifdef HAVE_XSHM
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment