diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2008-11-04 22:18:13 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2008-11-04 22:18:13 +0000 |
commit | 68dd9065de83ad8576834e6f7f228bf281f14246 (patch) | |
tree | 0a95f31f58edfdf5180344b0a09e96579201d474 /usr.bin/aucat/aproc.h | |
parent | 42ba8ee598cccebf83ab6461d77f8730f21a05b8 (diff) |
split code that converts any->any in two parts: one to encode
native->any and one to decode any->native. It is simpler and
faster this way.
Diffstat (limited to 'usr.bin/aucat/aproc.h')
-rw-r--r-- | usr.bin/aucat/aproc.h | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/usr.bin/aucat/aproc.h b/usr.bin/aucat/aproc.h index 0070405af93..b6713b3a2fc 100644 --- a/usr.bin/aucat/aproc.h +++ b/usr.bin/aucat/aproc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: aproc.h,v 1.10 2008/11/04 18:24:06 ratchov Exp $ */ +/* $OpenBSD: aproc.h,v 1.11 2008/11/04 22:18:12 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -111,18 +111,6 @@ struct aproc_ops { void (*done)(struct aproc *); }; -struct aconv { - /* - * Format of the buffer. This part is used by conversion code. - */ - int bfirst; /* bytes to skip at startup */ - unsigned bps; /* bytes per sample (padding included) */ - unsigned shift; /* shift to get 32bit MSB-justified int */ - int sigbit; /* sign bits to XOR to unsigned samples */ - int bnext; /* bytes to skip to reach the next byte */ - int snext; /* bytes to skip to reach the next sample */ -}; - /* * The aproc structure represents a simple audio processing unit; they are * interconnected by abuf structures and form a kind of "circuit". The circuit @@ -138,10 +126,6 @@ struct aproc { struct file *file; /* file to read/write */ } io; struct { - struct aconv ist, ost; - int idelta, odelta; /* reminder of conv_[io]pos */ - } conv; - struct { #define MIX_DROP 1 #define MIX_AUTOQUIT 2 unsigned flags; /* bit mask of above */ @@ -164,6 +148,14 @@ struct aproc { struct { short ctx[NCHAN_MAX]; } cmap; + struct { + int bfirst; /* bytes to skip at startup */ + unsigned bps; /* bytes per sample */ + unsigned shift; /* shift to get 32bit MSB */ + int sigbit; /* sign bits to XOR */ + int bnext; /* to reach the next byte */ + int snext; /* to reach the next sample */ + } conv; } u; }; @@ -188,11 +180,12 @@ void wpipe_hup(struct aproc *, struct abuf *); struct aproc *mix_new(char *, int); struct aproc *sub_new(char *, int); -struct aproc *conv_new(char *, struct aparams *, struct aparams *); struct aproc *resamp_new(char *, struct aparams *, struct aparams *); struct aproc *cmap_new(char *, struct aparams *, struct aparams *); +struct aproc *enc_new(char *, struct aparams *); +struct aproc *dec_new(char *, struct aparams *); void mix_pushzero(struct aproc *); void mix_setmaster(struct aproc *); -#endif /* !defined(FIFO_H) */ +#endif /* !defined(APROC_H) */ |