summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZaheer Abbas Merali <zaheerabbas@merali.org>2006-04-07 15:27:40 +0000
committerZaheer Abbas Merali <zaheerabbas@merali.org>2006-04-07 15:27:40 +0000
commit26b748c0fbd90d98c5a57966f4c784afa2860fec (patch)
tree6d11a3f5075d166beb8bc9b102bb6e12614914f0
parent83208d042bea60f66475cc566d3d4647b9d1ad7b (diff)
downloadgst-plugins-bad-26b748c0fbd90d98c5a57966f4c784afa2860fec.tar.gz
gst-plugins-bad-26b748c0fbd90d98c5a57966f4c784afa2860fec.tar.bz2
gst-plugins-bad-26b748c0fbd90d98c5a57966f4c784afa2860fec.zip
sys/ximagesrc/ximagesrc.c: Fix typo, C++ style comments and other small cleanups
Original commit message from CVS: 2006-04-07 Zaheer Abbas Merali <zaheerabbas at merali dot org> * sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_recalc), (composite_pixel), (gst_ximagesrc_ximage_get), (gst_ximagesrc_create), (gst_ximagesrc_set_property): Fix typo, C++ style comments and other small cleanups
-rw-r--r--ChangeLog7
-rw-r--r--sys/ximagesrc/ximagesrc.c23
2 files changed, 21 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index a4584d8a..dff46a4a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-04-07 Zaheer Abbas Merali <zaheerabbas at merali dot org>
+
+ * sys/ximagesrc/ximagesrc.c: (gst_ximagesrc_recalc),
+ (composite_pixel), (gst_ximagesrc_ximage_get),
+ (gst_ximagesrc_create), (gst_ximagesrc_set_property):
+ Fix typo, C++ style comments and other small cleanups
+
2006-04-06 Wim Taymans <wim@fluendo.com>
* gst/qtdemux/qtdemux.c: (gst_qtdemux_init),
diff --git a/sys/ximagesrc/ximagesrc.c b/sys/ximagesrc/ximagesrc.c
index 06dccead..5c727f16 100644
--- a/sys/ximagesrc/ximagesrc.c
+++ b/sys/ximagesrc/ximagesrc.c
@@ -25,7 +25,7 @@
* This element captures your X Display and creates raw RGB video. It uses
* the XDamage extension if available to only capture areas of the screen that
* have changed since the last frame. It uses the XFixes extension if
- * available to also cpature your mouse pointer
+ * available to also capture your mouse pointer
* </para>
* <title>Example pipelines</title>
* <para>
@@ -52,6 +52,9 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
+#include <gst/gst.h>
+#include <gst/gst-i18n-plugin.h>
+
GST_DEBUG_CATEGORY_STATIC (gst_debug_ximagesrc);
#define GST_CAT_DEFAULT gst_debug_ximagesrc
@@ -233,7 +236,7 @@ gst_ximagesrc_recalc (GstXImageSrc * src)
if (!src->xcontext)
return FALSE;
- /* FIXME: Check the display hasn't changed size or something */
+ /* Mayble later we can check the display hasn't changed size */
/* We could use XQueryPointer to get only the current window. */
return TRUE;
}
@@ -264,12 +267,13 @@ composite_pixel (GstXContext * xcontext, guchar * dest, guchar * src)
color = GUINT32_FROM_LE (*(guint32 *) (dest));
break;
default:
- g_warning ("bpp %d not supported\n", xcontext->bpp);
- color = 0;
+ /* Should not reach here */
+ g_assert_not_reached ();
}
- /* FIXME: move the code that finds shift and max in the _link function */
+ /* possible optimisation:
+ * move the code that finds shift and max in the _link function */
for (r_shift = 0; !(xcontext->visual->red_mask & (1 << r_shift)); r_shift++);
for (g_shift = 0; !(xcontext->visual->green_mask & (1 << g_shift));
g_shift++);
@@ -478,7 +482,6 @@ gst_ximagesrc_ximage_get (GstXImageSrc * ximagesrc)
cx = ximagesrc->cursor_image->x - ximagesrc->cursor_image->xhot;
cy = ximagesrc->cursor_image->y - ximagesrc->cursor_image->yhot;
- //count = image->width * image->height;
count = ximagesrc->cursor_image->width * ximagesrc->cursor_image->height;
for (i = 0; i < count; i++)
ximagesrc->cursor_image->pixels[i] =
@@ -522,7 +525,9 @@ gst_ximagesrc_create (GstPushSrc * bs, GstBuffer ** buf)
gint64 next_frame_no;
if (!gst_ximagesrc_recalc (s)) {
- /* FIXME: Post error on the bus */
+ GST_ELEMENT_ERROR (s, RESOURCE, FAILED,
+ (_("X11 Display changed resolution, we do not support this yet.")),
+ (NULL));
return GST_FLOW_ERROR;
}
@@ -610,11 +615,11 @@ gst_ximagesrc_set_property (GObject * object, guint prop_id,
g_free (src->display_name);
src->display_name = g_strdup (g_value_get_string (value));
- // src->screen_num = MIN (src->screen_num, ScreenCount (src->display) - 1);
+ /* src->screen_num = MIN (src->screen_num, ScreenCount (src->display) - 1); */
break;
case PROP_SCREEN_NUM:
src->screen_num = g_value_get_uint (value);
- // src->screen_num = MIN (src->screen_num, ScreenCount (src->display) - 1);
+ /* src->screen_num = MIN (src->screen_num, ScreenCount (src->display) - 1); */
break;
case PROP_SHOW_POINTER:
src->show_pointer = g_value_get_boolean (value);