2001-12-22 23:26:33 +00:00
|
|
|
/* -*- c-basic-offset: 2 -*-
|
|
|
|
* GStreamer
|
|
|
|
* Copyright (C) 1999-2001 Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2007-05-04 16:11:46 +00:00
|
|
|
/**
|
|
|
|
* SECTION:element-speed
|
|
|
|
*
|
|
|
|
* Plays an audio stream at a different speed.
|
2008-06-16 07:30:34 +00:00
|
|
|
*
|
2007-05-04 16:11:46 +00:00
|
|
|
* Do not use this element. Either use the 'pitch' element, or do a seek with
|
|
|
|
* a non-1.0 rate parameter, this will have the same effect as using the speed
|
|
|
|
* element (but relies on the decoder/demuxer to handle this correctly, also
|
|
|
|
* requires a fairly up-to-date gst-plugins-base, as of February 2007).
|
2008-06-16 07:30:34 +00:00
|
|
|
*
|
|
|
|
* <refsect2>
|
2007-05-04 16:11:46 +00:00
|
|
|
* <title>Example launch line</title>
|
2008-06-16 07:30:34 +00:00
|
|
|
* |[
|
2007-05-04 16:11:46 +00:00
|
|
|
* gst-launch filesrc location=test.ogg ! decodebin ! audioconvert ! speed speed=1.5 ! audioconvert ! audioresample ! autoaudiosink
|
2008-06-16 07:30:34 +00:00
|
|
|
* ]| Plays an .ogg file at 1.5x speed.
|
2007-05-04 16:11:46 +00:00
|
|
|
* </refsect2>
|
|
|
|
*
|
|
|
|
* Last reviewed on 2007-02-26 (0.10.4.1)
|
|
|
|
*/
|
|
|
|
|
2003-06-29 19:46:13 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2003-10-08 07:50:58 +00:00
|
|
|
# include "config.h"
|
2003-06-29 19:46:13 +00:00
|
|
|
#endif
|
2003-10-08 07:50:58 +00:00
|
|
|
|
2001-12-22 23:26:33 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <math.h>
|
2003-10-08 07:50:58 +00:00
|
|
|
#include <gst/gst.h>
|
2001-12-23 12:18:18 +00:00
|
|
|
#include <gst/audio/audio.h>
|
2003-10-08 07:50:58 +00:00
|
|
|
|
2001-12-22 23:26:33 +00:00
|
|
|
#include "gstspeed.h"
|
|
|
|
|
2007-05-04 16:11:46 +00:00
|
|
|
GST_DEBUG_CATEGORY_STATIC (speed_debug);
|
|
|
|
#define GST_CAT_DEFAULT speed_debug
|
|
|
|
|
2002-09-18 19:02:52 +00:00
|
|
|
/* elementfactory information */
|
2006-04-25 21:56:38 +00:00
|
|
|
static const GstElementDetails speed_details = GST_ELEMENT_DETAILS ("Speed",
|
2004-03-14 22:34:33 +00:00
|
|
|
"Filter/Effect/Audio",
|
|
|
|
"Set speed/pitch on audio/raw streams (resampler)",
|
2005-02-10 15:06:13 +00:00
|
|
|
"Andy Wingo <apwingo@eos.ncsu.edu>, "
|
|
|
|
"Tim-Philipp Müller <tim@centricular.net>");
|
2001-12-22 23:26:33 +00:00
|
|
|
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
enum
|
|
|
|
{
|
2001-12-22 23:26:33 +00:00
|
|
|
ARG_0,
|
|
|
|
ARG_SPEED
|
|
|
|
};
|
|
|
|
|
2005-02-10 15:06:13 +00:00
|
|
|
/* assumption here: sizeof (gfloat) = 4 */
|
|
|
|
#define GST_SPEED_AUDIO_CAPS \
|
|
|
|
"audio/x-raw-float, " \
|
|
|
|
"rate = (int) [ 1, MAX ], " \
|
|
|
|
"channels = (int) [ 1, MAX ], " \
|
|
|
|
"endianness = (int) BYTE_ORDER, " \
|
2005-10-17 20:48:35 +00:00
|
|
|
"width = (int) 32; " \
|
2005-02-10 15:06:13 +00:00
|
|
|
\
|
|
|
|
"audio/x-raw-int, " \
|
|
|
|
"rate = (int) [ 1, MAX ], " \
|
|
|
|
"channels = (int) [ 1, MAX ], " \
|
|
|
|
"endianness = (int) BYTE_ORDER, " \
|
|
|
|
"width = (int) 16, " \
|
|
|
|
"depth = (int) 16, " \
|
|
|
|
"signed = (boolean) true"
|
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
static GstStaticPadTemplate gst_speed_sink_template =
|
2005-02-10 15:06:13 +00:00
|
|
|
GST_STATIC_PAD_TEMPLATE ("sink",
|
2003-12-22 01:47:09 +00:00
|
|
|
GST_PAD_SINK,
|
|
|
|
GST_PAD_ALWAYS,
|
2005-02-10 15:06:13 +00:00
|
|
|
GST_STATIC_CAPS (GST_SPEED_AUDIO_CAPS)
|
2004-03-14 22:34:33 +00:00
|
|
|
);
|
2001-12-22 23:26:33 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
static GstStaticPadTemplate gst_speed_src_template =
|
2005-02-10 15:06:13 +00:00
|
|
|
GST_STATIC_PAD_TEMPLATE ("src",
|
2003-12-22 01:47:09 +00:00
|
|
|
GST_PAD_SRC,
|
|
|
|
GST_PAD_ALWAYS,
|
2005-02-10 15:06:13 +00:00
|
|
|
GST_STATIC_CAPS (GST_SPEED_AUDIO_CAPS)
|
2004-03-14 22:34:33 +00:00
|
|
|
);
|
2001-12-22 23:26:33 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void speed_base_init (gpointer g_class);
|
|
|
|
static void speed_class_init (GstSpeedClass * klass);
|
|
|
|
static void speed_init (GstSpeed * filter);
|
2001-12-22 23:26:33 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void speed_set_property (GObject * object, guint prop_id,
|
|
|
|
const GValue * value, GParamSpec * pspec);
|
|
|
|
static void speed_get_property (GObject * object, guint prop_id, GValue * value,
|
|
|
|
GParamSpec * pspec);
|
2001-12-22 23:26:33 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static gboolean speed_parse_caps (GstSpeed * filter, const GstCaps * caps);
|
2001-12-22 23:26:33 +00:00
|
|
|
|
2005-09-08 15:56:38 +00:00
|
|
|
static GstFlowReturn speed_chain (GstPad * pad, GstBuffer * buf);
|
2001-12-22 23:26:33 +00:00
|
|
|
|
2005-09-05 17:20:29 +00:00
|
|
|
static GstStateChangeReturn speed_change_state (GstElement * element,
|
|
|
|
GstStateChange transition);
|
2005-10-17 20:48:35 +00:00
|
|
|
static gboolean speed_sink_event (GstPad * pad, GstEvent * event);
|
|
|
|
static gboolean speed_src_event (GstPad * pad, GstEvent * event);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2005-02-10 15:06:13 +00:00
|
|
|
static GstElementClass *parent_class; /* NULL */
|
2001-12-22 23:26:33 +00:00
|
|
|
|
2005-09-08 15:56:38 +00:00
|
|
|
static gboolean
|
2005-10-17 20:48:35 +00:00
|
|
|
speed_setcaps (GstPad * pad, GstCaps * caps)
|
2001-12-22 23:26:33 +00:00
|
|
|
{
|
2002-02-17 17:34:23 +00:00
|
|
|
GstSpeed *filter;
|
2002-02-19 05:59:06 +00:00
|
|
|
GstPad *otherpad;
|
2005-10-17 20:48:35 +00:00
|
|
|
gboolean ret;
|
2003-10-08 07:50:58 +00:00
|
|
|
|
2002-02-17 17:34:23 +00:00
|
|
|
filter = GST_SPEED (gst_pad_get_parent (pad));
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2005-02-10 15:06:13 +00:00
|
|
|
otherpad = (pad == filter->srcpad) ? filter->sinkpad : filter->srcpad;
|
2003-10-08 07:50:58 +00:00
|
|
|
|
2005-10-17 20:48:35 +00:00
|
|
|
if ((ret = speed_parse_caps (filter, caps)))
|
|
|
|
ret = gst_pad_set_caps (otherpad, caps);
|
|
|
|
|
|
|
|
gst_object_unref (filter);
|
|
|
|
|
|
|
|
return ret;
|
2003-10-08 07:50:58 +00:00
|
|
|
|
2001-12-22 23:26:33 +00:00
|
|
|
}
|
|
|
|
|
2002-02-17 17:34:23 +00:00
|
|
|
static gboolean
|
2004-03-14 22:34:33 +00:00
|
|
|
speed_parse_caps (GstSpeed * filter, const GstCaps * caps)
|
2001-12-22 23:26:33 +00:00
|
|
|
{
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
GstStructure *structure;
|
2005-10-17 20:48:35 +00:00
|
|
|
gint rate, chans, width;
|
2003-07-19 23:47:42 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
g_return_val_if_fail (filter != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (caps != NULL, FALSE);
|
2003-07-19 23:47:42 +00:00
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
structure = gst_caps_get_structure (caps, 0);
|
|
|
|
|
2005-10-17 20:48:35 +00:00
|
|
|
|
|
|
|
if (gst_structure_has_name (structure, "audio/x-raw-float"))
|
2005-02-10 15:06:13 +00:00
|
|
|
filter->format = GST_SPEED_FORMAT_FLOAT;
|
2005-10-17 20:48:35 +00:00
|
|
|
else if (gst_structure_has_name (structure, "audio/x-raw-int"))
|
2005-02-10 15:06:13 +00:00
|
|
|
filter->format = GST_SPEED_FORMAT_INT;
|
|
|
|
else
|
|
|
|
return FALSE;
|
|
|
|
|
2005-10-17 20:48:35 +00:00
|
|
|
if (!gst_structure_get_int (structure, "rate", &rate)
|
|
|
|
|| !gst_structure_get_int (structure, "width", &width)
|
|
|
|
|| !gst_structure_get_int (structure, "channels", &chans)) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
2004-04-29 03:38:16 +00:00
|
|
|
|
2005-10-17 20:48:35 +00:00
|
|
|
filter->rate = rate;
|
|
|
|
filter->width = width;
|
|
|
|
filter->channels = chans;
|
2003-10-08 07:50:58 +00:00
|
|
|
|
2005-02-10 15:06:13 +00:00
|
|
|
if (filter->format == GST_SPEED_FORMAT_FLOAT) {
|
|
|
|
filter->sample_size = filter->channels * filter->width / 8;
|
2004-03-14 22:34:33 +00:00
|
|
|
} else {
|
2005-02-10 15:06:13 +00:00
|
|
|
/* our caps only allow width == depth for now */
|
|
|
|
filter->sample_size = filter->channels * filter->width / 8;
|
2001-12-22 23:26:33 +00:00
|
|
|
}
|
2005-02-10 15:06:13 +00:00
|
|
|
|
2005-10-17 20:48:35 +00:00
|
|
|
return TRUE;
|
2001-12-22 23:26:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GType
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_speed_get_type (void)
|
|
|
|
{
|
2001-12-22 23:26:33 +00:00
|
|
|
static GType speed_type = 0;
|
|
|
|
|
|
|
|
if (!speed_type) {
|
|
|
|
static const GTypeInfo speed_info = {
|
2004-03-14 22:34:33 +00:00
|
|
|
sizeof (GstSpeedClass),
|
2003-11-02 22:34:11 +00:00
|
|
|
speed_base_init,
|
2001-12-22 23:26:33 +00:00
|
|
|
NULL,
|
2004-03-14 22:34:33 +00:00
|
|
|
(GClassInitFunc) speed_class_init,
|
2001-12-22 23:26:33 +00:00
|
|
|
NULL,
|
|
|
|
NULL,
|
2004-03-14 22:34:33 +00:00
|
|
|
sizeof (GstSpeed),
|
2001-12-22 23:26:33 +00:00
|
|
|
0,
|
2004-03-14 22:34:33 +00:00
|
|
|
(GInstanceInitFunc) speed_init,
|
2001-12-22 23:26:33 +00:00
|
|
|
};
|
2004-03-15 19:32:27 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
speed_type =
|
2004-03-15 19:32:27 +00:00
|
|
|
g_type_register_static (GST_TYPE_ELEMENT, "GstSpeed", &speed_info, 0);
|
2001-12-22 23:26:33 +00:00
|
|
|
}
|
|
|
|
return speed_type;
|
|
|
|
}
|
|
|
|
|
2005-02-15 11:05:35 +00:00
|
|
|
static const GstQueryType *
|
|
|
|
speed_get_query_types (GstPad * pad)
|
|
|
|
{
|
|
|
|
static const GstQueryType src_query_types[] = {
|
|
|
|
GST_QUERY_POSITION,
|
2005-10-19 15:58:01 +00:00
|
|
|
GST_QUERY_DURATION,
|
2005-02-15 11:05:35 +00:00
|
|
|
0
|
|
|
|
};
|
|
|
|
|
|
|
|
return src_query_types;
|
|
|
|
}
|
|
|
|
|
2005-10-17 20:48:35 +00:00
|
|
|
static gboolean
|
|
|
|
speed_src_event (GstPad * pad, GstEvent * event)
|
|
|
|
{
|
|
|
|
GstSpeed *filter;
|
2007-05-04 17:20:31 +00:00
|
|
|
gboolean ret = FALSE;
|
2005-10-17 20:48:35 +00:00
|
|
|
|
|
|
|
filter = GST_SPEED (gst_pad_get_parent (pad));
|
|
|
|
|
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
2007-05-04 17:20:31 +00:00
|
|
|
case GST_EVENT_SEEK:{
|
2005-10-17 20:48:35 +00:00
|
|
|
gdouble rate;
|
|
|
|
GstFormat format;
|
|
|
|
GstSeekFlags flags;
|
|
|
|
GstSeekType start_type, stop_type;
|
|
|
|
gint64 start, stop;
|
|
|
|
|
2007-05-04 17:20:31 +00:00
|
|
|
gst_event_parse_seek (event, &rate, &format, &flags, &start_type, &start,
|
|
|
|
&stop_type, &stop);
|
|
|
|
gst_event_unref (event);
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2007-05-04 17:20:31 +00:00
|
|
|
if (format != GST_FORMAT_TIME) {
|
|
|
|
GST_DEBUG_OBJECT (filter, "only support seeks in TIME format");
|
|
|
|
break;
|
|
|
|
}
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2007-05-04 17:20:31 +00:00
|
|
|
if (start_type != GST_SEEK_TYPE_NONE && start != -1) {
|
|
|
|
start *= filter->speed;
|
|
|
|
}
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2007-05-04 17:20:31 +00:00
|
|
|
if (stop_type != GST_SEEK_TYPE_NONE && stop != -1) {
|
|
|
|
stop *= filter->speed;
|
2005-10-17 20:48:35 +00:00
|
|
|
}
|
|
|
|
|
2007-05-04 17:20:31 +00:00
|
|
|
event = gst_event_new_seek (rate, format, flags, start_type, start,
|
|
|
|
stop_type, stop);
|
|
|
|
|
|
|
|
GST_LOG ("sending seek event: %" GST_PTR_FORMAT, event->structure);
|
|
|
|
|
|
|
|
ret = gst_pad_send_event (GST_PAD_PEER (filter->sinkpad), event);
|
2005-10-17 20:48:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
ret = gst_pad_event_default (pad, event);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
gst_object_unref (filter);
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_speed_convert (GstPad * pad, GstFormat src_format, gint64 src_value,
|
|
|
|
GstFormat * dest_format, gint64 * dest_value)
|
|
|
|
{
|
|
|
|
gboolean ret = TRUE;
|
|
|
|
guint scale = 1;
|
|
|
|
GstSpeed *filter;
|
|
|
|
|
|
|
|
if (src_format == *dest_format) {
|
|
|
|
*dest_value = src_value;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
filter = GST_SPEED (GST_PAD_PARENT (pad));
|
|
|
|
|
|
|
|
switch (src_format) {
|
|
|
|
case GST_FORMAT_BYTES:
|
|
|
|
switch (*dest_format) {
|
|
|
|
case GST_FORMAT_DEFAULT:
|
|
|
|
if (filter->sample_size == 0) {
|
|
|
|
ret = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
*dest_value = src_value / filter->sample_size;
|
|
|
|
break;
|
|
|
|
case GST_FORMAT_TIME:
|
|
|
|
{
|
|
|
|
gint byterate = filter->sample_size * filter->rate;
|
|
|
|
|
|
|
|
if (byterate == 0) {
|
|
|
|
ret = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
*dest_value = src_value * GST_SECOND / byterate;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
ret = FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GST_FORMAT_DEFAULT:
|
|
|
|
switch (*dest_format) {
|
|
|
|
case GST_FORMAT_BYTES:
|
|
|
|
*dest_value = src_value * filter->sample_size;
|
|
|
|
break;
|
|
|
|
case GST_FORMAT_TIME:
|
|
|
|
if (filter->rate == 0) {
|
|
|
|
ret = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
*dest_value = src_value * GST_SECOND / filter->rate;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
ret = FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GST_FORMAT_TIME:
|
|
|
|
switch (*dest_format) {
|
|
|
|
case GST_FORMAT_BYTES:
|
|
|
|
scale = filter->sample_size;
|
|
|
|
/* fallthrough */
|
|
|
|
case GST_FORMAT_DEFAULT:
|
|
|
|
*dest_value = src_value * scale * filter->rate / GST_SECOND;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
ret = FALSE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
ret = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2005-02-15 11:05:35 +00:00
|
|
|
static gboolean
|
2005-09-08 15:56:38 +00:00
|
|
|
speed_src_query (GstPad * pad, GstQuery * query)
|
2005-02-15 11:05:35 +00:00
|
|
|
{
|
2005-10-17 20:48:35 +00:00
|
|
|
gboolean ret = TRUE;
|
2005-02-15 11:05:35 +00:00
|
|
|
GstSpeed *filter;
|
|
|
|
|
|
|
|
filter = GST_SPEED (gst_pad_get_parent (pad));
|
|
|
|
|
2005-09-08 15:56:38 +00:00
|
|
|
switch (GST_QUERY_TYPE (query)) {
|
2005-02-15 11:05:35 +00:00
|
|
|
case GST_QUERY_POSITION:
|
|
|
|
{
|
2005-10-17 20:48:35 +00:00
|
|
|
GstFormat format;
|
|
|
|
GstFormat rformat = GST_FORMAT_TIME;
|
2005-10-19 15:58:01 +00:00
|
|
|
gint64 cur;
|
2005-10-17 20:48:35 +00:00
|
|
|
GstFormat conv_format = GST_FORMAT_TIME;
|
|
|
|
|
|
|
|
/* save requested format */
|
2005-10-19 15:58:01 +00:00
|
|
|
gst_query_parse_position (query, &format, NULL);
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2005-10-19 15:58:01 +00:00
|
|
|
/* query peer for current position in time */
|
|
|
|
gst_query_set_position (query, GST_FORMAT_TIME, -1);
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2007-05-04 16:11:46 +00:00
|
|
|
if (!gst_pad_query_peer_position (filter->sinkpad, &rformat, &cur)) {
|
2005-10-17 20:48:35 +00:00
|
|
|
GST_LOG_OBJECT (filter, "query on peer pad failed");
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rformat == GST_FORMAT_BYTES)
|
2005-10-19 15:58:01 +00:00
|
|
|
GST_LOG_OBJECT (filter, "peer pad returned current=%lld bytes", cur);
|
2005-10-17 20:48:35 +00:00
|
|
|
else if (rformat == GST_FORMAT_TIME)
|
2005-10-19 15:58:01 +00:00
|
|
|
GST_LOG_OBJECT (filter, "peer pad returned time=%lld", cur);
|
2005-10-17 20:48:35 +00:00
|
|
|
|
|
|
|
/* convert to time format */
|
|
|
|
if (!gst_speed_convert (pad, rformat, cur, &conv_format, &cur)) {
|
|
|
|
ret = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
2005-10-19 15:58:01 +00:00
|
|
|
|
|
|
|
/* adjust for speed factor */
|
|
|
|
cur /= filter->speed;
|
|
|
|
|
2005-10-17 20:48:35 +00:00
|
|
|
/* convert to time format */
|
2005-10-19 15:58:01 +00:00
|
|
|
if (!gst_speed_convert (pad, conv_format, cur, &format, &cur)) {
|
2005-10-17 20:48:35 +00:00
|
|
|
ret = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
2005-10-19 15:58:01 +00:00
|
|
|
gst_query_set_position (query, format, cur);
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2005-10-19 15:58:01 +00:00
|
|
|
GST_LOG_OBJECT (filter,
|
|
|
|
"position query: we return %llu (format %u)", cur, format);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case GST_QUERY_DURATION:
|
|
|
|
{
|
|
|
|
GstFormat format;
|
|
|
|
GstFormat rformat = GST_FORMAT_TIME;
|
|
|
|
gint64 end;
|
|
|
|
GstFormat conv_format = GST_FORMAT_TIME;
|
|
|
|
|
|
|
|
/* save requested format */
|
|
|
|
gst_query_parse_duration (query, &format, NULL);
|
|
|
|
|
|
|
|
/* query peer for total length in time */
|
|
|
|
gst_query_set_duration (query, GST_FORMAT_TIME, -1);
|
|
|
|
|
2007-05-04 16:11:46 +00:00
|
|
|
if (!gst_pad_query_peer_duration (filter->sinkpad, &rformat, &end)) {
|
2005-10-19 15:58:01 +00:00
|
|
|
GST_LOG_OBJECT (filter, "query on peer pad failed");
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (rformat == GST_FORMAT_BYTES)
|
|
|
|
GST_LOG_OBJECT (filter, "peer pad returned total=%lld bytes", end);
|
|
|
|
else if (rformat == GST_FORMAT_TIME)
|
|
|
|
GST_LOG_OBJECT (filter, "peer pad returned time=%lld", end);
|
2005-10-17 20:48:35 +00:00
|
|
|
|
|
|
|
/* convert to time format */
|
2005-10-19 15:58:01 +00:00
|
|
|
if (!gst_speed_convert (pad, rformat, end, &conv_format, &end)) {
|
2005-10-17 20:48:35 +00:00
|
|
|
ret = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
2005-10-19 15:58:01 +00:00
|
|
|
|
|
|
|
/* adjust for speed factor */
|
|
|
|
end /= filter->speed;
|
|
|
|
|
2005-10-17 20:48:35 +00:00
|
|
|
/* convert to time format */
|
|
|
|
if (!gst_speed_convert (pad, conv_format, end, &format, &end)) {
|
|
|
|
ret = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-10-19 15:58:01 +00:00
|
|
|
gst_query_set_duration (query, format, end);
|
2005-10-17 20:48:35 +00:00
|
|
|
|
|
|
|
GST_LOG_OBJECT (filter,
|
2005-10-19 15:58:01 +00:00
|
|
|
"duration query: we return %llu (format %u)", end, format);
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2005-02-15 11:05:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
2005-10-17 20:48:35 +00:00
|
|
|
ret = FALSE;
|
2005-02-15 11:05:35 +00:00
|
|
|
break;
|
|
|
|
}
|
2005-10-17 20:48:35 +00:00
|
|
|
|
|
|
|
gst_object_unref (filter);
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
|
|
|
gst_object_unref (filter);
|
|
|
|
GST_DEBUG ("error handling query");
|
|
|
|
return FALSE;
|
2005-02-15 11:05:35 +00:00
|
|
|
}
|
|
|
|
|
2003-11-02 22:34:11 +00:00
|
|
|
static void
|
|
|
|
speed_base_init (gpointer g_class)
|
|
|
|
{
|
|
|
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
|
|
|
|
|
|
|
gst_element_class_set_details (element_class, &speed_details);
|
|
|
|
|
2003-12-22 01:47:09 +00:00
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&gst_speed_src_template));
|
|
|
|
gst_element_class_add_pad_template (element_class,
|
|
|
|
gst_static_pad_template_get (&gst_speed_sink_template));
|
2003-11-02 22:34:11 +00:00
|
|
|
}
|
2001-12-22 23:26:33 +00:00
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
speed_class_init (GstSpeedClass * klass)
|
2001-12-22 23:26:33 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
GObjectClass *gobject_class = (GObjectClass *) klass;
|
2005-02-10 15:06:13 +00:00
|
|
|
GstElementClass *gstelement_class = (GstElementClass *) klass;
|
2001-12-22 23:26:33 +00:00
|
|
|
|
2003-10-08 07:50:58 +00:00
|
|
|
gobject_class->set_property = speed_set_property;
|
|
|
|
gobject_class->get_property = speed_get_property;
|
2005-02-10 15:06:13 +00:00
|
|
|
gstelement_class->change_state = speed_change_state;
|
2001-12-22 23:26:33 +00:00
|
|
|
|
2005-02-10 15:06:13 +00:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2001-12-22 23:26:33 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SPEED,
|
|
|
|
g_param_spec_float ("speed", "speed", "speed",
|
2004-03-15 19:32:27 +00:00
|
|
|
0.1, 40.0, 1.0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
|
2001-12-22 23:26:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
speed_init (GstSpeed * filter)
|
2001-12-22 23:26:33 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
filter->sinkpad =
|
2007-06-22 10:46:33 +00:00
|
|
|
gst_pad_new_from_static_template (&gst_speed_sink_template, "sink");
|
2005-10-17 20:48:35 +00:00
|
|
|
gst_pad_set_setcaps_function (filter->sinkpad, speed_setcaps);
|
2005-02-10 15:06:13 +00:00
|
|
|
gst_pad_set_chain_function (filter->sinkpad, speed_chain);
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
|
2005-10-17 20:48:35 +00:00
|
|
|
gst_pad_set_event_function (filter->sinkpad, speed_sink_event);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
|
|
|
filter->srcpad =
|
2007-06-22 10:46:33 +00:00
|
|
|
gst_pad_new_from_static_template (&gst_speed_src_template, "src");
|
2005-10-17 20:48:35 +00:00
|
|
|
gst_pad_set_setcaps_function (filter->srcpad, speed_setcaps);
|
2005-02-15 11:05:35 +00:00
|
|
|
gst_pad_set_query_type_function (filter->srcpad, speed_get_query_types);
|
|
|
|
gst_pad_set_query_function (filter->srcpad, speed_src_query);
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
|
|
|
|
|
2005-10-17 20:48:35 +00:00
|
|
|
gst_pad_set_event_function (filter->srcpad, speed_src_event);
|
|
|
|
|
2005-02-10 15:06:13 +00:00
|
|
|
filter->offset = 0;
|
|
|
|
filter->timestamp = 0;
|
|
|
|
filter->sample_size = 0;
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2001-12-22 23:26:33 +00:00
|
|
|
}
|
|
|
|
|
2005-02-10 15:06:13 +00:00
|
|
|
static inline guint
|
|
|
|
speed_chain_int16 (GstSpeed * filter, GstBuffer * in_buf, GstBuffer * out_buf,
|
|
|
|
guint c, guint in_samples)
|
2001-12-22 23:26:33 +00:00
|
|
|
{
|
2005-02-10 15:06:13 +00:00
|
|
|
gint16 *in_data, *out_data;
|
|
|
|
gfloat interp, lower, i_float;
|
|
|
|
guint i, j;
|
2003-10-08 07:50:58 +00:00
|
|
|
|
2005-02-10 15:06:13 +00:00
|
|
|
in_data = ((gint16 *) GST_BUFFER_DATA (in_buf)) + c;
|
|
|
|
out_data = ((gint16 *) GST_BUFFER_DATA (out_buf)) + c;
|
2001-12-22 23:26:33 +00:00
|
|
|
|
2005-02-10 15:06:13 +00:00
|
|
|
lower = in_data[0];
|
|
|
|
i_float = 0.5 * (filter->speed - 1.0);
|
|
|
|
i = (guint) ceil (i_float);
|
|
|
|
j = 0;
|
2004-03-14 22:34:33 +00:00
|
|
|
|
2005-02-10 15:06:13 +00:00
|
|
|
while (i < in_samples) {
|
|
|
|
interp = i_float - floor (i_float);
|
2003-10-08 07:50:58 +00:00
|
|
|
|
2005-02-10 15:06:13 +00:00
|
|
|
out_data[j * filter->channels] =
|
|
|
|
lower * (1 - interp) + in_data[i * filter->channels] * interp;
|
|
|
|
|
|
|
|
lower = in_data[i * filter->channels];
|
|
|
|
|
|
|
|
i_float += filter->speed;
|
|
|
|
i = (guint) ceil (i_float);
|
|
|
|
|
|
|
|
++j;
|
2002-05-30 19:08:04 +00:00
|
|
|
}
|
2003-10-08 07:50:58 +00:00
|
|
|
|
2005-02-10 15:06:13 +00:00
|
|
|
return j;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline guint
|
|
|
|
speed_chain_float32 (GstSpeed * filter, GstBuffer * in_buf, GstBuffer * out_buf,
|
|
|
|
guint c, guint in_samples)
|
|
|
|
{
|
|
|
|
gfloat *in_data, *out_data;
|
|
|
|
gfloat interp, lower, i_float;
|
|
|
|
guint i, j;
|
|
|
|
|
|
|
|
in_data = ((gfloat *) GST_BUFFER_DATA (in_buf)) + c;
|
|
|
|
out_data = ((gfloat *) GST_BUFFER_DATA (out_buf)) + c;
|
|
|
|
|
|
|
|
lower = in_data[0];
|
|
|
|
i_float = 0.5 * (filter->speed - 1.0);
|
|
|
|
i = (guint) ceil (i_float);
|
|
|
|
j = 0;
|
|
|
|
|
|
|
|
while (i < in_samples) {
|
|
|
|
interp = i_float - floor (i_float);
|
|
|
|
|
|
|
|
out_data[j * filter->channels] =
|
|
|
|
lower * (1 - interp) + in_data[i * filter->channels] * interp;
|
|
|
|
|
|
|
|
lower = in_data[i * filter->channels];
|
|
|
|
|
|
|
|
i_float += filter->speed;
|
|
|
|
i = (guint) ceil (i_float);
|
|
|
|
|
|
|
|
++j;
|
2002-05-27 04:17:57 +00:00
|
|
|
}
|
|
|
|
|
2005-02-10 15:06:13 +00:00
|
|
|
return j;
|
|
|
|
}
|
|
|
|
|
2005-10-17 20:48:35 +00:00
|
|
|
|
|
|
|
static gboolean
|
|
|
|
speed_sink_event (GstPad * pad, GstEvent * event)
|
|
|
|
{
|
|
|
|
GstSpeed *filter;
|
2007-05-04 17:20:31 +00:00
|
|
|
gboolean ret = FALSE;
|
2005-10-17 20:48:35 +00:00
|
|
|
|
|
|
|
filter = GST_SPEED (gst_pad_get_parent (pad));
|
|
|
|
|
|
|
|
switch (GST_EVENT_TYPE (event)) {
|
2007-05-04 17:20:31 +00:00
|
|
|
case GST_EVENT_NEWSEGMENT:{
|
2005-10-17 20:48:35 +00:00
|
|
|
gdouble rate;
|
|
|
|
gboolean update = FALSE;
|
2007-05-04 17:20:31 +00:00
|
|
|
GstFormat format;
|
2005-10-17 20:48:35 +00:00
|
|
|
gint64 start_value, stop_value, base;
|
|
|
|
|
2005-11-22 11:57:51 +00:00
|
|
|
gst_event_parse_new_segment (event, &update, &rate, &format, &start_value,
|
2005-10-17 20:48:35 +00:00
|
|
|
&stop_value, &base);
|
|
|
|
gst_event_unref (event);
|
|
|
|
|
2007-05-04 17:20:31 +00:00
|
|
|
if (format != GST_FORMAT_TIME) {
|
|
|
|
GST_WARNING_OBJECT (filter, "newsegment event not in TIME format!");
|
|
|
|
break;
|
2005-10-17 20:48:35 +00:00
|
|
|
}
|
|
|
|
|
2007-05-04 17:20:31 +00:00
|
|
|
g_assert (filter->speed > 0);
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2007-05-04 17:20:31 +00:00
|
|
|
if (start_value >= 0)
|
|
|
|
start_value /= filter->speed;
|
|
|
|
if (stop_value >= 0)
|
|
|
|
stop_value /= filter->speed;
|
|
|
|
base /= filter->speed;
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2007-05-04 17:20:31 +00:00
|
|
|
/* this would only really be correct if we clipped incoming data */
|
|
|
|
filter->timestamp = start_value;
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2007-05-04 17:20:31 +00:00
|
|
|
/* set to NONE so it gets reset later based on the timestamp when we have
|
|
|
|
* the samplerate */
|
|
|
|
filter->offset = GST_BUFFER_OFFSET_NONE;
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2007-05-04 17:20:31 +00:00
|
|
|
ret =
|
|
|
|
gst_pad_event_default (pad, gst_event_new_new_segment (update, rate,
|
|
|
|
format, start_value, stop_value, base));
|
2005-10-17 20:48:35 +00:00
|
|
|
break;
|
2007-05-04 17:20:31 +00:00
|
|
|
}
|
2005-10-17 20:48:35 +00:00
|
|
|
default:
|
|
|
|
ret = gst_pad_event_default (pad, event);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gst_object_unref (filter);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2005-09-08 15:56:38 +00:00
|
|
|
static GstFlowReturn
|
2005-10-17 20:48:35 +00:00
|
|
|
speed_chain (GstPad * pad, GstBuffer * in_buf)
|
2005-02-10 15:06:13 +00:00
|
|
|
{
|
2005-09-08 15:56:38 +00:00
|
|
|
GstBuffer *out_buf;
|
2005-02-10 15:06:13 +00:00
|
|
|
GstSpeed *filter;
|
|
|
|
guint c, in_samples, out_samples, out_size;
|
2007-05-04 16:11:46 +00:00
|
|
|
GstFlowReturn flow;
|
2005-02-10 15:06:13 +00:00
|
|
|
|
2007-05-04 16:11:46 +00:00
|
|
|
filter = GST_SPEED (GST_PAD_PARENT (pad));
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2007-05-04 16:11:46 +00:00
|
|
|
if (G_UNLIKELY (filter->sample_size == 0 || filter->rate == 0)) {
|
|
|
|
flow = GST_FLOW_NOT_NEGOTIATED;
|
|
|
|
goto done;
|
|
|
|
}
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2007-05-04 17:20:31 +00:00
|
|
|
if (G_UNLIKELY (filter->offset == GST_BUFFER_OFFSET_NONE)) {
|
|
|
|
filter->offset =
|
|
|
|
gst_util_uint64_scale_int (filter->timestamp, filter->rate, GST_SECOND);
|
|
|
|
}
|
|
|
|
|
2005-10-17 20:48:35 +00:00
|
|
|
/* buffersize has to be aligned by samplesize */
|
|
|
|
out_size = ceil ((gfloat) GST_BUFFER_SIZE (in_buf) / filter->speed);
|
|
|
|
out_size = ((out_size + filter->sample_size - 1) / filter->sample_size) *
|
|
|
|
filter->sample_size;
|
2005-02-10 15:06:13 +00:00
|
|
|
|
2007-05-04 16:11:46 +00:00
|
|
|
flow =
|
2005-12-05 13:04:22 +00:00
|
|
|
gst_pad_alloc_buffer_and_set_caps (filter->srcpad, -1, out_size,
|
2005-09-08 15:56:38 +00:00
|
|
|
GST_PAD_CAPS (filter->srcpad), &out_buf);
|
2005-02-10 15:06:13 +00:00
|
|
|
|
2007-05-04 16:11:46 +00:00
|
|
|
if (flow != GST_FLOW_OK)
|
|
|
|
goto done;
|
2005-10-17 20:48:35 +00:00
|
|
|
|
|
|
|
in_samples = GST_BUFFER_SIZE (in_buf) / filter->sample_size;
|
2005-02-10 15:06:13 +00:00
|
|
|
|
|
|
|
out_samples = 0;
|
|
|
|
|
|
|
|
for (c = 0; c < filter->channels; ++c) {
|
|
|
|
if (filter->format == GST_SPEED_FORMAT_INT) {
|
2005-10-17 20:48:35 +00:00
|
|
|
out_samples = speed_chain_int16 (filter, in_buf, out_buf, c, in_samples);
|
2005-02-10 15:06:13 +00:00
|
|
|
} else {
|
2005-10-17 20:48:35 +00:00
|
|
|
out_samples =
|
|
|
|
speed_chain_float32 (filter, in_buf, out_buf, c, in_samples);
|
2005-02-10 15:06:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GST_BUFFER_SIZE (out_buf) = out_samples * filter->sample_size;
|
|
|
|
|
|
|
|
GST_BUFFER_OFFSET (out_buf) = filter->offset;
|
|
|
|
GST_BUFFER_TIMESTAMP (out_buf) = filter->timestamp;
|
|
|
|
|
|
|
|
filter->offset += GST_BUFFER_SIZE (out_buf) / filter->sample_size;
|
2007-05-04 16:11:46 +00:00
|
|
|
filter->timestamp =
|
|
|
|
gst_util_uint64_scale_int (filter->offset, GST_SECOND, filter->rate);
|
2005-02-10 15:06:13 +00:00
|
|
|
|
2007-05-04 16:11:46 +00:00
|
|
|
/* make sure it's at least nominally a perfect stream */
|
2005-02-10 15:06:13 +00:00
|
|
|
GST_BUFFER_DURATION (out_buf) =
|
|
|
|
filter->timestamp - GST_BUFFER_TIMESTAMP (out_buf);
|
|
|
|
|
2007-05-04 16:11:46 +00:00
|
|
|
flow = gst_pad_push (filter->srcpad, out_buf);
|
2005-02-10 15:06:13 +00:00
|
|
|
|
2007-05-04 16:11:46 +00:00
|
|
|
done:
|
|
|
|
|
|
|
|
if (G_UNLIKELY (flow != GST_FLOW_OK))
|
|
|
|
GST_DEBUG_OBJECT (filter, "flow: %s", gst_flow_get_name (flow));
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2007-05-04 16:11:46 +00:00
|
|
|
gst_buffer_unref (in_buf);
|
|
|
|
return flow;
|
2001-12-22 23:26:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
speed_set_property (GObject * object, guint prop_id, const GValue * value,
|
|
|
|
GParamSpec * pspec)
|
2001-12-22 23:26:33 +00:00
|
|
|
{
|
2005-10-17 20:48:35 +00:00
|
|
|
GstSpeed *filter = GST_SPEED (object);
|
2001-12-22 23:26:33 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
switch (prop_id) {
|
2001-12-22 23:26:33 +00:00
|
|
|
case ARG_SPEED:
|
|
|
|
filter->speed = g_value_get_float (value);
|
|
|
|
break;
|
|
|
|
default:
|
2005-10-17 20:48:35 +00:00
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
2001-12-22 23:26:33 +00:00
|
|
|
break;
|
|
|
|
}
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2001-12-22 23:26:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
speed_get_property (GObject * object, guint prop_id, GValue * value,
|
|
|
|
GParamSpec * pspec)
|
2001-12-22 23:26:33 +00:00
|
|
|
{
|
2005-10-17 20:48:35 +00:00
|
|
|
GstSpeed *filter = GST_SPEED (object);
|
2001-12-22 23:26:33 +00:00
|
|
|
|
|
|
|
switch (prop_id) {
|
|
|
|
case ARG_SPEED:
|
|
|
|
g_value_set_float (value, filter->speed);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
|
|
|
break;
|
|
|
|
}
|
2005-10-17 20:48:35 +00:00
|
|
|
|
2001-12-22 23:26:33 +00:00
|
|
|
}
|
|
|
|
|
2005-09-05 17:20:29 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
speed_change_state (GstElement * element, GstStateChange transition)
|
2005-02-10 15:06:13 +00:00
|
|
|
{
|
|
|
|
GstSpeed *speed = GST_SPEED (element);
|
|
|
|
|
2005-09-05 17:20:29 +00:00
|
|
|
switch (transition) {
|
|
|
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
2007-05-04 17:20:31 +00:00
|
|
|
speed->offset = GST_BUFFER_OFFSET_NONE;
|
2005-02-10 15:06:13 +00:00
|
|
|
speed->timestamp = 0;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-09-08 15:56:38 +00:00
|
|
|
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
|
|
|
return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
2005-02-10 15:06:13 +00:00
|
|
|
|
2005-09-05 17:20:29 +00:00
|
|
|
return GST_STATE_CHANGE_SUCCESS;
|
2005-02-10 15:06:13 +00:00
|
|
|
}
|
|
|
|
|
2001-12-22 23:26:33 +00:00
|
|
|
static gboolean
|
2004-03-14 22:34:33 +00:00
|
|
|
plugin_init (GstPlugin * plugin)
|
2001-12-22 23:26:33 +00:00
|
|
|
{
|
2007-05-04 16:11:46 +00:00
|
|
|
GST_DEBUG_CATEGORY_INIT (speed_debug, "speed", 0, "speed element");
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
return gst_element_register (plugin, "speed", GST_RANK_NONE, GST_TYPE_SPEED);
|
2001-12-22 23:26:33 +00:00
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
|
|
GST_VERSION_MINOR,
|
|
|
|
"speed",
|
|
|
|
"Set speed/pitch on audio/raw streams (resampler)",
|
2006-04-01 10:09:11 +00:00
|
|
|
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
|