diff --git a/gst/vmnc/Makefile.am b/gst/vmnc/Makefile.am index c32a578a1d..5419deeb1f 100644 --- a/gst/vmnc/Makefile.am +++ b/gst/vmnc/Makefile.am @@ -1,5 +1,7 @@ plugin_LTLIBRARIES = libgstvmnc.la +noinst_HEADERS = vmncdec.h + libgstvmnc_la_SOURCES = vmncdec.c libgstvmnc_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) libgstvmnc_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_API_VERSION) \ diff --git a/gst/vmnc/vmncdec.c b/gst/vmnc/vmncdec.c index 08163276d8..8e0830ecca 100644 --- a/gst/vmnc/vmncdec.c +++ b/gst/vmnc/vmncdec.c @@ -372,13 +372,11 @@ vmnc_fill_buffer (GstVMncDec * dec, GstVideoCodecFrame * frame) memcpy (map.data, dec->imagedata, map.size); - if (dec->cursor.visible) { + if (dec->cursor.visible) render_cursor (dec, map.data); - } gst_buffer_unmap (frame->output_buffer, &map); - return GST_FLOW_OK; } diff --git a/gst/vmnc/vmncdec.h b/gst/vmnc/vmncdec.h new file mode 100644 index 0000000000..d28ef7dbc5 --- /dev/null +++ b/gst/vmnc/vmncdec.h @@ -0,0 +1,111 @@ +/* GStreamer + * Copyright (C) 2007 Michael Smith + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + + +#include +#include + +#ifndef __VMNCDEC_H__ +#define __VMNCDEC_H__ + +G_BEGIN_DECLS + +#define GST_TYPE_VMNC_DEC \ + (gst_vmnc_dec_get_type()) +#define GST_VMNC_DEC(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_VMNC_DEC,GstVMncDec)) + + +#define MAKE_TYPE(a,b,c,d) ((a<<24)|(b<<16)|(c<<8)|d) +enum +{ + TYPE_RAW = 0, + TYPE_COPY = 1, + TYPE_RRE = 2, + TYPE_CoRRE = 4, + TYPE_HEXTILE = 5, + + TYPE_WMVd = MAKE_TYPE ('W', 'M', 'V', 'd'), + TYPE_WMVe = MAKE_TYPE ('W', 'M', 'V', 'e'), + TYPE_WMVf = MAKE_TYPE ('W', 'M', 'V', 'f'), + TYPE_WMVg = MAKE_TYPE ('W', 'M', 'V', 'g'), + TYPE_WMVh = MAKE_TYPE ('W', 'M', 'V', 'h'), + TYPE_WMVi = MAKE_TYPE ('W', 'M', 'V', 'i'), + TYPE_WMVj = MAKE_TYPE ('W', 'M', 'V', 'j') +}; + +struct RFBFormat +{ + int width; + int height; + int stride; + int bytes_per_pixel; + int depth; + int big_endian; + + guint8 descriptor[16]; /* The raw format descriptor block */ +}; + +enum CursorType +{ + CURSOR_COLOUR = 0, + CURSOR_ALPHA = 1 +}; + +struct Cursor +{ + enum CursorType type; + int visible; + int x; + int y; + int width; + int height; + int hot_x; + int hot_y; + guint8 *cursordata; + guint8 *cursormask; +}; + +typedef struct +{ + GstVideoDecoder parent; + + gboolean have_format; + + GstVideoCodecState *input_state; + + int framerate_num; + int framerate_denom; + + struct Cursor cursor; + struct RFBFormat format; + guint8 *imagedata; +} GstVMncDec; + +typedef struct +{ + GstVideoDecoderClass parent_class; +} GstVMncDecClass; + +GType gst_vmnc_dec_get_type (void); + + +G_END_DECLS + +#endif /* __VMNCDEC_H__ */