2 * Copyright (C) 2004 Wim Taymans <wim@fluendo.com>
3 * Copyright (c) 2012 Collabora Ltd.
4 * Author : Edward Hervey <edward@collabora.com>
5 * Author : Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
23 #ifndef __GST_THEORAENC_H__
24 #define __GST_THEORAENC_H__
27 #include <gst/base/gstadapter.h>
28 #include <gst/video/gstvideoencoder.h>
29 #include <theora/theoraenc.h>
33 #define GST_TYPE_THEORA_ENC \
34 (gst_theora_enc_get_type())
35 #define GST_THEORA_ENC(obj) \
36 (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_THEORA_ENC,GstTheoraEnc))
37 #define GST_THEORA_ENC_CLASS(klass) \
38 (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_THEORA_ENC,GstTheoraEncClass))
39 #define GST_IS_THEORA_ENC(obj) \
40 (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_THEORA_ENC))
41 #define GST_IS_THEORA_ENC_CLASS(klass) \
42 (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_THEORA_ENC))
44 typedef struct _GstTheoraEnc GstTheoraEnc;
45 typedef struct _GstTheoraEncClass GstTheoraEncClass;
48 * GstTheoraEncMultipassMode:
49 * @MULTIPASS_MODE_SINGLE_PASS: Single pass encoding
50 * @MULTIPASS_MODE_FIRST_PASS: First pass of two pass encoding
51 * @MULTIPASS_MODE_SECOND_PASS: Second pass of two pass encoding
56 MULTIPASS_MODE_SINGLE_PASS,
57 MULTIPASS_MODE_FIRST_PASS,
58 MULTIPASS_MODE_SECOND_PASS
59 } GstTheoraEncMultipassMode;
64 * Opaque data structure.
68 GstVideoEncoder element;
77 gint video_bitrate; /* bitrate target for Theora video */
78 gboolean bitrate_changed;
79 gint video_quality; /* Theora quality selector 0 = low, 63 = high */
80 gboolean quality_changed;
81 gboolean keyframe_auto;
85 GstVideoCodecState *input_state;
92 guint64 granulepos_offset;
93 guint64 timestamp_offset;
97 gboolean vp3_compatible;
99 gboolean cap_overflow;
100 gboolean cap_underflow;
103 GstTheoraEncMultipassMode multipass_mode;
104 GIOChannel *multipass_cache_fd;
105 GstAdapter *multipass_cache_adapter;
106 gchar *multipass_cache_file;
109 struct _GstTheoraEncClass
111 GstVideoEncoderClass parent_class;
114 GType gst_theora_enc_get_type (void);
118 #endif /* __GST_THEORAENC_H__ */