~ubuntu-branches/ubuntu/karmic/gst-plugins-bad0.10/karmic-proposed

« back to all changes in this revision

Viewing changes to gst/speexresample/speex_resampler_wrapper.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2009-01-08 07:59:36 UTC
  • mto: (18.1.3 sid) (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 23.
  • Revision ID: james.westby@ubuntu.com-20090108075936-dpmodc3g7ko1scwd
Tags: upstream-0.10.9.2
Import upstream version 0.10.9.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* GStreamer
2
 
 * Copyright (C) 2007 Sebastian Dröge <slomo@circular-chaos.org>
3
 
 *
4
 
 * This library is free software; you can redistribute it and/or
5
 
 * modify it under the terms of the GNU Library General Public
6
 
 * License as published by the Free Software Foundation; either
7
 
 * version 2 of the License, or (at your option) any later version.
8
 
 *
9
 
 * This library is distributed in the hope that it will be useful,
10
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 
 * Library General Public License for more details.
13
 
 *
14
 
 * You should have received a copy of the GNU Library General Public
15
 
 * License along with this library; if not, write to the
16
 
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
 
 * Boston, MA 02111-1307, USA.
18
 
 */
19
 
 
20
 
#ifndef __SPEEX_RESAMPLER_WRAPPER_H__
21
 
#define __SPEEX_RESAMPLER_WRAPPER_H__
22
 
 
23
 
#define SPEEX_RESAMPLER_QUALITY_MAX 10
24
 
#define SPEEX_RESAMPLER_QUALITY_MIN 0
25
 
#define SPEEX_RESAMPLER_QUALITY_DEFAULT 4
26
 
#define SPEEX_RESAMPLER_QUALITY_VOIP 3
27
 
#define SPEEX_RESAMPLER_QUALITY_DESKTOP 5
28
 
 
29
 
enum
30
 
{
31
 
  RESAMPLER_ERR_SUCCESS = 0,
32
 
  RESAMPLER_ERR_ALLOC_FAILED = 1,
33
 
  RESAMPLER_ERR_BAD_STATE = 2,
34
 
  RESAMPLER_ERR_INVALID_ARG = 3,
35
 
  RESAMPLER_ERR_PTR_OVERLAP = 4,
36
 
 
37
 
  RESAMPLER_ERR_MAX_ERROR
38
 
};
39
 
 
40
 
typedef struct SpeexResamplerState_ SpeexResamplerState;
41
 
 
42
 
SpeexResamplerState *resample_float_resampler_init (guint32 nb_channels,
43
 
    guint32 in_rate, guint32 out_rate, gint quality, gint * err);
44
 
SpeexResamplerState *resample_int_resampler_init (guint32 nb_channels,
45
 
    guint32 in_rate, guint32 out_rate, gint quality, gint * err);
46
 
 
47
 
#define resample_resampler_destroy resample_int_resampler_destroy
48
 
void resample_resampler_destroy (SpeexResamplerState * st);
49
 
 
50
 
int resample_float_resampler_process_interleaved_float (SpeexResamplerState *
51
 
    st, const gfloat * in, guint32 * in_len, gfloat * out, guint32 * out_len);
52
 
int resample_int_resampler_process_interleaved_int (SpeexResamplerState * st,
53
 
    const gint16 * in, guint32 * in_len, gint16 * out, guint32 * out_len);
54
 
 
55
 
int resample_float_resampler_set_rate (SpeexResamplerState * st,
56
 
    guint32 in_rate, guint32 out_rate);
57
 
int resample_int_resampler_set_rate (SpeexResamplerState * st,
58
 
    guint32 in_rate, guint32 out_rate);
59
 
 
60
 
void resample_float_resampler_get_rate (SpeexResamplerState * st,
61
 
    guint32 * in_rate, guint32 * out_rate);
62
 
void resample_int_resampler_get_rate (SpeexResamplerState * st,
63
 
    guint32 * in_rate, guint32 * out_rate);
64
 
 
65
 
void resample_float_resampler_get_ratio (SpeexResamplerState * st,
66
 
    guint32 * ratio_num, guint32 * ratio_den);
67
 
void resample_int_resampler_get_ratio (SpeexResamplerState * st,
68
 
    guint32 * ratio_num, guint32 * ratio_den);
69
 
 
70
 
int resample_float_resampler_get_input_latency (SpeexResamplerState * st);
71
 
int resample_int_resampler_get_input_latency (SpeexResamplerState * st);
72
 
 
73
 
int resample_float_resampler_set_quality (SpeexResamplerState * st,
74
 
    gint quality);
75
 
int resample_int_resampler_set_quality (SpeexResamplerState * st, gint quality);
76
 
 
77
 
int resample_float_resampler_reset_mem (SpeexResamplerState * st);
78
 
int resample_int_resampler_reset_mem (SpeexResamplerState * st);
79
 
 
80
 
int resample_float_resampler_skip_zeros (SpeexResamplerState * st);
81
 
int resample_int_resampler_skip_zeros (SpeexResamplerState * st);
82
 
 
83
 
#define resample_resampler_strerror resample_int_resampler_strerror
84
 
const char *resample_resampler_strerror (gint err);
85
 
 
86
 
#endif /* __SPEEX_RESAMPLER_WRAPPER_H__ */