2002-03-20 21:45:03 +00:00
|
|
|
/* GStreamer
|
2001-12-23 15:24:07 +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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GST_JPEGENC_H__
|
|
|
|
#define __GST_JPEGENC_H__
|
|
|
|
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
2010-04-27 10:19:22 +00:00
|
|
|
#include <gst/video/video.h>
|
2002-04-11 20:42:25 +00:00
|
|
|
/* this is a hack hack hack to get around jpeglib header bugs... */
|
|
|
|
#ifdef HAVE_STDLIB_H
|
|
|
|
# undef HAVE_STDLIB_H
|
|
|
|
#endif
|
2009-10-07 11:03:20 +00:00
|
|
|
#include <stdio.h>
|
2001-12-23 15:24:07 +00:00
|
|
|
#include <jpeglib.h>
|
|
|
|
|
2006-03-03 15:50:40 +00:00
|
|
|
G_BEGIN_DECLS
|
2001-12-23 15:24:07 +00:00
|
|
|
#define GST_TYPE_JPEGENC \
|
|
|
|
(gst_jpegenc_get_type())
|
|
|
|
#define GST_JPEGENC(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_JPEGENC,GstJpegEnc))
|
|
|
|
#define GST_JPEGENC_CLASS(klass) \
|
2006-06-01 21:07:26 +00:00
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_JPEGENC,GstJpegEncClass))
|
2001-12-23 15:24:07 +00:00
|
|
|
#define GST_IS_JPEGENC(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_JPEGENC))
|
2006-06-01 21:07:26 +00:00
|
|
|
#define GST_IS_JPEGENC_CLASS(klass) \
|
2001-12-23 15:24:07 +00:00
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_JPEGENC))
|
2010-04-27 10:19:22 +00:00
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
typedef struct _GstJpegEnc GstJpegEnc;
|
|
|
|
typedef struct _GstJpegEncClass GstJpegEncClass;
|
2001-12-23 15:24:07 +00:00
|
|
|
|
2010-01-22 01:22:38 +00:00
|
|
|
struct _GstJpegEnc
|
|
|
|
{
|
2004-03-15 16:32:54 +00:00
|
|
|
GstElement element;
|
2001-12-23 15:24:07 +00:00
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
/* pads */
|
2010-01-22 01:22:38 +00:00
|
|
|
GstPad *sinkpad, *srcpad;
|
2001-12-23 15:24:07 +00:00
|
|
|
|
2010-04-27 10:19:22 +00:00
|
|
|
/* stream/image properties */
|
2011-08-17 13:39:27 +00:00
|
|
|
GstVideoInfo info;
|
2010-04-27 10:19:22 +00:00
|
|
|
gint channels;
|
2011-08-17 13:39:27 +00:00
|
|
|
|
2010-04-27 10:19:22 +00:00
|
|
|
/* standard video_format indexed */
|
2011-08-17 13:39:27 +00:00
|
|
|
gint inc[GST_VIDEO_MAX_COMPONENTS];
|
|
|
|
gint cwidth[GST_VIDEO_MAX_COMPONENTS];
|
|
|
|
gint cheight[GST_VIDEO_MAX_COMPONENTS];
|
|
|
|
gint h_samp[GST_VIDEO_MAX_COMPONENTS];
|
|
|
|
gint v_samp[GST_VIDEO_MAX_COMPONENTS];
|
2010-04-27 10:19:22 +00:00
|
|
|
gint h_max_samp;
|
|
|
|
gint v_max_samp;
|
|
|
|
gboolean planar;
|
2004-03-15 16:32:54 +00:00
|
|
|
/* the video buffer */
|
|
|
|
gint bufsize;
|
|
|
|
/* the jpeg line buffer */
|
|
|
|
guchar **line[3];
|
2010-04-27 10:19:22 +00:00
|
|
|
/* indirect encoding line buffers */
|
|
|
|
guchar *row[3][4 * DCTSIZE];
|
2001-12-23 15:24:07 +00:00
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
struct jpeg_compress_struct cinfo;
|
|
|
|
struct jpeg_error_mgr jerr;
|
|
|
|
struct jpeg_destination_mgr jdest;
|
2001-12-23 15:24:07 +00:00
|
|
|
|
2009-07-21 07:04:36 +00:00
|
|
|
/* properties */
|
|
|
|
gint quality;
|
|
|
|
gint smoothing;
|
|
|
|
gint idct_method;
|
2010-01-22 01:22:38 +00:00
|
|
|
|
|
|
|
/* cached return state for any problems that may occur in callbacks */
|
|
|
|
GstFlowReturn last_ret;
|
|
|
|
|
2011-08-17 13:39:27 +00:00
|
|
|
GstMemory *output_mem;
|
2012-01-24 13:38:58 +00:00
|
|
|
GstMapInfo output_map;
|
2004-03-15 16:32:54 +00:00
|
|
|
};
|
2001-12-23 15:24:07 +00:00
|
|
|
|
2010-01-22 01:22:38 +00:00
|
|
|
struct _GstJpegEncClass
|
|
|
|
{
|
2004-03-15 16:32:54 +00:00
|
|
|
GstElementClass parent_class;
|
|
|
|
};
|
2001-12-23 15:24:07 +00:00
|
|
|
|
2010-01-22 01:22:38 +00:00
|
|
|
GType gst_jpegenc_get_type (void);
|
2001-12-23 15:24:07 +00:00
|
|
|
|
2006-03-03 15:50:40 +00:00
|
|
|
G_END_DECLS
|
2004-03-15 16:32:54 +00:00
|
|
|
#endif /* __GST_JPEGENC_H__ */
|