*参照元 [#xf67cb9a]
#backlinks

*説明 [#b17863b5]
-パス: [[linux-2.6.33/sound/core/pcm_lib.c]]

-FIXME: これは何?
--説明
--インターリーブ型読み込みに対応している場合、この読み込み関数が呼ばれる。
--インターリーブ: 各チャネルの LPCM データが交互に配置 LRLRLRLR... される形式のこと。


**引数 [#ce9d9985]
-struct snd_pcm_substream *substream
--
--[[linux-2.6.33/snd_pcm_substream]]
-unsigned int hwoff
--
-unsigned long data
--
-unsigned int off
--
-snd_pcm_uframes_t frames
--
--[[linux-2.6.33/snd_pcm_uframes_t]]


**返り値 [#o2dbdb59]
-int
--


**参考 [#v74c84bf]


*実装 [#d4afc1cb]
 static int snd_pcm_lib_read_transfer(struct snd_pcm_substream *substream, 
 				     unsigned int hwoff,
 				     unsigned long data, unsigned int off,
 				     snd_pcm_uframes_t frames)
 {
 	struct snd_pcm_runtime *runtime = substream->runtime;
 	int err;
 	char __user *buf = (char __user *) data + frames_to_bytes(runtime, off);
-
--[[linux-2.6.33/snd_pcm_runtime]]
-
--[[linux-2.6.33/frames_to_bytes()]]

 	if (substream->ops->copy) {
 		if ((err = substream->ops->copy(substream, -1, hwoff, buf, frames)) < 0)
 			return err;
-
--substream->ops は snd_pcm_ops 型のメンバ
--[[linux-2.6.33/snd_pcm_ops]]

 	} else {
 		char *hwbuf = runtime->dma_area + frames_to_bytes(runtime, hwoff);
 		if (copy_to_user(buf, hwbuf, frames_to_bytes(runtime, frames)))
 			return -EFAULT;
-
--[[linux-2.6.33/copy_to_user()]]

 	}
 	return 0;
 }

*コメント [#j4997be9]


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS