source: roaraudio/roard/include/codecfilter.h @ 3039:56455930dc5f

Last change on this file since 3039:56455930dc5f was 2816:b9e357b0dc43, checked in by phi, 15 years ago

added prethru support and updated list of codecs a bit

File size: 5.9 KB
RevLine 
[169]1//codecfilter.h:
2
[668]3/*
4 *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2008
5 *
6 *  This file is part of roard a part of RoarAudio,
7 *  a cross-platform sound system for both, home and professional use.
8 *  See README for details.
9 *
10 *  This file is free software; you can redistribute it and/or modify
11 *  it under the terms of the GNU General Public License version 3
12 *  as published by the Free Software Foundation.
13 *
14 *  RoarAudio 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 General Public License for more details.
18 *
19 *  You should have received a copy of the GNU General Public License
20 *  along with this software; see the file COPYING.  If not, write to
21 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 */
24
[169]25#ifndef _CODECFILTER_H_
26#define _CODECFILTER_H_
27
28#include <roaraudio.h>
29
[170]30#define CODECFILTER_USERDATA_T void *
31
[195]32struct roar_stream_server;
[170]33
[2816]34#define ROAR_CODECFILTER_NONE        0x00
35#define ROAR_CODECFILTER_READ        0x01
36#define ROAR_CODECFILTER_WRITE       0x02
37#define ROAR_CODECFILTER_PRETHRU     0x04 /* we have support for prethru */
38#define ROAR_CODECFILTER_PRETHRU_NN  0x08 /* prethru Not Needed          */
[612]39
[1238]40
41#define ROAR_CODECFILTER_CTL_NOOP            ROAR_STREAM_CTL_COMP_CF|0x0000 /* noop... */
42#define ROAR_CODECFILTER_CTL_BASE            ROAR_STREAM_CTL_COMP_CF|0x0000 /* Base ops... */
43#define ROAR_CODECFILTER_CTL_META            ROAR_STREAM_CTL_COMP_CF|0x1000 /* Meta data things... */
[2603]44#define ROAR_CODECFILTER_CTL_VIRTUAL         ROAR_STREAM_CTL_COMP_CF|0x2000 /* container/virtual stream things... */
[1238]45
[2083]46#define ROAR_CODECFILTER_CTL_SET             0x0002
47#define ROAR_CODECFILTER_CTL_GET             0x0003
48
[1238]49#define ROAR_CODECFILTER_CTL_UPDATE          0x0001
[2603]50#define ROAR_CODECFILTER_CTL_DELETE          0x0004
[2624]51#define ROAR_CODECFILTER_CTL_NEW             0x0005
[1238]52
[2083]53#define ROAR_CODECFILTER_CTL_Q               0x0010
54#define ROAR_CODECFILTER_CTL_SET_Q           ROAR_CODECFILTER_CTL_BASE|ROAR_CODECFILTER_CTL_Q|ROAR_CODECFILTER_CTL_SET
55#define ROAR_CODECFILTER_CTL_GET_Q           ROAR_CODECFILTER_CTL_BASE|ROAR_CODECFILTER_CTL_Q|ROAR_CODECFILTER_CTL_GET
56
[1238]57#define ROAR_CODECFILTER_CTL_META_UPDATE     ROAR_CODECFILTER_CTL_META|ROAR_CODECFILTER_CTL_UPDATE
58
[2603]59#define ROAR_CODECFILTER_CTL_VIRTUAL_DELETE  ROAR_CODECFILTER_CTL_VIRTUAL|ROAR_CODECFILTER_CTL_DELETE
[2624]60#define ROAR_CODECFILTER_CTL_VIRTUAL_NEW     ROAR_CODECFILTER_CTL_VIRTUAL|ROAR_CODECFILTER_CTL_NEW
[2603]61
62
[1238]63#define ROAR_CODECFILTER_CTL2CMD(x)          ((x) & (~ROAR_STREAM_CTL_COMP_CF))
64
[170]65struct roar_codecfilter {
[176]66 int    codec;
[170]67 char * name;
68 char * desc;
[171]69 char * options;
[2679]70 void * setup;
[612]71 int    flags;
[2679]72 unsigned int subsystems;
[193]73 int (*open )(CODECFILTER_USERDATA_T * inst, int codec,
[171]74                                             struct roar_stream_server * info,
75                                             struct roar_codecfilter   * filter);
[170]76 int (*close)(CODECFILTER_USERDATA_T   inst);
77 int (*pause)(CODECFILTER_USERDATA_T   inst, int newstate);
78 int (*write)(CODECFILTER_USERDATA_T   inst, char * buf, int len);
79 int (*read )(CODECFILTER_USERDATA_T   inst, char * buf, int len);
80 int (*flush)(CODECFILTER_USERDATA_T   inst);
[1144]81 int (*delay)(CODECFILTER_USERDATA_T   inst, uint_least32_t * delay);
[1223]82 int (*ctl  )(CODECFILTER_USERDATA_T   inst, int cmd, void * data);
[170]83};
84
[172]85
86#include "codecfilter_cmd.h"
[561]87#include "codecfilter_wave.h"
88
89
[204]90#ifdef ROAR_HAVE_LIBVORBISFILE
91#include "codecfilter_vorbis.h"
92#endif
[172]93
[323]94#ifdef ROAR_HAVE_LIBCELT
95#include "codecfilter_celt.h"
96#endif
[172]97
[371]98#ifdef ROAR_HAVE_LIBSPEEX
99#include "codecfilter_speex.h"
100#endif
101
[851]102#ifdef ROAR_HAVE_LIBSNDFILE
103#include "codecfilter_sndfile.h"
104#endif
105
[992]106#ifdef ROAR_HAVE_LIBFISHSOUND
107#include "codecfilter_fishsound.h"
108#endif
109
[2686]110#include "container_framework.h"
111
[992]112//cf alaw/mulaw:
[783]113#include <libroardsp/libroardsp.h>
114
[170]115void print_codecfilterlist (void);
116
117int codecfilter_open (CODECFILTER_USERDATA_T * inst,
118                 int * codecfilter_id, char * codecfilter /* NOTE: this is not part of struct roar_codecfilter's def! */,
[193]119                 int codec, struct roar_stream_server * info);
[170]120int codecfilter_close(CODECFILTER_USERDATA_T   inst, int codecfilter);
121int codecfilter_pause(CODECFILTER_USERDATA_T   inst, int codecfilter, int newstate);
122int codecfilter_write(CODECFILTER_USERDATA_T   inst, int codecfilter, char * buf, int len);
123int codecfilter_read (CODECFILTER_USERDATA_T   inst, int codecfilter, char * buf, int len);
124int codecfilter_flush(CODECFILTER_USERDATA_T   inst, int codecfilter);
[1144]125int codecfilter_delay(CODECFILTER_USERDATA_T   inst, int codecfilter, uint_least32_t * delay);
[1224]126int codecfilter_ctl  (CODECFILTER_USERDATA_T   inst, int codecfilter, int_least32_t cmd, void * data);
[1144]127
128int codecfilter_delay_fulldyn(CODECFILTER_USERDATA_T   inst, uint_least32_t * delay);
129
[170]130
[736]131// codecfilter without a own .h:
132int cf_alaw_open(CODECFILTER_USERDATA_T * inst, int codec,
133                                            struct roar_stream_server * info,
134                                            struct roar_codecfilter   * filter);
135
136int cf_alaw_close(CODECFILTER_USERDATA_T   inst);
137
138int cf_alaw_read(CODECFILTER_USERDATA_T   inst, char * buf, int len);
139int cf_alaw_write(CODECFILTER_USERDATA_T   inst, char * buf, int len);
[1144]140int cf_alaw_delay(CODECFILTER_USERDATA_T   inst, uint_least32_t * delay);
[170]141
[922]142int cf_mulaw_open(CODECFILTER_USERDATA_T * inst, int codec,
143                                            struct roar_stream_server * info,
144                                            struct roar_codecfilter   * filter);
145
146int cf_mulaw_close(CODECFILTER_USERDATA_T   inst);
147
148int cf_mulaw_read(CODECFILTER_USERDATA_T   inst, char * buf, int len);
149int cf_mulaw_write(CODECFILTER_USERDATA_T   inst, char * buf, int len);
[1144]150// cf_mulaw_delay() would be exactly the same as cf_alaw_delay() so it is just used by mulaw, too.
[922]151
[2686]152CONT_FW_SETUP_TYPE(cf_raum_setup);
153
[169]154#endif
155
156//ll
Note: See TracBrowser for help on using the repository browser.