2001-12-23 14:15:30 +00:00
|
|
|
/* GStreamer
|
|
|
|
* 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
|
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 14:15:30 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
#ifndef __GST_FLAC_ENC_H__
|
|
|
|
#define __GST_FLAC_ENC_H__
|
2001-12-23 14:15:30 +00:00
|
|
|
|
|
|
|
#include <gst/gst.h>
|
2011-09-28 14:09:58 +00:00
|
|
|
#include <gst/audio/gstaudioencoder.h>
|
2001-12-23 14:15:30 +00:00
|
|
|
|
|
|
|
#include <FLAC/all.h>
|
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
#define GST_TYPE_FLAC_ENC (gst_flac_enc_get_type())
|
|
|
|
#define GST_FLAC_ENC(obj) G_TYPE_CHECK_INSTANCE_CAST(obj, GST_TYPE_FLAC_ENC, GstFlacEnc)
|
2006-06-01 21:07:26 +00:00
|
|
|
#define GST_FLAC_ENC_CLASS(klass) G_TYPE_CHECK_CLASS_CAST(klass, GST_TYPE_FLAC_ENC, GstFlacEncClass)
|
2005-12-09 19:51:03 +00:00
|
|
|
#define GST_IS_FLAC_ENC(obj) G_TYPE_CHECK_INSTANCE_TYPE(obj, GST_TYPE_FLAC_ENC)
|
2006-06-01 21:07:26 +00:00
|
|
|
#define GST_IS_FLAC_ENC_CLASS(klass) G_TYPE_CHECK_CLASS_TYPE(klass, GST_TYPE_FLAC_ENC)
|
2001-12-23 14:15:30 +00:00
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
typedef struct _GstFlacEnc GstFlacEnc;
|
|
|
|
typedef struct _GstFlacEncClass GstFlacEncClass;
|
2001-12-23 14:15:30 +00:00
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
struct _GstFlacEnc {
|
2011-09-28 14:09:58 +00:00
|
|
|
GstAudioEncoder element;
|
2001-12-23 14:15:30 +00:00
|
|
|
|
2008-08-06 15:34:55 +00:00
|
|
|
/* < private > */
|
|
|
|
|
2007-09-26 13:19:17 +00:00
|
|
|
GstFlowReturn last_flow; /* save flow from last push so we can pass the
|
|
|
|
* correct flow return upstream in case the push
|
|
|
|
* fails for some reason */
|
|
|
|
|
2005-12-06 19:44:58 +00:00
|
|
|
guint64 offset;
|
|
|
|
gint quality;
|
|
|
|
gboolean stopped;
|
2009-07-16 18:44:40 +00:00
|
|
|
guint padding;
|
2010-01-06 16:06:53 +00:00
|
|
|
gint seekpoints;
|
2001-12-23 14:15:30 +00:00
|
|
|
|
Add support for flac >= 1.1.3 which changed the API. Fixes bug #385887.
Original commit message from CVS:
Patch by: Josh Coalson <xflac at yahoo dot com>,
updated by Alexis Ballier <aballier at gentoo dot org>:
* configure.ac:
* ext/flac/gstflacdec.c: (gst_flac_dec_reset_decoders),
(gst_flac_dec_setup_seekable_decoder),
(gst_flac_dec_setup_stream_decoder), (gst_flac_dec_seek),
(gst_flac_dec_tell), (gst_flac_dec_length), (gst_flac_dec_eof),
(gst_flac_dec_read_seekable), (gst_flac_dec_read_stream):
* ext/flac/gstflacdec.h:
* ext/flac/gstflacenc.c: (gst_flac_enc_init),
(gst_flac_enc_finalize), (gst_flac_enc_set_metadata),
(gst_flac_enc_sink_setcaps), (gst_flac_enc_update_quality),
(gst_flac_enc_seek_callback), (gst_flac_enc_write_callback),
(gst_flac_enc_tell_callback), (gst_flac_enc_sink_event),
(gst_flac_enc_chain), (gst_flac_enc_set_property),
(gst_flac_enc_get_property), (gst_flac_enc_change_state):
* ext/flac/gstflacenc.h:
Add support for flac >= 1.1.3 which changed the API. Fixes bug #385887.
2007-06-10 10:53:26 +00:00
|
|
|
FLAC__StreamEncoder *encoder;
|
2011-10-30 19:30:14 +00:00
|
|
|
|
2004-03-15 16:32:54 +00:00
|
|
|
FLAC__StreamMetadata **meta;
|
2003-11-28 13:04:21 +00:00
|
|
|
|
2005-12-06 19:44:58 +00:00
|
|
|
GstTagList * tags;
|
2012-07-26 13:19:57 +00:00
|
|
|
GstToc * toc;
|
2007-05-25 16:02:51 +00:00
|
|
|
|
2014-06-10 09:59:13 +00:00
|
|
|
guint64 samples_in;
|
|
|
|
guint64 samples_out;
|
2011-09-28 14:09:58 +00:00
|
|
|
gboolean eos;
|
2007-05-25 16:02:51 +00:00
|
|
|
/* queue headers until we have them all so we can add streamheaders to caps */
|
|
|
|
gboolean got_headers;
|
|
|
|
GList *headers;
|
2012-01-06 08:40:22 +00:00
|
|
|
|
|
|
|
gint channel_reorder_map[8];
|
2004-03-15 16:32:54 +00:00
|
|
|
};
|
2001-12-23 14:15:30 +00:00
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
struct _GstFlacEncClass {
|
2011-09-28 14:09:58 +00:00
|
|
|
GstAudioEncoderClass parent_class;
|
2004-03-15 16:32:54 +00:00
|
|
|
};
|
2001-12-23 14:15:30 +00:00
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
GType gst_flac_enc_get_type(void);
|
2005-10-02 15:33:14 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
2001-12-23 14:15:30 +00:00
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
#endif /* __GST_FLAC_ENC_H__ */
|