FreeBSD kernel sound device code
feeder.c File Reference
#include <dev/sound/pcm/sound.h>
#include "feeder_if.h"
Include dependency graph for feeder.c:

Go to the source code of this file.

Data Structures

struct  feedertab_entry
 

Macros

#define MAXFEEDERS   256
 
#define score_signeq(s1, s2)   (((s1) & 0x1) == ((s2) & 0x1))
 
#define score_endianeq(s1, s2)   (((s1) & 0x2) == ((s2) & 0x2))
 
#define score_cheq(s1, s2)   (((s1) & 0xfc) == ((s2) & 0xfc))
 
#define score_chgt(s1, s2)   (((s1) & 0xfc) > ((s2) & 0xfc))
 
#define score_chlt(s1, s2)   (((s1) & 0xfc) < ((s2) & 0xfc))
 
#define score_val(s1)   ((s1) & 0x3f00)
 
#define score_cse(s1)   ((s1) & 0x7f)
 

Functions

 SND_DECLARE_FILE ("$FreeBSD$")
 
static MALLOC_DEFINE (M_FEEDER, "feeder", "pcm feeder")
 
static SLIST_HEAD (feedertab_entry)
 
static void feeder_unregisterall (void *p)
 
static int cmpdesc (struct pcm_feederdesc *n, struct pcm_feederdesc *m)
 
static void feeder_destroy (struct pcm_feeder *f)
 
static struct pcm_feederfeeder_create (struct feeder_class *fc, struct pcm_feederdesc *desc)
 
struct feeder_classfeeder_getclass (struct pcm_feederdesc *desc)
 
int chn_addfeeder (struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederdesc *desc)
 
int chn_removefeeder (struct pcm_channel *c)
 
struct pcm_feederchn_findfeeder (struct pcm_channel *c, u_int32_t type)
 
u_int32_t snd_fmtscore (u_int32_t fmt)
 
static u_int32_t snd_fmtbestfunc (u_int32_t fmt, u_int32_t *fmts, int cheq)
 
u_int32_t snd_fmtbestbit (u_int32_t fmt, u_int32_t *fmts)
 
u_int32_t snd_fmtbestchannel (u_int32_t fmt, u_int32_t *fmts)
 
u_int32_t snd_fmtbest (u_int32_t fmt, u_int32_t *fmts)
 
void feeder_printchain (struct pcm_feeder *head)
 
static int feed_root (struct pcm_feeder *feeder, struct pcm_channel *ch, u_int8_t *buffer, u_int32_t count, void *source)
 
 SYSINIT (feeder_root, SI_SUB_DRIVERS, SI_ORDER_FIRST, feeder_register, &feeder_root_class)
 
 SYSUNINIT (feeder_root, SI_SUB_DRIVERS, SI_ORDER_FIRST, feeder_unregisterall, NULL)
 

Variables

static kobj_method_t feeder_root_methods []
 
static struct feeder_class feeder_root_class
 

Macro Definition Documentation

◆ MAXFEEDERS

#define MAXFEEDERS   256

Definition at line 42 of file feeder.c.

◆ score_cheq

#define score_cheq (   s1,
  s2 
)    (((s1) & 0xfc) == ((s2) & 0xfc))

Definition at line 313 of file feeder.c.

◆ score_chgt

#define score_chgt (   s1,
  s2 
)    (((s1) & 0xfc) > ((s2) & 0xfc))

Definition at line 314 of file feeder.c.

◆ score_chlt

#define score_chlt (   s1,
  s2 
)    (((s1) & 0xfc) < ((s2) & 0xfc))

Definition at line 315 of file feeder.c.

◆ score_cse

#define score_cse (   s1)    ((s1) & 0x7f)

Definition at line 317 of file feeder.c.

◆ score_endianeq

#define score_endianeq (   s1,
  s2 
)    (((s1) & 0x2) == ((s2) & 0x2))

Definition at line 312 of file feeder.c.

◆ score_signeq

#define score_signeq (   s1,
  s2 
)    (((s1) & 0x1) == ((s2) & 0x1))

Definition at line 311 of file feeder.c.

◆ score_val

#define score_val (   s1)    ((s1) & 0x3f00)

Definition at line 316 of file feeder.c.

Function Documentation

◆ chn_addfeeder()

int chn_addfeeder ( struct pcm_channel c,
struct feeder_class fc,
struct pcm_feederdesc desc 
)

Definition at line 238 of file feeder.c.

References c, desc, pcm_channel::feeder, feeder_create(), pcm_feeder::parent, and pcm_feeder::source.

Referenced by chn_init(), feeder_build_eq(), feeder_build_format(), feeder_build_matrix(), feeder_build_mixer(), feeder_build_rate(), feeder_build_root(), and feeder_build_volume().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ chn_findfeeder()

struct pcm_feeder * chn_findfeeder ( struct pcm_channel c,
u_int32_t  type 
)

◆ chn_removefeeder()

int chn_removefeeder ( struct pcm_channel c)

Definition at line 256 of file feeder.c.

References c, pcm_channel::feeder, feeder_destroy(), and pcm_feeder::source.

Referenced by chn_kill(), and feeder_chain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmpdesc()

static int cmpdesc ( struct pcm_feederdesc n,
struct pcm_feederdesc m 
)
static

Definition at line 171 of file feeder.c.

References m, n, and pcmchan_matrix::type.

Referenced by feeder_getclass().

Here is the caller graph for this function:

◆ feed_root()

static int feed_root ( struct pcm_feeder feeder,
struct pcm_channel ch,
u_int8_t *  buffer,
u_int32_t  count,
void *  source 
)
static

◆ feeder_create()

static struct pcm_feeder * feeder_create ( struct feeder_class fc,
struct pcm_feederdesc desc 
)
static

◆ feeder_destroy()

static void feeder_destroy ( struct pcm_feeder f)
static

Definition at line 180 of file feeder.c.

Referenced by chn_removefeeder(), and feeder_create().

Here is the caller graph for this function:

◆ feeder_getclass()

struct feeder_class * feeder_getclass ( struct pcm_feederdesc desc)

Definition at line 224 of file feeder.c.

References cmpdesc(), and desc.

Referenced by chn_init(), feeder_build_eq(), feeder_build_format(), feeder_build_matrix(), feeder_build_mixer(), feeder_build_rate(), feeder_build_root(), and feeder_build_volume().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ feeder_printchain()

void feeder_printchain ( struct pcm_feeder head)

Definition at line 442 of file feeder.c.

References pcm_feeder::class, pcm_feeder::desc, pcm_feederdesc::idx, and pcm_feeder::source.

◆ feeder_unregisterall()

static void feeder_unregisterall ( void *  p)
static

Definition at line 158 of file feeder.c.

References free, and next.

◆ MALLOC_DEFINE()

static MALLOC_DEFINE ( M_FEEDER  ,
"feeder"  ,
"pcm feeder  
)
static

◆ SLIST_HEAD()

◆ SND_DECLARE_FILE()

SND_DECLARE_FILE ( "$FreeBSD$"  )

◆ snd_fmtbest()

u_int32_t snd_fmtbest ( u_int32_t  fmt,
u_int32_t *  fmts 
)

Definition at line 408 of file feeder.c.

References AFMT_CHANNEL, fmt, fmts, score_val, snd_fmtbestbit(), snd_fmtbestchannel(), snd_fmtscore(), and snd_fmtvalid().

Referenced by chn_notify(), and feeder_chain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ snd_fmtbestbit()

u_int32_t snd_fmtbestbit ( u_int32_t  fmt,
u_int32_t *  fmts 
)

Definition at line 396 of file feeder.c.

References fmt, fmts, and snd_fmtbestfunc().

Referenced by snd_fmtbest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ snd_fmtbestchannel()

u_int32_t snd_fmtbestchannel ( u_int32_t  fmt,
u_int32_t *  fmts 
)

Definition at line 402 of file feeder.c.

References fmt, fmts, and snd_fmtbestfunc().

Referenced by snd_fmtbest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ snd_fmtbestfunc()

static u_int32_t snd_fmtbestfunc ( u_int32_t  fmt,
u_int32_t *  fmts,
int  cheq 
)
static

Definition at line 351 of file feeder.c.

References fmt, fmts, score_cheq, score_chgt, score_chlt, score_cse, score_endianeq, score_signeq, score_val, snd_fmtscore(), and snd_fmtvalid().

Referenced by snd_fmtbestbit(), and snd_fmtbestchannel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ snd_fmtscore()

u_int32_t snd_fmtscore ( u_int32_t  fmt)

Definition at line 320 of file feeder.c.

References AFMT_16BIT, AFMT_24BIT, AFMT_32BIT, AFMT_8BIT, AFMT_BIGENDIAN, AFMT_CHANNEL, AFMT_SIGNED, and fmt.

Referenced by snd_fmtbest(), and snd_fmtbestfunc().

Here is the caller graph for this function:

◆ SYSINIT()

SYSINIT ( feeder_root  ,
SI_SUB_DRIVERS  ,
SI_ORDER_FIRST  ,
feeder_register  ,
feeder_root_class 
)

◆ SYSUNINIT()

SYSUNINIT ( feeder_root  ,
SI_SUB_DRIVERS  ,
SI_ORDER_FIRST  ,
feeder_unregisterall  ,
NULL   
)

Variable Documentation

◆ feeder_root_class

struct feeder_class feeder_root_class
static
Initial value:
= {
.name = "feeder_root",
.methods = feeder_root_methods,
.size = sizeof(struct pcm_feeder),
.desc = NULL,
.data = NULL,
}
char * desc
Definition: atiixp.c:174
static kobj_method_t feeder_root_methods[]
Definition: feeder.c:510

Definition at line 514 of file feeder.c.

◆ feeder_root_methods

kobj_method_t feeder_root_methods[]
static
Initial value:
= {
KOBJMETHOD(feeder_feed, feed_root),
}
static int feed_root(struct pcm_feeder *feeder, struct pcm_channel *ch, u_int8_t *buffer, u_int32_t count, void *source)
Definition: feeder.c:458
#define KOBJMETHOD_END
Definition: midi.c:76

Definition at line 510 of file feeder.c.