2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3 * Copyright (C) 2012 Collabora Ltd.
4 * Author : Edward Hervey <edward@collabora.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
23 #ifndef __GST_JPEGENC_H__
24 #define __GST_JPEGENC_H__
28 #include <gst/video/video.h>
29 #include <gst/video/gstvideoencoder.h>
30 /* this is a hack hack hack to get around jpeglib header bugs... */
38 #define GST_TYPE_JPEGENC \
39 (gst_jpegenc_get_type())
40 #define GST_JPEGENC(obj) \
41 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_JPEGENC,GstJpegEnc))
42 #define GST_JPEGENC_CLASS(klass) \
43 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_JPEGENC,GstJpegEncClass))
44 #define GST_IS_JPEGENC(obj) \
45 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_JPEGENC))
46 #define GST_IS_JPEGENC_CLASS(klass) \
47 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_JPEGENC))
49 typedef struct _GstJpegEnc GstJpegEnc;
50 typedef struct _GstJpegEncClass GstJpegEncClass;
54 GstVideoEncoder encoder;
56 GstVideoCodecState *input_state;
57 GstVideoFrame current_vframe;
58 GstVideoCodecFrame *current_frame;
61 gboolean input_caps_changed;
65 gint inc[GST_VIDEO_MAX_COMPONENTS];
66 gint cwidth[GST_VIDEO_MAX_COMPONENTS];
67 gint cheight[GST_VIDEO_MAX_COMPONENTS];
68 gint h_samp[GST_VIDEO_MAX_COMPONENTS];
69 gint v_samp[GST_VIDEO_MAX_COMPONENTS];
74 /* the video buffer */
76 /* the jpeg line buffer */
78 /* indirect encoding line buffers */
79 guchar *row[3][4 * DCTSIZE];
81 struct jpeg_compress_struct cinfo;
82 struct jpeg_error_mgr jerr;
83 struct jpeg_destination_mgr jdest;
91 GstMemory *output_mem;
92 GstMapInfo output_map;
95 struct _GstJpegEncClass
97 GstVideoEncoderClass parent_class;
100 GType gst_jpegenc_get_type (void);
103 #endif /* __GST_JPEGENC_H__ */