Deleted Added
full compact
vchan.c (107237) vchan.c (109623)
1/*
2 * Copyright (c) 2001 Cameron Grant <gandalf@vilnya.demon.co.uk>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <dev/sound/pcm/sound.h>
28#include <dev/sound/pcm/vchan.h>
29#include "feeder_if.h"
30
1/*
2 * Copyright (c) 2001 Cameron Grant <gandalf@vilnya.demon.co.uk>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <dev/sound/pcm/sound.h>
28#include <dev/sound/pcm/vchan.h>
29#include "feeder_if.h"
30
31SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pcm/vchan.c 107237 2002-11-25 17:17:43Z cg $");
31SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pcm/vchan.c 109623 2003-01-21 08:56:16Z alfred $");
32
33struct vchinfo {
34 u_int32_t spd, fmt, blksz, bps, run;
35 struct pcm_channel *channel, *parent;
36 struct pcmchan_caps caps;
37};
38
39static u_int32_t vchan_fmt[] = {

--- 79 unchanged lines hidden (view full) ---

119
120static void *
121vchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
122{
123 struct vchinfo *ch;
124 struct pcm_channel *parent = devinfo;
125
126 KASSERT(dir == PCMDIR_PLAY, ("vchan_init: bad direction"));
32
33struct vchinfo {
34 u_int32_t spd, fmt, blksz, bps, run;
35 struct pcm_channel *channel, *parent;
36 struct pcmchan_caps caps;
37};
38
39static u_int32_t vchan_fmt[] = {

--- 79 unchanged lines hidden (view full) ---

119
120static void *
121vchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir)
122{
123 struct vchinfo *ch;
124 struct pcm_channel *parent = devinfo;
125
126 KASSERT(dir == PCMDIR_PLAY, ("vchan_init: bad direction"));
127 ch = malloc(sizeof(*ch), M_DEVBUF, M_WAITOK | M_ZERO);
127 ch = malloc(sizeof(*ch), M_DEVBUF, M_ZERO);
128 ch->parent = parent;
129 ch->channel = c;
130 ch->fmt = AFMT_U8;
131 ch->spd = DSP_DEFAULT_SPEED;
132 ch->blksz = 2048;
133
134 c->flags |= CHN_F_VIRTUAL;
135

--- 96 unchanged lines hidden (view full) ---

232int
233vchan_create(struct pcm_channel *parent)
234{
235 struct snddev_info *d = parent->parentsnddev;
236 struct pcmchan_children *pce;
237 struct pcm_channel *child;
238 int err, first;
239
128 ch->parent = parent;
129 ch->channel = c;
130 ch->fmt = AFMT_U8;
131 ch->spd = DSP_DEFAULT_SPEED;
132 ch->blksz = 2048;
133
134 c->flags |= CHN_F_VIRTUAL;
135

--- 96 unchanged lines hidden (view full) ---

232int
233vchan_create(struct pcm_channel *parent)
234{
235 struct snddev_info *d = parent->parentsnddev;
236 struct pcmchan_children *pce;
237 struct pcm_channel *child;
238 int err, first;
239
240 pce = malloc(sizeof(*pce), M_DEVBUF, M_WAITOK | M_ZERO);
240 pce = malloc(sizeof(*pce), M_DEVBUF, M_ZERO);
241 if (!pce) {
242 return ENOMEM;
243 }
244
245 /* create a new playback channel */
246 child = pcm_chn_create(d, parent, &vchan_class, PCMDIR_VIRTUAL, parent);
247 if (!child) {
248 free(pce, M_DEVBUF);

--- 96 unchanged lines hidden ---
241 if (!pce) {
242 return ENOMEM;
243 }
244
245 /* create a new playback channel */
246 child = pcm_chn_create(d, parent, &vchan_class, PCMDIR_VIRTUAL, parent);
247 if (!child) {
248 free(pce, M_DEVBUF);

--- 96 unchanged lines hidden ---