|
Packit |
971217 |
/* GStreamer
|
|
Packit |
971217 |
* Copyright (C) 2004 Wim Taymans <wim@fluendo.com>
|
|
Packit |
971217 |
* Copyright (c) 2012 Collabora Ltd.
|
|
Packit |
971217 |
* Author : Edward Hervey <edward@collabora.com>
|
|
Packit |
971217 |
* Author : Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* This library is free software; you can redistribute it and/or
|
|
Packit |
971217 |
* modify it under the terms of the GNU Library General Public
|
|
Packit |
971217 |
* License as published by the Free Software Foundation; either
|
|
Packit |
971217 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
971217 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
971217 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
971217 |
* Library General Public License for more details.
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* You should have received a copy of the GNU Library General Public
|
|
Packit |
971217 |
* License along with this library; if not, write to the
|
|
Packit |
971217 |
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
Packit |
971217 |
* Boston, MA 02110-1301, USA.
|
|
Packit |
971217 |
*/
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#ifndef __GST_THEORAENC_H__
|
|
Packit |
971217 |
#define __GST_THEORAENC_H__
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#include <gst/gst.h>
|
|
Packit |
971217 |
#include <gst/base/gstadapter.h>
|
|
Packit |
971217 |
#include <gst/video/gstvideoencoder.h>
|
|
Packit |
971217 |
#include <theora/theoraenc.h>
|
|
Packit |
971217 |
|
|
Packit |
971217 |
G_BEGIN_DECLS
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#define GST_TYPE_THEORA_ENC \
|
|
Packit |
971217 |
(gst_theora_enc_get_type())
|
|
Packit |
971217 |
#define GST_THEORA_ENC(obj) \
|
|
Packit |
971217 |
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_THEORA_ENC,GstTheoraEnc))
|
|
Packit |
971217 |
#define GST_THEORA_ENC_CLASS(klass) \
|
|
Packit |
971217 |
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_THEORA_ENC,GstTheoraEncClass))
|
|
Packit |
971217 |
#define GST_IS_THEORA_ENC(obj) \
|
|
Packit |
971217 |
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_THEORA_ENC))
|
|
Packit |
971217 |
#define GST_IS_THEORA_ENC_CLASS(klass) \
|
|
Packit |
971217 |
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_THEORA_ENC))
|
|
Packit |
971217 |
|
|
Packit |
971217 |
typedef struct _GstTheoraEnc GstTheoraEnc;
|
|
Packit |
971217 |
typedef struct _GstTheoraEncClass GstTheoraEncClass;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/**
|
|
Packit |
971217 |
* GstTheoraEncMultipassMode:
|
|
Packit |
971217 |
* @MULTIPASS_MODE_SINGLE_PASS: Single pass encoding
|
|
Packit |
971217 |
* @MULTIPASS_MODE_FIRST_PASS: First pass of two pass encoding
|
|
Packit |
971217 |
* @MULTIPASS_MODE_SECOND_PASS: Second pass of two pass encoding
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
*/
|
|
Packit |
971217 |
typedef enum
|
|
Packit |
971217 |
{
|
|
Packit |
971217 |
MULTIPASS_MODE_SINGLE_PASS,
|
|
Packit |
971217 |
MULTIPASS_MODE_FIRST_PASS,
|
|
Packit |
971217 |
MULTIPASS_MODE_SECOND_PASS
|
|
Packit |
971217 |
} GstTheoraEncMultipassMode;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
/**
|
|
Packit |
971217 |
* GstTheoraEnc:
|
|
Packit |
971217 |
*
|
|
Packit |
971217 |
* Opaque data structure.
|
|
Packit |
971217 |
*/
|
|
Packit |
971217 |
struct _GstTheoraEnc
|
|
Packit |
971217 |
{
|
|
Packit |
971217 |
GstVideoEncoder element;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
ogg_stream_state to;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
th_enc_ctx *encoder;
|
|
Packit |
971217 |
th_info info;
|
|
Packit |
971217 |
th_comment comment;
|
|
Packit |
971217 |
gboolean initialised;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
gint video_bitrate; /* bitrate target for Theora video */
|
|
Packit |
971217 |
gboolean bitrate_changed;
|
|
Packit |
971217 |
gint video_quality; /* Theora quality selector 0 = low, 63 = high */
|
|
Packit |
971217 |
gboolean quality_changed;
|
|
Packit |
971217 |
gboolean keyframe_auto;
|
|
Packit |
971217 |
gint keyframe_freq;
|
|
Packit |
971217 |
gint keyframe_force;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GstVideoCodecState *input_state;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
gint width, height;
|
|
Packit |
971217 |
gint fps_n, fps_d;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
guint packetno;
|
|
Packit |
971217 |
guint64 bytes_out;
|
|
Packit |
971217 |
guint64 granulepos_offset;
|
|
Packit |
971217 |
guint64 timestamp_offset;
|
|
Packit |
971217 |
guint64 pfn_offset;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
gint speed_level;
|
|
Packit |
971217 |
gboolean vp3_compatible;
|
|
Packit |
971217 |
gboolean drop_frames;
|
|
Packit |
971217 |
gboolean cap_overflow;
|
|
Packit |
971217 |
gboolean cap_underflow;
|
|
Packit |
971217 |
int rate_buffer;
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GstTheoraEncMultipassMode multipass_mode;
|
|
Packit |
971217 |
GIOChannel *multipass_cache_fd;
|
|
Packit |
971217 |
GstAdapter *multipass_cache_adapter;
|
|
Packit |
971217 |
gchar *multipass_cache_file;
|
|
Packit |
971217 |
};
|
|
Packit |
971217 |
|
|
Packit |
971217 |
struct _GstTheoraEncClass
|
|
Packit |
971217 |
{
|
|
Packit |
971217 |
GstVideoEncoderClass parent_class;
|
|
Packit |
971217 |
};
|
|
Packit |
971217 |
|
|
Packit |
971217 |
GType gst_theora_enc_get_type (void);
|
|
Packit |
971217 |
|
|
Packit |
971217 |
G_END_DECLS
|
|
Packit |
971217 |
|
|
Packit |
971217 |
#endif /* __GST_THEORAENC_H__ */
|
|
Packit |
971217 |
|