~ubuntu-branches/ubuntu/natty/gavl/natty

« back to all changes in this revision

Viewing changes to include/audio.h

  • Committer: Bazaar Package Importer
  • Author(s): Free Ekanayaka
  • Date: 2006-05-17 14:24:46 UTC
  • Revision ID: james.westby@ubuntu.com-20060517142446-iqm0jgfbkmy27n5w
Tags: upstream-0.2.3
ImportĀ upstreamĀ versionĀ 0.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************
 
2
 
 
3
  audio.h
 
4
 
 
5
  Copyright (c) 2003 by Burkhard Plaum - plaum@ipf.uni-stuttgart.de
 
6
 
 
7
  http://gmerlin.sourceforge.net
 
8
 
 
9
  This program 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
 
12
  GNU General Public License for more details.
 
13
 
 
14
  You should have received a copy of the GNU General Public License
 
15
  along with this program; if not, write to the Free Software
 
16
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
 
17
 
 
18
*****************************************************************/
 
19
 
 
20
/* Private structures for the video converter */
 
21
 
 
22
#include <gavl.h>
 
23
#include "config.h"
 
24
 
 
25
struct gavl_audio_options_s
 
26
  {
 
27
  /*
 
28
   *  Quality setting from 1 to 5 (0 means undefined).
 
29
   *  3 means Standard C routines or accellerated version with
 
30
   *  equal quality. Lower numbers mean accellerated versions with lower
 
31
   *  quality.
 
32
   */
 
33
  int quality;         
 
34
 
 
35
  /* Explicit accel_flags are mainly for debugging purposes */
 
36
  uint32_t accel_flags;     /* CPU Acceleration flags */
 
37
 
 
38
  /* #defines from above */
 
39
    
 
40
  uint32_t conversion_flags;
 
41
  };
 
42
 
 
43
typedef struct gavl_audio_convert_context_s gavl_audio_convert_context_t;
 
44
typedef struct gavl_mix_matrix_s gavl_mix_matrix_t;
 
45
 
 
46
typedef void (*gavl_audio_func_t)(struct gavl_audio_convert_context_s * ctx);
 
47
 
 
48
typedef struct gavl_samplerate_converter_s gavl_samplerate_converter_t;
 
49
 
 
50
typedef struct gavl_audio_dither_context_s gavl_audio_dither_context_t;
 
51
 
 
52
struct gavl_audio_convert_context_s
 
53
  {
 
54
  gavl_audio_frame_t * input_frame;
 
55
  gavl_audio_frame_t * output_frame;
 
56
 
 
57
  gavl_audio_format_t input_format;
 
58
  gavl_audio_format_t output_format;
 
59
  
 
60
  /* Conversion function to be called */
 
61
 
 
62
  gavl_audio_func_t func;
 
63
 
 
64
  /* Private data */
 
65
  
 
66
  gavl_mix_matrix_t * mix_matrix;
 
67
  gavl_samplerate_converter_t * samplerate_converter;
 
68
  gavl_audio_dither_context_t * dither_context;
 
69
    
 
70
  /* For chaining */
 
71
  
 
72
  struct gavl_audio_convert_context_s * next;
 
73
  };
 
74
 
 
75
gavl_audio_convert_context_t *
 
76
gavl_audio_convert_context_create(gavl_audio_format_t  * input_format,
 
77
                                  gavl_audio_format_t  * output_format);
 
78
 
 
79
gavl_audio_convert_context_t *
 
80
gavl_mix_context_create(gavl_audio_options_t * opt,
 
81
                        gavl_audio_format_t  * input_format,
 
82
                        gavl_audio_format_t  * output_format);
 
83
 
 
84
gavl_audio_convert_context_t *
 
85
gavl_interleave_context_create(gavl_audio_options_t * opt,
 
86
                               gavl_audio_format_t  * input_format,
 
87
                               gavl_audio_format_t  * output_format);
 
88
 
 
89
gavl_audio_convert_context_t *
 
90
gavl_sampleformat_context_create(gavl_audio_options_t * opt,
 
91
                                 gavl_audio_format_t  * input_format,
 
92
                                 gavl_audio_format_t  * output_format);
 
93
 
 
94
gavl_audio_convert_context_t *
 
95
gavl_samplerate_context_create(gavl_audio_options_t * opt,
 
96
                               gavl_audio_format_t  * input_format,
 
97
                               gavl_audio_format_t  * output_format);
 
98
 
 
99
/* Resampling support */
 
100
 
 
101
gavl_audio_convert_context_t *
 
102
gavl_samplerate_context_create(gavl_audio_options_t * opt,
 
103
                               gavl_audio_format_t  * input_format,
 
104
                               gavl_audio_format_t  * output_format);
 
105
 
 
106
 
 
107
/* Destroy samplerate converter */
 
108
 
 
109
void gavl_samplerate_converter_destroy(gavl_samplerate_converter_t * s);
 
110
 
 
111
/* Destroy dither context */
 
112
 
 
113
void gavl_audio_dither_context_destroy(gavl_audio_dither_context_t * s);
 
114
 
 
115
/* Utility function */
 
116
 
 
117
int gavl_bytes_per_sample(gavl_sample_format_t format);
 
118
 
 
119