stop using and remove AMSG_GETCAP message

This commit is contained in:
Alexandre Ratchov 2011-04-16 13:18:06 +02:00
parent 313ba302a8
commit fe6209ee49
3 changed files with 1 additions and 54 deletions

View File

@ -38,7 +38,6 @@ struct amsg {
#define AMSG_DATA 5 /* data block */
#define AMSG_POS 6 /* initial position */
#define AMSG_MOVE 7 /* position changed */
#define AMSG_GETCAP 8 /* get capabilities */
#define AMSG_SETVOL 9 /* set volume */
#define AMSG_HELLO 10 /* say hello, check versions and so ... */
#define AMSG_BYE 11 /* ask server to drop connection */
@ -62,15 +61,6 @@ struct amsg {
uint32_t appbufsz; /* client side bufsz */
uint32_t _reserved[1]; /* for future use */
} par;
struct amsg_cap {
uint32_t rate; /* native rate */
uint32_t _reserved2[1]; /* for future use */
uint16_t rchan; /* native rec channels */
uint16_t pchan; /* native play channels */
uint8_t bits; /* native bits per sample */
uint8_t bps; /* native ytes per sample */
uint8_t _reserved[10]; /* for future use */
} cap;
struct amsg_data {
#define AMSG_DATAMAX 0x1000
uint32_t size;
@ -83,7 +73,7 @@ struct amsg {
} vol;
struct amsg_hello {
uint16_t mode; /* bitmap of MODE_XXX */
#define AMSG_VERSION 4
#define AMSG_VERSION 5
uint8_t version; /* protocol version */
uint8_t reserved1[5]; /* for future use */
char opt[12]; /* profile name */

View File

@ -1289,35 +1289,6 @@ sock_execmsg(struct sock *f)
f->rstate = SOCK_RRET;
f->rtodo = sizeof(struct amsg);
break;
case AMSG_GETCAP:
#ifdef DEBUG
if (debug_level >= 3) {
sock_dbg(f);
dbg_puts(": GETCAP message\n");
}
#endif
if (f->pstate != SOCK_INIT) {
#ifdef DEBUG
if (debug_level >= 1) {
sock_dbg(f);
dbg_puts(": GETCAP, bad state\n");
}
#endif
aproc_del(f->pipe.file.rproc);
return 0;
}
AMSG_INIT(m);
m->cmd = AMSG_GETCAP;
m->u.cap.rate = f->dev->rate;
m->u.cap.pchan = (f->opt->mode & MODE_PLAY) ?
(f->opt->rpar.cmax - f->opt->rpar.cmin + 1) : 0;
m->u.cap.rchan = (f->opt->mode & (MODE_PLAY | MODE_REC)) ?
(f->opt->wpar.cmax - f->opt->wpar.cmin + 1) : 0;
m->u.cap.bits = ADATA_BITS;
m->u.cap.bps = sizeof(adata_t);
f->rstate = SOCK_RRET;
f->rtodo = sizeof(struct amsg);
break;
case AMSG_SETVOL:
#ifdef DEBUG
if (debug_level >= 3) {

View File

@ -320,23 +320,9 @@ sio_aucat_getpar(struct sio_hdl *sh, struct sio_par *par)
static int
sio_aucat_getcap(struct sio_hdl *sh, struct sio_cap *cap)
{
struct sio_aucat_hdl *hdl = (struct sio_aucat_hdl *)sh;
unsigned i, bps, le, sig, chan, rindex, rmult;
static unsigned rates[] = { 8000, 11025, 12000 };
AMSG_INIT(&hdl->aucat.wmsg);
hdl->aucat.wmsg.cmd = AMSG_GETCAP;
hdl->aucat.wtodo = sizeof(struct amsg);
if (!aucat_wmsg(&hdl->aucat, &hdl->sio.eof))
return 0;
hdl->aucat.rtodo = sizeof(struct amsg);
if (!aucat_rmsg(&hdl->aucat, &hdl->sio.eof))
return 0;
if (hdl->aucat.rmsg.cmd != AMSG_GETCAP) {
DPRINTF("sio_aucat_getcap: protocol err\n");
hdl->sio.eof = 1;
return 0;
}
bps = 1;
sig = le = 0;
cap->confs[0].enc = 0;