Commit 7cc1cf7d authored by Tim-Philipp Müller's avatar Tim-Philipp Müller

Port jpegdec to 0.9; handles 'progressive loading' now, ie. input does no...

Port jpegdec to 0.9; handles 'progressive loading' now, ie. input does no longer need to be one single buffer.

Original commit message from CVS:
* configure.ac:
* ext/Makefile.am:
* ext/jpeg/Makefile.am:
* ext/jpeg/gstjpeg.c: (plugin_init):
* ext/jpeg/gstjpegdec.c: (gst_jpeg_dec_get_type),
(gst_jpeg_dec_finalize), (gst_jpeg_dec_base_init),
(gst_jpeg_dec_class_init), (gst_jpeg_dec_fill_input_buffer),
(gst_jpeg_dec_init_source), (gst_jpeg_dec_skip_input_data),
(gst_jpeg_dec_resync_to_restart), (gst_jpeg_dec_term_source),
(gst_jpeg_dec_my_output_message), (gst_jpeg_dec_my_emit_message),
(gst_jpeg_dec_my_error_exit), (gst_jpeg_dec_init),
(is_jpeg_start_marker), (is_jpeg_end_marker),
(gst_jpeg_dec_find_jpeg_header), (gst_jpeg_dec_ensure_header),
(gst_jpeg_dec_have_end_marker),
(gst_jpeg_dec_parse_tag_has_entropy_segment),
(gst_jpeg_dec_parse_image_data), (gst_jpeg_dec_chain),
(gst_jpeg_dec_change_state):
* ext/jpeg/gstjpegdec.h:
Port jpegdec to 0.9; handles 'progressive loading' now, ie. input does
no longer need to be one single buffer.
parent 284327da
2005-08-08 Tim-Philipp Müller <tim at centricular dot net>
* configure.ac:
* ext/Makefile.am:
* ext/jpeg/Makefile.am:
* ext/jpeg/gstjpeg.c: (plugin_init):
* ext/jpeg/gstjpegdec.c: (gst_jpeg_dec_get_type),
(gst_jpeg_dec_finalize), (gst_jpeg_dec_base_init),
(gst_jpeg_dec_class_init), (gst_jpeg_dec_fill_input_buffer),
(gst_jpeg_dec_init_source), (gst_jpeg_dec_skip_input_data),
(gst_jpeg_dec_resync_to_restart), (gst_jpeg_dec_term_source),
(gst_jpeg_dec_my_output_message), (gst_jpeg_dec_my_emit_message),
(gst_jpeg_dec_my_error_exit), (gst_jpeg_dec_init),
(is_jpeg_start_marker), (is_jpeg_end_marker),
(gst_jpeg_dec_find_jpeg_header), (gst_jpeg_dec_ensure_header),
(gst_jpeg_dec_have_end_marker),
(gst_jpeg_dec_parse_tag_has_entropy_segment),
(gst_jpeg_dec_parse_image_data), (gst_jpeg_dec_chain),
(gst_jpeg_dec_change_state):
* ext/jpeg/gstjpegdec.h:
Port jpegdec to 0.9; handles 'progressive loading' now, ie. input does
no longer need to be one single buffer.
2005-08-04 Andy Wingo <wingo@pobox.com>
* sys/oss/gstossaudio.c (plugin_init): Second-class citizen.
......
common @ 856fbbfa
Subproject commit 694de4dbf4827f372321f0634643a254d7edd986
Subproject commit 856fbbfa88621ab67df141ead8d4d3df32c5c176
......@@ -447,6 +447,27 @@ GST_CHECK_FEATURE(SIDPLAY, [sidplay plug-in], sidplay, [
GST_PATH_SIDPLAY()
])
dnl *** jpeg ***
dnl FIXME: we could use header checks here as well IMO
translit(dnm, m, l) AM_CONDITIONAL(USE_JPEG, true)
GST_CHECK_FEATURE(JPEG, [jpeg], jpegenc jpegdec, [
AC_ARG_WITH(jpeg-mmx,
[ --with-jpeg-mmx, path to MMX'ified JPEG library])
OLD_LIBS="$LIBS"
if test x$with_jpeg_mmx != x; then
LIBS="$LIBS -L$with_jpeg_mmx"
fi
AC_CHECK_LIB(jpeg-mmx, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
JPEG_LIBS="$LIBS -ljpeg-mmx"
LIBS="$OLD_LIBS"
if test x$HAVE_JPEG != xyes; then
AC_CHECK_LIB(jpeg, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
JPEG_LIBS="-ljpeg"
fi
AC_SUBST(JPEG_LIBS)
])
dnl *** mad ***
dnl FIXME: we could use header checks here as well IMO
translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true)
......@@ -596,6 +617,7 @@ gst/silence/Makefile
gst/udp/Makefile
gst/videobox/Makefile
gst/videofilter/Makefile
ext/jpeg/Makefile
gst/wavparse/Makefile
gst-libs/Makefile
gst-libs/gst/Makefile
......
......@@ -160,11 +160,11 @@ HERMES_DIR=
JACK_DIR=
# endif
# if USE_JPEG
# JPEG_DIR=jpeg
# else
if USE_JPEG
JPEG_DIR=jpeg
else
JPEG_DIR=
# endif
endif
# if USE_LADSPA
# LADSPA_DIR=ladspa
......
......@@ -2,8 +2,14 @@
plugin_LTLIBRARIES = libgstjpeg.la
libgstjpeg_la_SOURCES = \
gstjpeg.c gstjpegdec.c gstjpegenc.c \
gstsmokeenc.c gstsmokedec.c smokecodec.c
gstjpeg.c \
gstjpegdec.c
# gstjpegenc.c
# gstsmokeenc.c
# gstsmokedec.c
# smokecodec.c
libgstjpeg_la_CFLAGS = $(GST_CFLAGS)
libgstjpeg_la_LIBADD = $(JPEG_LIBS)
libgstjpeg_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
......
......@@ -19,9 +19,14 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include <gst/gst.h>
#include "gstjpegdec.h"
#if 0
#include "gstjpegenc.h"
#include "gstsmokeenc.h"
#include "gstsmokedec.h"
......@@ -42,18 +47,22 @@ smoke_type_find (GstTypeFind * tf, gpointer private)
gst_type_find_suggest (tf, GST_TYPE_FIND_MAXIMUM, SMOKE_CAPS);
}
}
#endif
static gboolean
plugin_init (GstPlugin * plugin)
{
#if 0
if (!gst_element_register (plugin, "jpegenc", GST_RANK_NONE,
GST_TYPE_JPEGENC))
return FALSE;
#endif
if (!gst_element_register (plugin, "jpegdec", GST_RANK_PRIMARY,
GST_TYPE_JPEGDEC))
GST_TYPE_JPEG_DEC))
return FALSE;
#if 0
if (!gst_element_register (plugin, "smokeenc", GST_RANK_PRIMARY,
GST_TYPE_SMOKEENC))
return FALSE;
......@@ -65,6 +74,7 @@ plugin_init (GstPlugin * plugin)
if (!gst_type_find_register (plugin, "video/x-smoke", GST_RANK_PRIMARY,
smoke_type_find, NULL, SMOKE_CAPS, NULL))
return FALSE;
#endif
return TRUE;
}
......
This diff is collapsed.
......@@ -18,73 +18,81 @@
*/
#ifndef __GST_JPEGDEC_H__
#define __GST_JPEGDEC_H__
#ifndef __GST_JPEG_DEC_H__
#define __GST_JPEG_DEC_H__
#include <gst/gst.h>
#include <setjmp.h>
#include <gst/gstelement.h>
/* this is a hack hack hack to get around jpeglib header bugs... */
#ifdef HAVE_STDLIB_H
# undef HAVE_STDLIB_H
#endif
#include <jpeglib.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GST_TYPE_JPEGDEC \
(gst_jpegdec_get_type())
#define GST_JPEGDEC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_JPEGDEC,GstJpegDec))
#define GST_JPEGDEC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_JPEGDEC,GstJpegDec))
#define GST_IS_JPEGDEC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_JPEGDEC))
#define GST_IS_JPEGDEC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_JPEGDEC))
G_BEGIN_DECLS
#define GST_TYPE_JPEG_DEC \
(gst_jpeg_dec_get_type())
#define GST_JPEG_DEC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_JPEG_DEC,GstJpegDec))
#define GST_JPEG_DEC_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_JPEG_DEC,GstJpegDec))
#define GST_IS_JPEG_DEC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_JPEG_DEC))
#define GST_IS_JPEG_DEC_CLASS(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_JPEG_DEC))
typedef struct _GstJpegDec GstJpegDec;
typedef struct _GstJpegDecClass GstJpegDecClass;
struct GstJpegDecErrorMgr {
struct jpeg_error_mgr pub; /* public fields */
jmp_buf setjmp_buffer;
};
typedef struct _GstJpegDec GstJpegDec;
typedef struct _GstJpegDecClass GstJpegDecClass;
struct GstJpegDecSourceMgr {
struct jpeg_source_mgr pub; /* public fields */
GstJpegDec *dec;
};
/* Can't use GstBaseTransform, because GstBaseTransform
* doesn't handle the N buffers in, 1 buffer out case,
* but only the 1-in 1-out case */
struct _GstJpegDec {
GstElement element;
/* pads */
GstPad *sinkpad,*srcpad;
GstPad *sinkpad;
GstPad *srcpad;
GstBuffer *tempbuf;
int parse_state;
/* the timestamp of the next frame */
guint64 next_time;
/* the interval between frames */
guint64 time_interval;
guint64 next_ts;
/* video state */
gint format;
gint width;
gint height;
gdouble fps;
/* the size of the output buffer */
gint outsize;
guint width;
guint height;
gdouble fps;
/* the jpeg line buffer */
guchar **line[3];
struct jpeg_decompress_struct cinfo;
struct jpeg_error_mgr jerr;
struct jpeg_source_mgr jsrc;
struct GstJpegDecErrorMgr jerr;
struct GstJpegDecSourceMgr jsrc;
};
struct _GstJpegDecClass {
GstElementClass parent_class;
GstElementClass parent_class;
};
GType gst_jpegdec_get_type(void);
GType gst_jpeg_dec_get_type(void);
#ifdef __cplusplus
}
#endif /* __cplusplus */
G_END_DECLS
#endif /* __GST_JPEGDEC_H__ */
#endif /* __GST_JPEG_DEC_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment