OSDN Git Service

Addition of "infile" parameter (virtual mic) to the file plugin
authorJuan Carlos Castro y Castro <jcastro@vialink.com.br>
Fri, 19 May 2006 16:26:41 +0000 (18:26 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 19 May 2006 16:26:41 +0000 (18:26 +0200)
commit1d80c5b901baf7e1b7998dfa518532fbd64e4283
tree6d747b2210e0774aabe6d38c5842d6f77d7d71b8
parentdaed23393650bbbdc107aee2850f4b97c0f33a9f
Addition of "infile" parameter (virtual mic) to the file plugin

When this new parameter is specified, the behavior of opening a file PCM
for input is changed to the following: reads from the device, instead of
being passed down to the slave PCM, will read the raw data from the
specified file. No file writes will take place in this case. In the
absence of this parameter, previous behavior is unchanged.

The input file name and descriptor are kept in the snd_pcm_file_t struct
in a manner analogous to the already existing output file parameter.

TODO:

(1) Only interleaved reads (snd_pcm_file_readi) have been implemented
for now.

(2) File read()'s that return a number of bytes that's not a multiple of
the frame size will result in data loss (choppiness). The rbuf,
rbuf_size_bytes, and rbuf_used_bytes members of the snd_pcm_file_t
struct will be used to address this problem in the future.

(3) Mind whether the PCM was opened in blocking mode. If so, we'll have
to loop until the buffer has been filled with read()'s.

Signed-off-by: Juan Carlos Castro y Castro <jcastro@vialink.com.br>
src/pcm/pcm_file.c