From ab4038ce2e51ed2eddd3306b77a3e1b560aa5d03 Mon Sep 17 00:00:00 2001 From: Thijs Vermeir Date: Fri, 21 Sep 2007 10:27:02 +0000 Subject: [PATCH] gst/librfb/gstrfbsrc.c: Minimum raw encoding is working now Original commit message from CVS: * gst/librfb/gstrfbsrc.c: Minimum raw encoding is working now * gst/librfb/rfbdecoder.c: fix address while reading from stream --- ChangeLog | 7 +++++++ gst/librfb/gstrfbsrc.c | 6 +----- gst/librfb/rfbdecoder.c | 9 ++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2079d8103..6f891cb0f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-09-21 Thijs Vermeir + + * gst/librfb/gstrfbsrc.c: + Minimum raw encoding is working now + * gst/librfb/rfbdecoder.c: + fix address while reading from stream + 2007-09-20 Thijs Vermeir * gst/librfb/gstrfbsrc.c: diff --git a/gst/librfb/gstrfbsrc.c b/gst/librfb/gstrfbsrc.c index fc9a84311e..a4323815d2 100644 --- a/gst/librfb/gstrfbsrc.c +++ b/gst/librfb/gstrfbsrc.c @@ -40,10 +40,6 @@ enum ARG_PASSWORD, }; -#define RGB332_R(x) ((((x)&0x07) * 0x124)>>3) -#define RGB332_G(x) ((((x)&0x38) * 0x124)>>6) -#define RGB332_B(x) ((((x)&0xc0) * 0x149)>>8) - GST_DEBUG_CATEGORY_STATIC (rfbsrc_debug); #define GST_CAT_DEFAULT rfbsrc_debug @@ -67,7 +63,7 @@ GST_STATIC_PAD_TEMPLATE ("src", "green_mask = (int) 0x00ff0000, " "blue_mask = (int) 0xff000000, " "width = (int) [ 16, 4096 ], " - "height = (int) [ 16, 4096 ], " "framerate = (fraction) 30/1") + "height = (int) [ 16, 4096 ], " "framerate = (fraction) 0/1") ); static void gst_rfb_src_base_init (gpointer g_class); diff --git a/gst/librfb/rfbdecoder.c b/gst/librfb/rfbdecoder.c index 8c398becfb..3d150dbe8f 100644 --- a/gst/librfb/rfbdecoder.c +++ b/gst/librfb/rfbdecoder.c @@ -148,10 +148,10 @@ rfb_decoder_iterate (RfbDecoder * decoder) } guint8 * -rfb_decoder_read (RfbDecoder * decoder, gint len) +rfb_decoder_read (RfbDecoder * decoder, guint32 len) { - gint total = 0; - gint now = 0; + guint32 total = 0; + guint32 now = 0; guint8 *address = NULL; g_return_val_if_fail (decoder->fd > 0, NULL); @@ -160,9 +160,8 @@ rfb_decoder_read (RfbDecoder * decoder, gint len) address = g_malloc (len); g_return_val_if_fail (address, NULL); - address += total; while (total < len) { - now = recv (decoder->fd, address, len - total, 0); + now = recv (decoder->fd, address + total, len - total, 0); if (now <= 0) { GST_WARNING ("rfb read error on socket"); return NULL;