From 4a5a1e568e07c27316e75b321283664c512881a1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Fri, 6 Dec 2013 21:11:32 -0500 Subject: [PATCH] vmcndec: Add missing header file Forgot to add header file to previou commit --- gst/vmnc/Makefile.am | 2 + gst/vmnc/vmncdec.c | 4 +- gst/vmnc/vmncdec.h | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+), 3 deletions(-) create mode 100644 gst/vmnc/vmncdec.h diff --git a/gst/vmnc/Makefile.am b/gst/vmnc/Makefile.am index c32a578..5419dee 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 0816327..8e0830e 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 0000000..d28ef7d --- /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__ */ -- 2.7.4