summaryrefslogtreecommitdiffstats
path: root/ext/jpeg/gstjpeg.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2004-10-04 16:53:48 +0000
committerWim Taymans <wim.taymans@gmail.com>2004-10-04 16:53:48 +0000
commitb90716dd184e3a270fc31ab39307548fe16337cc (patch)
treee204108290be35fe11b3ecde34ebbc60396cdb5a /ext/jpeg/gstjpeg.c
parentd2ba80e45ee0a5b90aa2be7571efb92a560bd1c0 (diff)
ext/jpeg/: Updated smoke, new bitstream, allows embedding in ogg.
Original commit message from CVS: * ext/jpeg/gstjpeg.c: (smoke_type_find), (plugin_init): * ext/jpeg/gstsmokedec.c: (gst_smokedec_init), (gst_smokedec_chain): * ext/jpeg/gstsmokedec.h: * ext/jpeg/gstsmokeenc.c: (gst_smokeenc_class_init), (gst_smokeenc_init), (gst_smokeenc_resync), (gst_smokeenc_chain): * ext/jpeg/gstsmokeenc.h: * ext/jpeg/smokecodec.c: (smokecodec_encode_new), (smokecodec_decode_new), (smokecodec_info_free), (smokecodec_set_quality), (smokecodec_get_quality), (smokecodec_set_threshold), (smokecodec_get_threshold), (smokecodec_set_bitrate), (smokecodec_get_bitrate), (find_best_size), (abs_diff), (put), (smokecodec_encode_id), (smokecodec_encode), (smokecodec_parse_id), (smokecodec_parse_header), (smokecodec_decode): * ext/jpeg/smokecodec.h: * ext/jpeg/smokeformat.h: Updated smoke, new bitstream, allows embedding in ogg.
Diffstat (limited to 'ext/jpeg/gstjpeg.c')
-rw-r--r--ext/jpeg/gstjpeg.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/ext/jpeg/gstjpeg.c b/ext/jpeg/gstjpeg.c
index 58749534..63c54637 100644
--- a/ext/jpeg/gstjpeg.c
+++ b/ext/jpeg/gstjpeg.c
@@ -19,12 +19,30 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+#include <string.h>
#include "gstjpegdec.h"
#include "gstjpegenc.h"
#include "gstsmokeenc.h"
#include "gstsmokedec.h"
+static GstStaticCaps smoke_caps = GST_STATIC_CAPS ("video/x-smoke");
+
+#define SMOKE_CAPS (gst_static_caps_get(&smoke_caps))
+static void
+smoke_type_find (GstTypeFind * tf, gpointer private)
+{
+ guint8 *data = gst_type_find_peek (tf, 0, 6);
+
+ if (data) {
+ if (data[0] != 0x80)
+ return;
+ if (memcmp (&data[1], "smoke", 5) != 0)
+ return;
+ gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, SMOKE_CAPS);
+ }
+}
+
static gboolean
plugin_init (GstPlugin * plugin)
{
@@ -44,6 +62,10 @@ plugin_init (GstPlugin * plugin)
GST_TYPE_SMOKEDEC))
return FALSE;
+ if (!gst_type_find_register (plugin, "video/x-smoke", GST_RANK_PRIMARY,
+ smoke_type_find, NULL, SMOKE_CAPS, NULL))
+ return FALSE;
+
return TRUE;
}