+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:
gst_ximagesink_ximage_put (GstXImageSink * ximagesink, GstXImageBuffer * ximage)
{
GstVideoRectangle src, dst, result;
+ gboolean draw_border = FALSE;
g_return_if_fail (GST_IS_XIMAGESINK (ximagesink));
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) {
/* Expose sends a NULL image, we take the latest frame */
if (!ximage) {
+ draw_border = TRUE;
if (ximagesink->cur_image) {
ximage = ximagesink->cur_image;
} else {
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,
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);
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) {
/* Expose sends a NULL image, we take the latest frame */
if (!xvimage) {
+ draw_border = TRUE;
if (xvimagesink->cur_image) {
xvimage = xvimagesink->cur_image;
} else {
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