2005-08-23 19:29:38 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
|
2009-01-23 11:31:06 +00:00
|
|
|
* Copyright (C) <2007-2008> Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
2005-08-23 19:29:38 +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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2009-01-23 11:31:06 +00:00
|
|
|
#ifndef __AUDIO_RESAMPLE_H__
|
|
|
|
#define __AUDIO_RESAMPLE_H__
|
2005-08-23 19:29:38 +00:00
|
|
|
|
|
|
|
#include <gst/gst.h>
|
2005-08-24 14:08:58 +00:00
|
|
|
#include <gst/base/gstbasetransform.h>
|
2009-01-23 11:31:06 +00:00
|
|
|
#include <gst/audio/audio.h>
|
2005-08-23 19:29:38 +00:00
|
|
|
|
2009-01-23 11:31:06 +00:00
|
|
|
#include "speex_resampler_wrapper.h"
|
2005-08-23 19:29:38 +00:00
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2009-01-23 11:31:06 +00:00
|
|
|
#define GST_TYPE_AUDIO_RESAMPLE \
|
|
|
|
(gst_audio_resample_get_type())
|
|
|
|
#define GST_AUDIO_RESAMPLE(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_RESAMPLE,GstAudioResample))
|
|
|
|
#define GST_AUDIO_RESAMPLE_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_RESAMPLE,GstAudioResampleClass))
|
|
|
|
#define GST_IS_AUDIO_RESAMPLE(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_RESAMPLE))
|
|
|
|
#define GST_IS_AUDIO_RESAMPLE_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_RESAMPLE))
|
2005-08-23 19:29:38 +00:00
|
|
|
|
2009-01-23 11:31:06 +00:00
|
|
|
typedef struct _GstAudioResample GstAudioResample;
|
|
|
|
typedef struct _GstAudioResampleClass GstAudioResampleClass;
|
2005-08-23 19:29:38 +00:00
|
|
|
|
docs/plugins/: Add audioresample to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-base-plugins-docs.sgml:
* docs/plugins/gst-plugins-base-plugins-sections.txt:
Add audioresample to docs.
* gst/audioconvert/gstaudioconvert.c:
Add revision date.
* gst/audioresample/gstaudioresample.c:
(gst_audioresample_base_init), (gst_audioresample_class_init),
(gst_audioresample_init), (gst_audioresample_dispose),
(audioresample_get_unit_size), (audioresample_transform_caps),
(resample_set_state_from_caps), (audioresample_transform_size),
(audioresample_set_caps), (audioresample_event),
(audioresample_do_output), (audioresample_transform),
(audioresample_pushthrough), (gst_audioresample_set_property),
(gst_audioresample_get_property), (plugin_init):
* gst/audioresample/gstaudioresample.h:
Added docs.
Small code cleanups.
2006-03-02 18:23:55 +00:00
|
|
|
/**
|
2009-01-23 11:31:06 +00:00
|
|
|
* GstAudioResample:
|
docs/plugins/: Add audioresample to docs.
Original commit message from CVS:
* docs/plugins/Makefile.am:
* docs/plugins/gst-plugins-base-plugins-docs.sgml:
* docs/plugins/gst-plugins-base-plugins-sections.txt:
Add audioresample to docs.
* gst/audioconvert/gstaudioconvert.c:
Add revision date.
* gst/audioresample/gstaudioresample.c:
(gst_audioresample_base_init), (gst_audioresample_class_init),
(gst_audioresample_init), (gst_audioresample_dispose),
(audioresample_get_unit_size), (audioresample_transform_caps),
(resample_set_state_from_caps), (audioresample_transform_size),
(audioresample_set_caps), (audioresample_event),
(audioresample_do_output), (audioresample_transform),
(audioresample_pushthrough), (gst_audioresample_set_property),
(gst_audioresample_get_property), (plugin_init):
* gst/audioresample/gstaudioresample.h:
Added docs.
Small code cleanups.
2006-03-02 18:23:55 +00:00
|
|
|
*
|
|
|
|
* Opaque data structure.
|
|
|
|
*/
|
2009-01-23 11:31:06 +00:00
|
|
|
struct _GstAudioResample {
|
2005-08-24 14:08:58 +00:00
|
|
|
GstBaseTransform element;
|
2005-08-23 19:29:38 +00:00
|
|
|
|
2009-01-23 11:31:06 +00:00
|
|
|
/* <private> */
|
|
|
|
|
2005-08-24 14:08:58 +00:00
|
|
|
GstCaps *srccaps, *sinkcaps;
|
2005-08-23 19:29:38 +00:00
|
|
|
|
2007-03-14 17:16:30 +00:00
|
|
|
gboolean need_discont;
|
2005-08-23 19:29:38 +00:00
|
|
|
|
2009-08-21 04:57:58 +00:00
|
|
|
GstClockTime t0;
|
|
|
|
guint64 in_offset0;
|
|
|
|
guint64 out_offset0;
|
2010-12-13 08:56:04 +00:00
|
|
|
guint64 samples_in;
|
|
|
|
guint64 samples_out;
|
2010-12-17 04:09:58 +00:00
|
|
|
|
2010-12-17 04:40:33 +00:00
|
|
|
guint64 num_gap_samples;
|
|
|
|
guint64 num_nongap_samples;
|
2010-12-13 08:56:04 +00:00
|
|
|
|
2009-01-23 11:31:06 +00:00
|
|
|
gint channels;
|
|
|
|
gint inrate;
|
|
|
|
gint outrate;
|
|
|
|
gint quality;
|
|
|
|
gint width;
|
|
|
|
gboolean fp;
|
|
|
|
|
|
|
|
guint8 *tmp_in;
|
|
|
|
guint tmp_in_size;
|
|
|
|
|
|
|
|
guint8 *tmp_out;
|
|
|
|
guint tmp_out_size;
|
|
|
|
|
|
|
|
SpeexResamplerState *state;
|
|
|
|
const SpeexResampleFuncs *funcs;
|
2005-08-23 19:29:38 +00:00
|
|
|
};
|
|
|
|
|
2009-01-23 11:31:06 +00:00
|
|
|
struct _GstAudioResampleClass {
|
2005-08-24 14:08:58 +00:00
|
|
|
GstBaseTransformClass parent_class;
|
2005-08-23 19:29:38 +00:00
|
|
|
};
|
|
|
|
|
2009-01-23 11:31:06 +00:00
|
|
|
GType gst_audio_resample_get_type(void);
|
2005-08-23 19:29:38 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
2009-01-23 11:31:06 +00:00
|
|
|
#endif /* __AUDIO_RESAMPLE_H__ */
|