VLC  2.1.0-git
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
aout_internal.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * aout_internal.h : internal defines for audio output
3  *****************************************************************************
4  * Copyright (C) 2002 VLC authors and VideoLAN
5  * $Id: 93c828f1d9fd037462d8012399d6613c4fd324a2 $
6  *
7  * Authors: Christophe Massiot <massiot@via.ecp.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU Lesser General Public License as published by
11  * the Free Software Foundation; either version 2.1 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public License
20  * along with this program; if not, write to the Free Software Foundation,
21  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23 
24 #ifndef LIBVLC_AOUT_INTERNAL_H
25 # define LIBVLC_AOUT_INTERNAL_H 1
26 
27 # include <vlc_atomic.h>
28 
29 /* Max input rate factor (1/4 -> 4) */
30 # define AOUT_MAX_INPUT_RATE (4)
31 
32 # define AOUT_MAX_FILTERS 10
33 
34 enum {
38 };
39 
40 typedef struct
41 {
42  struct vout_thread_t *(*pf_request_vout)( void *, struct vout_thread_t *,
43  video_format_t *, bool );
44  void *p_private;
46 
47 typedef struct aout_volume aout_volume_t;
48 
49 typedef struct
50 {
52  module_t *module; /**< Output plugin (or NULL if inactive) */
54 
55  struct
56  {
58  char *device;
59  float volume;
60  signed char mute;
61  } req;
62 
63  struct
64  {
65  mtime_t end; /**< Last seen PTS */
66  unsigned resamp_start_drift; /**< Resampler drift absolute value */
67  int resamp_type; /**< Resampler mode (FIXME: redundant / resampling) */
69  } sync;
70 
73 
74  filter_t *rate_filter; /**< The filter adjusting samples count
75  (either the scaletempo filter or a resampler) */
76  filter_t *resampler; /**< The resampler */
77  int resampling; /**< Current resampling (Hz) */
78  unsigned nb_filters;
79  filter_t *filters[AOUT_MAX_FILTERS]; /**< Configured user filters
80  (e.g. equalization) and their conversions */
81 
84 
87 } aout_owner_t;
88 
89 typedef struct
90 {
94 
95 static inline aout_owner_t *aout_owner (audio_output_t *aout)
96 {
97  return &((aout_instance_t *)aout)->owner;
98 }
99 
100 /****************************************************************************
101  * Prototypes
102  *****************************************************************************/
103 
104 /* From filters.c : */
106  const audio_sample_format_t *, const aout_request_vout_t *);
110 
111 /* From mixer.c : */
113 #define aout_volume_New(o, g) aout_volume_New(VLC_OBJECT(o), g)
115 void aout_volume_SetVolume(aout_volume_t *, float);
118 
119 
120 /* From output.c : */
122 #define aout_New(a) aout_New(VLC_OBJECT(a))
124 
128 void aout_OutputPause( audio_output_t * p_aout, bool, mtime_t );
129 void aout_OutputFlush( audio_output_t * p_aout, bool );
130 void aout_OutputDelete( audio_output_t * p_aout );
133 
134 
135 /* From common.c : */
136 void aout_FormatsPrint(vlc_object_t *, const char *,
137  const audio_sample_format_t *,
138  const audio_sample_format_t *);
139 #define aout_FormatsPrint(o, t, a, b) \
140  aout_FormatsPrint(VLC_OBJECT(o), t, a, b)
142  const char *var, const char *name, bool b_add );
143 
144 /* From dec.c */
146  const audio_replay_gain_t *, const aout_request_vout_t *);
150 int aout_DecPlay(audio_output_t *, block_t *, int i_input_rate);
152 void aout_DecChangePause(audio_output_t *, bool b_paused, mtime_t i_date);
155 void aout_RequestRestart (audio_output_t *, unsigned);
156 
157 static inline void aout_InputRequestRestart(audio_output_t *aout)
158 {
160 }
161 
162 #endif /* !LIBVLC_AOUT_INTERNAL_H */