12024
|
1 /*
|
|
2 The mediastreamer library aims at providing modular media processing and I/O
|
|
3 for linphone, but also for any telephony application.
|
|
4 Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
|
|
5
|
|
6 This library is free software; you can redistribute it and/or
|
|
7 modify it under the terms of the GNU Lesser General Public
|
|
8 License as published by the Free Software Foundation; either
|
|
9 version 2.1 of the License, or (at your option) any later version.
|
|
10
|
|
11 This library is distributed in the hope that it will be useful,
|
|
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14 Lesser General Public License for more details.
|
|
15
|
|
16 You should have received a copy of the GNU Lesser General Public
|
|
17 License along with this library; if not, write to the Free Software
|
|
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
19 */
|
|
20 #ifndef MSOSSREAD_H
|
|
21 #define MSOSSREAD_H
|
|
22
|
|
23 #include "mssoundread.h"
|
|
24 #include "sndcard.h"
|
|
25 #include "mssync.h"
|
|
26
|
|
27
|
|
28 /*this is the class that implements oss writing sink filter*/
|
|
29
|
|
30 #define MS_OSS_READ_MAX_INPUTS 1 /* max output per filter*/
|
|
31
|
|
32 #define MS_OSS_READ_MAX_GRAN (512*2) /* the maximum granularity*/
|
|
33
|
|
34 struct _MSOssRead
|
|
35 {
|
|
36 /* the MSOssRead derivates from MSSoundRead so the MSSoundRead object MUST be the first of the MSOssRead object
|
|
37 in order to the object mechanism to work*/
|
|
38 MSSoundRead filter;
|
|
39 MSFifo *f_outputs[MS_OSS_READ_MAX_INPUTS];
|
|
40 MSSync *sync;
|
|
41 SndCard *sndcard;
|
|
42 gint freq;
|
|
43 gint devid; /* the sound device id it depends on*/
|
|
44 gint gran;
|
|
45 gint flags;
|
|
46 #define START_REQUESTED 1
|
|
47 #define STOP_REQUESTED 2
|
|
48 };
|
|
49
|
|
50 typedef struct _MSOssRead MSOssRead;
|
|
51
|
|
52 struct _MSOssReadClass
|
|
53 {
|
|
54 /* the MSOssRead derivates from MSSoundRead, so the MSSoundRead class MUST be the first of the MSOssRead class
|
|
55 in order to the class mechanism to work*/
|
|
56 MSSoundReadClass parent_class;
|
|
57 };
|
|
58
|
|
59 typedef struct _MSOssReadClass MSOssReadClass;
|
|
60
|
|
61 /* PUBLIC */
|
|
62 #define MS_OSS_READ(filter) ((MSOssRead*)(filter))
|
|
63 #define MS_OSS_READ_CLASS(klass) ((MSOssReadClass*)(klass))
|
|
64 MSFilter * ms_oss_read_new(void);
|
|
65 gint ms_oss_read_set_device(MSOssRead *w,gint devid);
|
|
66 void ms_oss_read_start(MSOssRead *w);
|
|
67 void ms_oss_read_stop(MSOssRead *w);
|
|
68
|
|
69 /* FOR INTERNAL USE*/
|
|
70 void ms_oss_read_init(MSOssRead *r);
|
|
71 void ms_oss_read_class_init(MSOssReadClass *klass);
|
|
72 void ms_oss_read_destroy( MSOssRead *obj);
|
|
73 void ms_oss_read_process(MSOssRead *f);
|
|
74 void ms_oss_read_setup(MSOssRead *f, MSSync *sync);
|
|
75
|
|
76
|
|
77 #endif
|