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>
|
2012-04-06 10:13:24 +00:00
|
|
|
* Copyright (C) 2012 Collabora Ltd.
|
|
|
|
* Author : Edward Hervey <edward@collabora.com>
|
2001-12-23 15:24:07 +00:00
|
|
|
*
|
|
|
|
* 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
|
2012-11-04 00:07:18 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2001-12-23 15:24:07 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#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>
|
2012-04-06 10:13:24 +00:00
|
|
|
#include <gst/video/gstvideoencoder.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
|
|
|
|
{
|
2012-04-06 10:13:24 +00:00
|
|
|
GstVideoEncoder encoder;
|
2001-12-23 15:24:07 +00:00
|
|
|
|
2012-04-06 10:13:24 +00:00
|
|
|
GstVideoCodecState *input_state;
|
2012-05-03 07:32:50 +00:00
|
|
|
GstVideoFrame current_vframe;
|
2012-04-06 10:13:24 +00:00
|
|
|
GstVideoCodecFrame *current_frame;
|
2012-12-20 14:55:02 +00:00
|
|
|
GstFlowReturn res;
|
2001-12-23 15:24:07 +00:00
|
|
|
|
2017-11-24 05:53:40 +00:00
|
|
|
gboolean input_caps_changed;
|
|
|
|
|
2012-04-06 10:13:24 +00:00
|
|
|
guint channels;
|
2011-08-17 13:39:27 +00:00
|
|
|
|
2012-05-03 07:32:50 +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;
|
2013-02-13 11:32:10 +00:00
|
|
|
gint sof_marker;
|
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;
|
2015-09-23 08:01:32 +00:00
|
|
|
gboolean snapshot;
|
2010-01-22 01:22:38 +00:00
|
|
|
|
2012-05-03 07:32:50 +00:00
|
|
|
GstMemory *output_mem;
|
|
|
|
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
|
|
|
|
{
|
2012-04-06 10:13:24 +00:00
|
|
|
GstVideoEncoderClass parent_class;
|
2004-03-15 16:32:54 +00:00
|
|
|
};
|
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__ */
|