remove stuff

Original commit message from CVS:
remove stuff
This commit is contained in:
Thomas Vander Stichele 2005-08-30 18:06:52 +00:00
parent a9e84f1e8e
commit 282729cfa6
16 changed files with 0 additions and 3413 deletions

View file

@ -1,10 +0,0 @@
plugin_LTLIBRARIES = libgstflxdec.la
libgstflxdec_la_SOURCES = gstflxdec.c flx_color.c
libgstflxdec_la_CFLAGS = $(GST_CFLAGS)
libgstflxdec_la_LIBADD =
libgstflxdec_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
noinst_HEADERS = flx_fmt.h flx_color.h gstflxdec.h

View file

@ -1,110 +0,0 @@
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@temple-baptist.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include <gst/gst.h>
#include "flx_color.h"
FlxColorSpaceConverter *
flx_colorspace_converter_new (gint width, gint height)
{
FlxColorSpaceConverter *new = g_malloc (sizeof (FlxColorSpaceConverter));
new->width = width;
new->height = height;
memset (new->palvec, 0, sizeof (new->palvec));
return new;
}
void
flx_colorspace_converter_destroy (FlxColorSpaceConverter * flxpal)
{
g_return_if_fail (flxpal != NULL);
g_free (flxpal);
}
void
flx_colorspace_convert (FlxColorSpaceConverter * flxpal, guchar * src,
guchar * dest)
{
guint size, col;
g_return_if_fail (flxpal != NULL);
g_return_if_fail (src != dest);
size = flxpal->width * flxpal->height;
while (size--) {
col = (*src++ * 3);
*dest++ = flxpal->palvec[col + 2];
*dest++ = flxpal->palvec[col + 1];
*dest++ = flxpal->palvec[col];
*dest++ = 0;
}
}
void
flx_set_palette_vector (FlxColorSpaceConverter * flxpal, guint start, guint num,
guchar * newpal, gint scale)
{
guint grab;
g_return_if_fail (flxpal != NULL);
g_return_if_fail (start < 0x100);
grab = ((start + num) > 0x100 ? 0x100 - start : num);
if (scale) {
gint i = 0;
start *= 3;
while (grab) {
flxpal->palvec[start++] = newpal[i++] << scale;
flxpal->palvec[start++] = newpal[i++] << scale;
flxpal->palvec[start++] = newpal[i++] << scale;
grab--;
}
} else {
memcpy (&flxpal->palvec[start * 3], newpal, grab * 3);
}
}
void
flx_set_color (FlxColorSpaceConverter * flxpal, guint colr, guint red,
guint green, guint blue, gint scale)
{
g_return_if_fail (flxpal != NULL);
g_return_if_fail (colr < 0x100);
flxpal->palvec[(colr * 3)] = red << scale;
flxpal->palvec[(colr * 3) + 1] = green << scale;
flxpal->palvec[(colr * 3) + 2] = blue << scale;
}

View file

@ -1,43 +0,0 @@
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
typedef enum {
FLX_COLORSPACE_RGB8,
FLX_COLORSPACE_RGB32,
} FlxColorSpaceType;
typedef struct _FlxColorSpaceConverter FlxColorSpaceConverter;
struct _FlxColorSpaceConverter {
guint width;
guint height;
guchar palvec[768];
};
void flx_colorspace_converter_destroy(FlxColorSpaceConverter *flxpal);
void flx_colorspace_convert(FlxColorSpaceConverter *flxpal, guchar *src, guchar *dest);
FlxColorSpaceConverter * flx_colorspace_converter_new(gint width, gint height);
void flx_set_palette_vector(FlxColorSpaceConverter *flxpal, guint start, guint num,
guchar *newpal, gint scale);
void flx_set_color(FlxColorSpaceConverter *flxpal, guint colr, guint red, guint green,
guint blue, gint scale);

View file

@ -1,136 +0,0 @@
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_FLX_FMT__H__
#define __GST_FLX_FMT_H__
#include <gst/gst.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
enum Flx_TypeChunk
{
/* frame chunks */
FLX_PREFIX_TYPE = 0xf100,
FLX_SCRIPT_CHUNK = 0xf1e0,
FLX_FRAME_TYPE = 0xf1fa,
FLX_SEGMENT_TABLE = 0xf1fb,
FLX_HUFFMAN_TABLE = 0xf1fc,
/* sub chunks */
FLX_CEL_DATA = 3,
FLX_COLOR256 = 4,
FLX_SS2 = 7,
FLX_COLOR64 = 11,
FLX_LC = 12,
FLX_BLACK = 13,
FLX_BRUN = 15,
FLX_COPY = 16,
FLX_MINI = 18,
FLX_DTA_RUN = 25,
FLX_DTA_COPY = 26,
FLX_DTA_LC = 27,
FLX_LABEL = 31,
FLX_BMP_MASK = 32,
FLX_MLEV_MASK = 33,
FLX_SEGMENT = 34,
FLX_KEY_IMAGE = 35,
FLX_KEY_PAL = 36,
FLX_REGION = 37,
FLX_WAVE = 38,
FLX_USERSTRING = 39,
FLX_RGN_MASK = 40
};
enum Flx_MagicHdr
{
FLX_MAGICHDR_FLI = 0xaf11,
FLX_MAGICHDR_FLC = 0xaf12,
FLX_MAGICHDR_FLX = 0xaf44,
FLX_MAGICHDR_HUFFBWT = 0xaf30
};
typedef struct _FlxHeader
{
guint32 size;
guint16 type;
guint16 frames;
guint16 width,height,depth,flags;
guint32 speed;
guint16 reserved1;
/* FLC */
guint32 created,creator,updated,updater;
guint16 aspect_dx, aspect_dy;
/* EGI */
guint16 ext_flags,keyframes,totalframes;
guint32 req_memory;
guint16 max_regions,transp_num;
guchar reserved2[24];
/* FLC */
guint32 oframe1,oframe2;
guchar reserved3[40];
} FlxHeader;
#define FlxHeaderSize 128
typedef struct _FlxFrameChunk
{
guint32 size;
guint16 id;
} FlxFrameChunk;
#define FlxFrameChunkSize 6
typedef struct _FlxPrefixChunk
{
guint16 chunks;
guchar reserved[8];
} FlxPrefixChunk;
typedef struct _FlxSegmentTable
{
guint16 segments;
} FlxSegmentTable;
typedef struct _FlxHuffmanTable
{
guint16 codelength;
guint16 numcodes;
guchar reserved[6];
} FlxHuffmanTable;
typedef struct _FlxFrameType
{
guint16 chunks;
guint16 delay;
guchar reserved[6];
} FlxFrameType;
#define FlxFrameTypeSize 10
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GST_FLX_FMT_H__ */

View file

@ -1,157 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="flxdec"
ProjectGUID="{979C216F-0ACF-4956-AE00-055A42D678B3}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="../../win32/Debug"
IntermediateDirectory="../../win32/Debug"
ConfigurationType="2"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../../gstreamer/win32;../../../gstreamer;../../../gstreamer/libs;../../../glib;../../../glib/glib;../../../glib/gmodule;&quot;../../gst-libs&quot;;../../../popt/include;../../../libxml2/include/libxml2"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;flxdec_EXPORTS;HAVE_CONFIG_H;_USE_MATH_DEFINES"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="glib-2.0.lib gmodule-2.0.lib gthread-2.0.lib gobject-2.0.lib libgstreamer.lib gstbytestream.lib iconv.lib intl.lib"
OutputFile="$(OutDir)/gstflxdec.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="../../../gstreamer/win32/Debug;../../../glib/glib;../../../glib/gmodule;../../../glib/gthread;../../../glib/gobject;../../../gettext/lib;../../../libiconv/lib"
ModuleDefinitionFile=""
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/flxdec.pdb"
SubSystem="2"
OptimizeReferences="2"
ImportLibrary="$(OutDir)/gstflxdec.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="copy /Y $(TargetPath) c:\gstreamer\plugins"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="../../win32/Release"
IntermediateDirectory="../../win32/Release"
ConfigurationType="2"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../../../gstreamer/win32;../../../gstreamer;../../../gstreamer/libs;../../../glib;../../../glib/glib;../../../glib/gmodule;&quot;../../gst-libs&quot;;../../../popt/include;../../../libxml2/include/libxml2"
PreprocessorDefinitions="WIN32;NDEBUG;GST_DISABLE_GST_DEBUG;_WINDOWS;_USRDLL;flxdec_EXPORTS;HAVE_CONFIG_H;_USE_MATH_DEFINES"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="glib-2.0.lib gmodule-2.0.lib gthread-2.0.lib gobject-2.0.lib libgstreamer.lib gstbytestream.lib iconv.lib intl.lib"
OutputFile="$(OutDir)/gstflxdec.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="../../../gstreamer/win32/Release;../../../glib/glib;../../../glib/gmodule;../../../glib/gthread;../../../glib/gobject;../../../gettext/lib;../../../libiconv/lib"
ModuleDefinitionFile=""
GenerateDebugInformation="TRUE"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/gstflxdec.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="copy /Y $(TargetPath) c:\gstreamer\plugins"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath=".\gstflxdec.c">
</File>
<File
RelativePath=".\flx_color.c">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath=".\flx_color.h">
</File>
<File
RelativePath=".\gstflxdec.h">
</File>
<File
RelativePath=".\flx_fmt.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View file

@ -1,656 +0,0 @@
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@temple-baptist.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include "flx_fmt.h"
#include "gstflxdec.h"
#include <gst/video/video.h>
#define JIFFIE (GST_SECOND/70)
GST_DEBUG_CATEGORY_STATIC (flxdec_debug);
#define GST_CAT_DEFAULT flxdec_debug
/* flx element information */
static GstElementDetails flxdec_details = {
"FLX Decoder",
"Codec/Decoder/Audio",
"FLX decoder",
"Sepp Wijnands <mrrazz@garbage-coderz.net>"
};
/* Flx signals and args */
enum
{
/* FILL ME */
LAST_SIGNAL
};
enum
{
ARG_0
};
/* input */
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("video/x-fli")
);
/* output */
static GstStaticPadTemplate src_video_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_xRGB_HOST_ENDIAN)
);
static void gst_flxdec_class_init (GstFlxDecClass * klass);
static void gst_flxdec_base_init (GstFlxDecClass * klass);
static void gst_flxdec_init (GstFlxDec * flxdec);
static void gst_flxdec_loop (GstElement * element);
static GstElementStateReturn gst_flxdec_change_state (GstElement * element);
static void gst_flxdec_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_flxdec_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static void flx_decode_color (GstFlxDec *, guchar *, guchar *, gint);
static void flx_decode_brun (GstFlxDec *, guchar *, guchar *);
static void flx_decode_delta_fli (GstFlxDec *, guchar *, guchar *);
static void flx_decode_delta_flc (GstFlxDec *, guchar *, guchar *);
#define rndalign(off) ((off) + ((off) % 2))
static GstElementClass *parent_class = NULL;
GType
gst_flxdec_get_type (void)
{
static GType flxdec_type = 0;
if (!flxdec_type) {
static const GTypeInfo flxdec_info = {
sizeof (GstFlxDecClass),
(GBaseInitFunc) gst_flxdec_base_init,
NULL,
(GClassInitFunc) gst_flxdec_class_init,
NULL,
NULL,
sizeof (GstFlxDec),
0,
(GInstanceInitFunc) gst_flxdec_init,
};
flxdec_type =
g_type_register_static (GST_TYPE_ELEMENT, "GstFlxDec", &flxdec_info, 0);
}
return flxdec_type;
}
static void
gst_flxdec_base_init (GstFlxDecClass * klass)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
gst_element_class_set_details (gstelement_class, &flxdec_details);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sink_factory));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&src_video_factory));
}
static void
gst_flxdec_class_init (GstFlxDecClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
GST_DEBUG_CATEGORY_INIT (flxdec_debug, "flxdec", 0, "FLX video decoder");
gobject_class->set_property = gst_flxdec_set_property;
gobject_class->get_property = gst_flxdec_get_property;
gstelement_class->change_state = gst_flxdec_change_state;
}
static void
gst_flxdec_init (GstFlxDec * flxdec)
{
flxdec->sinkpad =
gst_pad_new_from_template (gst_static_pad_template_get (&sink_factory),
"sink");
gst_element_add_pad (GST_ELEMENT (flxdec), flxdec->sinkpad);
gst_element_set_loop_function (GST_ELEMENT (flxdec), gst_flxdec_loop);
flxdec->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get
(&src_video_factory), "src");
gst_element_add_pad (GST_ELEMENT (flxdec), flxdec->srcpad);
gst_pad_use_explicit_caps (flxdec->srcpad);
flxdec->bs = NULL;
flxdec->frame = NULL;
flxdec->delta = NULL;
}
static void
flx_decode_chunks (GstFlxDec * flxdec, gulong count, gchar * data, gchar * dest)
{
FlxFrameChunk *hdr;
g_return_if_fail (data != NULL);
while (count--) {
hdr = (FlxFrameChunk *) data;
data += FlxFrameChunkSize;
switch (hdr->id) {
case FLX_COLOR64:
flx_decode_color (flxdec, data, dest, 2);
data += rndalign (hdr->size) - FlxFrameChunkSize;
break;
case FLX_COLOR256:
flx_decode_color (flxdec, data, dest, 0);
data += rndalign (hdr->size) - FlxFrameChunkSize;
break;
case FLX_BRUN:
flx_decode_brun (flxdec, data, dest);
data += rndalign (hdr->size) - FlxFrameChunkSize;
break;
case FLX_LC:
flx_decode_delta_fli (flxdec, data, dest);
data += rndalign (hdr->size) - FlxFrameChunkSize;
break;
case FLX_SS2:
flx_decode_delta_flc (flxdec, data, dest);
data += rndalign (hdr->size) - FlxFrameChunkSize;
break;
case FLX_BLACK:
memset (dest, 0, flxdec->size);
break;
case FLX_MINI:
data += rndalign (hdr->size) - FlxFrameChunkSize;
break;
default:
GST_WARNING ("Unimplented chunk type: 0x%02x size: %d - skipping",
hdr->id, hdr->size);
data += rndalign (hdr->size) - FlxFrameChunkSize;
break;
}
}
}
static void
flx_decode_color (GstFlxDec * flxdec, guchar * data, guchar * dest, gint scale)
{
guint packs, count, indx;
g_return_if_fail (flxdec != NULL);
packs = (data[0] + (data[1] << 8));
data += 2;
indx = 0;
GST_LOG ("GstFlxDec: cmap packs: %d", packs);
while (packs--) {
/* color map index + skip count */
indx += *data++;
/* number of rgb triplets */
count = *data++ & 0xff;
if (count == 0)
count = 256;
GST_LOG ("GstFlxDec: cmap count: %d (indx: %d)\n", count, indx);
flx_set_palette_vector (flxdec->converter, indx, count, data, scale);
data += (count * 3);
}
}
static void
flx_decode_brun (GstFlxDec * flxdec, guchar * data, guchar * dest)
{
gulong count, lines, row;
guchar x;
g_return_if_fail (flxdec != NULL);
lines = flxdec->hdr.height;
while (lines--) {
/* packet count.
* should not be used anymore, since the flc format can
* contain more then 255 RLE packets. we use the frame
* width instead.
*/
data++;
row = flxdec->hdr.width;
while (row) {
count = *data++;
if (count > 0x7f) {
/* literal run */
count = 0x100 - count;
row -= count;
while (count--)
*dest++ = *data++;
} else {
/* replicate run */
row -= count;
x = *data++;
while (count--)
*dest++ = x;
}
}
}
}
static void
flx_decode_delta_fli (GstFlxDec * flxdec, guchar * data, guchar * dest)
{
gulong count, packets, lines, start_line, start_l;
guchar *start_p, x;
g_return_if_fail (flxdec != NULL);
g_return_if_fail (flxdec->delta != NULL);
/* use last frame for delta */
memcpy (dest, GST_BUFFER_DATA (flxdec->delta),
GST_BUFFER_SIZE (flxdec->delta));
start_line = (data[0] + (data[1] << 8));
lines = (data[2] + (data[3] << 8));
data += 4;
/* start position of delta */
dest += (flxdec->hdr.width * start_line);
start_p = dest;
start_l = lines;
while (lines--) {
/* packet count */
packets = *data++;
while (packets--) {
/* skip count */
dest += *data++;
/* RLE count */
count = *data++;
if (count > 0x7f) {
/* literal run */
count = 0x100 - count;
x = *data++;
while (count--)
*dest++ = x;
} else {
/* replicate run */
while (count--)
*dest++ = *data++;
}
}
start_p += flxdec->hdr.width;
dest = start_p;
}
}
static void
flx_decode_delta_flc (GstFlxDec * flxdec, guchar * data, guchar * dest)
{
gulong count, lines, start_l, opcode;
guchar *start_p;
g_return_if_fail (flxdec != NULL);
g_return_if_fail (flxdec->delta != NULL);
/* use last frame for delta */
memcpy (dest, GST_BUFFER_DATA (flxdec->delta),
GST_BUFFER_SIZE (flxdec->delta));
lines = (data[0] + (data[1] << 8));
data += 2;
start_p = dest;
start_l = lines;
while (lines) {
dest = start_p + (flxdec->hdr.width * (start_l - lines));
/* process opcode(s) */
while ((opcode = (data[0] + (data[1] << 8))) & 0xc000) {
data += 2;
if ((opcode & 0xc000) == 0xc000) {
/* skip count */
start_l += (0x10000 - opcode);
dest += flxdec->hdr.width * (0x10000 - opcode);
} else {
/* last pixel */
dest += flxdec->hdr.width;
*dest++ = (opcode & 0xff);
}
}
data += 2;
/* last opcode is the packet count */
while (opcode--) {
/* skip count */
dest += *data++;
/* RLE count */
count = *data++;
if (count > 0x7f) {
/* replicate word run */
count = 0x100 - count;
while (count--) {
*dest++ = data[0];
*dest++ = data[1];
}
data += 2;
} else {
/* literal word run */
while (count--) {
*dest++ = *data++;
*dest++ = *data++;
}
}
}
lines--;
}
}
static GstBuffer *
flx_get_data (GstFlxDec * flxdec, gulong size)
{
GstBuffer *retbuf;
guint32 got_bytes;
g_return_val_if_fail (flxdec != NULL, NULL);
got_bytes = gst_bytestream_read (flxdec->bs, &retbuf, size);
if (got_bytes < size) {
GstEvent *event;
guint32 remaining;
gst_bytestream_get_status (flxdec->bs, &remaining, &event);
gst_pad_event_default (flxdec->sinkpad, event);
}
return retbuf;
}
static void
gst_flxdec_loop (GstElement * element)
{
GstBuffer *buf;
GstBuffer *databuf;
guchar *data, *chunk;
GstCaps *caps;
GstFlxDec *flxdec;
FlxHeader *flxh;
FlxFrameChunk *flxfh;
g_return_if_fail (element != NULL);
g_return_if_fail (GST_IS_FLXDEC (element));
GST_DEBUG ("entering loop function");
flxdec = GST_FLXDEC (element);
if (flxdec->state == GST_FLXDEC_READ_HEADER) {
databuf = flx_get_data (flxdec, FlxHeaderSize);
if (!databuf) {
GST_LOG ("empty buffer");
return;
}
data = GST_BUFFER_DATA (databuf);
memcpy ((char *) &flxdec->hdr, data, sizeof (FlxHeader));
gst_buffer_unref (databuf);
flxh = &flxdec->hdr;
/* check header */
if (flxh->type != FLX_MAGICHDR_FLI &&
flxh->type != FLX_MAGICHDR_FLC && flxh->type != FLX_MAGICHDR_FLX) {
GST_ELEMENT_ERROR (element, STREAM, WRONG_TYPE, (NULL),
("not a flx file (type %d)\n", flxh->type));
return;
}
GST_LOG ("size : %d\n", flxh->size);
GST_LOG ("frames : %d\n", flxh->frames);
GST_LOG ("width : %d\n", flxh->width);
GST_LOG ("height : %d\n", flxh->height);
GST_LOG ("depth : %d\n", flxh->depth);
GST_LOG ("speed : %d\n", flxh->speed);
flxdec->next_time = 0;
if (flxh->type == FLX_MAGICHDR_FLI) {
flxdec->frame_time = JIFFIE * flxh->speed;
} else {
flxdec->frame_time = flxh->speed * GST_MSECOND;
}
caps = gst_caps_from_string (GST_VIDEO_CAPS_xRGB_HOST_ENDIAN);
gst_caps_set_simple (caps,
"width", G_TYPE_INT, flxh->width,
"height", G_TYPE_INT, flxh->height,
"framerate", G_TYPE_DOUBLE, (gdouble) (GST_SECOND / flxdec->frame_time),
NULL);
gst_pad_set_explicit_caps (flxdec->srcpad, caps);
if (flxh->depth <= 8)
flxdec->converter =
flx_colorspace_converter_new (flxh->width, flxh->height);
if (flxh->type == FLX_MAGICHDR_FLC || flxh->type == FLX_MAGICHDR_FLX) {
GST_LOG ("(FLC) aspect_dx : %d\n", flxh->aspect_dx);
GST_LOG ("(FLC) aspect_dy : %d\n", flxh->aspect_dy);
GST_LOG ("(FLC) oframe1 : 0x%08x\n", flxh->oframe1);
GST_LOG ("(FLC) oframe2 : 0x%08x\n", flxh->oframe2);
}
flxdec->size = (flxh->width * flxh->height);
/* create delta and output frame */
flxdec->frame = gst_buffer_new ();
flxdec->delta = gst_buffer_new ();
GST_BUFFER_DATA (flxdec->frame) = g_malloc (flxdec->size);
GST_BUFFER_SIZE (flxdec->frame) = flxdec->size;
GST_BUFFER_DATA (flxdec->delta) = g_malloc (flxdec->size);
GST_BUFFER_SIZE (flxdec->delta) = flxdec->size;
flxdec->state = GST_FLXDEC_PLAYING;
} else if (flxdec->state == GST_FLXDEC_PLAYING) {
GstBuffer *out;
databuf = flx_get_data (flxdec, FlxFrameChunkSize);
if (!databuf)
return;
flxfh = (FlxFrameChunk *) GST_BUFFER_DATA (databuf);
switch (flxfh->id) {
case FLX_FRAME_TYPE:
buf = flx_get_data (flxdec, flxfh->size - FlxFrameChunkSize);
chunk = GST_BUFFER_DATA (buf);
if (((FlxFrameType *) chunk)->chunks == 0)
break;
/* create 32 bits output frame */
out = gst_buffer_new ();
GST_BUFFER_DATA (out) = g_malloc (flxdec->size * 4);
GST_BUFFER_SIZE (out) = flxdec->size * 4;
/* decode chunks */
flx_decode_chunks (flxdec,
((FlxFrameType *) chunk)->chunks,
GST_BUFFER_DATA (buf) + FlxFrameTypeSize,
GST_BUFFER_DATA (flxdec->frame));
/* destroy input buffer */
gst_buffer_unref (buf);
/* save copy of the current frame for possible delta. */
memcpy (GST_BUFFER_DATA (flxdec->delta),
GST_BUFFER_DATA (flxdec->frame), GST_BUFFER_SIZE (flxdec->delta));
/* convert current frame. */
flx_colorspace_convert (flxdec->converter,
GST_BUFFER_DATA (flxdec->frame), GST_BUFFER_DATA (out));
GST_BUFFER_TIMESTAMP (out) = flxdec->next_time;
flxdec->next_time += flxdec->frame_time;
gst_pad_push (flxdec->srcpad, GST_DATA (out));
break;
}
/* destroy header buffer */
gst_buffer_unref (databuf);
}
}
static GstElementStateReturn
gst_flxdec_change_state (GstElement * element)
{
GstFlxDec *flxdec;
flxdec = GST_FLXDEC (element);
switch (GST_STATE_TRANSITION (element)) {
case GST_STATE_NULL_TO_READY:
break;
case GST_STATE_READY_TO_PAUSED:
flxdec->bs = gst_bytestream_new (flxdec->sinkpad);
flxdec->state = GST_FLXDEC_READ_HEADER;
break;
case GST_STATE_PAUSED_TO_PLAYING:
break;
case GST_STATE_PLAYING_TO_PAUSED:
break;
case GST_STATE_PAUSED_TO_READY:
gst_buffer_unref (flxdec->frame);
flxdec->frame = NULL;
gst_buffer_unref (flxdec->delta);
flxdec->delta = NULL;
gst_bytestream_destroy (flxdec->bs);
break;
case GST_STATE_READY_TO_NULL:
break;
}
parent_class->change_state (element);
return GST_STATE_SUCCESS;
}
static void
gst_flxdec_set_property (GObject * object, guint prop_id, const GValue * value,
GParamSpec * pspec)
{
GstFlxDec *flxdec;
g_return_if_fail (GST_IS_FLXDEC (object));
flxdec = GST_FLXDEC (object);
switch (prop_id) {
default:
break;
}
}
static void
gst_flxdec_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec)
{
GstFlxDec *flxdec;
g_return_if_fail (GST_IS_FLXDEC (object));
flxdec = GST_FLXDEC (object);
switch (prop_id) {
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static gboolean
plugin_init (GstPlugin * plugin)
{
if (!gst_library_load ("gstbytestream"))
return FALSE;
return gst_element_register (plugin, "flxdec",
GST_RANK_PRIMARY, GST_TYPE_FLXDEC);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"flxdec",
"FLX video decoder",
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN)

View file

@ -1,88 +0,0 @@
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_FLX_DECODER_H__
#define __GST_FLX_DECODER_H__
#include <gst/gst.h>
#include "flx_color.h"
#include <gst/bytestream/bytestream.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef enum {
GST_FLXDEC_READ_HEADER,
GST_FLXDEC_PLAYING,
} GstFlxDecState;
/* Definition of structure storing data for this element. */
typedef struct _GstFlxDec GstFlxDec;
struct _GstFlxDec {
GstElement element;
GstPad *sinkpad,*srcpad;
gboolean active, new_meta;
GstBuffer *delta, *frame;
GstByteStream *bs;
gulong size;
GstFlxDecState state;
glong frame_time;
gint64 next_time;
FlxColorSpaceConverter *converter;
FlxHeader hdr;
};
/* Standard definition defining a class for this element. */
typedef struct _GstFlxDecClass GstFlxDecClass;
struct _GstFlxDecClass {
GstElementClass parent_class;
};
/* Standard macros for defining types for this element. */
#define GST_TYPE_FLXDEC \
(gst_flxdec_get_type())
#define GST_FLXDEC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_FLXDEC,GstFlxDec))
#define GST_FLXDEC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_FLXDEC,GstFlxDec))
#define GST_IS_FLXDEC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_FLXDEC))
#define GST_IS_FLXDEC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_FLXDEC))
/* Standard function returning type information. */
GType gst_flxdec_get_type(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GST_FLX_DECODER_H__ */

View file

@ -1,13 +0,0 @@
plugin_LTLIBRARIES = libgstsmpte.la
libgstsmpte_la_SOURCES = gstsmpte.c gstmask.c barboxwipes.c paint.c
noinst_HEADERS = gstsmpte.h gstmask.h paint.h
libgstsmpte_la_CFLAGS = $(GST_CFLAGS) -I ../../../gst-plugins-base/gst-libs/
libgstsmpte_la_LIBADD =
libgstsmpte_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) $(GST_BASE_LIBS)
EXTRA_DIST =

View file

@ -1,922 +0,0 @@
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "paint.h"
#include "gstmask.h"
enum
{
BOX_VERTICAL = 1,
BOX_HORIZONTAL = 2,
BOX_CLOCK = 3,
TRIGANLE_LINEAR = 4
};
static gint boxes_1b[][7] = {
#define WIPE_B1_1 0
{BOX_VERTICAL, 0, 0, 0, 1, 1, 1},
#define WIPE_B1_2 1
{BOX_HORIZONTAL, 0, 0, 0, 1, 1, 1}
};
static gint boxes_2b[][7 * 2] = {
#define WIPE_B2_21 0
{BOX_VERTICAL, 0, 0, 1, 1, 2, 0,
BOX_VERTICAL, 1, 0, 0, 2, 2, 1},
#define WIPE_B2_22 1
{BOX_HORIZONTAL, 0, 0, 1, 2, 1, 0,
BOX_HORIZONTAL, 0, 1, 0, 2, 2, 1},
};
static gint box_clock_1b[][1 * 10] = {
#define WIPE_B1_241 0
{BOX_CLOCK, 0, 0, 0, 1, 0, 0, 0, 1, 1},
#define WIPE_B1_242 1
{BOX_CLOCK, 0, 1, 0, 1, 1, 0, 0, 0, 1},
#define WIPE_B1_243 2
{BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1},
#define WIPE_B1_244 3
{BOX_CLOCK, 1, 0, 0, 0, 0, 0, 1, 1, 1},
};
#define WIPE_B2_221 0
static gint box_clock_2b[][2 * 10] = {
#define WIPE_B2_221 0
{BOX_CLOCK, 1, 0, 0, 2, 0, 0, 1, 2, 1,
BOX_CLOCK, 1, 0, 0, 1, 2, 1, 0, 0, 2},
#define WIPE_B2_222 1
{BOX_CLOCK, 2, 1, 0, 2, 2, 0, 0, 1, 1,
BOX_CLOCK, 2, 1, 0, 0, 1, 1, 2, 0, 2},
#define WIPE_B2_223 2
{BOX_CLOCK, 1, 2, 0, 0, 2, 0, 1, 0, 1,
BOX_CLOCK, 1, 2, 0, 1, 0, 1, 2, 2, 2},
#define WIPE_B2_224 3
{BOX_CLOCK, 0, 1, 0, 0, 0, 0, 2, 1, 1,
BOX_CLOCK, 0, 1, 0, 2, 1, 1, 0, 2, 2},
#define WIPE_B2_225 4
{BOX_CLOCK, 1, 0, 0, 2, 0, 0, 1, 2, 1,
BOX_CLOCK, 1, 2, 0, 0, 2, 0, 1, 0, 1},
#define WIPE_B2_226 5
{BOX_CLOCK, 0, 1, 0, 0, 0, 0, 2, 1, 1,
BOX_CLOCK, 2, 1, 0, 2, 2, 0, 0, 1, 1},
#define WIPE_B2_231 6
{BOX_CLOCK, 1, 0, 0, 1, 2, 0, 2, 0, 1,
BOX_CLOCK, 1, 0, 0, 1, 2, 0, 0, 0, 1},
#define WIPE_B2_232 7
{BOX_CLOCK, 2, 1, 0, 0, 1, 0, 2, 0, 1,
BOX_CLOCK, 2, 1, 0, 0, 1, 0, 2, 2, 1},
#define WIPE_B2_233 8
{BOX_CLOCK, 1, 2, 0, 1, 0, 0, 2, 2, 1,
BOX_CLOCK, 1, 2, 0, 1, 0, 0, 0, 2, 1},
#define WIPE_B2_234 9
{BOX_CLOCK, 0, 1, 0, 2, 1, 0, 0, 0, 1,
BOX_CLOCK, 0, 1, 0, 2, 1, 0, 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 3, 2, 0, 3, 0, 1, 2, 2, 2,
BOX_CLOCK, 3, 2, 0, 4, 2, 0, 3, 4, 1,
BOX_CLOCK, 3, 2, 0, 3, 4, 1, 2, 2, 2},
};
static gint triangles_2t[][2 * 9] = {
/* 3 -> 6 */
#define WIPE_T2_3 0
{0, 0, 0, 0, 1, 1, 1, 1, 1,
1, 0, 1, 0, 0, 0, 1, 1, 1},
#define WIPE_T2_4 WIPE_T2_3+1
{0, 0, 1, 1, 0, 0, 0, 1, 1,
1, 0, 0, 0, 1, 1, 1, 1, 1},
#define WIPE_T2_5 WIPE_T2_4+1
{0, 0, 1, 0, 1, 1, 1, 1, 0,
1, 0, 1, 0, 0, 1, 1, 1, 0},
#define WIPE_T2_6 WIPE_T2_5+1
{0, 0, 1, 1, 0, 1, 0, 1, 0,
1, 0, 1, 0, 1, 0, 1, 1, 1},
#define WIPE_T2_41 WIPE_T2_6+1
{0, 0, 0, 1, 0, 1, 0, 1, 1,
1, 0, 1, 0, 1, 1, 1, 1, 2},
#define WIPE_T2_42 WIPE_T2_41+1
{0, 0, 1, 1, 0, 0, 1, 1, 1,
0, 0, 1, 0, 1, 2, 1, 1, 1},
#define WIPE_T2_45 WIPE_T2_42+1
{0, 0, 1, 1, 0, 0, 0, 1, 0,
1, 0, 0, 0, 1, 0, 1, 1, 1},
#define WIPE_T2_46 WIPE_T2_45+1
{0, 0, 0, 1, 0, 1, 1, 1, 0,
0, 0, 0, 0, 1, 1, 1, 1, 0},
#define WIPE_T2_245 WIPE_T2_46+1
{0, 0, 0, 2, 0, 0, 2, 2, 1,
2, 2, 0, 0, 2, 0, 0, 0, 1},
#define WIPE_T2_246 WIPE_T2_245+1
{0, 2, 0, 0, 0, 0, 2, 0, 1,
2, 0, 0, 2, 2, 0, 0, 2, 1},
};
static gint triangles_3t[][3 * 9] = {
/* 23 -> 26 */
#define WIPE_T3_23 0
{0, 0, 1, 1, 0, 0, 0, 2, 1,
1, 0, 0, 0, 2, 1, 2, 2, 1,
1, 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,
2, 2, 1, 3, 3, 0, 2, 4, 1}
};
typedef struct _GstWipeConfig GstWipeConfig;
struct _GstWipeConfig
{
gint *objects;
gint nobjects;
gint xscale;
gint yscale;
gint cscale;
};
static GstWipeConfig wipe_config[] = {
#define WIPE_CONFIG_1 0
{boxes_1b[WIPE_B1_1], 1, 0, 0, 0}, /* 1 */
#define WIPE_CONFIG_2 WIPE_CONFIG_1+1
{boxes_1b[WIPE_B1_2], 1, 0, 0, 0}, /* 2 */
#define WIPE_CONFIG_3 WIPE_CONFIG_2+1
{triangles_2t[WIPE_T2_3], 2, 0, 0, 0}, /* 3 */
#define WIPE_CONFIG_4 WIPE_CONFIG_3+1
{triangles_2t[WIPE_T2_4], 2, 0, 0, 0}, /* 4 */
#define WIPE_CONFIG_5 WIPE_CONFIG_4+1
{triangles_2t[WIPE_T2_5], 2, 0, 0, 0}, /* 5 */
#define WIPE_CONFIG_6 WIPE_CONFIG_5+1
{triangles_2t[WIPE_T2_6], 2, 0, 0, 0}, /* 6 */
#define WIPE_CONFIG_7 WIPE_CONFIG_6+1
{triangles_8t[WIPE_T8_7], 8, 1, 1, 0}, /* 7 */
#define WIPE_CONFIG_8 WIPE_CONFIG_7+1
{triangles_16t[WIPE_T16_8], 16, 2, 2, 0}, /* 8 */
#define WIPE_CONFIG_21 WIPE_CONFIG_8+1
{boxes_2b[WIPE_B2_21], 2, 1, 1, 0}, /* 21 */
#define WIPE_CONFIG_22 WIPE_CONFIG_21+1
{boxes_2b[WIPE_B2_22], 2, 1, 1, 0}, /* 22 */
#define WIPE_CONFIG_23 WIPE_CONFIG_22+1
{triangles_3t[WIPE_T3_23], 3, 1, 1, 0}, /* 23 */
#define WIPE_CONFIG_24 WIPE_CONFIG_23+1
{triangles_3t[WIPE_T3_24], 3, 1, 1, 0}, /* 24 */
#define WIPE_CONFIG_25 WIPE_CONFIG_24+1
{triangles_3t[WIPE_T3_23], 3, 1, 1, 0}, /* 25 */
#define WIPE_CONFIG_26 WIPE_CONFIG_25+1
{triangles_3t[WIPE_T3_26], 3, 1, 1, 0}, /* 26 */
#define WIPE_CONFIG_41 WIPE_CONFIG_26+1
{triangles_2t[WIPE_T2_41], 2, 0, 0, 1}, /* 41 */
#define WIPE_CONFIG_42 WIPE_CONFIG_41+1
{triangles_2t[WIPE_T2_42], 2, 0, 0, 1}, /* 42 */
#define WIPE_CONFIG_43 WIPE_CONFIG_42+1
{triangles_8t[WIPE_T8_43], 8, 1, 1, 1}, /* 43 */
#define WIPE_CONFIG_44 WIPE_CONFIG_43+1
{triangles_8t[WIPE_T8_44], 8, 1, 1, 1}, /* 44 */
#define WIPE_CONFIG_45 WIPE_CONFIG_44+1
{triangles_2t[WIPE_T2_45], 2, 0, 0, 0}, /* 45 */
#define WIPE_CONFIG_46 WIPE_CONFIG_45+1
{triangles_2t[WIPE_T2_46], 2, 0, 0, 0}, /* 46 */
#define WIPE_CONFIG_47 WIPE_CONFIG_46+1
{triangles_8t[WIPE_T8_47], 8, 1, 1, 0}, /* 47 */
#define WIPE_CONFIG_48 WIPE_CONFIG_47+1
{triangles_8t[WIPE_T8_48], 8, 1, 1, 0}, /* 48 */
#define WIPE_CONFIG_61 WIPE_CONFIG_48+1
{triangles_4t[WIPE_T4_61], 4, 1, 1, 1}, /* 61 */
#define WIPE_CONFIG_62 WIPE_CONFIG_61+1
{triangles_4t[WIPE_T4_62], 4, 1, 1, 1}, /* 62 */
#define WIPE_CONFIG_63 WIPE_CONFIG_62+1
{triangles_4t[WIPE_T4_63], 4, 1, 1, 1}, /* 63 */
#define WIPE_CONFIG_64 WIPE_CONFIG_63+1
{triangles_4t[WIPE_T4_64], 4, 1, 1, 1}, /* 64 */
#define WIPE_CONFIG_65 WIPE_CONFIG_64+1
{triangles_4t[WIPE_T4_65], 4, 1, 1, 0}, /* 65 */
#define WIPE_CONFIG_66 WIPE_CONFIG_65+1
{triangles_4t[WIPE_T4_66], 4, 1, 1, 0}, /* 66 */
#define WIPE_CONFIG_67 WIPE_CONFIG_66+1
{triangles_4t[WIPE_T4_67], 4, 1, 1, 0}, /* 67 */
#define WIPE_CONFIG_68 WIPE_CONFIG_67+1
{triangles_4t[WIPE_T4_68], 4, 1, 1, 0}, /* 68 */
#define WIPE_CONFIG_101 WIPE_CONFIG_68+1
{triangles_4t[WIPE_T4_101], 4, 1, 1, 0}, /* 101 */
#define WIPE_CONFIG_201 WIPE_CONFIG_101+1
{box_clock_4b[WIPE_B4_201], 4, 1, 1, 2}, /* 201 */
#define WIPE_CONFIG_202 WIPE_CONFIG_201+1
{box_clock_4b[WIPE_B4_202], 4, 1, 1, 2}, /* 202 */
#define WIPE_CONFIG_203 WIPE_CONFIG_202+1
{box_clock_4b[WIPE_B4_203], 4, 1, 1, 2}, /* 203 */
#define WIPE_CONFIG_204 WIPE_CONFIG_203+1
{box_clock_4b[WIPE_B4_204], 4, 1, 1, 2}, /* 204 */
#define WIPE_CONFIG_205 WIPE_CONFIG_204+1
{box_clock_4b[WIPE_B4_205], 4, 1, 1, 1}, /* 205 */
#define WIPE_CONFIG_206 WIPE_CONFIG_205+1
{box_clock_4b[WIPE_B4_206], 4, 1, 1, 1}, /* 206 */
#define WIPE_CONFIG_207 WIPE_CONFIG_206+1
{box_clock_4b[WIPE_B4_207], 4, 1, 1, 0}, /* 207 */
#define WIPE_CONFIG_211 WIPE_CONFIG_207+1
{box_clock_4b[WIPE_B4_211], 4, 1, 1, 1}, /* 211 */
#define WIPE_CONFIG_212 WIPE_CONFIG_211+1
{box_clock_4b[WIPE_B4_212], 4, 1, 1, 1}, /* 212 */
#define WIPE_CONFIG_213 WIPE_CONFIG_212+1
{box_clock_4b[WIPE_B4_213], 4, 1, 1, 0}, /* 213 */
#define WIPE_CONFIG_214 WIPE_CONFIG_213+1
{box_clock_4b[WIPE_B4_214], 4, 1, 1, 0}, /* 214 */
#define WIPE_CONFIG_221 WIPE_CONFIG_214+1
{box_clock_2b[WIPE_B2_221], 2, 1, 1, 1}, /* 221 */
#define WIPE_CONFIG_222 WIPE_CONFIG_221+1
{box_clock_2b[WIPE_B2_222], 2, 1, 1, 1}, /* 222 */
#define WIPE_CONFIG_223 WIPE_CONFIG_222+1
{box_clock_2b[WIPE_B2_223], 2, 1, 1, 1}, /* 223 */
#define WIPE_CONFIG_224 WIPE_CONFIG_223+1
{box_clock_2b[WIPE_B2_224], 2, 1, 1, 1}, /* 224 */
#define WIPE_CONFIG_225 WIPE_CONFIG_224+1
{box_clock_2b[WIPE_B2_225], 2, 1, 1, 0}, /* 225 */
#define WIPE_CONFIG_226 WIPE_CONFIG_225+1
{box_clock_2b[WIPE_B2_226], 2, 1, 1, 0}, /* 226 */
#define WIPE_CONFIG_227 WIPE_CONFIG_226+1
{box_clock_4b[WIPE_B4_227], 4, 1, 1, 1}, /* 227 */
#define WIPE_CONFIG_228 WIPE_CONFIG_227+1
{box_clock_4b[WIPE_B4_228], 4, 1, 1, 1}, /* 228 */
#define WIPE_CONFIG_231 WIPE_CONFIG_228+1
{box_clock_2b[WIPE_B2_231], 2, 1, 1, 0}, /* 231 */
#define WIPE_CONFIG_232 WIPE_CONFIG_231+1
{box_clock_2b[WIPE_B2_232], 2, 1, 1, 0}, /* 232 */
#define WIPE_CONFIG_233 WIPE_CONFIG_232+1
{box_clock_2b[WIPE_B2_233], 2, 1, 1, 0}, /* 233 */
#define WIPE_CONFIG_234 WIPE_CONFIG_233+1
{box_clock_2b[WIPE_B2_234], 2, 1, 1, 0}, /* 234 */
#define WIPE_CONFIG_235 WIPE_CONFIG_234+1
{box_clock_4b[WIPE_B4_235], 4, 1, 1, 0}, /* 235 */
#define WIPE_CONFIG_236 WIPE_CONFIG_235+1
{box_clock_4b[WIPE_B4_236], 4, 1, 1, 0}, /* 236 */
#define WIPE_CONFIG_241 WIPE_CONFIG_236+1
{box_clock_1b[WIPE_B1_241], 1, 0, 0, 0}, /* 241 */
#define WIPE_CONFIG_242 WIPE_CONFIG_241+1
{box_clock_1b[WIPE_B1_242], 1, 0, 0, 0}, /* 242 */
#define WIPE_CONFIG_243 WIPE_CONFIG_242+1
{box_clock_1b[WIPE_B1_243], 1, 0, 0, 0}, /* 243 */
#define WIPE_CONFIG_244 WIPE_CONFIG_243+1
{box_clock_1b[WIPE_B1_244], 1, 0, 0, 0}, /* 244 */
#define WIPE_CONFIG_245 WIPE_CONFIG_244+1
{triangles_2t[WIPE_T2_245], 2, 1, 1, 0}, /* 245 */
#define WIPE_CONFIG_246 WIPE_CONFIG_245+1
{triangles_2t[WIPE_T2_246], 2, 1, 1, 0}, /* 246 */
#define WIPE_CONFIG_251 WIPE_CONFIG_246+1
{box_clock_2b[WIPE_B2_251], 2, 1, 1, 0}, /* 251 */
#define WIPE_CONFIG_252 WIPE_CONFIG_251+1
{box_clock_2b[WIPE_B2_252], 2, 1, 1, 0}, /* 252 */
#define WIPE_CONFIG_253 WIPE_CONFIG_252+1
{box_clock_2b[WIPE_B2_253], 2, 1, 1, 0}, /* 253 */
#define WIPE_CONFIG_254 WIPE_CONFIG_253+1
{box_clock_2b[WIPE_B2_254], 2, 1, 1, 0}, /* 254 */
#define WIPE_CONFIG_261 WIPE_CONFIG_254+1
{box_clock_8b[WIPE_B8_261], 8, 2, 2, 2}, /* 261 */
#define WIPE_CONFIG_262 WIPE_CONFIG_261+1
{box_clock_8b[WIPE_B8_262], 8, 2, 2, 2}, /* 262 */
#define WIPE_CONFIG_263 WIPE_CONFIG_262+1
{box_clock_8b[WIPE_B8_263], 8, 2, 2, 1}, /* 263 */
#define WIPE_CONFIG_264 WIPE_CONFIG_263+1
{box_clock_8b[WIPE_B8_264], 8, 2, 2, 1}, /* 264 */
};
static void
gst_wipe_boxes_draw (GstMask * mask)
{
GstWipeConfig *config = mask->user_data;
gint *impacts = config->objects;
gint width = (mask->width >> config->xscale);
gint height = (mask->height >> config->yscale);
gint depth = (1 << mask->bpp) >> config->cscale;
gint i;
for (i = 0; i < config->nobjects; i++) {
switch (impacts[0]) {
case BOX_VERTICAL:
gst_smpte_paint_vbox (mask->data, mask->width,
impacts[1] * width, impacts[2] * height, impacts[3] * depth,
impacts[4] * width, impacts[5] * height, impacts[6] * depth);
impacts += 7;
break;
case BOX_HORIZONTAL:
gst_smpte_paint_hbox (mask->data, mask->width,
impacts[1] * width, impacts[2] * height, impacts[3] * depth,
impacts[4] * width, impacts[5] * height, impacts[6] * depth);
impacts += 7;
case BOX_CLOCK:
gst_smpte_paint_box_clock (mask->data, mask->width,
impacts[1] * width, impacts[2] * height, impacts[3] * depth,
impacts[4] * width, impacts[5] * height, impacts[6] * depth,
impacts[7] * width, impacts[8] * height, impacts[9] * depth);
impacts += 10;
default:
break;
}
}
}
static void
gst_wipe_triangles_clock_draw (GstMask * mask)
{
GstWipeConfig *config = mask->user_data;
gint *impacts = config->objects;
gint width = (mask->width >> config->xscale);
gint height = (mask->height >> config->yscale);
gint depth = (1 << mask->bpp) >> config->cscale;
gint i;
for (i = 0; i < config->nobjects; i++) {
gst_smpte_paint_triangle_clock (mask->data, mask->width,
impacts[0] * width, impacts[1] * height, impacts[2] * depth,
impacts[3] * width, impacts[4] * height, impacts[5] * depth,
impacts[6] * width, impacts[7] * height, impacts[8] * depth);
impacts += 9;
}
}
static void
gst_wipe_triangles_draw (GstMask * mask)
{
GstWipeConfig *config = mask->user_data;
gint *impacts = config->objects;
gint width = (mask->width >> config->xscale);
gint height = (mask->height >> config->yscale);
gint depth = (1 << mask->bpp) >> config->cscale;
gint i;
for (i = 0; i < config->nobjects; i++) {
gst_smpte_paint_triangle_linear (mask->data, mask->width,
impacts[0] * width, impacts[1] * height, impacts[2] * depth,
impacts[3] * width, impacts[4] * height, impacts[5] * depth,
impacts[6] * width, impacts[7] * height, impacts[8] * depth);
impacts += 9;
}
}
static GstMaskDefinition definitions[] = {
{1, "bar_wipe_lr",
"A bar moves from left to right",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_1]},
{2, "bar_wipe_tb",
"A bar moves from top to bottom",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_2]},
{3, "box_wipe_tl",
"A box expands from the upper-left corner to the lower-right corner",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_3]},
{4, "box_wipe_tr",
"A box expands from the upper-right corner to the lower-left corner",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_4]},
{5, "box_wipe_br",
"A box expands from the lower-right corner to the upper-left corner",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_5]},
{6, "box_wipe_bl",
"A box expands from the lower-left corner to the upper-right corner",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_6]},
{7, "four_box_wipe_ci",
"A box shape expands from each of the four corners toward the center",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_7]},
{8, "four_box_wipe_co",
"A box shape expands from the center of each quadrant toward the corners of each quadrant",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_8]},
{21, "barndoor_v",
"A central, vertical line splits and expands toward the left and right edges",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_21]},
{22, "barndoor_h",
"A central, horizontal line splits and expands toward the top and bottom edges",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_22]},
{23, "box_wipe_tc",
"A box expands from the top edge's midpoint to the bottom corners",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_23]},
{24, "box_wipe_rc",
"A box expands from the right edge's midpoint to the left corners",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_24]},
{25, "box_wipe_bc",
"A box expands from the bottom edge's midpoint to the top corners",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_25]},
{26, "box_wipe_lc",
"A box expands from the left edge's midpoint to the right corners",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_26]},
{41, "diagonal_tl",
"A diagonal line moves from the upper-left corner to the lower-right corner",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_41]},
{42, "diagonal_tr",
"A diagonal line moves from the upper right corner to the lower-left corner",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_42]},
{43, "bowtie_v",
"Two wedge shapes slide in from the top and bottom edges toward the center",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_43]},
{44, "bowtie_h",
"Two wedge shapes slide in from the left and right edges toward the center",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_44]},
{45, "barndoor_dbl",
"A diagonal line from the lower-left to upper-right corners splits and expands toward the opposite corners",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_45]},
{46, "barndoor_dtl",
"A diagonal line from upper-left to lower-right corners splits and expands toward the opposite corners",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_46]},
{47, "misc_diagonal_dbd",
"Four wedge shapes split from the center and retract toward the four edges",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_47]},
{48, "misc_diagonal_dd",
"A diamond connecting the four edge midpoints simultaneously contracts toward the center and expands toward the edges",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_48]},
{61, "vee_d",
"A wedge shape moves from top to bottom",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_61]},
{62, "vee_l",
"A wedge shape moves from right to left",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_62]},
{63, "vee_u",
"A wedge shape moves from bottom to top",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_63]},
{64, "vee_r",
"A wedge shape moves from left to right",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_64]},
{65, "barnvee_d",
"A 'V' shape extending from the bottom edge's midpoint to the opposite corners contracts toward the center and expands toward the edges",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_65]},
{66, "barnvee_l",
"A 'V' shape extending from the left edge's midpoint to the opposite corners contracts toward the center and expands toward the edges",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_66]},
{67, "barnvee_u",
"A 'V' shape extending from the top edge's midpoint to the opposite corners contracts toward the center and expands toward the edges",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_67]},
{68, "barnvee_r",
"A 'V' shape extending from the right edge's midpoint to the opposite corners contracts toward the center and expands toward the edges",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_68]},
{101, "iris_rect",
"A rectangle expands from the center.",
gst_wipe_triangles_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_101]},
{201, "clock_cw12",
"A radial hand sweeps clockwise from the twelve o'clock position",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_201]},
{202, "clock_cw3",
"A radial hand sweeps clockwise from the three o'clock position",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_202]},
{203, "clock_cw6",
"A radial hand sweeps clockwise from the six o'clock position",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_203]},
{204, "clock_cw9",
"A radial hand sweeps clockwise from the nine o'clock position",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_204]},
{205, "pinwheel_tbv",
"Two radial hands sweep clockwise from the twelve and six o'clock positions",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_205]},
{206, "pinwheel_tbh",
"Two radial hands sweep clockwise from the nine and three o'clock positions",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_206]},
{207, "pinwheel_fb",
"Four radial hands sweep clockwise",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_207]},
{211, "fan_ct",
"A fan unfolds from the top edge, the fan axis at the center",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_211]},
{212, "fan_cr",
"A fan unfolds from the right edge, the fan axis at the center",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_212]},
{213, "doublefan_fov",
"Two fans, their axes at the center, unfold from the top and bottom",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_213]},
{214, "doublefan_foh",
"Two fans, their axes at the center, unfold from the left and right",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_214]},
{221, "singlesweep_cwt",
"A radial hand sweeps clockwise from the top edge's midpoint",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_221]},
{222, "singlesweep_cwr",
"A radial hand sweeps clockwise from the right edge's midpoint",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_222]},
{223, "singlesweep_cwb",
"A radial hand sweeps clockwise from the bottom edge's midpoint",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_223]},
{224, "singlesweep_cwl",
"A radial hand sweeps clockwise from the left edge's midpoint",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_224]},
{225, "doublesweep_pv",
"Two radial hands sweep clockwise and counter-clockwise from the top and bottom edges' midpoints",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_225]},
{226, "doublesweep_pd",
"Two radial hands sweep clockwise and counter-clockwise from the left and right edges' midpoints",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_226]},
{227, "doublesweep_ov",
"Two radial hands attached at the top and bottom edges' midpoints sweep from right to left",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_227]},
{228, "doublesweep_oh",
"Two radial hands attached at the left and right edges' midpoints sweep from top to bottom",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_228]},
{231, "fan_t",
"A fan unfolds from the bottom, the fan axis at the top edge's midpoint",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_231]},
{232, "fan_r",
"A fan unfolds from the left, the fan axis at the right edge's midpoint",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_232]},
{233, "fan_b",
"A fan unfolds from the top, the fan axis at the bottom edge's midpoint",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_233]},
{234, "fan_l",
"A fan unfolds from the right, the fan axis at the left edge's midpoint",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_234]},
{235, "doublefan_fiv",
"Two fans, their axes at the top and bottom, unfold from the center",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_235]},
{236, "doublefan_fih",
"Two fans, their axes at the left and right, unfold from the center",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_236]},
{241, "singlesweep_cwtl",
"A radial hand sweeps clockwise from the upper-left corner",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_241]},
{242, "singlesweep_cwbl",
"A radial hand sweeps counter-clockwise from the lower-left corner.",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_242]},
{243, "singlesweep_cwbr",
"A radial hand sweeps clockwise from the lower-right corner",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_243]},
{244, "singlesweep_cwtr",
"A radial hand sweeps counter-clockwise from the upper-right corner",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_244]},
{245, "doublesweep_pdtl",
"Two radial hands attached at the upper-left and lower-right corners sweep down and up",
gst_wipe_triangles_clock_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_245]},
{246, "doublesweep_pdbl",
"Two radial hands attached at the lower-left and upper-right corners sweep down and up",
gst_wipe_triangles_clock_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_246]},
{251, "saloondoor_t",
"Two radial hands attached at the upper-left and upper-right corners sweep down",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_251]},
{252, "saloondoor_l",
"Two radial hands attached at the upper-left and lower-left corners sweep to the right",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_252]},
{253, "saloondoor_b",
"Two radial hands attached at the lower-left and lower-right corners sweep up",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_253]},
{254, "saloondoor_r",
"Two radial hands attached at the upper-right and lower-right corners sweep to the left",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_254]},
{261, "windshield_r",
"Two radial hands attached at the midpoints of the top and bottom halves sweep from right to left",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_261]},
{262, "windshield_u",
"Two radial hands attached at the midpoints of the left and right halves sweep from top to bottom",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_262]},
{263, "windshield_v",
"Two sets of radial hands attached at the midpoints of the top and bottom halves sweep from top to bottom and bottom to top",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_263]},
{264, "windshield_h",
"Two sets of radial hands attached at the midpoints of the left and right halves sweep from left to right and right to left",
gst_wipe_boxes_draw, _gst_mask_default_destroy,
&wipe_config[WIPE_CONFIG_264]},
{0, NULL, NULL, NULL}
};
void
_gst_barboxwipes_register (void)
{
gint i = 0;
while (definitions[i].short_name) {
_gst_mask_register (&definitions[i]);
i++;
}
}

View file

@ -1,109 +0,0 @@
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstmask.h"
#include "paint.h"
extern void _gst_barboxwipes_register (void);
static GList *masks = NULL;
void
_gst_mask_init (void)
{
_gst_barboxwipes_register ();
}
static gint
gst_mask_compare (GstMaskDefinition * def1, GstMaskDefinition * def2)
{
return (def1->type - def2->type);
}
void
_gst_mask_register (GstMaskDefinition * definition)
{
masks =
g_list_insert_sorted (masks, definition, (GCompareFunc) gst_mask_compare);
}
const GList *
gst_mask_get_definitions (void)
{
return masks;
}
static GstMaskDefinition *
gst_mask_find_definition (gint type)
{
GList *walk = masks;
while (walk) {
GstMaskDefinition *def = (GstMaskDefinition *) walk->data;
if (def->type == type)
return def;
walk = g_list_next (walk);
}
return NULL;
}
GstMask *
gst_mask_factory_new (gint type, gint bpp, gint width, gint height)
{
GstMaskDefinition *definition;
GstMask *mask = NULL;
definition = gst_mask_find_definition (type);
if (definition) {
mask = g_new0 (GstMask, 1);
mask->type = definition->type;
mask->bpp = bpp;
mask->width = width;
mask->height = height;
mask->destroy_func = definition->destroy_func;
mask->user_data = definition->user_data;
mask->data = g_malloc (width * height * sizeof (guint32));
if (definition->draw_func)
definition->draw_func (mask);
}
return mask;
}
void
_gst_mask_default_destroy (GstMask * mask)
{
g_free (mask->data);
g_free (mask);
}
void
gst_mask_destroy (GstMask * mask)
{
if (mask->destroy_func)
mask->destroy_func (mask);
}

View file

@ -1,63 +0,0 @@
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_MASK_H__
#define __GST_MASK_H__
#include <gst/gst.h>
typedef struct _GstMask GstMask;
typedef struct _GstMaskDefinition GstMaskDefinition;
typedef void (*GstMaskDrawFunc) (GstMask *mask);
typedef void (*GstMaskDestroyFunc) (GstMask *mask);
struct _GstMaskDefinition {
gint type;
gchar *short_name;
gchar *long_name;
GstMaskDrawFunc draw_func;
GstMaskDestroyFunc destroy_func;
gpointer user_data;
};
struct _GstMask {
gint type;
guint32 *data;
gpointer user_data;
gint width;
gint height;
gint bpp;
GstMaskDestroyFunc destroy_func;
};
void _gst_mask_init (void);
void _gst_mask_register (GstMaskDefinition *definition);
void _gst_mask_default_destroy (GstMask *mask);
const GList* gst_mask_get_definitions (void);
GstMask* gst_mask_factory_new (gint type, gint bpp, gint width, gint height);
void gst_mask_destroy (GstMask *mask);
#endif /* __GST_MASK_H__ */

View file

@ -1,494 +0,0 @@
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <string.h>
#include "gstsmpte.h"
#include <gst/video/video.h>
#include "paint.h"
/* elementfactory information */
static GstElementDetails smpte_details = {
"SMPTE transitions",
"Filter/Editor/Video",
"Apply the standard SMPTE transitions on video images",
"Wim Taymans <wim.taymans@chello.be>"
};
static GstStaticPadTemplate gst_smpte_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("I420")
)
);
static GstStaticPadTemplate gst_smpte_sink1_template =
GST_STATIC_PAD_TEMPLATE ("sink1",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("I420")
)
);
static GstStaticPadTemplate gst_smpte_sink2_template =
GST_STATIC_PAD_TEMPLATE ("sink2",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_VIDEO_CAPS_YUV ("I420")
)
);
/* SMPTE signals and args */
enum
{
/* FILL ME */
LAST_SIGNAL
};
enum
{
ARG_0,
ARG_TYPE,
ARG_BORDER,
ARG_DEPTH,
ARG_FPS
};
#define GST_TYPE_SMPTE_TRANSITION_TYPE (gst_smpte_transition_type_get_type())
static GType
gst_smpte_transition_type_get_type (void)
{
static GType smpte_transition_type = 0;
GEnumValue *smpte_transitions;
if (!smpte_transition_type) {
const GList *definitions;
gint i = 0;
definitions = gst_mask_get_definitions ();
smpte_transitions =
g_new0 (GEnumValue, g_list_length ((GList *) definitions) + 1);
while (definitions) {
GstMaskDefinition *definition = (GstMaskDefinition *) definitions->data;
definitions = g_list_next (definitions);
smpte_transitions[i].value = definition->type;
smpte_transitions[i].value_name = definition->short_name;
smpte_transitions[i].value_nick = definition->long_name;
i++;
}
smpte_transition_type =
g_enum_register_static ("GstSMPTETransitionType", smpte_transitions);
}
return smpte_transition_type;
}
static void gst_smpte_class_init (GstSMPTEClass * klass);
static void gst_smpte_base_init (GstSMPTEClass * klass);
static void gst_smpte_init (GstSMPTE * smpte);
static GstFlowReturn gst_smpte_collected (GstCollectPads * pads,
GstSMPTE * smpte);
static void gst_smpte_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_smpte_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static GstElementClass *parent_class = NULL;
/*static guint gst_smpte_signals[LAST_SIGNAL] = { 0 }; */
static GType
gst_smpte_get_type (void)
{
static GType smpte_type = 0;
if (!smpte_type) {
static const GTypeInfo smpte_info = {
sizeof (GstSMPTEClass),
(GBaseInitFunc) gst_smpte_base_init,
NULL,
(GClassInitFunc) gst_smpte_class_init,
NULL,
NULL,
sizeof (GstSMPTE),
0,
(GInstanceInitFunc) gst_smpte_init,
};
smpte_type =
g_type_register_static (GST_TYPE_ELEMENT, "GstSMPTE", &smpte_info, 0);
}
return smpte_type;
}
static void
gst_smpte_base_init (GstSMPTEClass * klass)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_smpte_sink1_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_smpte_sink2_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_smpte_src_template));
gst_element_class_set_details (element_class, &smpte_details);
}
static void
gst_smpte_class_init (GstSMPTEClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
gobject_class->set_property = gst_smpte_set_property;
gobject_class->get_property = gst_smpte_get_property;
_gst_mask_init ();
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TYPE,
g_param_spec_enum ("type", "Type", "The type of transition to use",
GST_TYPE_SMPTE_TRANSITION_TYPE, 1, G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FPS,
g_param_spec_float ("fps", "FPS",
"Frames per second if no input files are given", 0., G_MAXFLOAT, 25.,
G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BORDER,
g_param_spec_int ("border", "Border",
"The border width of the transition", 0, G_MAXINT, 0,
G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DEPTH,
g_param_spec_int ("depth", "Depth", "Depth of the mask in bits", 1, 24,
16, G_PARAM_READWRITE));
}
/* wht yel cya grn mag red blu blk -I Q */
static int y_colors[] = { 255, 226, 179, 150, 105, 76, 29, 16, 16, 0 };
static int u_colors[] = { 128, 0, 170, 46, 212, 85, 255, 128, 0, 128 };
static int v_colors[] = { 128, 155, 0, 21, 235, 255, 107, 128, 128, 255 };
static void
fill_i420 (guint8 * data, gint width, gint height, gint color)
{
gint size = width * height, size4 = size >> 2;
guint8 *yp = data;
guint8 *up = data + size;
guint8 *vp = data + size + size4;
memset (yp, y_colors[color], size);
memset (up, u_colors[color], size4);
memset (vp, v_colors[color], size4);
}
static gboolean
gst_smpte_update_mask (GstSMPTE * smpte, gint type, gint depth, gint width,
gint height)
{
GstMask *newmask;
newmask = gst_mask_factory_new (type, depth, width, height);
if (newmask) {
if (smpte->mask) {
gst_mask_destroy (smpte->mask);
}
smpte->mask = newmask;
smpte->type = type;
smpte->depth = depth;
smpte->width = width;
smpte->height = height;
return TRUE;
}
return FALSE;
}
static gboolean
gst_smpte_setcaps (GstPad * pad, GstCaps * caps)
{
GstSMPTE *smpte;
GstStructure *structure;
gboolean ret;
smpte = GST_SMPTE (GST_PAD_PARENT (pad));
structure = gst_caps_get_structure (caps, 0);
ret = gst_structure_get_int (structure, "width", &smpte->width);
ret &= gst_structure_get_int (structure, "height", &smpte->height);
ret &= gst_structure_get_double (structure, "framerate", &smpte->fps);
if (!ret)
return FALSE;
gst_smpte_update_mask (smpte, smpte->type, smpte->depth, smpte->width,
smpte->height);
/* forward to the next plugin */
return TRUE;
}
static void
gst_smpte_init (GstSMPTE * smpte)
{
smpte->sinkpad1 =
gst_pad_new_from_template (gst_static_pad_template_get
(&gst_smpte_sink1_template), "sink1");
gst_pad_set_setcaps_function (smpte->sinkpad1, gst_smpte_setcaps);
gst_element_add_pad (GST_ELEMENT (smpte), smpte->sinkpad1);
smpte->sinkpad2 =
gst_pad_new_from_template (gst_static_pad_template_get
(&gst_smpte_sink2_template), "sink2");
gst_pad_set_setcaps_function (smpte->sinkpad2, gst_smpte_setcaps);
gst_element_add_pad (GST_ELEMENT (smpte), smpte->sinkpad2);
smpte->srcpad =
gst_pad_new_from_template (gst_static_pad_template_get
(&gst_smpte_src_template), "src");
gst_element_add_pad (GST_ELEMENT (smpte), smpte->srcpad);
smpte->collect = gst_collectpads_new ();
gst_collectpads_set_function (smpte->collect,
(GstCollectPadsFunction) gst_smpte_collected, smpte);
gst_collectpads_start (smpte->collect);
gst_collectpads_add_pad (smpte->collect, smpte->sinkpad1,
sizeof (GstCollectData));
gst_collectpads_add_pad (smpte->collect, smpte->sinkpad2,
sizeof (GstCollectData));
smpte->width = 320;
smpte->height = 200;
smpte->fps = 25.;
smpte->duration = 512;
smpte->position = 0;
smpte->type = 1;
smpte->border = 0;
smpte->depth = 16;
gst_smpte_update_mask (smpte, smpte->type, smpte->depth, smpte->width,
smpte->height);
}
static void
gst_smpte_blend_i420 (guint8 * in1, guint8 * in2, guint8 * out, GstMask * mask,
gint width, gint height, gint border, gint pos)
{
guint32 *maskp;
gint value;
gint i, j;
gint min, max;
guint8 *in1u, *in1v, *in2u, *in2v, *outu, *outv;
gint lumsize = width * height;
gint chromsize = lumsize >> 2;
if (border == 0)
border++;
min = pos - border;
max = pos;
in1u = in1 + lumsize;
in1v = in1u + chromsize;
in2u = in2 + lumsize;
in2v = in2u + chromsize;
outu = out + lumsize;
outv = outu + chromsize;
maskp = mask->data;
for (i = 0; i < height; i++) {
for (j = 0; j < width; j++) {
value = *maskp++;
value = ((CLAMP (value, min, max) - min) << 8) / border;
*out++ = ((*in1++ * value) + (*in2++ * (256 - value))) >> 8;
if (!(i & 1) && !(j & 1)) {
*outu++ = ((*in1u++ * value) + (*in2u++ * (256 - value))) >> 8;
*outv++ = ((*in1v++ * value) + (*in2v++ * (256 - value))) >> 8;
}
}
}
}
static GstFlowReturn
gst_smpte_collected (GstCollectPads * pads, GstSMPTE * smpte)
{
GstBuffer *outbuf;
GstClockTime ts;
GstBuffer *in1 = NULL, *in2 = NULL;
GSList *collected;
ts = smpte->position * GST_SECOND / smpte->fps;
for (collected = pads->data; collected; collected = g_slist_next (collected)) {
GstCollectData *data;
data = (GstCollectData *) collected->data;
if (data->pad == smpte->sinkpad1)
in1 = gst_collectpads_pop (pads, data);
else if (data->pad == smpte->sinkpad2)
in2 = gst_collectpads_pop (pads, data);
}
if (in1 == NULL) {
in1 = gst_buffer_new_and_alloc (smpte->width * smpte->height * 3);
fill_i420 (GST_BUFFER_DATA (in1), smpte->width, smpte->height, 7);
}
if (in2 == NULL) {
in2 = gst_buffer_new_and_alloc (smpte->width * smpte->height * 3);
fill_i420 (GST_BUFFER_DATA (in2), smpte->width, smpte->height, 0);
}
if (smpte->position < smpte->duration) {
outbuf = gst_buffer_new_and_alloc (smpte->width * smpte->height * 3);
/* set caps if not done yet */
if (!GST_PAD_CAPS (smpte->srcpad)) {
GstCaps *caps;
caps =
gst_caps_copy (gst_static_caps_get (&gst_smpte_src_template.
static_caps));
gst_caps_set_simple (caps, "width", G_TYPE_INT, smpte->width, "height",
G_TYPE_INT, smpte->height, "framerate", G_TYPE_DOUBLE, smpte->fps,
NULL);
gst_pad_set_caps (smpte->srcpad, caps);
}
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (smpte->srcpad));
gst_smpte_blend_i420 (GST_BUFFER_DATA (in1),
GST_BUFFER_DATA (in2),
GST_BUFFER_DATA (outbuf),
smpte->mask, smpte->width, smpte->height,
smpte->border,
((1 << smpte->depth) + smpte->border) *
smpte->position / smpte->duration);
} else {
outbuf = in2;
gst_buffer_ref (in2);
}
smpte->position++;
if (in1)
gst_buffer_unref (in1);
if (in2)
gst_buffer_unref (in2);
GST_BUFFER_TIMESTAMP (outbuf) = ts;
return gst_pad_push (smpte->srcpad, outbuf);
}
static void
gst_smpte_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
{
GstSMPTE *smpte;
smpte = GST_SMPTE (object);
switch (prop_id) {
case ARG_TYPE:
{
gint type = g_value_get_enum (value);
gst_smpte_update_mask (smpte, type, smpte->depth,
smpte->width, smpte->height);
break;
}
case ARG_BORDER:
smpte->border = g_value_get_int (value);
break;
case ARG_FPS:
smpte->fps = g_value_get_float (value);
break;
case ARG_DEPTH:
{
gint depth = g_value_get_int (value);
gst_smpte_update_mask (smpte, smpte->type, depth,
smpte->width, smpte->height);
break;
}
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gst_smpte_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec)
{
GstSMPTE *smpte;
smpte = GST_SMPTE (object);
switch (prop_id) {
case ARG_TYPE:
if (smpte->mask) {
g_value_set_enum (value, smpte->mask->type);
}
break;
case ARG_FPS:
g_value_set_float (value, smpte->fps);
break;
case ARG_BORDER:
g_value_set_int (value, smpte->border);
break;
case ARG_DEPTH:
g_value_set_int (value, smpte->depth);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static gboolean
plugin_init (GstPlugin * plugin)
{
return gst_element_register (plugin, "smpte", GST_RANK_NONE, GST_TYPE_SMPTE);
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"smpte",
"Apply the standard SMPTE transitions on video images",
plugin_init, VERSION, "LGPL", GST_PACKAGE, GST_ORIGIN)

View file

@ -1,70 +0,0 @@
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_SMPTE_H__
#define __GST_SMPTE_H__
#include <gst/gst.h>
#include <gst/base/gstcollectpads.h>
#include "gstmask.h"
#define GST_TYPE_SMPTE \
(gst_smpte_get_type())
#define GST_SMPTE(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SMPTE,GstSMPTE))
#define GST_SMPTE_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SMPTE,GstSMPTE))
#define GST_IS_SMPTE(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SMPTE))
#define GST_IS_SMPTE_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SMPTE))
typedef struct _GstSMPTE GstSMPTE;
typedef struct _GstSMPTEClass GstSMPTEClass;
struct _GstSMPTE {
GstElement element;
gint format;
gint width;
gint height;
gdouble fps;
gint duration;
gint position;
GstPad *srcpad,
*sinkpad1,
*sinkpad2;
GstCollectPads *collect;
gint type;
gint border;
gint depth;
GstMask *mask;
};
struct _GstSMPTEClass {
GstElementClass parent_class;
};
#endif /* __GST_SMPTE_H__ */

View file

@ -1,332 +0,0 @@
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <math.h>
#include <stdlib.h>
#include "paint.h"
void
gst_smpte_paint_vbox (guint32 * dest, gint stride,
gint x0, gint y0, gint c0, gint x1, gint y1, gint c1)
{
gint i, j;
gint width, height;
width = x1 - x0;
height = y1 - y0;
g_assert (width > 0);
g_assert (height > 0);
dest = dest + y0 * stride + x0;
for (i = 0; i < height; i++) {
for (j = 0; j < width; j++) {
dest[j] = (c1 * j + c0 * (width - j)) / width;
}
dest += stride;
}
}
void
gst_smpte_paint_hbox (guint32 * dest, gint stride,
gint x0, gint y0, gint c0, gint x1, gint y1, gint c1)
{
gint i, j;
gint width, height;
width = x1 - x0;
height = y1 - y0;
g_assert (width > 0);
g_assert (height > 0);
g_print ("vbox: %d %d %d %d %d %d\n", x0, y0, c0, x1, y1, c1);
dest = dest + y0 * stride + x0;
for (i = 0; i < height; i++) {
guint32 value = (c1 * i + c0 * (height - i)) / height;
for (j = 0; j < width; j++) {
dest[j] = value;
}
dest += stride;
}
}
#define STEP_3D_LINE(dxabs,dyabs,dzabs,sdx,sdy,sdz,xr,yr,zr,px,py,pz) \
G_STMT_START { \
if (dxabs >= dyabs && dxabs >= dzabs) { \
yr += dyabs; \
zr += dzabs; \
if (yr >= dxabs) { \
py += sdy; \
yr -= dxabs; \
} \
if (zr >= dzabs) { \
pz += sdz; \
zr -= dxabs; \
} \
px += sdx; \
} else if (dyabs >= dxabs && dyabs >= dzabs) { \
xr += dxabs; \
zr += dzabs; \
if (xr >= dyabs) { \
px += sdx; \
xr -= dyabs; \
} \
if (zr >= dzabs) { \
pz += sdz; \
zr -= dyabs; \
} \
py += sdy; \
} else { \
yr += dyabs; \
xr += dxabs; \
if (yr >= dyabs) { \
py += sdy; \
yr -= dzabs; \
} \
if (xr >= dyabs) { \
px += sdx; \
xr -= dzabs; \
} \
pz += sdz; \
} \
} G_STMT_END
#define SWAP_INT(a,b) \
G_STMT_START { \
gint tmp; \
tmp = (a); \
(a) = (b); \
(b) = (tmp); \
} G_STMT_END
#define SIGN(a) ((a) < 0 ? -1 : 1)
#define PREPARE_3D_LINE(x0,y0,z0,x1,y1,z1,dxabs,dyabs,dzabs,sdx,sdy,sdz,xr,yr,zr,px,py,pz)\
G_STMT_START { \
gint dx, dy, dz; \
dx = x1 - x0; \
dy = y1 - y0; \
dz = z1 - z0; \
dxabs = abs (dx); \
dyabs = abs (dy); \
dzabs = abs (dz); \
sdx = SIGN (dx); \
sdy = SIGN (dy); \
sdz = SIGN (dz); \
xr = dxabs >> 1; \
yr = dyabs >> 1; \
zr = dzabs >> 1; \
px = x0; \
py = y0; \
pz = z0; \
} G_STMT_END
void
gst_smpte_paint_triangle_linear (guint32 * dest, gint stride,
gint x0, gint y0, gint c0,
gint x1, gint y1, gint c1, gint x2, gint y2, gint c2)
{
gint sdxl, sdyl, sdcl, dxlabs, dylabs, dclabs, xrl, yrl, crl, pxl, pyl, pcl;
gint sdxr, sdyr, sdcr, dxrabs, dyrabs, dcrabs, xrr, yrr, crr, pxr, pyr, pcr;
gint i, j, k, seg_start, seg_end;
if (y0 > y1) {
SWAP_INT (x0, x1);
SWAP_INT (y0, y1);
SWAP_INT (c0, c1);
}
if (y0 > y2) {
SWAP_INT (x0, x2);
SWAP_INT (y0, y2);
SWAP_INT (c0, c2);
}
if (y1 > y2) {
SWAP_INT (x1, x2);
SWAP_INT (y1, y2);
SWAP_INT (c1, c2);
}
PREPARE_3D_LINE (x0, y0, c0, x2, y2, c2,
dxlabs, dylabs, dclabs, sdxl, sdyl, sdcl, xrl, yrl, crl, pxl, pyl, pcl);
PREPARE_3D_LINE (x0, y0, c0, x1, y1, c1,
dxrabs, dyrabs, dcrabs, sdxr, sdyr, sdcr, xrr, yrr, crr, pxr, pyr, pcr);
dest = dest + stride * y0;
seg_start = y0;
seg_end = y1;
/* do two passes */
for (k = 0; k < 2; k++) {
for (i = seg_start; i < seg_end; i++) {
gint s = pxl, e = pxr, sc = pcl, ec = pcr;
gint sign = SIGN (e - s);
e += sign;
for (j = s; j != e; j += sign) {
dest[j] = (ec * (j - s) + sc * (e - j)) / (e - s);
}
while (pyr == i) {
STEP_3D_LINE (dxrabs, dyrabs, dcrabs, sdxr, sdyr, sdcr,
xrr, yrr, crr, pxr, pyr, pcr);
}
while (pyl == i) {
STEP_3D_LINE (dxlabs, dylabs, dclabs, sdxl, sdyl, sdcl,
xrl, yrl, crl, pxl, pyl, pcl);
}
dest += stride;
}
PREPARE_3D_LINE (x1, y1, c1, x2, y2, c2,
dxrabs, dyrabs, dcrabs, sdxr, sdyr, sdcr, xrr, yrr, crr, pxr, pyr, pcr);
seg_start = y1;
seg_end = y2;
}
}
static void
draw_bresenham_line (guint32 * dest, gint stride,
gint x0, gint y0, gint x1, gint y1, guint32 col)
{
gint dx = abs (x1 - x0);
gint dy = abs (y1 - y0);
gint x_incr, y_incr;
gint i, dpr, dpru, P, indep;
dest = dest + y0 * stride + x0;
x_incr = SIGN (x1 - x0);
y_incr = SIGN (y1 - y0) * stride;
if (dx >= dy) {
dpr = dy << 1;
i = dx;
indep = x_incr;
} else {
dpr = dx << 1;
i = dy;
indep = y_incr;
}
dpru = dpr - (i << 1);
P = dpr - i;
for (; i >= 0; i--) {
*dest = col;
if (P > 0) {
dest += x_incr;
dest += y_incr;
P += dpru;
} else {
dest += indep;
P += dpr;
}
}
}
void
gst_smpte_paint_triangle_clock (guint32 * dest, gint stride,
gint x0, gint y0, gint c0,
gint x1, gint y1, gint c1, gint x2, gint y2, gint c2)
{
gint i;
gint sign;
gfloat angle, angle_s, angle_e;
gfloat len1;
angle_s = 0.0;
angle_e = acos (((x1 - x0) * (x2 - x0) + (y1 - y0) * (y2 - y0)) /
(sqrt ((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) *
sqrt ((x2 - x0) * (x2 - x0) + (y2 - y0) * (y2 - y0))));
len1 = sqrt ((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0));
if (x1 == x2) {
sign = SIGN (y2 - y1);
for (i = y1; i != (y2 + sign); i += sign) {
if (y1 == i)
angle = 0;
else
angle = acos (((x1 - x0) * (x2 - x0) + (y1 - y0) * (i - y0)) /
(len1 * sqrt ((x1 - x0) * (x1 - x0) + (i - y0) * (i -
y0)))) / angle_e;
draw_bresenham_line (dest, stride,
x0, y0, x1, i, (c2 * angle + c1 * (1.0 - angle)));
}
} else if (y1 == y2) {
sign = SIGN (x2 - x1);
for (i = x1; i != (x2 + sign); i += sign) {
if (x1 == i)
angle = 0;
else
angle = acos (((x1 - x0) * (i - x0) + (y1 - y0) * (y2 - y0)) /
(len1 * sqrt ((i - x0) * (i - x0) + (y2 - y0) * (y2 -
y0)))) / angle_e;
draw_bresenham_line (dest, stride,
x0, y0, i, y1, (c2 * angle + c1 * (1.0 - angle)));
}
}
}
void
gst_smpte_paint_box_clock (guint32 * dest, gint stride,
gint x0, gint y0, gint c0,
gint x1, gint y1, gint c1, gint x2, gint y2, gint c2)
{
gfloat angle_m, col_m;
gint xv, yv;
if (x1 == x0) {
xv = x2;
yv = y1;
} else if (y1 == y0) {
xv = x1;
yv = y2;
} else {
g_warning ("paint box clock: not supported");
return;
}
angle_m = 2 * acos (((x1 - x0) * (xv - x0) + (y1 - y0) * (yv - y0)) /
(sqrt ((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) *
sqrt ((xv - x0) * (xv - x0) + (yv - y0) * (yv - y0)))) / M_PI;
col_m = c2 * angle_m + c1 * (1.0 - angle_m);
gst_smpte_paint_triangle_clock (dest, stride,
x0, y0, c0, x1, y1, c1, xv, yv, col_m);
gst_smpte_paint_triangle_clock (dest, stride,
x0, y0, c0, xv, yv, col_m, x2, y2, c2);
}

View file

@ -1,47 +0,0 @@
/* GStreamer
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GST_SMPTE_PAINT_H__
#define __GST_SMPTE_PAINT_H__
#include <glib.h>
void gst_smpte_paint_vbox (guint32 *dest, gint stride,
gint x0, gint y0, gint c0,
gint x1, gint y1, gint c1);
void gst_smpte_paint_hbox (guint32 *dest, gint stride,
gint x0, gint y0, gint c0,
gint x1, gint y1, gint c1);
void gst_smpte_paint_triangle_linear (guint32 *dest, gint stride,
gint x0, gint y0, gint c0,
gint x1, gint y1, gint c1,
gint x2, gint y2, gint c2);
void gst_smpte_paint_triangle_clock (guint32 *dest, gint stride,
gint x0, gint y0, gint c0,
gint x1, gint y1, gint c1,
gint x2, gint y2, gint c2);
void gst_smpte_paint_box_clock (guint32 *dest, gint stride,
gint x0, gint y0, gint c0,
gint x1, gint y1, gint c1,
gint x2, gint y2, gint c2);
#endif /* __GST_SMPTE_PAINT_H__ */

View file

@ -1,163 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="smpte"
ProjectGUID="{979C216F-0ACF-4956-AE00-055A42D678CB}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="../../win32/Debug"
IntermediateDirectory="../../win32/Debug"
ConfigurationType="2"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../../gstreamer/win32;../../../gstreamer;../../../gstreamer/libs;../../../glib;../../../glib/glib;../../../glib/gmodule;&quot;../../gst-libs&quot;;../../../popt/include;../../../libxml2/include/libxml2"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;smpte_EXPORTS;HAVE_CONFIG_H;_USE_MATH_DEFINES"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="glib-2.0.lib gmodule-2.0.lib gthread-2.0.lib gobject-2.0.lib libgstreamer.lib gstbytestream.lib iconv.lib intl.lib"
OutputFile="$(OutDir)/gstsmpte.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="../../../gstreamer/win32/Debug;../../../glib/glib;../../../glib/gmodule;../../../glib/gthread;../../../glib/gobject;../../../gettext/lib;../../../libiconv/lib"
ModuleDefinitionFile=""
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/smpte.pdb"
SubSystem="2"
OptimizeReferences="2"
ImportLibrary="$(OutDir)/gstsmpte.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="copy /Y $(TargetPath) c:\gstreamer\plugins"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="../../win32/Release"
IntermediateDirectory="../../win32/Release"
ConfigurationType="2"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../../../gstreamer/win32;../../../gstreamer;../../../gstreamer/libs;../../../glib;../../../glib/glib;../../../glib/gmodule;&quot;../../gst-libs&quot;;../../../popt/include;../../../libxml2/include/libxml2"
PreprocessorDefinitions="WIN32;NDEBUG;GST_DISABLE_GST_DEBUG;_WINDOWS;_USRDLL;smpte_EXPORTS;HAVE_CONFIG_H;_USE_MATH_DEFINES"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="glib-2.0.lib gmodule-2.0.lib gthread-2.0.lib gobject-2.0.lib libgstreamer.lib gstbytestream.lib iconv.lib intl.lib"
OutputFile="$(OutDir)/gstsmpte.dll"
LinkIncremental="1"
AdditionalLibraryDirectories="../../../gstreamer/win32/Release;../../../glib/glib;../../../glib/gmodule;../../../glib/gthread;../../../glib/gobject;../../../gettext/lib;../../../libiconv/lib"
ModuleDefinitionFile=""
GenerateDebugInformation="TRUE"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/gstsmpte.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="copy /Y $(TargetPath) c:\gstreamer\plugins"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath=".\gstsmpte.c">
</File>
<File
RelativePath=".\gstmask.c">
</File>
<File
RelativePath=".\barboxwipes.c">
</File>
<File
RelativePath=".\paint.c">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath=".\gstsmpte.h">
</File>
<File
RelativePath=".\gstmask.h">
</File>
<File
RelativePath=".\paint.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>