2002-03-20 21:45:03 +00:00
|
|
|
/* GStreamer
|
2001-12-23 13:56:23 +00:00
|
|
|
* 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
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2007-05-25 16:02:51 +00:00
|
|
|
/* FIXME:
|
|
|
|
* - we assume timestamps start from 0 and that we get a perfect stream; we
|
|
|
|
* don't handle non-zero starts and mid-stream discontinuities, esp. not if
|
|
|
|
* we're muxing into ogg
|
2007-08-05 14:58:20 +00:00
|
|
|
* - need to support wider caps, flac can do 1-8 channels and 4-32 bit pcm
|
|
|
|
* http://flac.sourceforge.net/faq.html#general__channels
|
|
|
|
* it also support sampling rate from 1Hz - 655350Hz
|
2007-05-25 16:02:51 +00:00
|
|
|
*/
|
2001-12-23 13:56:23 +00:00
|
|
|
|
2003-06-29 19:46:12 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2001-12-23 13:56:23 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include <gstflacenc.h>
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
#include <gst/audio/audio.h>
|
2003-12-14 19:09:23 +00:00
|
|
|
#include <gst/tag/tag.h>
|
2005-09-07 13:49:37 +00:00
|
|
|
#include <gst/gsttagsetter.h>
|
2002-09-18 20:56:42 +00:00
|
|
|
|
2001-12-23 13:56:23 +00:00
|
|
|
|
Define GstElementDetails as const and also static (when defined as global)
Original commit message from CVS:
* ext/aalib/gstaasink.c:
* ext/annodex/gstcmmldec.c:
* ext/annodex/gstcmmlenc.c:
* ext/cairo/gsttextoverlay.c:
* ext/cairo/gsttimeoverlay.c:
* ext/cdio/gstcdiocddasrc.c:
* ext/dv/gstdvdec.c:
* ext/dv/gstdvdemux.c:
* ext/esd/esdmon.c:
* ext/esd/esdsink.c:
* ext/flac/gstflacenc.c:
* ext/flac/gstflactag.c:
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_base_init):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init):
* ext/gdk_pixbuf/pixbufscale.c:
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/jpeg/gstjpegdec.c:
* ext/jpeg/gstjpegenc.c:
* ext/jpeg/gstsmokedec.c:
* ext/jpeg/gstsmokeenc.c:
* ext/libcaca/gstcacasink.c:
* ext/libmng/gstmngdec.c:
* ext/libmng/gstmngenc.c:
* ext/libpng/gstpngdec.c:
* ext/libpng/gstpngenc.c:
* ext/mikmod/gstmikmod.c:
* ext/raw1394/gstdv1394src.c:
* ext/shout2/gstshout2.c: (gst_shout2send_init):
* ext/shout2/gstshout2.h:
* ext/speex/gstspeexdec.c:
* ext/speex/gstspeexenc.c:
* gst/alpha/gstalpha.c:
* gst/alpha/gstalphacolor.c:
* gst/apetag/gstapedemux.c:
* gst/auparse/gstauparse.c:
* gst/autodetect/gstautoaudiosink.c:
(gst_auto_audio_sink_base_init):
* gst/autodetect/gstautovideosink.c:
(gst_auto_video_sink_base_init):
* gst/avi/gstavidemux.c: (gst_avi_demux_base_init):
* gst/avi/gstavimux.c: (gst_avimux_base_init):
* gst/cutter/gstcutter.c:
* gst/debug/breakmydata.c:
* gst/debug/efence.c:
* gst/debug/gstnavigationtest.c:
* gst/debug/gstnavseek.c:
* gst/debug/negotiation.c:
* gst/debug/progressreport.c:
* gst/debug/testplugin.c:
* gst/effectv/gstaging.c:
* gst/effectv/gstdice.c:
* gst/effectv/gstedge.c:
* gst/effectv/gstquark.c:
* gst/effectv/gstrev.c:
* gst/effectv/gstshagadelic.c:
* gst/effectv/gstvertigo.c:
* gst/effectv/gstwarp.c:
* gst/flx/gstflxdec.c:
* gst/goom/gstgoom.c:
* gst/icydemux/gsticydemux.c:
* gst/id3demux/gstid3demux.c:
* gst/interleave/deinterleave.c:
* gst/interleave/interleave.c:
* gst/law/alaw-decode.c: (gst_alawdec_base_init):
* gst/law/alaw-encode.c: (gst_alawenc_base_init):
* gst/law/mulaw-decode.c: (gst_mulawdec_base_init):
* gst/law/mulaw-encode.c: (gst_mulawenc_base_init):
* gst/level/gstlevel.c:
* gst/matroska/matroska-demux.c: (gst_matroska_demux_base_init):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_base_init):
* gst/median/gstmedian.c:
* gst/monoscope/gstmonoscope.c:
* gst/multipart/multipartdemux.c:
* gst/multipart/multipartmux.c:
* gst/oldcore/gstaggregator.c:
* gst/oldcore/gstfdsink.c:
* gst/oldcore/gstmd5sink.c:
* gst/oldcore/gstmultifilesrc.c:
* gst/oldcore/gstpipefilter.c:
* gst/oldcore/gstshaper.c:
* gst/oldcore/gststatistics.c:
* gst/rtp/gstasteriskh263.c:
* gst/rtp/gstrtpL16depay.c:
* gst/rtp/gstrtpL16pay.c:
* gst/rtp/gstrtpamrdepay.c:
* gst/rtp/gstrtpamrpay.c:
* gst/rtp/gstrtpdepay.c:
* gst/rtp/gstrtpgsmpay.c:
* gst/rtp/gstrtph263pay.c:
* gst/rtp/gstrtph263pdepay.c:
* gst/rtp/gstrtph263ppay.c:
* gst/rtp/gstrtpilbcdepay.c:
* gst/rtp/gstrtpmp4gpay.c:
* gst/rtp/gstrtpmp4vdepay.c:
* gst/rtp/gstrtpmp4vpay.c:
* gst/rtp/gstrtpmpadepay.c:
* gst/rtp/gstrtpmpapay.c:
* gst/rtp/gstrtppcmadepay.c:
* gst/rtp/gstrtppcmapay.c:
* gst/rtp/gstrtppcmudepay.c:
* gst/rtp/gstrtppcmupay.c:
* gst/rtp/gstrtpspeexdepay.c:
* gst/rtp/gstrtpspeexpay.c:
* gst/rtsp/gstrtpdec.c:
* gst/rtsp/gstrtspsrc.c:
* gst/smpte/gstsmpte.c:
* gst/udp/gstdynudpsink.c:
* gst/udp/gstmultiudpsink.c:
* gst/udp/gstudpsink.c:
* gst/udp/gstudpsrc.c:
* gst/videobox/gstvideobox.c:
* gst/videofilter/gstgamma.c: (gst_gamma_base_init):
* gst/videofilter/gstvideobalance.c:
* gst/videofilter/gstvideoflip.c:
* gst/videofilter/gstvideotemplate.c:
(gst_videotemplate_base_init):
* gst/videomixer/videomixer.c:
* gst/wavparse/gstwavparse.c: (gst_wavparse_base_init),
(gst_wavparse_class_init), (gst_wavparse_dispose),
(gst_wavparse_reset), (gst_wavparse_init),
(gst_wavparse_perform_seek), (gst_wavparse_peek_chunk_info),
(gst_wavparse_peek_chunk), (gst_wavparse_stream_headers),
(gst_wavparse_parse_stream_init), (gst_wavparse_send_event),
(gst_wavparse_add_src_pad), (gst_wavparse_stream_data),
(gst_wavparse_chain), (gst_wavparse_srcpad_event),
(gst_wavparse_sink_activate), (gst_wavparse_sink_activate_pull),
(gst_wavparse_change_state):
* gst/wavparse/gstwavparse.h:
* sys/oss/gstossmixerelement.c:
* sys/oss/gstosssink.c:
* sys/oss/gstosssrc.c:
* sys/osxaudio/gstosxaudioelement.c:
* sys/osxaudio/gstosxaudiosink.c:
* sys/osxaudio/gstosxaudiosrc.c:
* sys/sunaudio/gstsunaudiomixer.c:
* sys/sunaudio/gstsunaudiosink.c:
Define GstElementDetails as const and also static (when defined as
global)
2006-04-25 21:39:46 +00:00
|
|
|
static const GstElementDetails flacenc_details =
|
|
|
|
GST_ELEMENT_DETAILS ("FLAC audio encoder",
|
2006-03-30 15:37:05 +00:00
|
|
|
"Codec/Encoder/Audio",
|
|
|
|
"Encodes audio with the FLAC lossless audio encoder",
|
|
|
|
"Wim Taymans <wim.taymans@chello.be>");
|
2001-12-23 13:56:23 +00:00
|
|
|
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
#define FLAC_SINK_CAPS \
|
|
|
|
"audio/x-raw-int, " \
|
|
|
|
"endianness = (int) BYTE_ORDER, " \
|
|
|
|
"signed = (boolean) TRUE, " \
|
|
|
|
"width = (int) 16, " \
|
|
|
|
"depth = (int) 16, " \
|
2007-08-05 14:58:20 +00:00
|
|
|
"rate = (int) [ 8000, 96000 ], " \
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
"channels = (int) [ 1, 2 ]"
|
2005-10-02 15:33:14 +00:00
|
|
|
|
|
|
|
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
|
|
|
GST_STATIC_CAPS ("audio/x-flac")
|
|
|
|
);
|
|
|
|
|
|
|
|
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
GST_STATIC_CAPS (FLAC_SINK_CAPS)
|
2005-10-02 15:33:14 +00:00
|
|
|
);
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
enum
|
|
|
|
{
|
2005-10-02 15:33:14 +00:00
|
|
|
PROP_0,
|
|
|
|
PROP_QUALITY,
|
|
|
|
PROP_STREAMABLE_SUBSET,
|
|
|
|
PROP_MID_SIDE_STEREO,
|
|
|
|
PROP_LOOSE_MID_SIDE_STEREO,
|
|
|
|
PROP_BLOCKSIZE,
|
|
|
|
PROP_MAX_LPC_ORDER,
|
|
|
|
PROP_QLP_COEFF_PRECISION,
|
|
|
|
PROP_QLP_COEFF_PREC_SEARCH,
|
|
|
|
PROP_ESCAPE_CODING,
|
|
|
|
PROP_EXHAUSTIVE_MODEL_SEARCH,
|
|
|
|
PROP_MIN_RESIDUAL_PARTITION_ORDER,
|
|
|
|
PROP_MAX_RESIDUAL_PARTITION_ORDER,
|
|
|
|
PROP_RICE_PARAMETER_SEARCH_DIST
|
2001-12-23 13:56:23 +00:00
|
|
|
};
|
|
|
|
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (flacenc_debug);
|
|
|
|
#define GST_CAT_DEFAULT flacenc_debug
|
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
|
|
|
|
#define _do_init(type) \
|
|
|
|
G_STMT_START{ \
|
|
|
|
static const GInterfaceInfo tag_setter_info = { \
|
|
|
|
NULL, \
|
|
|
|
NULL, \
|
|
|
|
NULL \
|
|
|
|
}; \
|
|
|
|
g_type_add_interface_static (type, GST_TYPE_TAG_SETTER, \
|
|
|
|
&tag_setter_info); \
|
|
|
|
}G_STMT_END
|
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
GST_BOILERPLATE_FULL (GstFlacEnc, gst_flac_enc, GstElement, GST_TYPE_ELEMENT,
|
2005-10-02 15:33:14 +00:00
|
|
|
_do_init);
|
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
static void gst_flac_enc_finalize (GObject * object);
|
2001-12-23 13:56:23 +00:00
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
static gboolean gst_flac_enc_sink_setcaps (GstPad * pad, GstCaps * caps);
|
|
|
|
static gboolean gst_flac_enc_sink_event (GstPad * pad, GstEvent * event);
|
|
|
|
static GstFlowReturn gst_flac_enc_chain (GstPad * pad, GstBuffer * buffer);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
static gboolean gst_flac_enc_update_quality (GstFlacEnc * flacenc,
|
|
|
|
gint quality);
|
|
|
|
static void gst_flac_enc_set_property (GObject * object, guint prop_id,
|
2004-03-14 22:34:33 +00:00
|
|
|
const GValue * value, GParamSpec * pspec);
|
2005-12-09 19:51:03 +00:00
|
|
|
static void gst_flac_enc_get_property (GObject * object, guint prop_id,
|
2004-03-14 22:34:33 +00:00
|
|
|
GValue * value, GParamSpec * pspec);
|
2005-12-09 19:51:03 +00:00
|
|
|
static GstStateChangeReturn gst_flac_enc_change_state (GstElement * element,
|
2005-09-02 15:44:50 +00:00
|
|
|
GstStateChange transition);
|
2004-03-14 22:34:33 +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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
static FLAC__StreamEncoderWriteStatus
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_write_callback (const FLAC__SeekableStreamEncoder * encoder,
|
2004-03-14 22:34:33 +00:00
|
|
|
const FLAC__byte buffer[], unsigned bytes,
|
|
|
|
unsigned samples, unsigned current_frame, void *client_data);
|
2003-05-11 17:18:17 +00:00
|
|
|
static FLAC__SeekableStreamEncoderSeekStatus
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder * encoder,
|
2004-03-14 22:34:33 +00:00
|
|
|
FLAC__uint64 absolute_byte_offset, void *client_data);
|
2005-10-02 15:33:14 +00:00
|
|
|
static FLAC__SeekableStreamEncoderTellStatus
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_tell_callback (const FLAC__SeekableStreamEncoder * encoder,
|
2005-10-02 15:33:14 +00:00
|
|
|
FLAC__uint64 * absolute_byte_offset, void *client_data);
|
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
|
|
|
#else
|
|
|
|
static FLAC__StreamEncoderWriteStatus
|
|
|
|
gst_flac_enc_write_callback (const FLAC__StreamEncoder * encoder,
|
|
|
|
const FLAC__byte buffer[], size_t bytes,
|
|
|
|
unsigned samples, unsigned current_frame, void *client_data);
|
|
|
|
static FLAC__StreamEncoderSeekStatus
|
|
|
|
gst_flac_enc_seek_callback (const FLAC__StreamEncoder * encoder,
|
|
|
|
FLAC__uint64 absolute_byte_offset, void *client_data);
|
|
|
|
static FLAC__StreamEncoderTellStatus
|
|
|
|
gst_flac_enc_tell_callback (const FLAC__StreamEncoder * encoder,
|
|
|
|
FLAC__uint64 * absolute_byte_offset, void *client_data);
|
|
|
|
#endif
|
2001-12-23 13:56:23 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
gboolean exhaustive_model_search;
|
|
|
|
gboolean escape_coding;
|
|
|
|
gboolean mid_side;
|
|
|
|
gboolean loose_mid_side;
|
|
|
|
guint qlp_coeff_precision;
|
|
|
|
gboolean qlp_coeff_prec_search;
|
|
|
|
guint min_residual_partition_order;
|
|
|
|
guint max_residual_partition_order;
|
|
|
|
guint rice_parameter_search_dist;
|
|
|
|
guint max_lpc_order;
|
|
|
|
guint blocksize;
|
2004-03-15 19:32:27 +00:00
|
|
|
}
|
2005-10-02 15:33:14 +00:00
|
|
|
GstFlacEncParams;
|
2002-09-15 22:26:33 +00:00
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
static const GstFlacEncParams flacenc_params[] = {
|
2004-03-14 22:34:33 +00:00
|
|
|
{FALSE, FALSE, FALSE, FALSE, 0, FALSE, 2, 2, 0, 0, 1152},
|
|
|
|
{FALSE, FALSE, TRUE, TRUE, 0, FALSE, 2, 2, 0, 0, 1152},
|
|
|
|
{FALSE, FALSE, TRUE, FALSE, 0, FALSE, 0, 3, 0, 0, 1152},
|
|
|
|
{FALSE, FALSE, FALSE, FALSE, 0, FALSE, 3, 3, 0, 6, 4608},
|
|
|
|
{FALSE, FALSE, TRUE, TRUE, 0, FALSE, 3, 3, 0, 8, 4608},
|
|
|
|
{FALSE, FALSE, TRUE, FALSE, 0, FALSE, 3, 3, 0, 8, 4608},
|
|
|
|
{FALSE, FALSE, TRUE, FALSE, 0, FALSE, 0, 4, 0, 8, 4608},
|
|
|
|
{TRUE, FALSE, TRUE, FALSE, 0, FALSE, 0, 6, 0, 8, 4608},
|
|
|
|
{TRUE, FALSE, TRUE, FALSE, 0, FALSE, 0, 6, 0, 12, 4608},
|
|
|
|
{TRUE, TRUE, TRUE, FALSE, 0, FALSE, 0, 16, 0, 32, 4608},
|
2002-09-15 22:26:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define DEFAULT_QUALITY 5
|
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
#define GST_TYPE_FLAC_ENC_QUALITY (gst_flac_enc_quality_get_type ())
|
2002-09-15 22:26:33 +00:00
|
|
|
GType
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_quality_get_type (void)
|
2002-09-15 22:26:33 +00:00
|
|
|
{
|
|
|
|
static GType qtype = 0;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2002-09-15 22:26:33 +00:00
|
|
|
if (qtype == 0) {
|
|
|
|
static const GEnumValue values[] = {
|
2005-11-22 18:11:58 +00:00
|
|
|
{0, "0 - Fastest compression", "0"},
|
2004-03-14 22:34:33 +00:00
|
|
|
{1, "1", "1"},
|
|
|
|
{2, "2", "2"},
|
|
|
|
{3, "3", "3"},
|
|
|
|
{4, "4", "4"},
|
2005-11-22 18:11:58 +00:00
|
|
|
{5, "5 - Default", "5"},
|
2004-03-14 22:34:33 +00:00
|
|
|
{6, "6", "6"},
|
|
|
|
{7, "7", "7"},
|
2005-11-22 18:11:58 +00:00
|
|
|
{8, "8 - Highest compression", "8"},
|
|
|
|
{9, "9 - Insane", "9"},
|
2004-03-14 22:34:33 +00:00
|
|
|
{0, NULL, NULL}
|
2002-09-15 22:26:33 +00:00
|
|
|
};
|
2004-03-15 19:32:27 +00:00
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
qtype = g_enum_register_static ("GstFlacEncQuality", values);
|
2002-09-15 22:26:33 +00:00
|
|
|
}
|
|
|
|
return qtype;
|
|
|
|
}
|
|
|
|
|
2003-11-01 15:46:35 +00:00
|
|
|
static void
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_base_init (gpointer g_class)
|
2003-11-01 15:46:35 +00:00
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&src_factory));
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&sink_factory));
|
2003-12-08 12:41:02 +00:00
|
|
|
|
2003-11-01 15:46:35 +00:00
|
|
|
gst_element_class_set_details (element_class, &flacenc_details);
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
|
|
|
|
GST_DEBUG_CATEGORY_INIT (flacenc_debug, "flacenc", 0,
|
|
|
|
"Flac encoding element");
|
2003-11-01 15:46:35 +00:00
|
|
|
}
|
|
|
|
|
2001-12-23 13:56:23 +00:00
|
|
|
static void
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_class_init (GstFlacEncClass * klass)
|
2001-12-23 13:56:23 +00:00
|
|
|
{
|
|
|
|
GObjectClass *gobject_class;
|
|
|
|
GstElementClass *gstelement_class;
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
gobject_class = (GObjectClass *) klass;
|
|
|
|
gstelement_class = (GstElementClass *) klass;
|
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
gobject_class->set_property = gst_flac_enc_set_property;
|
|
|
|
gobject_class->get_property = gst_flac_enc_get_property;
|
|
|
|
gobject_class->finalize = gst_flac_enc_finalize;
|
2002-09-15 22:26:33 +00:00
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_QUALITY,
|
2004-03-14 22:34:33 +00:00
|
|
|
g_param_spec_enum ("quality",
|
2004-03-15 19:32:27 +00:00
|
|
|
"Quality",
|
|
|
|
"Speed versus compression tradeoff",
|
2005-12-09 19:51:03 +00:00
|
|
|
GST_TYPE_FLAC_ENC_QUALITY, DEFAULT_QUALITY, G_PARAM_READWRITE));
|
2004-03-14 22:34:33 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
2005-10-02 15:33:14 +00:00
|
|
|
PROP_STREAMABLE_SUBSET, g_param_spec_boolean ("streamable_subset",
|
2004-03-15 19:32:27 +00:00
|
|
|
"Streamable subset",
|
|
|
|
"true to limit encoder to generating a Subset stream, else false",
|
|
|
|
TRUE, G_PARAM_READWRITE));
|
2005-10-02 15:33:14 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MID_SIDE_STEREO,
|
2004-03-14 22:34:33 +00:00
|
|
|
g_param_spec_boolean ("mid_side_stereo", "Do mid side stereo",
|
2004-03-15 19:32:27 +00:00
|
|
|
"Do mid side stereo (only for stereo input)",
|
|
|
|
flacenc_params[DEFAULT_QUALITY].mid_side, G_PARAM_READWRITE));
|
2004-03-14 22:34:33 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
2005-10-02 15:33:14 +00:00
|
|
|
PROP_LOOSE_MID_SIDE_STEREO, g_param_spec_boolean ("loose_mid_side_stereo",
|
2004-03-15 19:32:27 +00:00
|
|
|
"Loose mid side stereo", "Loose mid side stereo",
|
|
|
|
flacenc_params[DEFAULT_QUALITY].loose_mid_side, G_PARAM_READWRITE));
|
2005-10-02 15:33:14 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_BLOCKSIZE,
|
2004-03-14 22:34:33 +00:00
|
|
|
g_param_spec_uint ("blocksize", "Blocksize", "Blocksize in samples",
|
2004-03-15 19:32:27 +00:00
|
|
|
FLAC__MIN_BLOCK_SIZE, FLAC__MAX_BLOCK_SIZE,
|
|
|
|
flacenc_params[DEFAULT_QUALITY].blocksize, G_PARAM_READWRITE));
|
2005-10-02 15:33:14 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MAX_LPC_ORDER,
|
2004-03-14 22:34:33 +00:00
|
|
|
g_param_spec_uint ("max_lpc_order", "Max LPC order",
|
2004-03-15 19:32:27 +00:00
|
|
|
"Max LPC order; 0 => use only fixed predictors", 0,
|
|
|
|
FLAC__MAX_LPC_ORDER, flacenc_params[DEFAULT_QUALITY].max_lpc_order,
|
|
|
|
G_PARAM_READWRITE));
|
2004-03-14 22:34:33 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
2005-10-02 15:33:14 +00:00
|
|
|
PROP_QLP_COEFF_PRECISION, g_param_spec_uint ("qlp_coeff_precision",
|
2004-03-15 19:32:27 +00:00
|
|
|
"QLP coefficients precision",
|
|
|
|
"Precision in bits of quantized linear-predictor coefficients; 0 = automatic",
|
|
|
|
0, 32, flacenc_params[DEFAULT_QUALITY].qlp_coeff_precision,
|
|
|
|
G_PARAM_READWRITE));
|
2004-03-14 22:34:33 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
2005-10-02 15:33:14 +00:00
|
|
|
PROP_QLP_COEFF_PREC_SEARCH, g_param_spec_boolean ("qlp_coeff_prec_search",
|
2004-03-15 19:32:27 +00:00
|
|
|
"Do QLP coefficients precision search",
|
|
|
|
"false = use qlp_coeff_precision, "
|
|
|
|
"true = search around qlp_coeff_precision, take best",
|
|
|
|
flacenc_params[DEFAULT_QUALITY].qlp_coeff_prec_search,
|
|
|
|
G_PARAM_READWRITE));
|
2005-10-02 15:33:14 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_ESCAPE_CODING,
|
2004-03-14 22:34:33 +00:00
|
|
|
g_param_spec_boolean ("escape_coding", "Do Escape coding",
|
2004-03-15 19:32:27 +00:00
|
|
|
"search for escape codes in the entropy coding stage "
|
|
|
|
"for slightly better compression",
|
|
|
|
flacenc_params[DEFAULT_QUALITY].escape_coding, G_PARAM_READWRITE));
|
2004-03-14 22:34:33 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
2005-10-02 15:33:14 +00:00
|
|
|
PROP_EXHAUSTIVE_MODEL_SEARCH,
|
2004-03-14 22:34:33 +00:00
|
|
|
g_param_spec_boolean ("exhaustive_model_search",
|
2004-03-15 19:32:27 +00:00
|
|
|
"Do exhaustive model search",
|
|
|
|
"do exhaustive search of LP coefficient quantization (expensive!)",
|
|
|
|
flacenc_params[DEFAULT_QUALITY].exhaustive_model_search,
|
|
|
|
G_PARAM_READWRITE));
|
2004-03-14 22:34:33 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
2005-10-02 15:33:14 +00:00
|
|
|
PROP_MIN_RESIDUAL_PARTITION_ORDER,
|
2004-03-14 22:34:33 +00:00
|
|
|
g_param_spec_uint ("min_residual_partition_order",
|
2004-03-15 19:32:27 +00:00
|
|
|
"Min residual partition order",
|
|
|
|
"Min residual partition order (above 4 doesn't usually help much)", 0,
|
|
|
|
16, flacenc_params[DEFAULT_QUALITY].min_residual_partition_order,
|
|
|
|
G_PARAM_READWRITE));
|
2004-03-14 22:34:33 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
2005-10-02 15:33:14 +00:00
|
|
|
PROP_MAX_RESIDUAL_PARTITION_ORDER,
|
2004-03-14 22:34:33 +00:00
|
|
|
g_param_spec_uint ("max_residual_partition_order",
|
2004-03-15 19:32:27 +00:00
|
|
|
"Max residual partition order",
|
|
|
|
"Max residual partition order (above 4 doesn't usually help much)", 0,
|
|
|
|
16, flacenc_params[DEFAULT_QUALITY].max_residual_partition_order,
|
|
|
|
G_PARAM_READWRITE));
|
2004-03-14 22:34:33 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass),
|
2005-10-02 15:33:14 +00:00
|
|
|
PROP_RICE_PARAMETER_SEARCH_DIST,
|
2004-03-14 22:34:33 +00:00
|
|
|
g_param_spec_uint ("rice_parameter_search_dist",
|
2004-03-15 19:32:27 +00:00
|
|
|
"rice_parameter_search_dist",
|
|
|
|
"0 = try only calc'd parameter k; else try all [k-dist..k+dist] "
|
|
|
|
"parameters, use best", 0, FLAC__MAX_RICE_PARTITION_ORDER,
|
|
|
|
flacenc_params[DEFAULT_QUALITY].rice_parameter_search_dist,
|
|
|
|
G_PARAM_READWRITE));
|
2002-09-15 17:48:42 +00:00
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
gstelement_class->change_state = gst_flac_enc_change_state;
|
2001-12-23 13:56:23 +00:00
|
|
|
}
|
|
|
|
|
2002-09-15 22:26:33 +00:00
|
|
|
static void
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_init (GstFlacEnc * flacenc, GstFlacEncClass * klass)
|
2002-09-15 22:26:33 +00:00
|
|
|
{
|
2007-09-26 13:19:17 +00:00
|
|
|
flacenc->sinkpad = gst_pad_new_from_static_template (&sink_factory, "sink");
|
|
|
|
gst_pad_set_chain_function (flacenc->sinkpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_flac_enc_chain));
|
|
|
|
gst_pad_set_event_function (flacenc->sinkpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_flac_enc_sink_event));
|
|
|
|
gst_pad_set_setcaps_function (flacenc->sinkpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_flac_enc_sink_setcaps));
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (flacenc), flacenc->sinkpad);
|
2002-09-15 22:26:33 +00:00
|
|
|
|
2007-09-26 13:19:17 +00:00
|
|
|
flacenc->srcpad = gst_pad_new_from_static_template (&src_factory, "src");
|
2005-10-02 15:33:14 +00:00
|
|
|
gst_pad_use_fixed_caps (flacenc->srcpad);
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (flacenc), flacenc->srcpad);
|
2002-09-15 22:26:33 +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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
flacenc->encoder = FLAC__seekable_stream_encoder_new ();
|
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
|
|
|
#else
|
|
|
|
flacenc->encoder = FLAC__stream_encoder_new ();
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
|
2005-01-09 20:01:59 +00:00
|
|
|
flacenc->offset = 0;
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
flacenc->samples_written = 0;
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_update_quality (flacenc, DEFAULT_QUALITY);
|
2003-11-28 13:04:21 +00:00
|
|
|
flacenc->tags = gst_tag_list_new ();
|
2007-05-25 16:02:51 +00:00
|
|
|
flacenc->got_headers = FALSE;
|
|
|
|
flacenc->headers = NULL;
|
2007-09-26 13:19:17 +00:00
|
|
|
flacenc->last_flow = GST_FLOW_OK;
|
2002-09-15 22:26:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_finalize (GObject * object)
|
2002-09-15 22:26:33 +00:00
|
|
|
{
|
2005-12-09 19:51:03 +00:00
|
|
|
GstFlacEnc *flacenc = GST_FLAC_ENC (object);
|
2002-09-15 22:26:33 +00:00
|
|
|
|
Fix a bunch of leaks shown by the newly-added states test.
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flac_enc_finalize):
* ext/gconf/gstgconfaudiosink.c: (gst_gconf_audio_sink_class_init),
(gst_gconf_audio_sink_dispose), (gst_gconf_audio_sink_finalize):
* ext/gconf/gstgconfaudiosrc.c: (gst_gconf_audio_src_base_init),
(gst_gconf_audio_src_class_init), (gst_gconf_audio_src_dispose),
(gst_gconf_audio_src_finalize), (do_toggle_element):
* ext/gconf/gstgconfvideosink.c: (gst_gconf_video_sink_base_init),
(gst_gconf_video_sink_class_init), (gst_gconf_video_sink_finalize),
(do_toggle_element):
* ext/gconf/gstgconfvideosrc.c: (gst_gconf_video_src_base_init),
(gst_gconf_video_src_class_init), (gst_gconf_video_src_dispose),
(gst_gconf_video_src_finalize), (do_toggle_element):
* ext/gconf/gstswitchsink.c: (gst_switch_sink_class_init),
(gst_switch_sink_reset), (gst_switch_sink_set_child):
* ext/hal/gsthalaudiosink.c: (gst_hal_audio_sink_base_init):
* ext/hal/gsthalaudiosrc.c: (gst_hal_audio_src_base_init):
* ext/shout2/gstshout2.c: (gst_shout2send_class_init),
(gst_shout2send_init), (gst_shout2send_finalize):
* gst/debug/testplugin.c: (gst_test_class_init),
(gst_test_finalize):
* gst/flx/gstflxdec.c: (gst_flxdec_class_init),
(gst_flxdec_dispose):
* gst/multipart/multipartmux.c: (gst_multipart_mux_finalize):
* gst/rtp/gstrtpmp4gpay.c: (gst_rtp_mp4g_pay_finalize):
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_init),
(gst_rtspsrc_finalize):
* gst/rtsp/rtspextwms.c: (rtsp_ext_wms_free_context):
* gst/rtsp/rtspextwms.h:
* gst/smpte/gstsmpte.c: (gst_smpte_class_init),
(gst_smpte_finalize):
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_finalize):
* gst/udp/gstudpsink.c: (gst_udpsink_class_init),
(gst_udpsink_finalize):
* gst/wavparse/gstwavparse.c: (gst_wavparse_dispose),
(gst_wavparse_sink_activate):
* sys/oss/gstosssink.c: (gst_oss_sink_finalise):
* sys/oss/gstosssrc.c: (gst_oss_src_class_init),
(gst_oss_src_finalize):
* sys/v4l2/gstv4l2object.c: (gst_v4l2_object_destroy):
* sys/v4l2/gstv4l2object.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_class_init),
(gst_v4l2src_finalize):
* sys/ximage/gstximagesrc.c: (gst_ximage_src_ximage_get):
Fix a bunch of leaks shown by the newly-added states test.
2007-03-04 13:52:03 +00:00
|
|
|
gst_tag_list_free (flacenc->tags);
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2003-05-11 17:18:17 +00:00
|
|
|
FLAC__seekable_stream_encoder_delete (flacenc->encoder);
|
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
|
|
|
#else
|
|
|
|
FLAC__stream_encoder_delete (flacenc->encoder);
|
|
|
|
#endif
|
2004-03-14 22:34:33 +00:00
|
|
|
|
Fixes a bunch of problems with finalize and dispose functions, either assumptions that dispose is only called once, o...
Original commit message from CVS:
* ext/alsa/gstalsa.c: (gst_alsa_class_init), (gst_alsa_dispose),
(gst_alsa_finalize):
* ext/cdaudio/gstcdaudio.c: (gst_cdaudio_class_init),
(gst_cdaudio_finalize):
* ext/cdparanoia/gstcdparanoia.c: (cdparanoia_class_init),
(cdparanoia_finalize):
* ext/divx/gstdivxdec.c: (gst_divxdec_dispose):
* ext/divx/gstdivxenc.c: (gst_divxenc_dispose):
* ext/dvdread/dvdreadsrc.c: (dvdreadsrc_class_init),
(dvdreadsrc_finalize):
* ext/flac/gstflacdec.c: (gst_flacdec_class_init),
(gst_flacdec_finalize):
* ext/flac/gstflacenc.c: (gst_flacenc_class_init),
(gst_flacenc_finalize):
* ext/gnomevfs/gstgnomevfssink.c: (gst_gnomevfssink_class_init),
(gst_gnomevfssink_finalize):
* ext/gnomevfs/gstgnomevfssrc.c: (gst_gnomevfssrc_class_init),
(gst_gnomevfssrc_finalize):
* ext/libfame/gstlibfame.c: (gst_fameenc_class_init),
(gst_fameenc_finalize):
* ext/nas/nassink.c: (gst_nassink_class_init),
(gst_nassink_finalize):
* ext/sdl/sdlvideosink.c: (gst_sdlvideosink_finalize),
(gst_sdlvideosink_class_init):
* ext/sndfile/gstsf.c: (gst_sf_dispose):
* gst-libs/gst/mixer/mixertrack.c: (gst_mixer_track_dispose):
* gst-libs/gst/tuner/tunerchannel.c: (gst_tuner_channel_dispose):
* gst-libs/gst/tuner/tunernorm.c: (gst_tuner_norm_dispose):
* gst-libs/gst/xwindowlistener/xwindowlistener.c:
(gst_x_window_listener_dispose):
* gst/audioscale/gstaudioscale.c:
* gst/playondemand/gstplayondemand.c: (play_on_demand_class_init),
(play_on_demand_finalize):
* gst/videofilter/gstvideobalance.c: (gst_videobalance_dispose):
* gst/videoscale/gstvideoscale.c: (gst_videoscale_chain):
* sys/cdrom/gstcdplayer.c: (cdplayer_class_init),
(cdplayer_finalize):
* sys/glsink/glimagesink.c: (gst_glimagesink_finalize),
(gst_glimagesink_class_init):
* sys/oss/gstosselement.c: (gst_osselement_class_init),
(gst_osselement_finalize):
* sys/oss/gstosssink.c: (gst_osssink_dispose):
* sys/oss/gstosssrc.c: (gst_osssrc_dispose):
* sys/v4l/gstv4lelement.c: (gst_v4lelement_dispose):
Fixes a bunch of problems with finalize and dispose functions,
either assumptions that dispose is only called once, or not calling
the parent class dispose/finalize function
2004-11-01 14:43:38 +00:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
2002-09-15 22:26:33 +00:00
|
|
|
}
|
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
static void
|
|
|
|
add_one_tag (const GstTagList * list, const gchar * tag, gpointer user_data)
|
|
|
|
{
|
|
|
|
GList *comments;
|
|
|
|
GList *it;
|
2005-12-09 19:51:03 +00:00
|
|
|
GstFlacEnc *flacenc = GST_FLAC_ENC (user_data);
|
2005-10-02 15:33:14 +00:00
|
|
|
|
|
|
|
comments = gst_tag_to_vorbis_comments (list, tag);
|
|
|
|
for (it = comments; it != NULL; it = it->next) {
|
|
|
|
FLAC__StreamMetadata_VorbisComment_Entry commment_entry;
|
|
|
|
|
|
|
|
commment_entry.length = strlen (it->data);
|
|
|
|
commment_entry.entry = it->data;
|
|
|
|
FLAC__metadata_object_vorbiscomment_insert_comment (flacenc->meta[0],
|
|
|
|
flacenc->meta[0]->data.vorbis_comment.num_comments,
|
|
|
|
commment_entry, TRUE);
|
|
|
|
g_free (it->data);
|
|
|
|
}
|
|
|
|
g_list_free (comments);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_set_metadata (GstFlacEnc * flacenc)
|
2001-12-23 13:56:23 +00:00
|
|
|
{
|
2005-10-02 15:33:14 +00:00
|
|
|
const GstTagList *user_tags;
|
|
|
|
GstTagList *copy;
|
|
|
|
|
|
|
|
g_return_if_fail (flacenc != NULL);
|
2005-11-22 12:38:33 +00:00
|
|
|
user_tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (flacenc));
|
2005-10-02 15:33:14 +00:00
|
|
|
if ((flacenc->tags == NULL) && (user_tags == NULL)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
copy = gst_tag_list_merge (user_tags, flacenc->tags,
|
2005-11-22 12:38:33 +00:00
|
|
|
gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (flacenc)));
|
2005-10-02 15:33:14 +00:00
|
|
|
flacenc->meta = g_malloc (sizeof (FLAC__StreamMetadata **));
|
|
|
|
|
|
|
|
flacenc->meta[0] =
|
|
|
|
FLAC__metadata_object_new (FLAC__METADATA_TYPE_VORBIS_COMMENT);
|
|
|
|
gst_tag_list_foreach (copy, add_one_tag, flacenc);
|
|
|
|
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2005-10-02 15:33:14 +00:00
|
|
|
if (FLAC__seekable_stream_encoder_set_metadata (flacenc->encoder,
|
|
|
|
flacenc->meta, 1) != true)
|
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
|
|
|
#else
|
|
|
|
if (FLAC__stream_encoder_set_metadata (flacenc->encoder,
|
|
|
|
flacenc->meta, 1) != true)
|
|
|
|
#endif
|
2005-10-02 15:33:14 +00:00
|
|
|
g_warning ("Dude, i'm already initialized!");
|
|
|
|
gst_tag_list_free (copy);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_sink_setcaps (GstPad * pad, GstCaps * caps)
|
2005-10-02 15:33:14 +00:00
|
|
|
{
|
|
|
|
GstFlacEnc *flacenc;
|
2003-12-22 01:47:09 +00:00
|
|
|
GstStructure *structure;
|
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
|
|
|
|
|
|
|
#ifdef LEGACY_FLAC
|
2005-10-02 15:33:14 +00:00
|
|
|
FLAC__SeekableStreamEncoderState state;
|
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
|
|
|
#else
|
|
|
|
FLAC__StreamEncoderInitStatus init_status;
|
|
|
|
#endif
|
2007-05-24 17:00:21 +00:00
|
|
|
gint depth, chans, rate, width;
|
2001-12-23 13:56:23 +00:00
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
flacenc = GST_FLAC_ENC (gst_pad_get_parent (pad));
|
2001-12-23 13:56:23 +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
|
|
|
#ifdef LEGACY_FLAC
|
2005-10-02 15:33:14 +00:00
|
|
|
if (FLAC__seekable_stream_encoder_get_state (flacenc->encoder) !=
|
|
|
|
FLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED)
|
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
|
|
|
#else
|
|
|
|
if (FLAC__stream_encoder_get_state (flacenc->encoder) !=
|
|
|
|
FLAC__STREAM_ENCODER_UNINITIALIZED)
|
|
|
|
#endif
|
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
goto encoder_already_initialized;
|
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
2002-01-13 22:27:25 +00:00
|
|
|
|
2007-05-24 17:00:21 +00:00
|
|
|
if (!gst_structure_get_int (structure, "channels", &chans) ||
|
|
|
|
!gst_structure_get_int (structure, "width", &width) ||
|
|
|
|
!gst_structure_get_int (structure, "depth", &depth) ||
|
|
|
|
!gst_structure_get_int (structure, "rate", &rate)) {
|
|
|
|
GST_DEBUG_OBJECT (flacenc, "incomplete caps: %" GST_PTR_FORMAT, caps);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
flacenc->channels = chans;
|
|
|
|
flacenc->depth = depth;
|
|
|
|
flacenc->sample_rate = rate;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
caps = gst_caps_new_simple ("audio/x-flac",
|
|
|
|
"channels", G_TYPE_INT, flacenc->channels,
|
|
|
|
"rate", G_TYPE_INT, flacenc->sample_rate, NULL);
|
2004-08-17 12:38:33 +00:00
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
if (!gst_pad_set_caps (flacenc->srcpad, caps))
|
|
|
|
goto setting_src_caps_failed;
|
|
|
|
|
|
|
|
gst_caps_unref (caps);
|
2003-07-06 20:49:52 +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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
FLAC__seekable_stream_encoder_set_bits_per_sample (flacenc->encoder,
|
|
|
|
flacenc->depth);
|
|
|
|
FLAC__seekable_stream_encoder_set_sample_rate (flacenc->encoder,
|
|
|
|
flacenc->sample_rate);
|
|
|
|
FLAC__seekable_stream_encoder_set_channels (flacenc->encoder,
|
|
|
|
flacenc->channels);
|
2002-09-15 17:48:42 +00:00
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
FLAC__seekable_stream_encoder_set_write_callback (flacenc->encoder,
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_write_callback);
|
2005-10-02 15:33:14 +00:00
|
|
|
FLAC__seekable_stream_encoder_set_seek_callback (flacenc->encoder,
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_seek_callback);
|
2005-10-02 15:33:14 +00:00
|
|
|
FLAC__seekable_stream_encoder_set_tell_callback (flacenc->encoder,
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_tell_callback);
|
2002-01-13 22:27:25 +00:00
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
FLAC__seekable_stream_encoder_set_client_data (flacenc->encoder, flacenc);
|
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
|
|
|
#else
|
|
|
|
FLAC__stream_encoder_set_bits_per_sample (flacenc->encoder, flacenc->depth);
|
|
|
|
FLAC__stream_encoder_set_sample_rate (flacenc->encoder, flacenc->sample_rate);
|
|
|
|
FLAC__stream_encoder_set_channels (flacenc->encoder, flacenc->channels);
|
|
|
|
#endif
|
2005-10-02 15:33:14 +00:00
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_set_metadata (flacenc);
|
2005-10-02 15:33:14 +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
|
|
|
#ifdef LEGACY_FLAC
|
2005-10-02 15:33:14 +00:00
|
|
|
state = FLAC__seekable_stream_encoder_init (flacenc->encoder);
|
|
|
|
if (state != FLAC__STREAM_ENCODER_OK)
|
|
|
|
goto failed_to_initialize;
|
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
|
|
|
#else
|
|
|
|
init_status = FLAC__stream_encoder_init_stream (flacenc->encoder,
|
|
|
|
gst_flac_enc_write_callback, gst_flac_enc_seek_callback,
|
|
|
|
gst_flac_enc_tell_callback, NULL, flacenc);
|
|
|
|
if (init_status != FLAC__STREAM_ENCODER_INIT_STATUS_OK)
|
|
|
|
goto failed_to_initialize;
|
|
|
|
#endif
|
2005-10-02 15:33:14 +00:00
|
|
|
|
|
|
|
gst_object_unref (flacenc);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
encoder_already_initialized:
|
|
|
|
{
|
|
|
|
g_warning ("flac already initialized -- fixme allow this");
|
|
|
|
gst_object_unref (flacenc);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
setting_src_caps_failed:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (flacenc,
|
|
|
|
"Couldn't set caps on source pad: %" GST_PTR_FORMAT, caps);
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
gst_object_unref (flacenc);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
failed_to_initialize:
|
|
|
|
{
|
|
|
|
GST_ELEMENT_ERROR (flacenc, LIBRARY, INIT, (NULL),
|
|
|
|
("could not initialize encoder (wrong parameters?)"));
|
|
|
|
gst_object_unref (flacenc);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2001-12-23 13:56:23 +00:00
|
|
|
}
|
|
|
|
|
2002-09-15 22:26:33 +00:00
|
|
|
static gboolean
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_update_quality (GstFlacEnc * flacenc, gint quality)
|
2001-12-23 13:56:23 +00:00
|
|
|
{
|
2002-09-15 22:26:33 +00:00
|
|
|
flacenc->quality = quality;
|
|
|
|
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2005-10-02 15:33:14 +00:00
|
|
|
#define DO_UPDATE(name, val, str) \
|
|
|
|
G_STMT_START { \
|
|
|
|
if (FLAC__seekable_stream_encoder_get_##name (flacenc->encoder) != \
|
|
|
|
flacenc_params[quality].val) { \
|
|
|
|
FLAC__seekable_stream_encoder_set_##name (flacenc->encoder, \
|
|
|
|
flacenc_params[quality].val); \
|
|
|
|
g_object_notify (G_OBJECT (flacenc), str); \
|
|
|
|
} \
|
2002-09-19 15:17:02 +00:00
|
|
|
} G_STMT_END
|
2002-09-15 22:26:33 +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
|
|
|
#else
|
|
|
|
#define DO_UPDATE(name, val, str) \
|
|
|
|
G_STMT_START { \
|
|
|
|
if (FLAC__stream_encoder_get_##name (flacenc->encoder) != \
|
|
|
|
flacenc_params[quality].val) { \
|
|
|
|
FLAC__stream_encoder_set_##name (flacenc->encoder, \
|
|
|
|
flacenc_params[quality].val); \
|
|
|
|
g_object_notify (G_OBJECT (flacenc), str); \
|
|
|
|
} \
|
|
|
|
} G_STMT_END
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2002-09-15 22:26:33 +00:00
|
|
|
g_object_freeze_notify (G_OBJECT (flacenc));
|
|
|
|
|
2004-08-17 12:38:33 +00:00
|
|
|
if (flacenc->channels == 2) {
|
|
|
|
DO_UPDATE (do_mid_side_stereo, mid_side, "mid_side_stereo");
|
|
|
|
DO_UPDATE (loose_mid_side_stereo, loose_mid_side, "loose_mid_side");
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
DO_UPDATE (blocksize, blocksize, "blocksize");
|
|
|
|
DO_UPDATE (max_lpc_order, max_lpc_order, "max_lpc_order");
|
|
|
|
DO_UPDATE (qlp_coeff_precision, qlp_coeff_precision, "qlp_coeff_precision");
|
|
|
|
DO_UPDATE (do_qlp_coeff_prec_search, qlp_coeff_prec_search,
|
|
|
|
"qlp_coeff_prec_search");
|
|
|
|
DO_UPDATE (do_escape_coding, escape_coding, "escape_coding");
|
|
|
|
DO_UPDATE (do_exhaustive_model_search, exhaustive_model_search,
|
|
|
|
"exhaustive_model_search");
|
|
|
|
DO_UPDATE (min_residual_partition_order, min_residual_partition_order,
|
|
|
|
"min_residual_partition_order");
|
|
|
|
DO_UPDATE (max_residual_partition_order, max_residual_partition_order,
|
|
|
|
"max_residual_partition_order");
|
|
|
|
DO_UPDATE (rice_parameter_search_dist, rice_parameter_search_dist,
|
|
|
|
"rice_parameter_search_dist");
|
2002-09-15 22:26:33 +00:00
|
|
|
|
|
|
|
#undef DO_UPDATE
|
|
|
|
|
|
|
|
g_object_thaw_notify (G_OBJECT (flacenc));
|
|
|
|
|
|
|
|
return TRUE;
|
2001-12-23 13:56:23 +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
|
|
|
#ifdef LEGACY_FLAC
|
2003-05-11 17:18:17 +00:00
|
|
|
static FLAC__SeekableStreamEncoderSeekStatus
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder * encoder,
|
2004-03-14 22:34:33 +00:00
|
|
|
FLAC__uint64 absolute_byte_offset, void *client_data)
|
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
|
|
|
#else
|
|
|
|
static FLAC__StreamEncoderSeekStatus
|
|
|
|
gst_flac_enc_seek_callback (const FLAC__StreamEncoder * encoder,
|
|
|
|
FLAC__uint64 absolute_byte_offset, void *client_data)
|
|
|
|
#endif
|
2003-05-11 17:18:17 +00:00
|
|
|
{
|
2005-10-02 15:33:14 +00:00
|
|
|
GstFlacEnc *flacenc;
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
GstEvent *event;
|
|
|
|
GstPad *peerpad;
|
2003-05-11 17:18:17 +00:00
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
flacenc = GST_FLAC_ENC (client_data);
|
2003-05-11 17:18:17 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
if (flacenc->stopped)
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2006-10-16 18:22:47 +00:00
|
|
|
return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_OK;
|
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
|
|
|
#else
|
|
|
|
return FLAC__STREAM_ENCODER_SEEK_STATUS_OK;
|
|
|
|
#endif
|
2005-11-22 11:53:34 +00:00
|
|
|
event = gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_BYTES,
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
absolute_byte_offset, GST_BUFFER_OFFSET_NONE, 0);
|
2005-10-02 15:33:14 +00:00
|
|
|
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
if ((peerpad = gst_pad_get_peer (flacenc->srcpad))) {
|
|
|
|
gboolean ret = gst_pad_send_event (peerpad, event);
|
2005-10-02 15:33:14 +00:00
|
|
|
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
gst_object_unref (peerpad);
|
2003-05-11 17:18:17 +00:00
|
|
|
|
2006-02-03 20:05:20 +00:00
|
|
|
if (ret) {
|
|
|
|
GST_DEBUG ("Seek to %" G_GUINT64_FORMAT " %s", absolute_byte_offset,
|
|
|
|
"succeeded");
|
|
|
|
} else {
|
|
|
|
GST_DEBUG ("Seek to %" G_GUINT64_FORMAT " %s", absolute_byte_offset,
|
|
|
|
"failed");
|
|
|
|
}
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
} else {
|
|
|
|
GST_DEBUG ("Seek to %" G_GUINT64_FORMAT " failed (no peer pad)",
|
|
|
|
absolute_byte_offset);
|
2005-01-09 20:01:59 +00:00
|
|
|
}
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
|
|
|
|
flacenc->offset = absolute_byte_offset;
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2006-10-16 18:22:47 +00:00
|
|
|
return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_OK;
|
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
|
|
|
#else
|
|
|
|
return FLAC__STREAM_ENCODER_SEEK_STATUS_OK;
|
|
|
|
#endif
|
2003-05-11 17:18:17 +00:00
|
|
|
}
|
|
|
|
|
2007-05-25 16:02:51 +00:00
|
|
|
static void
|
|
|
|
notgst_value_array_append_buffer (GValue * array_val, GstBuffer * buf)
|
|
|
|
{
|
|
|
|
GValue value = { 0, };
|
|
|
|
|
|
|
|
g_value_init (&value, GST_TYPE_BUFFER);
|
|
|
|
/* copy buffer to avoid problems with circular refcounts */
|
|
|
|
buf = gst_buffer_copy (buf);
|
|
|
|
/* again, for good measure */
|
|
|
|
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_IN_CAPS);
|
|
|
|
gst_value_set_buffer (&value, buf);
|
|
|
|
gst_buffer_unref (buf);
|
|
|
|
gst_value_array_append_value (array_val, &value);
|
|
|
|
g_value_unset (&value);
|
|
|
|
}
|
|
|
|
|
|
|
|
#define HDR_TYPE_STREAMINFO 0
|
|
|
|
#define HDR_TYPE_VORBISCOMMENT 4
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_flac_enc_process_stream_headers (GstFlacEnc * enc)
|
|
|
|
{
|
|
|
|
GstBuffer *vorbiscomment = NULL;
|
|
|
|
GstBuffer *streaminfo = NULL;
|
|
|
|
GstBuffer *marker = NULL;
|
|
|
|
GValue array = { 0, };
|
|
|
|
GstCaps *caps;
|
|
|
|
GList *l;
|
|
|
|
|
|
|
|
caps = gst_caps_new_simple ("audio/x-flac",
|
|
|
|
"channels", G_TYPE_INT, enc->channels,
|
|
|
|
"rate", G_TYPE_INT, enc->sample_rate, NULL);
|
|
|
|
|
|
|
|
for (l = enc->headers; l != NULL; l = l->next) {
|
|
|
|
const guint8 *data;
|
|
|
|
guint size;
|
|
|
|
|
|
|
|
/* mark buffers so oggmux will ignore them if it already muxed the
|
|
|
|
* header buffers from the streamheaders field in the caps */
|
|
|
|
l->data = gst_buffer_make_metadata_writable (GST_BUFFER (l->data));
|
|
|
|
GST_BUFFER_FLAG_SET (GST_BUFFER (l->data), GST_BUFFER_FLAG_IN_CAPS);
|
|
|
|
|
|
|
|
data = GST_BUFFER_DATA (GST_BUFFER_CAST (l->data));
|
|
|
|
size = GST_BUFFER_SIZE (GST_BUFFER_CAST (l->data));
|
|
|
|
|
|
|
|
/* find initial 4-byte marker which we need to skip later on */
|
|
|
|
if (size == 4 && memcmp (data, "fLaC", 4) == 0) {
|
|
|
|
marker = GST_BUFFER_CAST (l->data);
|
|
|
|
} else if (size > 1 && (data[0] & 0x7f) == HDR_TYPE_STREAMINFO) {
|
|
|
|
streaminfo = GST_BUFFER_CAST (l->data);
|
|
|
|
} else if (size > 1 && (data[0] & 0x7f) == HDR_TYPE_VORBISCOMMENT) {
|
|
|
|
vorbiscomment = GST_BUFFER_CAST (l->data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (marker == NULL || streaminfo == NULL || vorbiscomment == NULL) {
|
|
|
|
GST_WARNING_OBJECT (enc, "missing header %p %p %p, muxing into container "
|
|
|
|
"formats may be broken", marker, streaminfo, vorbiscomment);
|
|
|
|
goto push_headers;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_value_init (&array, GST_TYPE_ARRAY);
|
|
|
|
|
|
|
|
/* add marker including STREAMINFO header */
|
|
|
|
{
|
|
|
|
GstBuffer *buf;
|
|
|
|
guint16 num;
|
|
|
|
|
|
|
|
/* minus one for the marker that is merged with streaminfo here */
|
|
|
|
num = g_list_length (enc->headers) - 1;
|
|
|
|
|
|
|
|
buf = gst_buffer_new_and_alloc (13 + GST_BUFFER_SIZE (streaminfo));
|
|
|
|
GST_BUFFER_DATA (buf)[0] = 0x7f;
|
|
|
|
memcpy (GST_BUFFER_DATA (buf) + 1, "FLAC", 4);
|
|
|
|
GST_BUFFER_DATA (buf)[5] = 0x01; /* mapping version major */
|
|
|
|
GST_BUFFER_DATA (buf)[6] = 0x00; /* mapping version minor */
|
|
|
|
GST_BUFFER_DATA (buf)[7] = (num & 0xFF00) >> 8;
|
|
|
|
GST_BUFFER_DATA (buf)[8] = (num & 0x00FF) >> 0;
|
|
|
|
memcpy (GST_BUFFER_DATA (buf) + 9, "fLaC", 4);
|
|
|
|
memcpy (GST_BUFFER_DATA (buf) + 13, GST_BUFFER_DATA (streaminfo),
|
|
|
|
GST_BUFFER_SIZE (streaminfo));
|
|
|
|
notgst_value_array_append_buffer (&array, buf);
|
|
|
|
gst_buffer_unref (buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* add VORBISCOMMENT header */
|
|
|
|
notgst_value_array_append_buffer (&array, vorbiscomment);
|
|
|
|
|
|
|
|
/* add other headers, if there are any */
|
|
|
|
for (l = enc->headers; l != NULL; l = l->next) {
|
|
|
|
if (GST_BUFFER_CAST (l->data) != marker &&
|
|
|
|
GST_BUFFER_CAST (l->data) != streaminfo &&
|
|
|
|
GST_BUFFER_CAST (l->data) != vorbiscomment) {
|
|
|
|
notgst_value_array_append_buffer (&array, GST_BUFFER_CAST (l->data));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_structure_set_value (gst_caps_get_structure (caps, 0),
|
|
|
|
"streamheader", &array);
|
|
|
|
g_value_unset (&array);
|
|
|
|
|
|
|
|
push_headers:
|
|
|
|
|
|
|
|
gst_pad_set_caps (enc->srcpad, caps);
|
|
|
|
|
|
|
|
/* push header buffers; update caps, so when we push the first buffer the
|
|
|
|
* negotiated caps will change to caps that include the streamheader field */
|
|
|
|
for (l = enc->headers; l != NULL; l = l->next) {
|
|
|
|
GstBuffer *buf;
|
|
|
|
|
|
|
|
buf = GST_BUFFER (l->data);
|
|
|
|
gst_buffer_set_caps (buf, caps);
|
|
|
|
GST_LOG ("Pushing header buffer, size %u bytes", GST_BUFFER_SIZE (buf));
|
|
|
|
(void) gst_pad_push (enc->srcpad, buf);
|
|
|
|
l->data = NULL;
|
|
|
|
}
|
|
|
|
g_list_free (enc->headers);
|
|
|
|
enc->headers = NULL;
|
|
|
|
|
|
|
|
gst_caps_unref (caps);
|
|
|
|
}
|
|
|
|
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
static FLAC__StreamEncoderWriteStatus
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_write_callback (const FLAC__SeekableStreamEncoder * encoder,
|
2004-03-14 22:34:33 +00:00
|
|
|
const FLAC__byte buffer[], unsigned bytes,
|
|
|
|
unsigned samples, unsigned current_frame, void *client_data)
|
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
|
|
|
#else
|
|
|
|
static FLAC__StreamEncoderWriteStatus
|
|
|
|
gst_flac_enc_write_callback (const FLAC__StreamEncoder * encoder,
|
|
|
|
const FLAC__byte buffer[], size_t bytes,
|
|
|
|
unsigned samples, unsigned current_frame, void *client_data)
|
|
|
|
#endif
|
2001-12-23 13:56:23 +00:00
|
|
|
{
|
2007-05-25 16:02:51 +00:00
|
|
|
GstFlowReturn ret = GST_FLOW_OK;
|
2005-10-02 15:33:14 +00:00
|
|
|
GstFlacEnc *flacenc;
|
2001-12-23 13:56:23 +00:00
|
|
|
GstBuffer *outbuf;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
flacenc = GST_FLAC_ENC (client_data);
|
2001-12-23 13:56:23 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
if (flacenc->stopped)
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
|
2002-09-15 22:26:33 +00:00
|
|
|
|
2007-05-25 16:02:51 +00:00
|
|
|
outbuf = gst_buffer_new_and_alloc (bytes);
|
2001-12-23 13:56:23 +00:00
|
|
|
memcpy (GST_BUFFER_DATA (outbuf), buffer, bytes);
|
|
|
|
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
if (samples > 0 && flacenc->samples_written != (guint64) - 1) {
|
2007-05-25 16:02:51 +00:00
|
|
|
guint64 granulepos;
|
|
|
|
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
GST_BUFFER_TIMESTAMP (outbuf) =
|
|
|
|
GST_FRAMES_TO_CLOCK_TIME (flacenc->samples_written,
|
|
|
|
flacenc->sample_rate);
|
|
|
|
GST_BUFFER_DURATION (outbuf) =
|
|
|
|
GST_FRAMES_TO_CLOCK_TIME (samples, flacenc->sample_rate);
|
|
|
|
/* offset_end = granulepos for ogg muxer */
|
2007-05-25 16:02:51 +00:00
|
|
|
granulepos = flacenc->samples_written + samples;
|
|
|
|
GST_BUFFER_OFFSET_END (outbuf) = granulepos;
|
|
|
|
/* offset = timestamp corresponding to granulepos for ogg muxer
|
|
|
|
* (see vorbisenc for a much more elaborate version of this) */
|
|
|
|
GST_BUFFER_OFFSET (outbuf) =
|
|
|
|
GST_FRAMES_TO_CLOCK_TIME (granulepos, flacenc->sample_rate);
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
} else {
|
|
|
|
GST_BUFFER_TIMESTAMP (outbuf) = GST_CLOCK_TIME_NONE;
|
|
|
|
GST_BUFFER_DURATION (outbuf) = GST_CLOCK_TIME_NONE;
|
|
|
|
}
|
|
|
|
|
2007-05-25 16:02:51 +00:00
|
|
|
/* we assume libflac passes us stuff neatly framed */
|
|
|
|
if (!flacenc->got_headers) {
|
|
|
|
if (samples == 0) {
|
|
|
|
GST_DEBUG_OBJECT (flacenc, "Got header, queueing (%u bytes)", bytes);
|
|
|
|
flacenc->headers = g_list_append (flacenc->headers, outbuf);
|
|
|
|
/* note: it's important that we increase our byte offset */
|
|
|
|
goto out;
|
|
|
|
} else {
|
|
|
|
GST_INFO_OBJECT (flacenc, "Non-header packet, we have all headers now");
|
|
|
|
gst_flac_enc_process_stream_headers (flacenc);
|
|
|
|
flacenc->got_headers = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_LOG ("Pushing buffer: ts=%" GST_TIME_FORMAT ", samples=%u, size=%u, "
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
"pos=%" G_GUINT64_FORMAT, GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf)),
|
|
|
|
samples, bytes, flacenc->offset);
|
|
|
|
|
2007-05-25 16:02:51 +00:00
|
|
|
gst_buffer_set_caps (outbuf, GST_PAD_CAPS (flacenc->srcpad));
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
ret = gst_pad_push (flacenc->srcpad, outbuf);
|
|
|
|
|
2007-09-26 13:19:17 +00:00
|
|
|
if (ret != GST_FLOW_OK)
|
|
|
|
GST_DEBUG_OBJECT (flacenc, "flow: %s", gst_flow_get_name (ret));
|
|
|
|
|
|
|
|
flacenc->last_flow = ret;
|
|
|
|
|
2007-05-25 16:02:51 +00:00
|
|
|
out:
|
|
|
|
|
2005-01-09 20:01:59 +00:00
|
|
|
flacenc->offset += bytes;
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
flacenc->samples_written += samples;
|
2005-01-09 20:01:59 +00:00
|
|
|
|
2007-09-26 13:19:17 +00:00
|
|
|
if (GST_FLOW_IS_FATAL (ret) || ret == GST_FLOW_NOT_LINKED)
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR;
|
|
|
|
|
|
|
|
return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
|
2005-01-09 20:01:59 +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
|
|
|
#ifdef LEGACY_FLAC
|
2005-01-09 20:01:59 +00:00
|
|
|
static FLAC__SeekableStreamEncoderTellStatus
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_tell_callback (const FLAC__SeekableStreamEncoder * encoder,
|
2005-01-09 20:01:59 +00:00
|
|
|
FLAC__uint64 * absolute_byte_offset, void *client_data)
|
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
|
|
|
#else
|
|
|
|
static FLAC__StreamEncoderTellStatus
|
|
|
|
gst_flac_enc_tell_callback (const FLAC__StreamEncoder * encoder,
|
|
|
|
FLAC__uint64 * absolute_byte_offset, void *client_data)
|
|
|
|
#endif
|
2005-01-09 20:01:59 +00:00
|
|
|
{
|
2005-12-09 19:51:03 +00:00
|
|
|
GstFlacEnc *flacenc = GST_FLAC_ENC (client_data);
|
2005-01-09 20:01:59 +00:00
|
|
|
|
|
|
|
*absolute_byte_offset = flacenc->offset;
|
2001-12-23 13:56:23 +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
|
|
|
#ifdef LEGACY_FLAC
|
2006-10-16 18:22:47 +00:00
|
|
|
return FLAC__SEEKABLE_STREAM_ENCODER_TELL_STATUS_OK;
|
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
|
|
|
#else
|
|
|
|
return FLAC__STREAM_ENCODER_TELL_STATUS_OK;
|
|
|
|
#endif
|
2001-12-23 13:56:23 +00:00
|
|
|
}
|
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
static gboolean
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_sink_event (GstPad * pad, GstEvent * event)
|
2003-11-28 13:04:21 +00:00
|
|
|
{
|
2005-10-02 15:33:14 +00:00
|
|
|
GstFlacEnc *flacenc;
|
|
|
|
GstTagList *taglist;
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
gboolean ret = TRUE;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2005-12-09 19:51:03 +00:00
|
|
|
flacenc = GST_FLAC_ENC (gst_pad_get_parent (pad));
|
2002-06-07 20:09:05 +00:00
|
|
|
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
GST_DEBUG ("Received %s event on sinkpad", GST_EVENT_TYPE_NAME (event));
|
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
case GST_EVENT_NEWSEGMENT:{
|
|
|
|
GstFormat format;
|
|
|
|
gint64 start, stream_time;
|
|
|
|
|
|
|
|
if (flacenc->offset == 0) {
|
2005-11-22 11:53:34 +00:00
|
|
|
gst_event_parse_new_segment (event, NULL, NULL, &format, &start, NULL,
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
&stream_time);
|
|
|
|
} else {
|
|
|
|
start = -1;
|
|
|
|
}
|
|
|
|
if (start != 0) {
|
|
|
|
if (flacenc->offset > 0)
|
|
|
|
GST_DEBUG ("Not handling mid-stream newsegment event");
|
|
|
|
else
|
|
|
|
GST_DEBUG ("Not handling newsegment event with non-zero start");
|
|
|
|
} else {
|
2005-11-22 11:53:34 +00:00
|
|
|
GstEvent *e = gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_BYTES,
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
0, -1, 0);
|
|
|
|
|
|
|
|
ret = gst_pad_push_event (flacenc->srcpad, e);
|
|
|
|
}
|
|
|
|
if (stream_time != 0) {
|
|
|
|
GST_DEBUG ("Not handling non-zero stream time");
|
|
|
|
}
|
|
|
|
gst_event_unref (event);
|
|
|
|
/* don't push it downstream, we'll generate our own via seek to 0 */
|
|
|
|
break;
|
|
|
|
}
|
2005-10-02 15:33:14 +00:00
|
|
|
case GST_EVENT_EOS:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2005-10-02 15:33:14 +00:00
|
|
|
FLAC__seekable_stream_encoder_finish (flacenc->encoder);
|
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
|
|
|
#else
|
|
|
|
FLAC__stream_encoder_finish (flacenc->encoder);
|
|
|
|
#endif
|
2005-10-02 15:33:14 +00:00
|
|
|
ret = gst_pad_event_default (pad, event);
|
|
|
|
break;
|
|
|
|
case GST_EVENT_TAG:
|
|
|
|
if (flacenc->tags) {
|
|
|
|
gst_event_parse_tag (event, &taglist);
|
|
|
|
gst_tag_list_insert (flacenc->tags, taglist, GST_TAG_MERGE_REPLACE);
|
|
|
|
} else {
|
|
|
|
g_assert_not_reached ();
|
|
|
|
}
|
|
|
|
ret = gst_pad_event_default (pad, event);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
ret = gst_pad_event_default (pad, event);
|
|
|
|
break;
|
2003-11-28 13:04:21 +00:00
|
|
|
}
|
2002-06-07 20:09:05 +00:00
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
gst_object_unref (flacenc);
|
2002-06-07 20:09:05 +00:00
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
return ret;
|
2003-05-11 17:18:17 +00:00
|
|
|
}
|
2002-06-07 20:09:05 +00:00
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
static GstFlowReturn
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_chain (GstPad * pad, GstBuffer * buffer)
|
2001-12-23 13:56:23 +00:00
|
|
|
{
|
2005-10-02 15:33:14 +00:00
|
|
|
GstFlacEnc *flacenc;
|
2002-09-15 22:26:33 +00:00
|
|
|
FLAC__int32 *data;
|
2001-12-23 13:56:23 +00:00
|
|
|
gulong insize;
|
2002-09-15 22:26:33 +00:00
|
|
|
gint samples, depth;
|
|
|
|
gulong i;
|
|
|
|
FLAC__bool res;
|
2001-12-23 13:56:23 +00:00
|
|
|
|
2007-05-24 17:00:21 +00:00
|
|
|
flacenc = GST_FLAC_ENC (GST_PAD_PARENT (pad));
|
|
|
|
|
2007-05-25 16:02:51 +00:00
|
|
|
/* make sure setcaps has been called and the encoder is set up */
|
2007-05-24 17:00:21 +00:00
|
|
|
if (G_UNLIKELY (flacenc->depth == 0))
|
|
|
|
return GST_FLOW_NOT_NEGOTIATED;
|
2001-12-23 13:56:23 +00:00
|
|
|
|
|
|
|
depth = flacenc->depth;
|
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
insize = GST_BUFFER_SIZE (buffer);
|
2004-03-14 22:34:33 +00:00
|
|
|
samples = insize / ((depth + 7) >> 3);
|
2001-12-23 13:56:23 +00:00
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
data = g_malloc (samples * sizeof (FLAC__int32));
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2001-12-23 13:56:23 +00:00
|
|
|
if (depth == 8) {
|
2005-10-02 15:33:14 +00:00
|
|
|
gint8 *indata = (gint8 *) GST_BUFFER_DATA (buffer);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
for (i = 0; i < samples; i++)
|
|
|
|
data[i] = (FLAC__int32) indata[i];
|
2004-03-14 22:34:33 +00:00
|
|
|
} else if (depth == 16) {
|
2005-10-02 15:33:14 +00:00
|
|
|
gint16 *indata = (gint16 *) GST_BUFFER_DATA (buffer);
|
2002-09-15 22:26:33 +00:00
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
for (i = 0; i < samples; i++)
|
|
|
|
data[i] = (FLAC__int32) indata[i];
|
|
|
|
} else {
|
|
|
|
g_assert_not_reached ();
|
2001-12-23 13:56:23 +00:00
|
|
|
}
|
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
gst_buffer_unref (buffer);
|
2001-12-23 13:56:23 +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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
res = FLAC__seekable_stream_encoder_process_interleaved (flacenc->encoder,
|
|
|
|
(const FLAC__int32 *) data, samples / flacenc->channels);
|
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
|
|
|
#else
|
|
|
|
res = FLAC__stream_encoder_process_interleaved (flacenc->encoder,
|
|
|
|
(const FLAC__int32 *) data, samples / flacenc->channels);
|
|
|
|
#endif
|
2001-12-23 13:56:23 +00:00
|
|
|
|
2005-10-02 15:33:14 +00:00
|
|
|
g_free (data);
|
2002-09-15 22:26:33 +00:00
|
|
|
|
2007-09-26 13:19:17 +00:00
|
|
|
if (!res) {
|
|
|
|
if (flacenc->last_flow == GST_FLOW_OK)
|
|
|
|
return GST_FLOW_ERROR;
|
|
|
|
else
|
|
|
|
return flacenc->last_flow;
|
|
|
|
}
|
|
|
|
|
|
|
|
return GST_FLOW_OK;
|
2001-12-23 13:56:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_set_property (GObject * object, guint prop_id,
|
2004-03-14 22:34:33 +00:00
|
|
|
const GValue * value, GParamSpec * pspec)
|
2001-12-23 13:56:23 +00:00
|
|
|
{
|
2005-12-09 19:51:03 +00:00
|
|
|
GstFlacEnc *this = GST_FLAC_ENC (object);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2005-11-21 16:36:05 +00:00
|
|
|
GST_OBJECT_LOCK (this);
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
|
2001-12-23 13:56:23 +00:00
|
|
|
switch (prop_id) {
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_QUALITY:
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_update_quality (this, g_value_get_enum (value));
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_STREAMABLE_SUBSET:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
FLAC__seekable_stream_encoder_set_streamable_subset (this->encoder,
|
2004-03-15 19:32:27 +00:00
|
|
|
g_value_get_boolean (value));
|
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
|
|
|
#else
|
|
|
|
FLAC__stream_encoder_set_streamable_subset (this->encoder,
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_MID_SIDE_STEREO:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
FLAC__seekable_stream_encoder_set_do_mid_side_stereo (this->encoder,
|
2004-03-15 19:32:27 +00:00
|
|
|
g_value_get_boolean (value));
|
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
|
|
|
#else
|
|
|
|
FLAC__stream_encoder_set_do_mid_side_stereo (this->encoder,
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_LOOSE_MID_SIDE_STEREO:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
FLAC__seekable_stream_encoder_set_loose_mid_side_stereo (this->encoder,
|
2004-03-15 19:32:27 +00:00
|
|
|
g_value_get_boolean (value));
|
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
|
|
|
#else
|
|
|
|
FLAC__stream_encoder_set_loose_mid_side_stereo (this->encoder,
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_BLOCKSIZE:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
FLAC__seekable_stream_encoder_set_blocksize (this->encoder,
|
2004-03-15 19:32:27 +00:00
|
|
|
g_value_get_uint (value));
|
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
|
|
|
#else
|
|
|
|
FLAC__stream_encoder_set_blocksize (this->encoder,
|
|
|
|
g_value_get_uint (value));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_MAX_LPC_ORDER:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
FLAC__seekable_stream_encoder_set_max_lpc_order (this->encoder,
|
2004-03-15 19:32:27 +00:00
|
|
|
g_value_get_uint (value));
|
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
|
|
|
#else
|
|
|
|
FLAC__stream_encoder_set_max_lpc_order (this->encoder,
|
|
|
|
g_value_get_uint (value));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_QLP_COEFF_PRECISION:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
FLAC__seekable_stream_encoder_set_qlp_coeff_precision (this->encoder,
|
2004-03-15 19:32:27 +00:00
|
|
|
g_value_get_uint (value));
|
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
|
|
|
#else
|
|
|
|
FLAC__stream_encoder_set_qlp_coeff_precision (this->encoder,
|
|
|
|
g_value_get_uint (value));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_QLP_COEFF_PREC_SEARCH:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
FLAC__seekable_stream_encoder_set_do_qlp_coeff_prec_search (this->encoder,
|
2004-03-15 19:32:27 +00:00
|
|
|
g_value_get_boolean (value));
|
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
|
|
|
#else
|
|
|
|
FLAC__stream_encoder_set_do_qlp_coeff_prec_search (this->encoder,
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_ESCAPE_CODING:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
FLAC__seekable_stream_encoder_set_do_escape_coding (this->encoder,
|
2004-03-15 19:32:27 +00:00
|
|
|
g_value_get_boolean (value));
|
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
|
|
|
#else
|
|
|
|
FLAC__stream_encoder_set_do_escape_coding (this->encoder,
|
|
|
|
g_value_get_boolean (value));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_EXHAUSTIVE_MODEL_SEARCH:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
FLAC__seekable_stream_encoder_set_do_exhaustive_model_search (this->
|
2004-03-15 19:32:27 +00:00
|
|
|
encoder, g_value_get_boolean (value));
|
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
|
|
|
#else
|
|
|
|
FLAC__stream_encoder_set_do_exhaustive_model_search (this->
|
|
|
|
encoder, g_value_get_boolean (value));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_MIN_RESIDUAL_PARTITION_ORDER:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
FLAC__seekable_stream_encoder_set_min_residual_partition_order (this->
|
2004-03-15 19:32:27 +00:00
|
|
|
encoder, g_value_get_uint (value));
|
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
|
|
|
#else
|
|
|
|
FLAC__stream_encoder_set_min_residual_partition_order (this->
|
|
|
|
encoder, g_value_get_uint (value));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_MAX_RESIDUAL_PARTITION_ORDER:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
FLAC__seekable_stream_encoder_set_max_residual_partition_order (this->
|
2004-03-15 19:32:27 +00:00
|
|
|
encoder, g_value_get_uint (value));
|
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
|
|
|
#else
|
|
|
|
FLAC__stream_encoder_set_max_residual_partition_order (this->
|
|
|
|
encoder, g_value_get_uint (value));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_RICE_PARAMETER_SEARCH_DIST:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
FLAC__seekable_stream_encoder_set_rice_parameter_search_dist (this->
|
2004-03-15 19:32:27 +00:00
|
|
|
encoder, g_value_get_uint (value));
|
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
|
|
|
#else
|
|
|
|
FLAC__stream_encoder_set_rice_parameter_search_dist (this->
|
|
|
|
encoder, g_value_get_uint (value));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
break;
|
2001-12-23 13:56:23 +00:00
|
|
|
}
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
|
2005-11-21 16:36:05 +00:00
|
|
|
GST_OBJECT_UNLOCK (this);
|
2001-12-23 13:56:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_get_property (GObject * object, guint prop_id,
|
2004-03-14 22:34:33 +00:00
|
|
|
GValue * value, GParamSpec * pspec)
|
2001-12-23 13:56:23 +00:00
|
|
|
{
|
2005-12-09 19:51:03 +00:00
|
|
|
GstFlacEnc *this = GST_FLAC_ENC (object);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2005-11-21 16:36:05 +00:00
|
|
|
GST_OBJECT_LOCK (this);
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
|
2001-12-23 13:56:23 +00:00
|
|
|
switch (prop_id) {
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_QUALITY:
|
2002-09-15 22:26:33 +00:00
|
|
|
g_value_set_enum (value, this->quality);
|
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_STREAMABLE_SUBSET:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
g_value_set_boolean (value,
|
2004-03-15 19:32:27 +00:00
|
|
|
FLAC__seekable_stream_encoder_get_streamable_subset (this->encoder));
|
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
|
|
|
#else
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
FLAC__stream_encoder_get_streamable_subset (this->encoder));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_MID_SIDE_STEREO:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
g_value_set_boolean (value,
|
2004-03-15 19:32:27 +00:00
|
|
|
FLAC__seekable_stream_encoder_get_do_mid_side_stereo (this->encoder));
|
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
|
|
|
#else
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
FLAC__stream_encoder_get_do_mid_side_stereo (this->encoder));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_LOOSE_MID_SIDE_STEREO:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
g_value_set_boolean (value,
|
2004-03-15 19:32:27 +00:00
|
|
|
FLAC__seekable_stream_encoder_get_loose_mid_side_stereo (this->
|
|
|
|
encoder));
|
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
|
|
|
#else
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
FLAC__stream_encoder_get_loose_mid_side_stereo (this->encoder));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_BLOCKSIZE:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
g_value_set_uint (value,
|
2004-03-15 19:32:27 +00:00
|
|
|
FLAC__seekable_stream_encoder_get_blocksize (this->encoder));
|
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
|
|
|
#else
|
|
|
|
g_value_set_uint (value,
|
|
|
|
FLAC__stream_encoder_get_blocksize (this->encoder));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_MAX_LPC_ORDER:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
g_value_set_uint (value,
|
2004-03-15 19:32:27 +00:00
|
|
|
FLAC__seekable_stream_encoder_get_max_lpc_order (this->encoder));
|
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
|
|
|
#else
|
|
|
|
g_value_set_uint (value,
|
|
|
|
FLAC__stream_encoder_get_max_lpc_order (this->encoder));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_QLP_COEFF_PRECISION:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
g_value_set_uint (value,
|
2004-03-15 19:32:27 +00:00
|
|
|
FLAC__seekable_stream_encoder_get_qlp_coeff_precision (this->
|
|
|
|
encoder));
|
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
|
|
|
#else
|
|
|
|
g_value_set_uint (value,
|
|
|
|
FLAC__stream_encoder_get_qlp_coeff_precision (this->encoder));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_QLP_COEFF_PREC_SEARCH:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
g_value_set_boolean (value,
|
2004-03-15 19:32:27 +00:00
|
|
|
FLAC__seekable_stream_encoder_get_do_qlp_coeff_prec_search (this->
|
|
|
|
encoder));
|
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
|
|
|
#else
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
FLAC__stream_encoder_get_do_qlp_coeff_prec_search (this->encoder));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_ESCAPE_CODING:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
g_value_set_boolean (value,
|
2004-03-15 19:32:27 +00:00
|
|
|
FLAC__seekable_stream_encoder_get_do_escape_coding (this->encoder));
|
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
|
|
|
#else
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
FLAC__stream_encoder_get_do_escape_coding (this->encoder));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_EXHAUSTIVE_MODEL_SEARCH:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
g_value_set_boolean (value,
|
2004-03-15 19:32:27 +00:00
|
|
|
FLAC__seekable_stream_encoder_get_do_exhaustive_model_search (this->
|
|
|
|
encoder));
|
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
|
|
|
#else
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
FLAC__stream_encoder_get_do_exhaustive_model_search (this->encoder));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_MIN_RESIDUAL_PARTITION_ORDER:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
g_value_set_uint (value,
|
2004-03-15 19:32:27 +00:00
|
|
|
FLAC__seekable_stream_encoder_get_min_residual_partition_order (this->
|
|
|
|
encoder));
|
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
|
|
|
#else
|
|
|
|
g_value_set_uint (value,
|
|
|
|
FLAC__stream_encoder_get_min_residual_partition_order (this->
|
|
|
|
encoder));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_MAX_RESIDUAL_PARTITION_ORDER:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
g_value_set_uint (value,
|
2004-03-15 19:32:27 +00:00
|
|
|
FLAC__seekable_stream_encoder_get_max_residual_partition_order (this->
|
|
|
|
encoder));
|
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
|
|
|
#else
|
|
|
|
g_value_set_uint (value,
|
|
|
|
FLAC__stream_encoder_get_max_residual_partition_order (this->
|
|
|
|
encoder));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
2005-10-02 15:33:14 +00:00
|
|
|
case PROP_RICE_PARAMETER_SEARCH_DIST:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
g_value_set_uint (value,
|
2004-03-15 19:32:27 +00:00
|
|
|
FLAC__seekable_stream_encoder_get_rice_parameter_search_dist (this->
|
|
|
|
encoder));
|
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
|
|
|
#else
|
|
|
|
g_value_set_uint (value,
|
|
|
|
FLAC__stream_encoder_get_rice_parameter_search_dist (this->encoder));
|
|
|
|
#endif
|
2002-09-15 22:26:33 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
2001-12-23 13:56:23 +00:00
|
|
|
}
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
|
2005-11-21 16:36:05 +00:00
|
|
|
GST_OBJECT_UNLOCK (this);
|
2001-12-23 13:56:23 +00:00
|
|
|
}
|
|
|
|
|
2005-09-02 15:44:50 +00:00
|
|
|
static GstStateChangeReturn
|
2005-12-09 19:51:03 +00:00
|
|
|
gst_flac_enc_change_state (GstElement * element, GstStateChange transition)
|
2002-09-15 17:48:42 +00:00
|
|
|
{
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
2005-12-09 19:51:03 +00:00
|
|
|
GstFlacEnc *flacenc = GST_FLAC_ENC (element);
|
2002-09-15 17:48:42 +00:00
|
|
|
|
2005-09-02 15:44:50 +00:00
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_NULL_TO_READY:
|
|
|
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
2002-09-15 22:26:33 +00:00
|
|
|
flacenc->stopped = FALSE;
|
2002-09-15 17:48:42 +00:00
|
|
|
break;
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
|
|
|
|
|
|
|
switch (transition) {
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
|
2002-09-15 17:48:42 +00:00
|
|
|
break;
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
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
|
|
|
#ifdef LEGACY_FLAC
|
2004-03-14 22:34:33 +00:00
|
|
|
if (FLAC__seekable_stream_encoder_get_state (flacenc->encoder) !=
|
2004-03-15 19:32:27 +00:00
|
|
|
FLAC__STREAM_ENCODER_UNINITIALIZED) {
|
|
|
|
flacenc->stopped = TRUE;
|
|
|
|
FLAC__seekable_stream_encoder_finish (flacenc->encoder);
|
2002-09-15 22:26:33 +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
|
|
|
#else
|
|
|
|
if (FLAC__stream_encoder_get_state (flacenc->encoder) !=
|
|
|
|
FLAC__STREAM_ENCODER_UNINITIALIZED) {
|
|
|
|
flacenc->stopped = TRUE;
|
|
|
|
FLAC__stream_encoder_finish (flacenc->encoder);
|
|
|
|
}
|
|
|
|
#endif
|
2005-01-09 20:01:59 +00:00
|
|
|
flacenc->offset = 0;
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
flacenc->samples_written = 0;
|
2007-05-25 16:02:51 +00:00
|
|
|
flacenc->channels = 0;
|
|
|
|
flacenc->depth = 0;
|
|
|
|
flacenc->sample_rate = 0;
|
2003-11-22 01:04:57 +00:00
|
|
|
if (flacenc->meta) {
|
2004-03-15 19:32:27 +00:00
|
|
|
FLAC__metadata_object_delete (flacenc->meta[0]);
|
|
|
|
g_free (flacenc->meta);
|
|
|
|
flacenc->meta = NULL;
|
2003-11-22 01:04:57 +00:00
|
|
|
}
|
2007-05-25 16:02:51 +00:00
|
|
|
g_list_foreach (flacenc->headers, (GFunc) gst_mini_object_unref, NULL);
|
|
|
|
g_list_free (flacenc->headers);
|
|
|
|
flacenc->headers = NULL;
|
|
|
|
flacenc->got_headers = FALSE;
|
2007-09-26 13:19:17 +00:00
|
|
|
flacenc->last_flow = GST_FLOW_OK;
|
2002-09-15 17:48:42 +00:00
|
|
|
break;
|
2005-09-02 15:44:50 +00:00
|
|
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
2002-09-15 17:48:42 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
ext/flac/gstflacenc.*: Fix seeking, so that flacenc can rewrite the header with the correct duration and amount of sa...
Original commit message from CVS:
* ext/flac/gstflacenc.c: (gst_flacenc_base_init),
(gst_flacenc_init), (gst_flacenc_sink_setcaps),
(gst_flacenc_seek_callback), (gst_flacenc_write_callback),
(gst_flacenc_sink_event), (gst_flacenc_chain),
(gst_flacenc_set_property), (gst_flacenc_get_property),
(gst_flacenc_change_state):
* ext/flac/gstflacenc.h:
Fix seeking, so that flacenc can rewrite the header with the
correct duration and amount of samples and all that at EOS;
also set timestamps and granulepos on outgoing buffers; add
debug category; fix state change function.
2005-10-24 15:50:06 +00:00
|
|
|
return ret;
|
2002-09-15 17:48:42 +00:00
|
|
|
}
|