2002-03-20 21:45:04 +00:00
|
|
|
/* GStreamer
|
2002-02-03 16:30:31 +00:00
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "gsttarkinenc.h"
|
|
|
|
#include "gsttarkindec.h"
|
|
|
|
|
|
|
|
extern GstElementDetails tarkinenc_details;
|
|
|
|
extern GstElementDetails tarkindec_details;
|
|
|
|
|
|
|
|
GstPadTemplate *enc_src_template, *enc_sink_template;
|
|
|
|
GstPadTemplate *dec_src_template, *dec_sink_template;
|
|
|
|
|
|
|
|
static GstCaps*
|
|
|
|
tarkin_caps_factory (void)
|
|
|
|
{
|
|
|
|
return
|
|
|
|
gst_caps_new (
|
|
|
|
"tarkin_tarkin",
|
2003-07-06 20:49:52 +00:00
|
|
|
"application/ogg",
|
|
|
|
NULL);
|
2002-02-03 16:30:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static GstCaps*
|
|
|
|
raw_caps_factory (void)
|
|
|
|
{
|
|
|
|
return
|
|
|
|
GST_CAPS_NEW (
|
|
|
|
"tarkin_raw",
|
2003-07-06 20:49:52 +00:00
|
|
|
"video/x-raw-rgb",
|
2002-02-03 16:30:31 +00:00
|
|
|
"bpp", GST_PROPS_INT (24),
|
|
|
|
"depth", GST_PROPS_INT (24),
|
|
|
|
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
|
|
|
|
"red_mask", GST_PROPS_INT (0xff0000),
|
|
|
|
"green_mask", GST_PROPS_INT (0xff00),
|
|
|
|
"blue_mask", GST_PROPS_INT (0xff),
|
|
|
|
"width", GST_PROPS_INT_RANGE (0, G_MAXINT),
|
2003-07-06 20:49:52 +00:00
|
|
|
"height", GST_PROPS_INT_RANGE (0, G_MAXINT),
|
|
|
|
"framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT)
|
2002-02-03 16:30:31 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
plugin_init (GModule *module, GstPlugin *plugin)
|
|
|
|
{
|
|
|
|
GstElementFactory *enc, *dec;
|
|
|
|
GstCaps *raw_caps, *tarkin_caps;
|
|
|
|
|
2003-07-06 20:49:52 +00:00
|
|
|
gst_plugin_set_longname (plugin, "The OGG Tarkin Codec");
|
2002-02-03 16:30:31 +00:00
|
|
|
|
|
|
|
/* create an elementfactory for the tarkinenc element */
|
2002-04-11 20:42:26 +00:00
|
|
|
enc = gst_element_factory_new ("tarkinenc", GST_TYPE_TARKINENC,
|
2002-02-03 16:30:31 +00:00
|
|
|
&tarkinenc_details);
|
|
|
|
g_return_val_if_fail (enc != NULL, FALSE);
|
|
|
|
|
|
|
|
raw_caps = raw_caps_factory ();
|
|
|
|
tarkin_caps = tarkin_caps_factory ();
|
|
|
|
|
|
|
|
/* register sink pads */
|
2002-04-11 20:42:26 +00:00
|
|
|
enc_sink_template = gst_pad_template_new ("sink",
|
2002-02-03 16:30:31 +00:00
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
raw_caps,
|
|
|
|
NULL);
|
2002-04-11 20:42:26 +00:00
|
|
|
gst_element_factory_add_pad_template (enc, enc_sink_template);
|
2002-02-03 16:30:31 +00:00
|
|
|
|
|
|
|
/* register src pads */
|
2002-04-11 20:42:26 +00:00
|
|
|
enc_src_template = gst_pad_template_new ("src",
|
2002-02-03 16:30:31 +00:00
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
tarkin_caps,
|
|
|
|
NULL);
|
2002-04-11 20:42:26 +00:00
|
|
|
gst_element_factory_add_pad_template (enc, enc_src_template);
|
2002-02-03 16:30:31 +00:00
|
|
|
|
|
|
|
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (enc));
|
|
|
|
|
|
|
|
/* create an elementfactory for the tarkindec element */
|
2002-04-11 20:42:26 +00:00
|
|
|
dec = gst_element_factory_new ("tarkindec", GST_TYPE_TARKINDEC,
|
2002-02-03 16:30:31 +00:00
|
|
|
&tarkindec_details);
|
|
|
|
g_return_val_if_fail (dec != NULL, FALSE);
|
|
|
|
|
|
|
|
raw_caps = raw_caps_factory ();
|
|
|
|
tarkin_caps = tarkin_caps_factory ();
|
|
|
|
|
|
|
|
/* register sink pads */
|
2002-04-11 20:42:26 +00:00
|
|
|
dec_sink_template = gst_pad_template_new ("sink",
|
2002-02-03 16:30:31 +00:00
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
tarkin_caps,
|
|
|
|
NULL);
|
2002-04-11 20:42:26 +00:00
|
|
|
gst_element_factory_add_pad_template (dec, dec_sink_template);
|
2002-02-03 16:30:31 +00:00
|
|
|
|
|
|
|
/* register src pads */
|
2002-04-11 20:42:26 +00:00
|
|
|
dec_src_template = gst_pad_template_new ("src",
|
2002-02-03 16:30:31 +00:00
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
raw_caps,
|
|
|
|
NULL);
|
2002-04-11 20:42:26 +00:00
|
|
|
gst_element_factory_add_pad_template (dec, dec_src_template);
|
2002-02-03 16:30:31 +00:00
|
|
|
|
|
|
|
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (dec));
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
GstPluginDesc plugin_desc = {
|
|
|
|
GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
|
|
|
"tarkin",
|
|
|
|
plugin_init
|
|
|
|
};
|