2004-11-07 18:30:06 +00:00
|
|
|
/* GStreamer Musepack decoder plugin
|
|
|
|
* Copyright (C) 2004 Ronald Bultje <rbultje@ronald.bitfreak.net>
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
* Copyright (C) 2006 Tim-Philipp Müller <tim centricular net>
|
2008-04-24 22:19:48 +00:00
|
|
|
* Copyright (C) 2008 Sebastian Dröge <slomo@circular-chaos.org>
|
2004-11-07 18:30:06 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2012-03-06 17:11:35 +00:00
|
|
|
/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex
|
|
|
|
* with newer GLib versions (>= 2.31.0) */
|
|
|
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
|
|
|
|
2004-11-07 18:30:06 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "gstmusepackdec.h"
|
|
|
|
#include "gstmusepackreader.h"
|
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
GST_DEBUG_CATEGORY (musepackdec_debug);
|
|
|
|
#define GST_CAT_DEFAULT musepackdec_debug
|
|
|
|
|
2004-11-07 18:30:06 +00:00
|
|
|
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
|
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
2008-04-24 22:19:48 +00:00
|
|
|
#ifdef MPC_IS_OLD_API
|
|
|
|
GST_STATIC_CAPS ("audio/x-musepack, streamversion = (int) 7")
|
|
|
|
#else
|
|
|
|
GST_STATIC_CAPS ("audio/x-musepack, streamversion = (int) { 7, 8 }")
|
|
|
|
#endif
|
2004-11-07 18:30:06 +00:00
|
|
|
);
|
|
|
|
|
2004-12-03 18:13:43 +00:00
|
|
|
#ifdef MPC_FIXED_POINT
|
|
|
|
#define BASE_CAPS \
|
|
|
|
"audio/x-raw-int, " \
|
|
|
|
"signed = (bool) TRUE, " \
|
|
|
|
"width = (int) 32, " \
|
|
|
|
"depth = (int) 32"
|
|
|
|
#else
|
|
|
|
#define BASE_CAPS \
|
|
|
|
"audio/x-raw-float, " \
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
"width = (int) 32"
|
2004-12-03 18:13:43 +00:00
|
|
|
#endif
|
|
|
|
|
2004-11-07 18:30:06 +00:00
|
|
|
static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
|
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
2004-12-03 18:13:43 +00:00
|
|
|
GST_STATIC_CAPS (BASE_CAPS ", "
|
2004-11-07 18:30:06 +00:00
|
|
|
"endianness = (int) BYTE_ORDER, "
|
Update to 1.1 API (#165446).
Original commit message from CVS:
* configure.ac:
* ext/musepack/Makefile.am:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_class_init),
(gst_musepackdec_init), (gst_musepackdec_dispose),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.cpp:
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_read), (gst_musepack_reader_seek),
(gst_musepack_reader_tell), (gst_musepack_reader_get_size),
(gst_musepack_reader_canseek), (gst_musepack_init_reader):
* ext/musepack/gstmusepackreader.cpp:
* ext/musepack/gstmusepackreader.h:
Update to 1.1 API (#165446).
2005-01-29 01:28:34 +00:00
|
|
|
"rate = (int) [ 8000, 96000 ], " "channels = (int) [ 1, 2 ]")
|
2004-11-07 18:30:06 +00:00
|
|
|
);
|
|
|
|
|
Update to 1.1 API (#165446).
Original commit message from CVS:
* configure.ac:
* ext/musepack/Makefile.am:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_class_init),
(gst_musepackdec_init), (gst_musepackdec_dispose),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.cpp:
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_read), (gst_musepack_reader_seek),
(gst_musepack_reader_tell), (gst_musepack_reader_get_size),
(gst_musepack_reader_canseek), (gst_musepack_init_reader):
* ext/musepack/gstmusepackreader.cpp:
* ext/musepack/gstmusepackreader.h:
Update to 1.1 API (#165446).
2005-01-29 01:28:34 +00:00
|
|
|
static void gst_musepackdec_dispose (GObject * obj);
|
2004-11-07 18:30:06 +00:00
|
|
|
|
|
|
|
static gboolean gst_musepackdec_src_event (GstPad * pad, GstEvent * event);
|
2005-11-22 15:09:28 +00:00
|
|
|
static const GstQueryType *gst_musepackdec_get_src_query_types (GstPad * pad);
|
|
|
|
static gboolean gst_musepackdec_src_query (GstPad * pad, GstQuery * query);
|
|
|
|
static gboolean gst_musepackdec_sink_activate (GstPad * sinkpad);
|
|
|
|
static gboolean
|
|
|
|
gst_musepackdec_sink_activate_pull (GstPad * sinkpad, gboolean active);
|
|
|
|
|
|
|
|
static void gst_musepackdec_loop (GstPad * sinkpad);
|
2005-09-05 17:20:29 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_musepackdec_change_state (GstElement * element, GstStateChange transition);
|
2004-11-07 18:30:06 +00:00
|
|
|
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
GST_BOILERPLATE (GstMusepackDec, gst_musepackdec, GstElement, GST_TYPE_ELEMENT);
|
2004-11-07 18:30:06 +00:00
|
|
|
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
static void
|
|
|
|
gst_musepackdec_base_init (gpointer klass)
|
2004-11-07 18:30:06 +00:00
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
|
|
|
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&src_template));
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&sink_template));
|
|
|
|
|
2008-04-24 22:19:48 +00:00
|
|
|
gst_element_class_set_details_simple (element_class, "Musepack decoder",
|
|
|
|
"Codec/Decoder/Audio",
|
|
|
|
"Musepack decoder", "Ronald Bultje <rbultje@ronald.bitfreak.net>");
|
2004-11-07 18:30:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_musepackdec_class_init (GstMusepackDecClass * klass)
|
|
|
|
{
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
GST_ELEMENT_CLASS (klass)->change_state =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_musepackdec_change_state);
|
2004-11-07 18:30:06 +00:00
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
G_OBJECT_CLASS (klass)->dispose = GST_DEBUG_FUNCPTR (gst_musepackdec_dispose);
|
2004-11-07 18:30:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
gst_musepackdec_init (GstMusepackDec * musepackdec, GstMusepackDecClass * klass)
|
2004-11-07 18:30:06 +00:00
|
|
|
{
|
2005-11-22 15:09:28 +00:00
|
|
|
musepackdec->offset = 0;
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
musepackdec->rate = 0;
|
|
|
|
musepackdec->bps = 0;
|
2004-11-07 18:30:06 +00:00
|
|
|
|
Update to 1.1 API (#165446).
Original commit message from CVS:
* configure.ac:
* ext/musepack/Makefile.am:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_class_init),
(gst_musepackdec_init), (gst_musepackdec_dispose),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.cpp:
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_read), (gst_musepack_reader_seek),
(gst_musepack_reader_tell), (gst_musepack_reader_get_size),
(gst_musepack_reader_canseek), (gst_musepack_init_reader):
* ext/musepack/gstmusepackreader.cpp:
* ext/musepack/gstmusepackreader.h:
Update to 1.1 API (#165446).
2005-01-29 01:28:34 +00:00
|
|
|
musepackdec->r = g_new (mpc_reader, 1);
|
2008-04-24 22:19:48 +00:00
|
|
|
#ifdef MPC_IS_OLD_API
|
Update to 1.1 API (#165446).
Original commit message from CVS:
* configure.ac:
* ext/musepack/Makefile.am:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_class_init),
(gst_musepackdec_init), (gst_musepackdec_dispose),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.cpp:
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_read), (gst_musepack_reader_seek),
(gst_musepack_reader_tell), (gst_musepack_reader_get_size),
(gst_musepack_reader_canseek), (gst_musepack_init_reader):
* ext/musepack/gstmusepackreader.cpp:
* ext/musepack/gstmusepackreader.h:
Update to 1.1 API (#165446).
2005-01-29 01:28:34 +00:00
|
|
|
musepackdec->d = g_new (mpc_decoder, 1);
|
2008-04-24 22:19:48 +00:00
|
|
|
#endif
|
2004-11-07 18:30:06 +00:00
|
|
|
|
|
|
|
musepackdec->sinkpad =
|
2006-04-14 13:12:58 +00:00
|
|
|
gst_pad_new_from_static_template (&sink_template, "sink");
|
2005-11-22 15:09:28 +00:00
|
|
|
gst_pad_set_activate_function (musepackdec->sinkpad,
|
2006-04-14 13:12:58 +00:00
|
|
|
GST_DEBUG_FUNCPTR (gst_musepackdec_sink_activate));
|
2005-11-22 15:09:28 +00:00
|
|
|
gst_pad_set_activatepull_function (musepackdec->sinkpad,
|
2006-04-14 13:12:58 +00:00
|
|
|
GST_DEBUG_FUNCPTR (gst_musepackdec_sink_activate_pull));
|
|
|
|
gst_element_add_pad (GST_ELEMENT (musepackdec), musepackdec->sinkpad);
|
2005-11-22 15:09:28 +00:00
|
|
|
|
2006-04-14 13:12:58 +00:00
|
|
|
musepackdec->srcpad = gst_pad_new_from_static_template (&src_template, "src");
|
2004-11-07 18:30:06 +00:00
|
|
|
gst_pad_set_event_function (musepackdec->srcpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_musepackdec_src_event));
|
|
|
|
gst_pad_set_query_function (musepackdec->srcpad,
|
|
|
|
GST_DEBUG_FUNCPTR (gst_musepackdec_src_query));
|
|
|
|
gst_pad_set_query_type_function (musepackdec->srcpad,
|
2005-11-22 15:09:28 +00:00
|
|
|
GST_DEBUG_FUNCPTR (gst_musepackdec_get_src_query_types));
|
|
|
|
gst_pad_use_fixed_caps (musepackdec->srcpad);
|
2004-11-07 18:30:06 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (musepackdec), musepackdec->srcpad);
|
|
|
|
}
|
|
|
|
|
Update to 1.1 API (#165446).
Original commit message from CVS:
* configure.ac:
* ext/musepack/Makefile.am:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_class_init),
(gst_musepackdec_init), (gst_musepackdec_dispose),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.cpp:
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_read), (gst_musepack_reader_seek),
(gst_musepack_reader_tell), (gst_musepack_reader_get_size),
(gst_musepack_reader_canseek), (gst_musepack_init_reader):
* ext/musepack/gstmusepackreader.cpp:
* ext/musepack/gstmusepackreader.h:
Update to 1.1 API (#165446).
2005-01-29 01:28:34 +00:00
|
|
|
static void
|
|
|
|
gst_musepackdec_dispose (GObject * obj)
|
|
|
|
{
|
|
|
|
GstMusepackDec *musepackdec = GST_MUSEPACK_DEC (obj);
|
|
|
|
|
|
|
|
g_free (musepackdec->r);
|
|
|
|
musepackdec->r = NULL;
|
2008-04-24 22:19:48 +00:00
|
|
|
|
|
|
|
#ifdef MPC_IS_OLD_API
|
Update to 1.1 API (#165446).
Original commit message from CVS:
* configure.ac:
* ext/musepack/Makefile.am:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_class_init),
(gst_musepackdec_init), (gst_musepackdec_dispose),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.cpp:
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_read), (gst_musepack_reader_seek),
(gst_musepack_reader_tell), (gst_musepack_reader_get_size),
(gst_musepack_reader_canseek), (gst_musepack_init_reader):
* ext/musepack/gstmusepackreader.cpp:
* ext/musepack/gstmusepackreader.h:
Update to 1.1 API (#165446).
2005-01-29 01:28:34 +00:00
|
|
|
g_free (musepackdec->d);
|
|
|
|
musepackdec->d = NULL;
|
2008-04-24 22:19:48 +00:00
|
|
|
#else
|
|
|
|
if (musepackdec->d) {
|
|
|
|
mpc_demux_exit (musepackdec->d);
|
|
|
|
musepackdec->d = NULL;
|
|
|
|
}
|
|
|
|
#endif
|
Update to 1.1 API (#165446).
Original commit message from CVS:
* configure.ac:
* ext/musepack/Makefile.am:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_class_init),
(gst_musepackdec_init), (gst_musepackdec_dispose),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.cpp:
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_read), (gst_musepack_reader_seek),
(gst_musepack_reader_tell), (gst_musepack_reader_get_size),
(gst_musepack_reader_canseek), (gst_musepack_init_reader):
* ext/musepack/gstmusepackreader.cpp:
* ext/musepack/gstmusepackreader.h:
Update to 1.1 API (#165446).
2005-01-29 01:28:34 +00:00
|
|
|
|
|
|
|
G_OBJECT_CLASS (parent_class)->dispose (obj);
|
|
|
|
}
|
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
static void
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
gst_musepackdec_send_newsegment (GstMusepackDec * dec)
|
2005-11-22 15:09:28 +00:00
|
|
|
{
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
GstSegment *s = &dec->segment;
|
|
|
|
gint64 stop_time = GST_CLOCK_TIME_NONE;
|
|
|
|
gint64 start_time = 0;
|
|
|
|
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
start_time = gst_util_uint64_scale_int (s->start, GST_SECOND, dec->rate);
|
2005-11-22 15:09:28 +00:00
|
|
|
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
if (s->stop != -1)
|
|
|
|
stop_time = gst_util_uint64_scale_int (s->stop, GST_SECOND, dec->rate);
|
2005-11-22 15:09:28 +00:00
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
GST_DEBUG_OBJECT (dec, "sending newsegment from %" GST_TIME_FORMAT
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
" to %" GST_TIME_FORMAT ", rate = %.1f", GST_TIME_ARGS (start_time),
|
|
|
|
GST_TIME_ARGS (stop_time), s->rate);
|
2005-11-22 15:09:28 +00:00
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
gst_pad_push_event (dec->srcpad,
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
gst_event_new_new_segment (FALSE, s->rate, GST_FORMAT_TIME,
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
start_time, stop_time, start_time));
|
2005-11-22 15:09:28 +00:00
|
|
|
}
|
|
|
|
|
2004-11-07 18:30:06 +00:00
|
|
|
static gboolean
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
gst_musepackdec_handle_seek_event (GstMusepackDec * dec, GstEvent * event)
|
2004-11-07 18:30:06 +00:00
|
|
|
{
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
GstSeekType start_type, stop_type;
|
|
|
|
GstSeekFlags flags;
|
|
|
|
GstSegment segment;
|
|
|
|
GstFormat format;
|
|
|
|
gboolean flush;
|
|
|
|
gdouble rate;
|
|
|
|
gint64 start, stop;
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
gint samplerate;
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
|
|
|
|
gst_event_parse_seek (event, &rate, &format, &flags, &start_type, &start,
|
|
|
|
&stop_type, &stop);
|
|
|
|
|
|
|
|
if (format != GST_FORMAT_TIME && format != GST_FORMAT_DEFAULT) {
|
|
|
|
GST_DEBUG_OBJECT (dec, "seek failed: only TIME or DEFAULT format allowed");
|
|
|
|
return FALSE;
|
|
|
|
}
|
2004-11-07 18:30:06 +00:00
|
|
|
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
samplerate = g_atomic_int_get (&dec->rate);
|
2005-11-22 15:09:28 +00:00
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
if (format == GST_FORMAT_TIME) {
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
if (start_type != GST_SEEK_TYPE_NONE)
|
|
|
|
start = gst_util_uint64_scale_int (start, samplerate, GST_SECOND);
|
|
|
|
if (stop_type != GST_SEEK_TYPE_NONE)
|
|
|
|
stop = gst_util_uint64_scale_int (stop, samplerate, GST_SECOND);
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
}
|
2005-11-22 15:09:28 +00:00
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
flush = ((flags & GST_SEEK_FLAG_FLUSH) == GST_SEEK_FLAG_FLUSH);
|
2005-11-22 15:09:28 +00:00
|
|
|
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
if (flush)
|
|
|
|
gst_pad_push_event (dec->srcpad, gst_event_new_flush_start ());
|
|
|
|
else
|
|
|
|
gst_pad_pause_task (dec->sinkpad); /* not _stop_task()? */
|
|
|
|
|
|
|
|
GST_PAD_STREAM_LOCK (dec->sinkpad);
|
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
/* operate on segment copy until we know the seek worked */
|
|
|
|
segment = dec->segment;
|
2005-11-22 15:09:28 +00:00
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
gst_segment_set_seek (&segment, rate, GST_FORMAT_DEFAULT,
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
flags, start_type, start, stop_type, stop, NULL);
|
2004-11-07 18:30:06 +00:00
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
gst_pad_push_event (dec->sinkpad, gst_event_new_flush_stop ());
|
2004-11-07 18:30:06 +00:00
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
GST_DEBUG_OBJECT (dec, "segment: [%" G_GINT64_FORMAT "-%" G_GINT64_FORMAT
|
|
|
|
"] = [%" GST_TIME_FORMAT "-%" GST_TIME_FORMAT "]",
|
|
|
|
segment.start, segment.stop,
|
|
|
|
GST_TIME_ARGS (segment.start * GST_SECOND / dec->rate),
|
|
|
|
GST_TIME_ARGS (segment.stop * GST_SECOND / dec->rate));
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (dec, "performing seek to sample %" G_GINT64_FORMAT,
|
|
|
|
segment.start);
|
|
|
|
|
|
|
|
if (segment.start < 0 || segment.start >= segment.duration) {
|
|
|
|
GST_WARNING_OBJECT (dec, "seek out of bounds");
|
|
|
|
goto failed;
|
|
|
|
}
|
2008-04-24 22:19:48 +00:00
|
|
|
#ifdef MPC_IS_OLD_API
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
if (!mpc_decoder_seek_sample (dec->d, segment.start))
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
goto failed;
|
2008-04-24 22:19:48 +00:00
|
|
|
#else
|
|
|
|
if (mpc_demux_seek_sample (dec->d, segment.start) != MPC_STATUS_OK)
|
|
|
|
goto failed;
|
|
|
|
#endif
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
|
2006-04-20 18:02:07 +00:00
|
|
|
if ((flags & GST_SEEK_FLAG_SEGMENT) == GST_SEEK_FLAG_SEGMENT) {
|
|
|
|
GST_DEBUG_OBJECT (dec, "posting SEGMENT_START message");
|
|
|
|
|
|
|
|
gst_element_post_message (GST_ELEMENT (dec),
|
|
|
|
gst_message_new_segment_start (GST_OBJECT (dec), GST_FORMAT_TIME,
|
|
|
|
gst_util_uint64_scale_int (segment.start, GST_SECOND, dec->rate)));
|
|
|
|
}
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
|
|
|
|
if (flush) {
|
|
|
|
gst_pad_push_event (dec->srcpad, gst_event_new_flush_stop ());
|
|
|
|
}
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
|
|
|
|
gst_segment_set_last_stop (&segment, GST_FORMAT_DEFAULT, segment.start);
|
|
|
|
dec->segment = segment;
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
gst_musepackdec_send_newsegment (dec);
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (dec, "seek successful");
|
|
|
|
|
|
|
|
gst_pad_start_task (dec->sinkpad,
|
2012-06-20 08:34:48 +00:00
|
|
|
(GstTaskFunction) gst_musepackdec_loop, dec->sinkpad, NULL);
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
GST_PAD_STREAM_UNLOCK (dec->sinkpad);
|
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
failed:
|
|
|
|
{
|
|
|
|
GST_WARNING_OBJECT (dec, "seek failed");
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
GST_PAD_STREAM_UNLOCK (dec->sinkpad);
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_musepackdec_src_event (GstPad * pad, GstEvent * event)
|
|
|
|
{
|
|
|
|
GstMusepackDec *dec;
|
|
|
|
gboolean res;
|
|
|
|
|
|
|
|
dec = GST_MUSEPACK_DEC (gst_pad_get_parent (pad));
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (dec, "handling %s event", GST_EVENT_TYPE_NAME (event));
|
|
|
|
|
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
|
|
|
case GST_EVENT_SEEK:
|
|
|
|
res = gst_musepackdec_handle_seek_event (dec, event);
|
2004-11-07 18:30:06 +00:00
|
|
|
break;
|
|
|
|
default:
|
2005-11-22 15:09:28 +00:00
|
|
|
res = gst_pad_event_default (pad, event);
|
2004-11-07 18:30:06 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
gst_object_unref (dec);
|
2004-11-07 18:30:06 +00:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const GstQueryType *
|
2005-11-22 15:09:28 +00:00
|
|
|
gst_musepackdec_get_src_query_types (GstPad * pad)
|
2004-11-07 18:30:06 +00:00
|
|
|
{
|
|
|
|
static const GstQueryType query_types[] = {
|
|
|
|
GST_QUERY_POSITION,
|
2005-11-22 15:09:28 +00:00
|
|
|
GST_QUERY_DURATION,
|
2009-07-24 05:40:17 +00:00
|
|
|
GST_QUERY_SEEKING,
|
2004-11-07 18:30:06 +00:00
|
|
|
(GstQueryType) 0
|
|
|
|
};
|
|
|
|
|
|
|
|
return query_types;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
2005-11-22 15:09:28 +00:00
|
|
|
gst_musepackdec_src_query (GstPad * pad, GstQuery * query)
|
2004-11-07 18:30:06 +00:00
|
|
|
{
|
|
|
|
GstMusepackDec *musepackdec = GST_MUSEPACK_DEC (gst_pad_get_parent (pad));
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
GstFormat format;
|
|
|
|
gboolean res = FALSE;
|
|
|
|
gint samplerate;
|
2004-11-07 18:30:06 +00:00
|
|
|
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
samplerate = g_atomic_int_get (&musepackdec->rate);
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
if (samplerate == 0)
|
2005-11-22 15:09:28 +00:00
|
|
|
goto done;
|
2004-11-07 18:30:06 +00:00
|
|
|
|
2005-11-22 15:09:28 +00:00
|
|
|
switch (GST_QUERY_TYPE (query)) {
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
case GST_QUERY_POSITION:{
|
|
|
|
gint64 cur, cur_off;
|
|
|
|
|
|
|
|
gst_query_parse_position (query, &format, NULL);
|
|
|
|
|
|
|
|
GST_OBJECT_LOCK (musepackdec);
|
|
|
|
cur_off = musepackdec->segment.last_stop;
|
|
|
|
GST_OBJECT_UNLOCK (musepackdec);
|
|
|
|
|
|
|
|
if (format == GST_FORMAT_TIME) {
|
|
|
|
cur = gst_util_uint64_scale_int (cur_off, GST_SECOND, samplerate);
|
|
|
|
gst_query_set_position (query, GST_FORMAT_TIME, cur);
|
|
|
|
res = TRUE;
|
|
|
|
} else if (format == GST_FORMAT_DEFAULT) {
|
|
|
|
gst_query_set_position (query, GST_FORMAT_DEFAULT, cur_off);
|
|
|
|
res = TRUE;
|
2005-11-22 15:09:28 +00:00
|
|
|
}
|
|
|
|
break;
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
}
|
|
|
|
case GST_QUERY_DURATION:{
|
|
|
|
gint64 len, len_off;
|
|
|
|
|
|
|
|
gst_query_parse_duration (query, &format, NULL);
|
|
|
|
|
|
|
|
GST_OBJECT_LOCK (musepackdec);
|
|
|
|
len_off = musepackdec->segment.duration;
|
|
|
|
GST_OBJECT_UNLOCK (musepackdec);
|
|
|
|
|
|
|
|
if (format == GST_FORMAT_TIME) {
|
|
|
|
len = gst_util_uint64_scale_int (len_off, GST_SECOND, samplerate);
|
|
|
|
gst_query_set_duration (query, GST_FORMAT_TIME, len);
|
|
|
|
res = TRUE;
|
|
|
|
} else if (format == GST_FORMAT_DEFAULT) {
|
|
|
|
gst_query_set_duration (query, GST_FORMAT_DEFAULT, len_off);
|
|
|
|
res = TRUE;
|
2005-11-22 15:09:28 +00:00
|
|
|
}
|
2004-11-07 18:30:06 +00:00
|
|
|
break;
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
}
|
2009-07-24 05:40:17 +00:00
|
|
|
case GST_QUERY_SEEKING:{
|
|
|
|
GstFormat fmt;
|
|
|
|
|
|
|
|
res = TRUE;
|
|
|
|
gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL);
|
|
|
|
if (fmt == GST_FORMAT_TIME || fmt == GST_FORMAT_DEFAULT)
|
|
|
|
gst_query_set_seeking (query, fmt, TRUE, 0, -1);
|
|
|
|
else
|
|
|
|
gst_query_set_seeking (query, fmt, FALSE, -1, -1);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
2004-11-07 18:30:06 +00:00
|
|
|
default:
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
res = gst_pad_query_default (pad, query);
|
2004-11-07 18:30:06 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-11-22 15:09:28 +00:00
|
|
|
done:
|
|
|
|
gst_object_unref (musepackdec);
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
return res;
|
2004-11-07 18:30:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_musepack_stream_init (GstMusepackDec * musepackdec)
|
|
|
|
{
|
Update to 1.1 API (#165446).
Original commit message from CVS:
* configure.ac:
* ext/musepack/Makefile.am:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_class_init),
(gst_musepackdec_init), (gst_musepackdec_dispose),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.cpp:
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_read), (gst_musepack_reader_seek),
(gst_musepack_reader_tell), (gst_musepack_reader_get_size),
(gst_musepack_reader_canseek), (gst_musepack_init_reader):
* ext/musepack/gstmusepackreader.cpp:
* ext/musepack/gstmusepackreader.h:
Update to 1.1 API (#165446).
2005-01-29 01:28:34 +00:00
|
|
|
mpc_streaminfo i;
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
GstTagList *tags;
|
2004-12-03 18:13:43 +00:00
|
|
|
GstCaps *caps;
|
2004-11-07 18:30:06 +00:00
|
|
|
|
Update to 1.1 API (#165446).
Original commit message from CVS:
* configure.ac:
* ext/musepack/Makefile.am:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_class_init),
(gst_musepackdec_init), (gst_musepackdec_dispose),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.cpp:
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_read), (gst_musepack_reader_seek),
(gst_musepack_reader_tell), (gst_musepack_reader_get_size),
(gst_musepack_reader_canseek), (gst_musepack_init_reader):
* ext/musepack/gstmusepackreader.cpp:
* ext/musepack/gstmusepackreader.h:
Update to 1.1 API (#165446).
2005-01-29 01:28:34 +00:00
|
|
|
/* set up reading */
|
2005-11-22 15:09:28 +00:00
|
|
|
gst_musepack_init_reader (musepackdec->r, musepackdec);
|
2004-11-07 18:30:06 +00:00
|
|
|
|
2008-04-24 22:19:48 +00:00
|
|
|
#ifdef MPC_IS_OLD_API
|
Update to 1.1 API (#165446).
Original commit message from CVS:
* configure.ac:
* ext/musepack/Makefile.am:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_class_init),
(gst_musepackdec_init), (gst_musepackdec_dispose),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.cpp:
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_read), (gst_musepack_reader_seek),
(gst_musepack_reader_tell), (gst_musepack_reader_get_size),
(gst_musepack_reader_canseek), (gst_musepack_init_reader):
* ext/musepack/gstmusepackreader.cpp:
* ext/musepack/gstmusepackreader.h:
Update to 1.1 API (#165446).
2005-01-29 01:28:34 +00:00
|
|
|
/* streaminfo */
|
|
|
|
mpc_streaminfo_init (&i);
|
|
|
|
if (mpc_streaminfo_read (&i, musepackdec->r) < 0) {
|
2004-11-07 18:30:06 +00:00
|
|
|
GST_ELEMENT_ERROR (musepackdec, STREAM, WRONG_TYPE, (NULL), (NULL));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
Update to 1.1 API (#165446).
Original commit message from CVS:
* configure.ac:
* ext/musepack/Makefile.am:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_class_init),
(gst_musepackdec_init), (gst_musepackdec_dispose),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.cpp:
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_read), (gst_musepack_reader_seek),
(gst_musepack_reader_tell), (gst_musepack_reader_get_size),
(gst_musepack_reader_canseek), (gst_musepack_init_reader):
* ext/musepack/gstmusepackreader.cpp:
* ext/musepack/gstmusepackreader.h:
Update to 1.1 API (#165446).
2005-01-29 01:28:34 +00:00
|
|
|
/* decoding */
|
|
|
|
mpc_decoder_setup (musepackdec->d, musepackdec->r);
|
|
|
|
mpc_decoder_scale_output (musepackdec->d, 1.0);
|
|
|
|
if (!mpc_decoder_initialize (musepackdec->d, &i)) {
|
|
|
|
GST_ELEMENT_ERROR (musepackdec, STREAM, WRONG_TYPE, (NULL), (NULL));
|
2004-11-07 18:30:06 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
2008-04-24 22:19:48 +00:00
|
|
|
#else
|
|
|
|
musepackdec->d = mpc_demux_init (musepackdec->r);
|
|
|
|
if (!musepackdec->d) {
|
|
|
|
GST_ELEMENT_ERROR (musepackdec, STREAM, WRONG_TYPE, (NULL), (NULL));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
mpc_demux_get_info (musepackdec->d, &i);
|
|
|
|
#endif
|
2004-11-07 18:30:06 +00:00
|
|
|
|
Update to 1.1 API (#165446).
Original commit message from CVS:
* configure.ac:
* ext/musepack/Makefile.am:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_class_init),
(gst_musepackdec_init), (gst_musepackdec_dispose),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.cpp:
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_read), (gst_musepack_reader_seek),
(gst_musepack_reader_tell), (gst_musepack_reader_get_size),
(gst_musepack_reader_canseek), (gst_musepack_init_reader):
* ext/musepack/gstmusepackreader.cpp:
* ext/musepack/gstmusepackreader.h:
Update to 1.1 API (#165446).
2005-01-29 01:28:34 +00:00
|
|
|
/* capsnego */
|
2004-12-03 18:13:43 +00:00
|
|
|
caps = gst_caps_from_string (BASE_CAPS);
|
|
|
|
gst_caps_set_simple (caps,
|
|
|
|
"endianness", G_TYPE_INT, G_BYTE_ORDER,
|
Update to 1.1 API (#165446).
Original commit message from CVS:
* configure.ac:
* ext/musepack/Makefile.am:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_class_init),
(gst_musepackdec_init), (gst_musepackdec_dispose),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.cpp:
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_read), (gst_musepack_reader_seek),
(gst_musepack_reader_tell), (gst_musepack_reader_get_size),
(gst_musepack_reader_canseek), (gst_musepack_init_reader):
* ext/musepack/gstmusepackreader.cpp:
* ext/musepack/gstmusepackreader.h:
Update to 1.1 API (#165446).
2005-01-29 01:28:34 +00:00
|
|
|
"channels", G_TYPE_INT, i.channels,
|
|
|
|
"rate", G_TYPE_INT, i.sample_freq, NULL);
|
2005-11-22 15:09:28 +00:00
|
|
|
gst_pad_use_fixed_caps (musepackdec->srcpad);
|
|
|
|
if (!gst_pad_set_caps (musepackdec->srcpad, caps)) {
|
2004-11-07 18:30:06 +00:00
|
|
|
GST_ELEMENT_ERROR (musepackdec, CORE, NEGOTIATION, (NULL), (NULL));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2008-04-24 22:19:48 +00:00
|
|
|
g_atomic_int_set (&musepackdec->bps, 4 * i.channels);
|
|
|
|
g_atomic_int_set (&musepackdec->rate, i.sample_freq);
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
|
|
|
|
gst_segment_set_last_stop (&musepackdec->segment, GST_FORMAT_DEFAULT, 0);
|
|
|
|
gst_segment_set_duration (&musepackdec->segment, GST_FORMAT_DEFAULT,
|
|
|
|
mpc_streaminfo_get_length_samples (&i));
|
|
|
|
|
|
|
|
/* send basic tags */
|
|
|
|
tags = gst_tag_list_new ();
|
|
|
|
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE,
|
|
|
|
GST_TAG_AUDIO_CODEC, "Musepack", NULL);
|
|
|
|
|
|
|
|
if (i.encoder[0] != '\0' && i.encoder_version > 0) {
|
|
|
|
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE,
|
|
|
|
GST_TAG_ENCODER, i.encoder,
|
|
|
|
GST_TAG_ENCODER_VERSION, i.encoder_version, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i.bitrate > 0) {
|
|
|
|
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE,
|
|
|
|
GST_TAG_BITRATE, i.bitrate, NULL);
|
|
|
|
} else if (i.average_bitrate > 0.0) {
|
|
|
|
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE,
|
|
|
|
GST_TAG_BITRATE, (guint) i.average_bitrate, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (i.gain_title != 0 || i.gain_album != 0) {
|
|
|
|
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE,
|
|
|
|
GST_TAG_TRACK_GAIN, (gdouble) i.gain_title / 100.0,
|
|
|
|
GST_TAG_ALBUM_GAIN, (gdouble) i.gain_album / 100.0, NULL);
|
|
|
|
}
|
|
|
|
|
2006-04-14 13:12:58 +00:00
|
|
|
if (i.peak_title != 0 && i.peak_title != 32767 &&
|
|
|
|
i.peak_album != 0 && i.peak_album != 32767) {
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE,
|
2006-04-14 13:12:58 +00:00
|
|
|
GST_TAG_TRACK_PEAK, (gdouble) i.peak_title / 32767.0,
|
|
|
|
GST_TAG_ALBUM_PEAK, (gdouble) i.peak_album / 32767.0, NULL);
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (musepackdec, "Posting tags: %" GST_PTR_FORMAT, tags);
|
|
|
|
gst_element_found_tags (GST_ELEMENT (musepackdec), tags);
|
2004-11-07 18:30:06 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2005-11-22 15:09:28 +00:00
|
|
|
static gboolean
|
|
|
|
gst_musepackdec_sink_activate (GstPad * sinkpad)
|
|
|
|
{
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
if (!gst_pad_check_pull_range (sinkpad))
|
2005-11-22 15:09:28 +00:00
|
|
|
return FALSE;
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
|
|
|
|
return gst_pad_activate_pull (sinkpad, TRUE);
|
2005-11-22 15:09:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_musepackdec_sink_activate_pull (GstPad * sinkpad, gboolean active)
|
|
|
|
{
|
|
|
|
gboolean result;
|
|
|
|
|
|
|
|
if (active) {
|
|
|
|
result = gst_pad_start_task (sinkpad,
|
2012-06-20 08:34:48 +00:00
|
|
|
(GstTaskFunction) gst_musepackdec_loop, sinkpad, NULL);
|
2005-11-22 15:09:28 +00:00
|
|
|
} else {
|
|
|
|
result = gst_pad_stop_task (sinkpad);
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2004-11-07 18:30:06 +00:00
|
|
|
static void
|
2005-11-22 15:09:28 +00:00
|
|
|
gst_musepackdec_loop (GstPad * sinkpad)
|
2004-11-07 18:30:06 +00:00
|
|
|
{
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
GstMusepackDec *musepackdec;
|
|
|
|
GstFlowReturn flow;
|
2004-11-07 18:30:06 +00:00
|
|
|
GstBuffer *out;
|
2008-04-24 22:19:48 +00:00
|
|
|
|
|
|
|
#ifdef MPC_IS_OLD_API
|
Update to 1.1 API (#165446).
Original commit message from CVS:
* configure.ac:
* ext/musepack/Makefile.am:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_class_init),
(gst_musepackdec_init), (gst_musepackdec_dispose),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.cpp:
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_read), (gst_musepack_reader_seek),
(gst_musepack_reader_tell), (gst_musepack_reader_get_size),
(gst_musepack_reader_canseek), (gst_musepack_init_reader):
* ext/musepack/gstmusepackreader.cpp:
* ext/musepack/gstmusepackreader.h:
Update to 1.1 API (#165446).
2005-01-29 01:28:34 +00:00
|
|
|
guint32 update_acc, update_bits;
|
2008-04-24 22:19:48 +00:00
|
|
|
#else
|
|
|
|
mpc_frame_info frame;
|
|
|
|
mpc_status err;
|
|
|
|
#endif
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
gint num_samples, samplerate, bitspersample;
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
|
|
|
|
musepackdec = GST_MUSEPACK_DEC (GST_PAD_PARENT (sinkpad));
|
2004-11-07 18:30:06 +00:00
|
|
|
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
samplerate = g_atomic_int_get (&musepackdec->rate);
|
|
|
|
|
|
|
|
if (samplerate == 0) {
|
2004-11-07 18:30:06 +00:00
|
|
|
if (!gst_musepack_stream_init (musepackdec))
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
goto pause_task;
|
2004-11-07 18:30:06 +00:00
|
|
|
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
gst_musepackdec_send_newsegment (musepackdec);
|
|
|
|
samplerate = g_atomic_int_get (&musepackdec->rate);
|
2004-11-07 18:30:06 +00:00
|
|
|
}
|
|
|
|
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
bitspersample = g_atomic_int_get (&musepackdec->bps);
|
|
|
|
|
|
|
|
flow = gst_pad_alloc_buffer_and_set_caps (musepackdec->srcpad, -1,
|
|
|
|
MPC_DECODER_BUFFER_LENGTH * 4, GST_PAD_CAPS (musepackdec->srcpad), &out);
|
|
|
|
|
|
|
|
if (flow != GST_FLOW_OK) {
|
|
|
|
GST_DEBUG_OBJECT (musepackdec, "Flow: %s", gst_flow_get_name (flow));
|
|
|
|
goto pause_task;
|
|
|
|
}
|
2008-04-24 22:19:48 +00:00
|
|
|
#ifdef MPC_IS_OLD_API
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
num_samples = mpc_decoder_decode (musepackdec->d,
|
Update to 1.1 API (#165446).
Original commit message from CVS:
* configure.ac:
* ext/musepack/Makefile.am:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_class_init),
(gst_musepackdec_init), (gst_musepackdec_dispose),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.cpp:
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_read), (gst_musepack_reader_seek),
(gst_musepack_reader_tell), (gst_musepack_reader_get_size),
(gst_musepack_reader_canseek), (gst_musepack_init_reader):
* ext/musepack/gstmusepackreader.cpp:
* ext/musepack/gstmusepackreader.h:
Update to 1.1 API (#165446).
2005-01-29 01:28:34 +00:00
|
|
|
(MPC_SAMPLE_FORMAT *) GST_BUFFER_DATA (out), &update_acc, &update_bits);
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
|
|
|
|
if (num_samples < 0) {
|
|
|
|
GST_ERROR_OBJECT (musepackdec, "Failed to decode sample");
|
|
|
|
GST_ELEMENT_ERROR (musepackdec, STREAM, DECODE, (NULL), (NULL));
|
|
|
|
goto pause_task;
|
|
|
|
} else if (num_samples == 0) {
|
2006-04-20 18:02:07 +00:00
|
|
|
goto eos_and_pause;
|
2004-11-07 18:30:06 +00:00
|
|
|
}
|
2008-04-24 22:19:48 +00:00
|
|
|
#else
|
|
|
|
frame.buffer = (MPC_SAMPLE_FORMAT *) GST_BUFFER_DATA (out);
|
|
|
|
err = mpc_demux_decode (musepackdec->d, &frame);
|
|
|
|
|
|
|
|
if (err != MPC_STATUS_OK) {
|
|
|
|
GST_ERROR_OBJECT (musepackdec, "Failed to decode sample");
|
|
|
|
GST_ELEMENT_ERROR (musepackdec, STREAM, DECODE, (NULL), (NULL));
|
|
|
|
goto pause_task;
|
|
|
|
} else if (frame.bits == -1) {
|
|
|
|
goto eos_and_pause;
|
|
|
|
}
|
|
|
|
|
|
|
|
num_samples = frame.samples;
|
|
|
|
#endif
|
Update to 1.1 API (#165446).
Original commit message from CVS:
* configure.ac:
* ext/musepack/Makefile.am:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_class_init),
(gst_musepackdec_init), (gst_musepackdec_dispose),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.cpp:
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_read), (gst_musepack_reader_seek),
(gst_musepack_reader_tell), (gst_musepack_reader_get_size),
(gst_musepack_reader_canseek), (gst_musepack_init_reader):
* ext/musepack/gstmusepackreader.cpp:
* ext/musepack/gstmusepackreader.h:
Update to 1.1 API (#165446).
2005-01-29 01:28:34 +00:00
|
|
|
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
GST_BUFFER_SIZE (out) = num_samples * bitspersample;
|
2005-11-22 15:09:28 +00:00
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
GST_BUFFER_OFFSET (out) = musepackdec->segment.last_stop;
|
|
|
|
GST_BUFFER_TIMESTAMP (out) =
|
|
|
|
gst_util_uint64_scale_int (musepackdec->segment.last_stop,
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
GST_SECOND, samplerate);
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
GST_BUFFER_DURATION (out) =
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
gst_util_uint64_scale_int (num_samples, GST_SECOND, samplerate);
|
2005-11-22 15:09:28 +00:00
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
musepackdec->segment.last_stop += num_samples;
|
2005-11-22 15:09:28 +00:00
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
GST_LOG_OBJECT (musepackdec, "Pushing buffer, timestamp %" GST_TIME_FORMAT,
|
2005-12-12 10:40:42 +00:00
|
|
|
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (out)));
|
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
flow = gst_pad_push (musepackdec->srcpad, out);
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
if (flow != GST_FLOW_OK) {
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
GST_DEBUG_OBJECT (musepackdec, "Flow: %s", gst_flow_get_name (flow));
|
|
|
|
goto pause_task;
|
|
|
|
}
|
|
|
|
|
2006-04-20 18:02:07 +00:00
|
|
|
/* check if we're at the end of a configured segment */
|
|
|
|
if (musepackdec->segment.stop != -1 &&
|
|
|
|
musepackdec->segment.last_stop >= musepackdec->segment.stop) {
|
|
|
|
gint64 stop_time;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (musepackdec, "Reached end of configured segment");
|
|
|
|
|
|
|
|
if ((musepackdec->segment.flags & GST_SEEK_FLAG_SEGMENT) == 0)
|
|
|
|
goto eos_and_pause;
|
|
|
|
|
|
|
|
GST_DEBUG_OBJECT (musepackdec, "Posting SEGMENT_DONE message");
|
|
|
|
|
|
|
|
stop_time = gst_util_uint64_scale_int (musepackdec->segment.stop,
|
|
|
|
GST_SECOND, samplerate);
|
|
|
|
|
|
|
|
gst_element_post_message (GST_ELEMENT (musepackdec),
|
|
|
|
gst_message_new_segment_done (GST_OBJECT (musepackdec),
|
|
|
|
GST_FORMAT_TIME, stop_time));
|
2012-07-05 11:18:47 +00:00
|
|
|
gst_pad_push_event (musepackdec->srcpad,
|
|
|
|
gst_event_new_segment_done (GST_FORMAT_TIME, stop_time));
|
2006-04-20 18:02:07 +00:00
|
|
|
|
|
|
|
goto pause_task;
|
|
|
|
}
|
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
return;
|
|
|
|
|
2006-04-20 18:02:07 +00:00
|
|
|
eos_and_pause:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (musepackdec, "sending EOS event");
|
|
|
|
gst_pad_push_event (musepackdec->srcpad, gst_event_new_eos ());
|
|
|
|
/* fall through to pause */
|
|
|
|
}
|
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
pause_task:
|
|
|
|
{
|
|
|
|
GST_DEBUG_OBJECT (musepackdec, "Pausing task");
|
|
|
|
gst_pad_pause_task (sinkpad);
|
|
|
|
return;
|
|
|
|
}
|
2004-11-07 18:30:06 +00:00
|
|
|
}
|
|
|
|
|
2005-09-05 17:20:29 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_musepackdec_change_state (GstElement * element, GstStateChange transition)
|
2004-11-07 18:30:06 +00:00
|
|
|
{
|
|
|
|
GstMusepackDec *musepackdec = GST_MUSEPACK_DEC (element);
|
2005-11-22 15:09:28 +00:00
|
|
|
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
|
|
|
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
|
|
|
gst_segment_init (&musepackdec->segment, GST_FORMAT_DEFAULT);
|
|
|
|
gst_segment_set_last_stop (&musepackdec->segment, GST_FORMAT_DEFAULT, 0);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-11-22 15:09:28 +00:00
|
|
|
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
|
|
|
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
|
|
|
|
2005-09-05 17:20:29 +00:00
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
ext/musepack/: Fix seeking in musepack files (it's still incredibly slow, but I don't think that is our plugin's faul...
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_class_init), (gst_musepackdec_init),
(gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event), (gst_musepackdec_src_event),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate_pull),
(gst_musepackdec_loop), (gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_seek), (gst_musepack_reader_tell),
(gst_musepack_reader_get_size):
* ext/musepack/gstmusepackreader.h:
Fix seeking in musepack files (it's still incredibly slow, but I
don't think that is our plugin's fault). Clean up code and get
rid of old cruft. Post tags with all kind of neat information like
replay gain and such on the bus, if it is available. Add a
'musepackdec' debug category.
2006-01-24 21:33:25 +00:00
|
|
|
gst_segment_init (&musepackdec->segment, GST_FORMAT_UNDEFINED);
|
|
|
|
musepackdec->offset = 0;
|
ext/musepack/gstmusepackdec.c: Some cleanups; pause task when push fails.
Original commit message from CVS:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_base_init),
(gst_musepackdec_init), (gst_musepackdec_send_newsegment),
(gst_musepackdec_handle_seek_event),
(gst_musepackdec_get_src_query_types), (gst_musepackdec_src_query),
(gst_musepack_stream_init), (gst_musepackdec_sink_activate),
(gst_musepackdec_sink_activate_pull), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
Some cleanups; pause task when push fails.
2006-03-06 13:13:44 +00:00
|
|
|
musepackdec->rate = 0;
|
|
|
|
musepackdec->bps = 0;
|
2004-11-07 18:30:06 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-11-22 15:09:28 +00:00
|
|
|
return ret;
|
2004-11-07 18:30:06 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
plugin_init (GstPlugin * plugin)
|
|
|
|
{
|
2008-04-24 22:19:48 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (musepackdec_debug, "musepackdec", 0, "mpc decoder");
|
|
|
|
|
2005-11-22 15:09:28 +00:00
|
|
|
return gst_element_register (plugin, "musepackdec",
|
Update to 1.1 API (#165446).
Original commit message from CVS:
* configure.ac:
* ext/musepack/Makefile.am:
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_class_init),
(gst_musepackdec_init), (gst_musepackdec_dispose),
(gst_musepackdec_src_query), (gst_musepackdec_src_convert),
(gst_musepack_stream_init), (gst_musepackdec_loop),
(gst_musepackdec_change_state):
* ext/musepack/gstmusepackdec.cpp:
* ext/musepack/gstmusepackdec.h:
* ext/musepack/gstmusepackreader.c: (gst_musepack_reader_peek),
(gst_musepack_reader_read), (gst_musepack_reader_seek),
(gst_musepack_reader_tell), (gst_musepack_reader_get_size),
(gst_musepack_reader_canseek), (gst_musepack_init_reader):
* ext/musepack/gstmusepackreader.cpp:
* ext/musepack/gstmusepackreader.h:
Update to 1.1 API (#165446).
2005-01-29 01:28:34 +00:00
|
|
|
GST_RANK_PRIMARY, GST_TYPE_MUSEPACK_DEC);
|
2004-11-07 18:30:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
2012-04-05 16:02:56 +00:00
|
|
|
musepack,
|
2006-04-01 10:09:11 +00:00
|
|
|
"Musepack decoder", plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME,
|
|
|
|
GST_PACKAGE_ORIGIN)
|