static int snd_pcm_oss_make_ready(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime;
int err;
if (substream == NULL)
return 0;
runtime = substream->runtime;
// 在snd_pcm_oss_open
// ==> snd_pcm_oss_open_file
// ==> snd_pcm_oss_init_substream
// ==> runtime->oss.params = 1;
if (runtime->oss.params) {
err = snd_pcm_oss_change_params(substream);
《浅析alsa声卡驱动snd_pcm_oss_change_params函数》// snd_pcm_oss_change_params中会设置runtime->oss.prepare = 1;
if (err < 0)
return err;
}
if (runtime->oss.prepare) {
err = snd_pcm_oss_prepare(substream); // 调用snd_pcm_kernel_ioctl发送SNDRV_PCM_IOCTL_PREPARE
《浅析alsa声卡驱动snd_pcm_kernel_ioctl函数》 if (err < 0) // 准备就绪,音频数据从现在开始可以操作了[luther.gliethttp]
return err;
}
return 0;
}
阅读(1076) | 评论(0) | 转发(0) |