diff options
author | Thijs Vermeir <thijsvermeir@gmail.com> | 2007-11-15 15:32:47 +0000 |
---|---|---|
committer | Thijs Vermeir <thijsvermeir@gmail.com> | 2007-11-15 15:32:47 +0000 |
commit | 621a4e4792bbc0d5b3a338024a3ce6c4053177f3 (patch) | |
tree | 32a87945edbac07dc1a79aa33f4a028eaf590707 /gst/librfb/gstrfbsrc.c | |
parent | 88f5ef13bf5e8203b88b21fd2392b639a0161665 (diff) | |
download | gst-plugins-bad-621a4e4792bbc0d5b3a338024a3ce6c4053177f3.tar.gz gst-plugins-bad-621a4e4792bbc0d5b3a338024a3ce6c4053177f3.tar.bz2 gst-plugins-bad-621a4e4792bbc0d5b3a338024a3ce6c4053177f3.zip |
gst/librfb/gstrfbsrc.c: don't forget to handle the offset's
Original commit message from CVS:
* gst/librfb/gstrfbsrc.c:
don't forget to handle the offset's
* gst/librfb/rfbdecoder.c:
* gst/librfb/rfbdecoder.h:
precalculate some many used values
Diffstat (limited to 'gst/librfb/gstrfbsrc.c')
-rw-r--r-- | gst/librfb/gstrfbsrc.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gst/librfb/gstrfbsrc.c b/gst/librfb/gstrfbsrc.c index 0f4af6c1..1106cbe4 100644 --- a/gst/librfb/gstrfbsrc.c +++ b/gst/librfb/gstrfbsrc.c @@ -337,14 +337,18 @@ gst_rfb_src_start (GstBaseSrc * bsrc) decoder->prev_frame = g_malloc (bsrc->blocksize); decoder->decoder_private = src; + /* calculate some many used values */ + decoder->bytespp = decoder->bpp / 8; + decoder->line_size = decoder->rect_width * decoder->bytespp; + GST_DEBUG_OBJECT (src, "setting caps width to %d and height to %d", - decoder->width, decoder->height); + decoder->rect_width, decoder->rect_height); caps = gst_caps_copy (gst_pad_get_pad_template_caps (GST_BASE_SRC_PAD (bsrc))); - gst_caps_set_simple (caps, "width", G_TYPE_INT, decoder->width, "height", - G_TYPE_INT, decoder->height, "bpp", G_TYPE_INT, decoder->bpp, "depth", - G_TYPE_INT, decoder->depth, "endianness", G_TYPE_INT, + gst_caps_set_simple (caps, "width", G_TYPE_INT, decoder->rect_width, "height", + G_TYPE_INT, decoder->rect_height, "bpp", G_TYPE_INT, decoder->bpp, + "depth", G_TYPE_INT, decoder->depth, "endianness", G_TYPE_INT, (decoder->big_endian ? 1234 : 4321), NULL); gst_pad_set_caps (GST_BASE_SRC_PAD (bsrc), caps); gst_caps_unref (caps); @@ -425,6 +429,10 @@ gst_rfb_src_event (GstBaseSrc * bsrc, GstEvent * event) gst_structure_get_double (structure, "pointer_y", &y); button = 0; + /* we need to take care of the offset's */ + x += src->decoder->offset_x; + y += src->decoder->offset_y; + if (strcmp (event_type, "key-press") == 0) { const gchar *key = gst_structure_get_string (structure, "key"); |