Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2007 Michael Smith <msmith@xiph.org>
|
|
|
|
*
|
|
|
|
* 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
|
2012-11-03 20:38:00 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2013-12-07 01:58:48 +00:00
|
|
|
* This is a decoder for the VMWare VMnc video codec, which VMWare uses for
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
* recording * of virtual machine instances.
|
2013-12-07 01:58:48 +00:00
|
|
|
* It's essentially a serialisation of RFB (the VNC protocol)
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
* 'FramebufferUpdate' messages, with some special encoding-types for VMnc
|
|
|
|
* extensions. There's some documentation (with fixes from VMWare employees) at:
|
|
|
|
* http://wiki.multimedia.cx/index.php?title=VMware_Video
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
#include "vmncdec.h"
|
|
|
|
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
static gboolean gst_vmnc_dec_reset (GstVideoDecoder * decoder);
|
|
|
|
static gboolean gst_vmnc_dec_set_format (GstVideoDecoder * decoder,
|
|
|
|
GstVideoCodecState * state);
|
|
|
|
static GstFlowReturn gst_vmnc_dec_handle_frame (GstVideoDecoder * decoder,
|
|
|
|
GstVideoCodecFrame * frame);
|
|
|
|
static GstFlowReturn gst_vmnc_dec_parse (GstVideoDecoder * decoder,
|
|
|
|
GstVideoCodecFrame * frame, GstAdapter * adapter, gboolean at_eos);
|
2016-06-08 01:04:21 +00:00
|
|
|
static gboolean gst_vmnc_dec_sink_event (GstVideoDecoder * bdec,
|
|
|
|
GstEvent * event);
|
2013-12-07 01:58:48 +00:00
|
|
|
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
#define GST_CAT_DEFAULT vmnc_debug
|
|
|
|
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
|
|
|
|
|
2010-01-11 00:59:38 +00:00
|
|
|
#define RFB_GET_UINT32(ptr) GST_READ_UINT32_BE(ptr)
|
|
|
|
#define RFB_GET_UINT16(ptr) GST_READ_UINT16_BE(ptr)
|
|
|
|
#define RFB_GET_UINT8(ptr) GST_READ_UINT8(ptr)
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
2015-04-27 09:55:13 +00:00
|
|
|
PROP_0,
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
};
|
|
|
|
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
ERROR_INVALID = -1, /* Invalid data in bitstream */
|
|
|
|
ERROR_INSUFFICIENT_DATA = -2 /* Haven't received enough data yet */
|
|
|
|
};
|
|
|
|
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
static GstStaticPadTemplate vmnc_dec_src_factory =
|
|
|
|
GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
2013-12-07 01:58:48 +00:00
|
|
|
GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("{ RGBx, BGRx, xRGB, xBGR,"
|
|
|
|
" RGB15, BGR15, RGB16, BGR16, GRAY8 }")));
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
|
|
|
static GstStaticPadTemplate vmnc_dec_sink_factory =
|
|
|
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("video/x-vmnc, version=(int)1, "
|
|
|
|
"framerate=(fraction)[0, max], "
|
|
|
|
"width=(int)[0, max], " "height=(int)[0, max]")
|
|
|
|
);
|
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
G_DEFINE_TYPE (GstVMncDec, gst_vmnc_dec, GST_TYPE_VIDEO_DECODER);
|
2021-02-25 14:22:15 +00:00
|
|
|
GST_ELEMENT_REGISTER_DEFINE (vmncdec, "vmncdec", GST_RANK_PRIMARY,
|
|
|
|
GST_TYPE_VMNC_DEC);
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
|
|
|
static void
|
2013-12-07 01:58:48 +00:00
|
|
|
gst_vmnc_dec_class_init (GstVMncDecClass * klass)
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
{
|
2013-12-07 01:58:48 +00:00
|
|
|
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
|
|
|
|
GstVideoDecoderClass *decoder_class = GST_VIDEO_DECODER_CLASS (klass);
|
|
|
|
|
|
|
|
decoder_class->start = gst_vmnc_dec_reset;
|
|
|
|
decoder_class->stop = gst_vmnc_dec_reset;
|
|
|
|
decoder_class->parse = gst_vmnc_dec_parse;
|
|
|
|
decoder_class->handle_frame = gst_vmnc_dec_handle_frame;
|
|
|
|
decoder_class->set_format = gst_vmnc_dec_set_format;
|
2016-06-08 01:04:21 +00:00
|
|
|
decoder_class->sink_event = gst_vmnc_dec_sink_event;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
2016-03-04 06:50:26 +00:00
|
|
|
gst_element_class_add_static_pad_template (gstelement_class,
|
|
|
|
&vmnc_dec_src_factory);
|
|
|
|
gst_element_class_add_static_pad_template (gstelement_class,
|
|
|
|
&vmnc_dec_sink_factory);
|
2013-12-07 01:58:48 +00:00
|
|
|
gst_element_class_set_static_metadata (gstelement_class, "VMnc video decoder",
|
2016-03-04 06:50:26 +00:00
|
|
|
"Codec/Decoder/Video", "Decode VmWare video to raw (RGB) video",
|
2010-03-18 16:30:26 +00:00
|
|
|
"Michael Smith <msmith@xiph.org>");
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_INIT (vmnc_debug, "vmncdec", 0, "VMnc decoder");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2013-12-07 01:58:48 +00:00
|
|
|
gst_vmnc_dec_init (GstVMncDec * dec)
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
{
|
2015-08-15 15:55:49 +00:00
|
|
|
gst_video_decoder_set_use_default_pad_acceptcaps (GST_VIDEO_DECODER_CAST
|
|
|
|
(dec), TRUE);
|
|
|
|
GST_PAD_SET_ACCEPT_TEMPLATE (GST_VIDEO_DECODER_SINK_PAD (dec));
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
}
|
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
static gboolean
|
|
|
|
gst_vmnc_dec_reset (GstVideoDecoder * decoder)
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
{
|
2013-12-07 01:58:48 +00:00
|
|
|
GstVMncDec *dec = GST_VMNC_DEC (decoder);
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
g_free (dec->imagedata);
|
|
|
|
dec->imagedata = NULL;
|
2008-02-12 10:22:42 +00:00
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
g_free (dec->cursor.cursordata);
|
|
|
|
dec->cursor.cursordata = NULL;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
g_free (dec->cursor.cursormask);
|
|
|
|
dec->cursor.cursormask = NULL;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
|
|
|
dec->cursor.visible = 0;
|
|
|
|
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
dec->have_format = FALSE;
|
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
if (dec->input_state)
|
|
|
|
gst_video_codec_state_unref (dec->input_state);
|
|
|
|
dec->input_state = NULL;
|
|
|
|
|
|
|
|
return TRUE;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct RfbRectangle
|
|
|
|
{
|
|
|
|
guint16 x;
|
|
|
|
guint16 y;
|
|
|
|
guint16 width;
|
|
|
|
guint16 height;
|
|
|
|
|
|
|
|
gint32 type;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Rectangle handling functions.
|
|
|
|
* Return number of bytes consumed, or < 0 on error
|
|
|
|
*/
|
|
|
|
typedef int (*rectangle_handler) (GstVMncDec * dec, struct RfbRectangle * rect,
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
const guint8 * data, int len, gboolean decode);
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
|
|
|
static int
|
|
|
|
vmnc_handle_wmvi_rectangle (GstVMncDec * dec, struct RfbRectangle *rect,
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
const guint8 * data, int len, gboolean decode)
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
{
|
2013-12-07 01:58:48 +00:00
|
|
|
GstVideoFormat format;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
gint bpp, tc;
|
|
|
|
guint32 redmask, greenmask, bluemask;
|
|
|
|
guint32 endianness, dataendianness;
|
2014-05-13 09:38:44 +00:00
|
|
|
GstVideoCodecState *state;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
|
|
|
/* A WMVi rectangle has a 16byte payload */
|
|
|
|
if (len < 16) {
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
GST_DEBUG_OBJECT (dec, "Bad WMVi rect: too short");
|
|
|
|
return ERROR_INSUFFICIENT_DATA;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* We only compare 13 bytes; ignoring the 3 padding bytes at the end */
|
2013-12-07 01:58:48 +00:00
|
|
|
if (dec->have_format && memcmp (data, dec->format.descriptor, 13) == 0) {
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
/* Nothing changed, so just exit */
|
|
|
|
return 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Store the whole block for simple comparison later */
|
|
|
|
memcpy (dec->format.descriptor, data, 16);
|
|
|
|
|
|
|
|
if (rect->x != 0 || rect->y != 0) {
|
|
|
|
GST_WARNING_OBJECT (dec, "Bad WMVi rect: wrong coordinates");
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INVALID;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bpp = data[0];
|
|
|
|
dec->format.depth = data[1];
|
|
|
|
dec->format.big_endian = data[2];
|
|
|
|
dataendianness = data[2] ? G_BIG_ENDIAN : G_LITTLE_ENDIAN;
|
|
|
|
tc = data[3];
|
|
|
|
|
|
|
|
if (bpp != 8 && bpp != 16 && bpp != 32) {
|
|
|
|
GST_WARNING_OBJECT (dec, "Bad bpp value: %d", bpp);
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INVALID;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!tc) {
|
|
|
|
GST_WARNING_OBJECT (dec, "Paletted video not supported");
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INVALID;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
dec->format.bytes_per_pixel = bpp / 8;
|
|
|
|
dec->format.width = rect->width;
|
|
|
|
dec->format.height = rect->height;
|
|
|
|
|
|
|
|
redmask = (guint32) (RFB_GET_UINT16 (data + 4)) << data[10];
|
|
|
|
greenmask = (guint32) (RFB_GET_UINT16 (data + 6)) << data[11];
|
|
|
|
bluemask = (guint32) (RFB_GET_UINT16 (data + 8)) << data[12];
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (dec, "Red: mask %d, shift %d",
|
|
|
|
RFB_GET_UINT16 (data + 4), data[10]);
|
|
|
|
GST_DEBUG_OBJECT (dec, "Green: mask %d, shift %d",
|
|
|
|
RFB_GET_UINT16 (data + 6), data[11]);
|
|
|
|
GST_DEBUG_OBJECT (dec, "Blue: mask %d, shift %d",
|
|
|
|
RFB_GET_UINT16 (data + 8), data[12]);
|
|
|
|
GST_DEBUG_OBJECT (dec, "BPP: %d. endianness: %s", bpp,
|
|
|
|
data[2] ? "big" : "little");
|
|
|
|
|
|
|
|
/* GStreamer's RGB caps are a bit weird. */
|
|
|
|
if (bpp == 8) {
|
|
|
|
endianness = G_BYTE_ORDER; /* Doesn't matter */
|
|
|
|
} else if (bpp == 16) {
|
|
|
|
/* We require host-endian. */
|
|
|
|
endianness = G_BYTE_ORDER;
|
|
|
|
} else { /* bpp == 32 */
|
|
|
|
/* We require big endian */
|
|
|
|
endianness = G_BIG_ENDIAN;
|
|
|
|
if (endianness != dataendianness) {
|
|
|
|
redmask = GUINT32_SWAP_LE_BE (redmask);
|
|
|
|
greenmask = GUINT32_SWAP_LE_BE (greenmask);
|
|
|
|
bluemask = GUINT32_SWAP_LE_BE (bluemask);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
format = gst_video_format_from_masks (dec->format.depth, bpp, endianness,
|
|
|
|
redmask, greenmask, bluemask, 0);
|
|
|
|
|
2019-09-02 19:08:44 +00:00
|
|
|
GST_DEBUG_OBJECT (dec, "From depth: %d bpp: %u endianness: %s redmask: %X "
|
2013-12-07 01:58:48 +00:00
|
|
|
"greenmask: %X bluemask: %X got format %s",
|
|
|
|
dec->format.depth, bpp, endianness == G_BIG_ENDIAN ? "BE" : "LE",
|
|
|
|
GUINT32_FROM_BE (redmask), GUINT32_FROM_BE (greenmask),
|
|
|
|
GUINT32_FROM_BE (bluemask),
|
2019-09-02 19:08:44 +00:00
|
|
|
format == GST_VIDEO_FORMAT_UNKNOWN ? "UNKNOWN" :
|
2013-12-07 01:58:48 +00:00
|
|
|
gst_video_format_to_string (format));
|
|
|
|
|
|
|
|
if (format == GST_VIDEO_FORMAT_UNKNOWN) {
|
|
|
|
GST_WARNING_OBJECT (dec, "Video format unknown to GStreamer");
|
|
|
|
return ERROR_INVALID;
|
|
|
|
}
|
|
|
|
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
dec->have_format = TRUE;
|
|
|
|
if (!decode) {
|
2013-12-07 01:58:48 +00:00
|
|
|
GST_LOG_OBJECT (dec, "Parsing, not setting caps");
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return 16;
|
|
|
|
}
|
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
|
2014-05-13 09:38:44 +00:00
|
|
|
state = gst_video_decoder_set_output_state (GST_VIDEO_DECODER (dec), format,
|
2013-12-07 01:58:48 +00:00
|
|
|
rect->width, rect->height, dec->input_state);
|
2014-05-13 09:38:44 +00:00
|
|
|
gst_video_codec_state_unref (state);
|
2013-12-07 01:58:48 +00:00
|
|
|
|
|
|
|
g_free (dec->imagedata);
|
2016-11-16 18:41:39 +00:00
|
|
|
dec->imagedata = g_malloc0 (dec->format.width * dec->format.height *
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
dec->format.bytes_per_pixel);
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
GST_DEBUG_OBJECT (dec, "Allocated image data at %p", dec->imagedata);
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
|
|
|
dec->format.stride = dec->format.width * dec->format.bytes_per_pixel;
|
|
|
|
|
|
|
|
return 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
render_colour_cursor (GstVMncDec * dec, guint8 * data, int x, int y,
|
|
|
|
int off_x, int off_y, int width, int height)
|
|
|
|
{
|
|
|
|
int i, j;
|
|
|
|
guint8 *dstraw = data + dec->format.stride * y +
|
|
|
|
dec->format.bytes_per_pixel * x;
|
|
|
|
guint8 *srcraw = dec->cursor.cursordata +
|
|
|
|
dec->cursor.width * dec->format.bytes_per_pixel * off_y;
|
|
|
|
guint8 *maskraw = dec->cursor.cursormask +
|
|
|
|
dec->cursor.width * dec->format.bytes_per_pixel * off_y;
|
|
|
|
|
|
|
|
/* Boundchecking done by caller; this is just the renderer inner loop */
|
|
|
|
if (dec->format.bytes_per_pixel == 1) {
|
|
|
|
guint8 *dst = dstraw;
|
|
|
|
guint8 *src = srcraw;
|
|
|
|
guint8 *mask = maskraw;
|
|
|
|
|
|
|
|
for (i = 0; i < height; i++) {
|
|
|
|
for (j = 0; j < width; j++) {
|
|
|
|
dst[j] = (dst[j] & src[j]) ^ mask[j];
|
|
|
|
}
|
|
|
|
dst += dec->format.width;
|
|
|
|
src += dec->cursor.width;
|
|
|
|
mask += dec->cursor.width;
|
|
|
|
}
|
|
|
|
} else if (dec->format.bytes_per_pixel == 2) {
|
|
|
|
guint16 *dst = (guint16 *) dstraw;
|
|
|
|
guint16 *src = (guint16 *) srcraw;
|
|
|
|
guint16 *mask = (guint16 *) maskraw;
|
|
|
|
|
|
|
|
for (i = 0; i < height; i++) {
|
|
|
|
for (j = 0; j < width; j++) {
|
|
|
|
dst[j] = (dst[j] & src[j]) ^ mask[j];
|
|
|
|
}
|
|
|
|
dst += dec->format.width;
|
|
|
|
src += dec->cursor.width;
|
|
|
|
mask += dec->cursor.width;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
guint32 *dst = (guint32 *) dstraw;
|
|
|
|
guint32 *src = (guint32 *) srcraw;
|
|
|
|
guint32 *mask = (guint32 *) maskraw;
|
|
|
|
|
|
|
|
for (i = 0; i < height; i++) {
|
|
|
|
for (j = 0; j < width; j++) {
|
|
|
|
dst[j] = (dst[j] & src[j]) ^ mask[j];
|
|
|
|
}
|
|
|
|
dst += dec->format.width;
|
|
|
|
src += dec->cursor.width;
|
|
|
|
mask += dec->cursor.width;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
render_cursor (GstVMncDec * dec, guint8 * data)
|
|
|
|
{
|
|
|
|
/* First, figure out the portion of the cursor that's on-screen */
|
|
|
|
/* X,Y of top-left of cursor */
|
|
|
|
int x = dec->cursor.x - dec->cursor.hot_x;
|
|
|
|
int y = dec->cursor.y - dec->cursor.hot_y;
|
|
|
|
|
|
|
|
/* Width, height of rendered portion of cursor */
|
|
|
|
int width = dec->cursor.width;
|
|
|
|
int height = dec->cursor.height;
|
|
|
|
|
|
|
|
/* X,Y offset of rendered portion of cursor */
|
|
|
|
int off_x = 0;
|
|
|
|
int off_y = 0;
|
|
|
|
|
|
|
|
if (x < 0) {
|
|
|
|
off_x = -x;
|
|
|
|
width += x;
|
|
|
|
x = 0;
|
|
|
|
}
|
|
|
|
if (x + width > dec->format.width)
|
|
|
|
width = dec->format.width - x;
|
|
|
|
if (y < 0) {
|
|
|
|
off_y = -y;
|
|
|
|
height += y;
|
|
|
|
y = 0;
|
|
|
|
}
|
|
|
|
if (y + height > dec->format.height)
|
|
|
|
height = dec->format.height - y;
|
|
|
|
|
|
|
|
if (dec->cursor.type == CURSOR_COLOUR) {
|
|
|
|
render_colour_cursor (dec, data, x, y, off_x, off_y, width, height);
|
|
|
|
} else {
|
|
|
|
/* Alpha cursor. */
|
|
|
|
/* TODO: Implement me! */
|
|
|
|
GST_WARNING_OBJECT (dec, "Alpha composited cursors not yet implemented");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
static GstFlowReturn
|
|
|
|
vmnc_fill_buffer (GstVMncDec * dec, GstVideoCodecFrame * frame)
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
{
|
2013-12-07 01:58:48 +00:00
|
|
|
GstFlowReturn ret;
|
|
|
|
GstMapInfo map;
|
|
|
|
|
|
|
|
ret =
|
|
|
|
gst_video_decoder_allocate_output_frame (GST_VIDEO_DECODER (dec), frame);
|
|
|
|
if (ret != GST_FLOW_OK)
|
|
|
|
return ret;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
gst_buffer_map (frame->output_buffer, &map, GST_MAP_READWRITE);
|
|
|
|
|
|
|
|
memcpy (map.data, dec->imagedata, map.size);
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
2013-12-07 02:11:32 +00:00
|
|
|
if (dec->cursor.visible)
|
2013-12-07 01:58:48 +00:00
|
|
|
render_cursor (dec, map.data);
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
gst_buffer_unmap (frame->output_buffer, &map);
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
return GST_FLOW_OK;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
vmnc_handle_wmvd_rectangle (GstVMncDec * dec, struct RfbRectangle *rect,
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
const guint8 * data, int len, gboolean decode)
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
{
|
|
|
|
/* Cursor data. */
|
|
|
|
int datalen = 2;
|
|
|
|
int type, size;
|
|
|
|
|
|
|
|
if (len < datalen) {
|
2013-12-07 01:58:48 +00:00
|
|
|
GST_LOG_OBJECT (dec, "Cursor data too short");
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INSUFFICIENT_DATA;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type = RFB_GET_UINT8 (data);
|
|
|
|
|
|
|
|
if (type == CURSOR_COLOUR) {
|
|
|
|
datalen += rect->width * rect->height * dec->format.bytes_per_pixel * 2;
|
|
|
|
} else if (type == CURSOR_ALPHA) {
|
|
|
|
datalen += rect->width * rect->height * 4;
|
|
|
|
} else {
|
|
|
|
GST_WARNING_OBJECT (dec, "Unknown cursor type: %d", type);
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INVALID;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (len < datalen) {
|
2013-12-07 01:58:48 +00:00
|
|
|
GST_LOG_OBJECT (dec, "Cursor data too short");
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INSUFFICIENT_DATA;
|
|
|
|
} else if (!decode)
|
|
|
|
return datalen;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
|
|
|
dec->cursor.type = type;
|
|
|
|
dec->cursor.width = rect->width;
|
|
|
|
dec->cursor.height = rect->height;
|
|
|
|
dec->cursor.type = type;
|
|
|
|
dec->cursor.hot_x = rect->x;
|
|
|
|
dec->cursor.hot_y = rect->y;
|
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
g_free (dec->cursor.cursordata);
|
|
|
|
g_free (dec->cursor.cursormask);
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
|
|
|
if (type == 0) {
|
|
|
|
size = rect->width * rect->height * dec->format.bytes_per_pixel;
|
|
|
|
dec->cursor.cursordata = g_malloc (size);
|
|
|
|
dec->cursor.cursormask = g_malloc (size);
|
|
|
|
memcpy (dec->cursor.cursordata, data + 2, size);
|
|
|
|
memcpy (dec->cursor.cursormask, data + 2 + size, size);
|
|
|
|
} else {
|
|
|
|
dec->cursor.cursordata = g_malloc (rect->width * rect->height * 4);
|
|
|
|
memcpy (dec->cursor.cursordata, data + 2, rect->width * rect->height * 4);
|
|
|
|
}
|
|
|
|
|
|
|
|
return datalen;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
vmnc_handle_wmve_rectangle (GstVMncDec * dec, struct RfbRectangle *rect,
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
const guint8 * data, int len, gboolean decode)
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
{
|
|
|
|
guint16 flags;
|
|
|
|
|
|
|
|
/* Cursor state. */
|
|
|
|
if (len < 2) {
|
2013-12-07 01:58:48 +00:00
|
|
|
GST_LOG_OBJECT (dec, "Cursor data too short");
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INSUFFICIENT_DATA;
|
|
|
|
} else if (!decode)
|
|
|
|
return 2;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
|
|
|
flags = RFB_GET_UINT16 (data);
|
|
|
|
dec->cursor.visible = flags & 0x01;
|
|
|
|
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
vmnc_handle_wmvf_rectangle (GstVMncDec * dec, struct RfbRectangle *rect,
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
const guint8 * data, int len, gboolean decode)
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
{
|
|
|
|
/* Cursor position. */
|
|
|
|
dec->cursor.x = rect->x;
|
|
|
|
dec->cursor.y = rect->y;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
vmnc_handle_wmvg_rectangle (GstVMncDec * dec, struct RfbRectangle *rect,
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
const guint8 * data, int len, gboolean decode)
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
{
|
|
|
|
/* Keyboard stuff; not interesting for playback */
|
|
|
|
if (len < 10) {
|
2013-12-07 01:58:48 +00:00
|
|
|
GST_LOG_OBJECT (dec, "Keyboard data too short");
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INSUFFICIENT_DATA;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
return 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
vmnc_handle_wmvh_rectangle (GstVMncDec * dec, struct RfbRectangle *rect,
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
const guint8 * data, int len, gboolean decode)
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
{
|
|
|
|
/* More keyboard stuff; not interesting for playback */
|
|
|
|
if (len < 4) {
|
2013-12-07 01:58:48 +00:00
|
|
|
GST_LOG_OBJECT (dec, "Keyboard data too short");
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INSUFFICIENT_DATA;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
vmnc_handle_wmvj_rectangle (GstVMncDec * dec, struct RfbRectangle *rect,
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
const guint8 * data, int len, gboolean decode)
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
{
|
|
|
|
/* VM state info, not interesting for playback */
|
|
|
|
if (len < 2) {
|
2013-12-07 01:58:48 +00:00
|
|
|
GST_LOG_OBJECT (dec, "VM state data too short");
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INSUFFICIENT_DATA;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
render_raw_tile (GstVMncDec * dec, const guint8 * data, int x, int y,
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
int width, int height)
|
|
|
|
{
|
|
|
|
int i;
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
guint8 *dst;
|
|
|
|
const guint8 *src;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
int line;
|
|
|
|
|
|
|
|
src = data;
|
|
|
|
dst = dec->imagedata + dec->format.stride * y +
|
|
|
|
dec->format.bytes_per_pixel * x;
|
|
|
|
line = width * dec->format.bytes_per_pixel;
|
|
|
|
|
|
|
|
for (i = 0; i < height; i++) {
|
|
|
|
/* This is wrong-endian currently */
|
|
|
|
memcpy (dst, src, line);
|
|
|
|
|
|
|
|
dst += dec->format.stride;
|
|
|
|
src += line;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
render_subrect (GstVMncDec * dec, int x, int y, int width,
|
|
|
|
int height, guint32 colour)
|
|
|
|
{
|
|
|
|
/* Crazy inefficient! */
|
|
|
|
int i, j;
|
|
|
|
guint8 *dst;
|
|
|
|
|
|
|
|
for (i = 0; i < height; i++) {
|
|
|
|
dst = dec->imagedata + dec->format.stride * (y + i) +
|
|
|
|
dec->format.bytes_per_pixel * x;
|
|
|
|
for (j = 0; j < width; j++) {
|
|
|
|
memcpy (dst, &colour, dec->format.bytes_per_pixel);
|
|
|
|
dst += dec->format.bytes_per_pixel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
vmnc_handle_raw_rectangle (GstVMncDec * dec, struct RfbRectangle *rect,
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
const guint8 * data, int len, gboolean decode)
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
{
|
|
|
|
int datalen = rect->width * rect->height * dec->format.bytes_per_pixel;
|
|
|
|
|
|
|
|
if (len < datalen) {
|
2013-12-07 01:58:48 +00:00
|
|
|
GST_LOG_OBJECT (dec, "Raw data too short");
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INSUFFICIENT_DATA;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
if (decode)
|
|
|
|
render_raw_tile (dec, data, rect->x, rect->y, rect->width, rect->height);
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
|
|
|
return datalen;
|
|
|
|
}
|
|
|
|
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
static int
|
|
|
|
vmnc_handle_copy_rectangle (GstVMncDec * dec, struct RfbRectangle *rect,
|
|
|
|
const guint8 * data, int len, gboolean decode)
|
|
|
|
{
|
|
|
|
int src_x, src_y;
|
|
|
|
guint8 *src, *dst;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (len < 4) {
|
2013-12-07 01:58:48 +00:00
|
|
|
GST_LOG_OBJECT (dec, "Copy data too short");
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INSUFFICIENT_DATA;
|
|
|
|
} else if (!decode)
|
|
|
|
return 4;
|
|
|
|
|
|
|
|
src_x = RFB_GET_UINT16 (data);
|
|
|
|
src_y = RFB_GET_UINT16 (data + 2);
|
|
|
|
|
|
|
|
/* Our destination rectangle is guaranteed in-frame; check this for the source
|
|
|
|
* rectangle. */
|
|
|
|
if (src_x + rect->width > dec->format.width ||
|
|
|
|
src_y + rect->height > dec->format.height) {
|
|
|
|
GST_WARNING_OBJECT (dec, "Source rectangle out of range");
|
|
|
|
return ERROR_INVALID;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (src_y > rect->y || src_x > rect->x) {
|
|
|
|
/* Moving forward */
|
|
|
|
src = dec->imagedata + dec->format.stride * src_y +
|
|
|
|
dec->format.bytes_per_pixel * src_x;
|
|
|
|
dst = dec->imagedata + dec->format.stride * rect->y +
|
|
|
|
dec->format.bytes_per_pixel * rect->x;
|
|
|
|
for (i = 0; i < rect->height; i++) {
|
|
|
|
memmove (dst, src, rect->width * dec->format.bytes_per_pixel);
|
|
|
|
dst += dec->format.stride;
|
|
|
|
src += dec->format.stride;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
/* Backwards */
|
|
|
|
src = dec->imagedata + dec->format.stride * (src_y + rect->height - 1) +
|
|
|
|
dec->format.bytes_per_pixel * src_x;
|
|
|
|
dst = dec->imagedata + dec->format.stride * (rect->y + rect->height - 1) +
|
|
|
|
dec->format.bytes_per_pixel * rect->x;
|
|
|
|
for (i = rect->height; i > 0; i--) {
|
|
|
|
memmove (dst, src, rect->width * dec->format.bytes_per_pixel);
|
|
|
|
dst -= dec->format.stride;
|
|
|
|
src -= dec->format.stride;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 4;
|
|
|
|
}
|
|
|
|
|
2010-01-11 00:59:38 +00:00
|
|
|
/* FIXME: data+off might not be properly aligned */
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
#define READ_PIXEL(pixel, data, off, len) \
|
|
|
|
if (dec->format.bytes_per_pixel == 1) { \
|
|
|
|
if (off >= len) \
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INSUFFICIENT_DATA; \
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
pixel = data[off++]; \
|
|
|
|
} else if (dec->format.bytes_per_pixel == 2) { \
|
|
|
|
if (off+2 > len) \
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INSUFFICIENT_DATA; \
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
pixel = (*(guint16 *)(data + off)); \
|
|
|
|
off += 2; \
|
|
|
|
} else { \
|
|
|
|
if (off+4 > len) \
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INSUFFICIENT_DATA; \
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
pixel = (*(guint32 *)(data + off)); \
|
|
|
|
off += 4; \
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
vmnc_handle_hextile_rectangle (GstVMncDec * dec, struct RfbRectangle *rect,
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
const guint8 * data, int len, gboolean decode)
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
{
|
|
|
|
int tilesx = GST_ROUND_UP_16 (rect->width) / 16;
|
|
|
|
int tilesy = GST_ROUND_UP_16 (rect->height) / 16;
|
|
|
|
int x, y, z;
|
|
|
|
int off = 0;
|
|
|
|
int subrects;
|
|
|
|
int coloured;
|
|
|
|
int width, height;
|
|
|
|
guint32 fg = 0, bg = 0, colour;
|
|
|
|
guint8 flags;
|
|
|
|
|
|
|
|
for (y = 0; y < tilesy; y++) {
|
|
|
|
if (y == tilesy - 1)
|
|
|
|
height = rect->height - (tilesy - 1) * 16;
|
|
|
|
else
|
|
|
|
height = 16;
|
|
|
|
|
|
|
|
for (x = 0; x < tilesx; x++) {
|
|
|
|
if (x == tilesx - 1)
|
|
|
|
width = rect->width - (tilesx - 1) * 16;
|
|
|
|
else
|
|
|
|
width = 16;
|
|
|
|
|
|
|
|
if (off >= len) {
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INSUFFICIENT_DATA;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
flags = data[off++];
|
|
|
|
|
|
|
|
if (flags & 0x1) {
|
|
|
|
if (off + width * height * dec->format.bytes_per_pixel > len) {
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INSUFFICIENT_DATA;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
if (decode)
|
|
|
|
render_raw_tile (dec, data + off, rect->x + x * 16, rect->y + y * 16,
|
|
|
|
width, height);
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
off += width * height * dec->format.bytes_per_pixel;
|
|
|
|
} else {
|
|
|
|
if (flags & 0x2) {
|
|
|
|
READ_PIXEL (bg, data, off, len)
|
|
|
|
}
|
|
|
|
if (flags & 0x4) {
|
|
|
|
READ_PIXEL (fg, data, off, len)
|
|
|
|
}
|
|
|
|
|
|
|
|
subrects = 0;
|
|
|
|
if (flags & 0x8) {
|
|
|
|
if (off >= len) {
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INSUFFICIENT_DATA;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
subrects = data[off++];
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Paint background colour on entire tile */
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
if (decode)
|
|
|
|
render_subrect (dec, rect->x + x * 16, rect->y + y * 16,
|
|
|
|
width, height, bg);
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
|
|
|
coloured = flags & 0x10;
|
|
|
|
for (z = 0; z < subrects; z++) {
|
|
|
|
if (coloured) {
|
|
|
|
READ_PIXEL (colour, data, off, len);
|
|
|
|
} else
|
|
|
|
colour = fg;
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
if (off + 2 > len)
|
|
|
|
return ERROR_INSUFFICIENT_DATA;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
int off_x = (data[off] & 0xf0) >> 4;
|
|
|
|
int off_y = (data[off] & 0x0f);
|
|
|
|
int w = ((data[off + 1] & 0xf0) >> 4) + 1;
|
|
|
|
int h = (data[off + 1] & 0x0f) + 1;
|
|
|
|
|
|
|
|
off += 2;
|
|
|
|
|
|
|
|
/* Ensure we don't have out of bounds coordinates */
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
if (off_x + w > width || off_y + h > height) {
|
|
|
|
GST_WARNING_OBJECT (dec, "Subrect out of bounds: %d-%d x %d-%d "
|
|
|
|
"extends outside %dx%d", off_x, w, off_y, h, width, height);
|
|
|
|
return ERROR_INVALID;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (decode)
|
|
|
|
render_subrect (dec, rect->x + x * 16 + off_x,
|
|
|
|
rect->y + y * 16 + off_y, w, h, colour);
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return off;
|
|
|
|
}
|
|
|
|
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
/* Handle a packet in one of two modes: decode or parse.
|
|
|
|
* In parse mode, we don't execute any of the decoding, we just do enough to
|
|
|
|
* figure out how many bytes it contains
|
|
|
|
*
|
|
|
|
* Returns: >= 0, the number of bytes consumed
|
|
|
|
* < 0, packet too short to decode, or error
|
|
|
|
*/
|
|
|
|
static int
|
|
|
|
vmnc_handle_packet (GstVMncDec * dec, const guint8 * data, int len,
|
|
|
|
gboolean decode)
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
{
|
|
|
|
int type;
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
int offset = 0;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
|
|
|
if (len < 4) {
|
2013-12-07 01:58:48 +00:00
|
|
|
GST_LOG_OBJECT (dec, "Packet too short");
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INSUFFICIENT_DATA;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type = data[0];
|
|
|
|
|
|
|
|
switch (type) {
|
|
|
|
case 0:
|
|
|
|
{
|
|
|
|
int numrect = RFB_GET_UINT16 (data + 2);
|
|
|
|
int i;
|
|
|
|
int read;
|
|
|
|
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
offset = 4;
|
|
|
|
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
for (i = 0; i < numrect; i++) {
|
|
|
|
struct RfbRectangle r;
|
|
|
|
rectangle_handler handler;
|
|
|
|
|
|
|
|
if (len < offset + 12) {
|
2013-12-07 01:58:48 +00:00
|
|
|
GST_LOG_OBJECT (dec,
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
"Packet too short for rectangle header: %d < %d",
|
|
|
|
len, offset + 12);
|
|
|
|
return ERROR_INSUFFICIENT_DATA;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
2013-12-07 01:58:48 +00:00
|
|
|
GST_LOG_OBJECT (dec, "Reading rectangle %d", i);
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
r.x = RFB_GET_UINT16 (data + offset);
|
|
|
|
r.y = RFB_GET_UINT16 (data + offset + 2);
|
|
|
|
r.width = RFB_GET_UINT16 (data + offset + 4);
|
|
|
|
r.height = RFB_GET_UINT16 (data + offset + 6);
|
|
|
|
r.type = RFB_GET_UINT32 (data + offset + 8);
|
|
|
|
|
|
|
|
if (r.type != TYPE_WMVi) {
|
|
|
|
/* We must have a WMVi packet to initialise things before we can
|
|
|
|
* continue */
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
if (!dec->have_format) {
|
|
|
|
GST_WARNING_OBJECT (dec, "Received packet without WMVi: %d",
|
|
|
|
r.type);
|
|
|
|
return ERROR_INVALID;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
2016-12-06 05:58:25 +00:00
|
|
|
if (r.x > dec->format.width || r.y > dec->format.height ||
|
|
|
|
r.x + r.width > dec->format.width ||
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
r.y + r.height > dec->format.height) {
|
|
|
|
GST_WARNING_OBJECT (dec, "Rectangle out of range, type %d", r.type);
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INVALID;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
2016-11-16 18:41:39 +00:00
|
|
|
} else if (r.width > 16384 || r.height > 16384) {
|
|
|
|
GST_WARNING_OBJECT (dec, "Width or height too high: %ux%u", r.width,
|
|
|
|
r.height);
|
|
|
|
return ERROR_INVALID;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
switch (r.type) {
|
|
|
|
case TYPE_WMVd:
|
|
|
|
handler = vmnc_handle_wmvd_rectangle;
|
|
|
|
break;
|
|
|
|
case TYPE_WMVe:
|
|
|
|
handler = vmnc_handle_wmve_rectangle;
|
|
|
|
break;
|
|
|
|
case TYPE_WMVf:
|
|
|
|
handler = vmnc_handle_wmvf_rectangle;
|
|
|
|
break;
|
|
|
|
case TYPE_WMVg:
|
|
|
|
handler = vmnc_handle_wmvg_rectangle;
|
|
|
|
break;
|
|
|
|
case TYPE_WMVh:
|
|
|
|
handler = vmnc_handle_wmvh_rectangle;
|
|
|
|
break;
|
|
|
|
case TYPE_WMVi:
|
|
|
|
handler = vmnc_handle_wmvi_rectangle;
|
|
|
|
break;
|
|
|
|
case TYPE_WMVj:
|
|
|
|
handler = vmnc_handle_wmvj_rectangle;
|
|
|
|
break;
|
|
|
|
case TYPE_RAW:
|
|
|
|
handler = vmnc_handle_raw_rectangle;
|
|
|
|
break;
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
case TYPE_COPY:
|
|
|
|
handler = vmnc_handle_copy_rectangle;
|
|
|
|
break;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
case TYPE_HEXTILE:
|
|
|
|
handler = vmnc_handle_hextile_rectangle;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
GST_WARNING_OBJECT (dec, "Unknown rectangle type");
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INVALID;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
read = handler (dec, &r, data + offset + 12, len - offset - 12, decode);
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
if (read < 0) {
|
2019-12-11 09:47:20 +00:00
|
|
|
GST_DEBUG_OBJECT (dec, "Error calling rectangle handler");
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return read;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
offset += 12 + read;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
GST_WARNING_OBJECT (dec, "Packet type unknown: %d", type);
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return ERROR_INVALID;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
return offset;
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2013-12-07 01:58:48 +00:00
|
|
|
gst_vmnc_dec_set_format (GstVideoDecoder * decoder, GstVideoCodecState * state)
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
{
|
2013-12-07 01:58:48 +00:00
|
|
|
GstVMncDec *dec = GST_VMNC_DEC (decoder);
|
|
|
|
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
/* We require a format descriptor in-stream, so we ignore the info from the
|
|
|
|
* container here. We just use the framerate */
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
if (dec->input_state)
|
|
|
|
gst_video_codec_state_unref (dec->input_state);
|
|
|
|
dec->input_state = gst_video_codec_state_ref (state);
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2016-06-08 01:04:21 +00:00
|
|
|
static gboolean
|
|
|
|
gst_vmnc_dec_sink_event (GstVideoDecoder * bdec, GstEvent * event)
|
|
|
|
{
|
|
|
|
const GstSegment *segment;
|
|
|
|
|
|
|
|
if (GST_EVENT_TYPE (event) != GST_EVENT_SEGMENT)
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
gst_event_parse_segment (event, &segment);
|
|
|
|
|
|
|
|
if (segment->format == GST_FORMAT_TIME)
|
|
|
|
gst_video_decoder_set_packetized (bdec, TRUE);
|
|
|
|
else
|
|
|
|
gst_video_decoder_set_packetized (bdec, FALSE);
|
|
|
|
|
|
|
|
done:
|
|
|
|
return GST_VIDEO_DECODER_CLASS (gst_vmnc_dec_parent_class)->sink_event (bdec,
|
|
|
|
event);
|
|
|
|
}
|
|
|
|
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
static GstFlowReturn
|
2013-12-07 01:58:48 +00:00
|
|
|
gst_vmnc_dec_handle_frame (GstVideoDecoder * decoder,
|
|
|
|
GstVideoCodecFrame * frame)
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
{
|
2013-12-07 01:58:48 +00:00
|
|
|
GstVMncDec *dec = GST_VMNC_DEC (decoder);
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
int res;
|
|
|
|
GstFlowReturn ret = GST_FLOW_OK;
|
2013-12-07 01:58:48 +00:00
|
|
|
GstMapInfo map;
|
|
|
|
|
|
|
|
if (!gst_buffer_map (frame->input_buffer, &map, GST_MAP_READ))
|
|
|
|
return GST_FLOW_ERROR;
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
res = vmnc_handle_packet (dec, map.data, map.size, TRUE);
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
gst_buffer_unmap (frame->input_buffer, &map);
|
|
|
|
|
|
|
|
if (!dec->have_format) {
|
|
|
|
GST_VIDEO_DECODER_ERROR (decoder, 2, STREAM, DECODE, (NULL),
|
|
|
|
("Data found before header"), ret);
|
|
|
|
gst_video_decoder_drop_frame (decoder, frame);
|
|
|
|
} else if (res < 0) {
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
ret = GST_FLOW_ERROR;
|
2013-12-07 01:58:48 +00:00
|
|
|
gst_video_decoder_drop_frame (decoder, frame);
|
|
|
|
GST_VIDEO_DECODER_ERROR (decoder, 1, STREAM, DECODE, (NULL),
|
|
|
|
("Couldn't decode packet"), ret);
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
} else {
|
2013-12-07 01:58:48 +00:00
|
|
|
GST_LOG_OBJECT (dec, "read %d bytes of %" G_GSIZE_FORMAT, res,
|
|
|
|
gst_buffer_get_size (frame->input_buffer));
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
/* inbuf may be NULL; that's ok */
|
2013-12-07 01:58:48 +00:00
|
|
|
ret = vmnc_fill_buffer (dec, frame);
|
|
|
|
if (ret == GST_FLOW_OK)
|
|
|
|
gst_video_decoder_finish_frame (decoder, frame);
|
|
|
|
else
|
|
|
|
gst_video_decoder_drop_frame (decoder, frame);
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
static GstFlowReturn
|
2013-12-07 01:58:48 +00:00
|
|
|
gst_vmnc_dec_parse (GstVideoDecoder * decoder, GstVideoCodecFrame * frame,
|
|
|
|
GstAdapter * adapter, gboolean at_eos)
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
{
|
2013-12-07 01:58:48 +00:00
|
|
|
GstVMncDec *dec = GST_VMNC_DEC (decoder);
|
|
|
|
const guint8 *data;
|
|
|
|
int avail;
|
|
|
|
int len;
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
avail = gst_adapter_available (adapter);
|
|
|
|
data = gst_adapter_map (adapter, avail);
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
GST_LOG_OBJECT (dec, "Parsing %d bytes", avail);
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
len = vmnc_handle_packet (dec, data, avail, FALSE);
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
|
2013-12-07 01:58:48 +00:00
|
|
|
if (len == ERROR_INSUFFICIENT_DATA) {
|
|
|
|
GST_LOG_OBJECT (dec, "Not enough data yet");
|
|
|
|
return GST_VIDEO_DECODER_FLOW_NEED_DATA;
|
|
|
|
} else if (len < 0) {
|
|
|
|
GST_ERROR_OBJECT (dec, "Fatal error in bitstream");
|
|
|
|
return GST_FLOW_ERROR;
|
gst/vmnc/vmncdec.c: Redesign to include a parser for raw files (no timestamps in that mode yet, though).
Original commit message from CVS:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_class_init),
(gst_vmnc_dec_init), (vmnc_dec_finalize), (gst_vmnc_dec_reset),
(vmnc_handle_wmvi_rectangle), (render_colour_cursor),
(render_cursor), (vmnc_make_buffer), (vmnc_handle_wmvd_rectangle),
(vmnc_handle_wmve_rectangle), (vmnc_handle_wmvf_rectangle),
(vmnc_handle_wmvg_rectangle), (vmnc_handle_wmvh_rectangle),
(vmnc_handle_wmvj_rectangle), (render_raw_tile), (render_subrect),
(vmnc_handle_raw_rectangle), (vmnc_handle_copy_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain_frame), (vmnc_dec_chain),
(vmnc_dec_set_property), (vmnc_dec_get_property):
Redesign to include a parser for raw files (no timestamps in that
mode yet, though).
2007-03-23 18:41:52 +00:00
|
|
|
} else {
|
2013-12-07 01:58:48 +00:00
|
|
|
GST_LOG_OBJECT (dec, "Parsed packet: %d bytes", len);
|
|
|
|
gst_video_decoder_add_to_frame (decoder, len);
|
|
|
|
return gst_video_decoder_have_frame (decoder);
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
plugin_init (GstPlugin * plugin)
|
|
|
|
{
|
2021-02-25 14:22:15 +00:00
|
|
|
return GST_ELEMENT_REGISTER (vmncdec, plugin);
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
2012-04-05 16:02:56 +00:00
|
|
|
vmnc,
|
2010-03-01 12:47:32 +00:00
|
|
|
"VmWare Video Codec plugins",
|
Add VMnc decoder.
Original commit message from CVS:
* configure.ac:
* gst/vmnc/Makefile.am:
* gst/vmnc/vmncdec.c: (gst_vmnc_dec_base_init),
(gst_vmnc_dec_class_init), (gst_vmnc_dec_init),
(gst_vmnc_dec_reset), (vmnc_handle_wmvi_rectangle),
(render_colour_cursor), (render_cursor), (vmnc_make_buffer),
(vmnc_handle_wmvd_rectangle), (vmnc_handle_wmve_rectangle),
(vmnc_handle_wmvf_rectangle), (vmnc_handle_wmvg_rectangle),
(vmnc_handle_wmvh_rectangle), (vmnc_handle_wmvj_rectangle),
(render_raw_tile), (render_subrect), (vmnc_handle_raw_rectangle),
(vmnc_handle_hextile_rectangle), (vmnc_handle_packet),
(vmnc_dec_setcaps), (vmnc_dec_chain), (vmnc_dec_change_state),
(vmnc_dec_set_property), (vmnc_dec_get_property), (plugin_init):
Add VMnc decoder.
Still missing support for:
- rectangle types I didn't find in my samples (e.g. copy, RRE,
ZRLE)
- alpha-composited cursors
2007-03-03 22:13:22 +00:00
|
|
|
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
|