Re: [RFC 01/xx] ALSA: add snd_stream_is_playback/capture() macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Amadeusz, Pierre-Louis, Takashi

Thank you for your helps

> That said, as of now, I'm not much convinced to go further.
> OTOH, I'm not strongly against taking this kind of change -- if other
> people do find it absolutely better, I'm ready to be convinced :)
(snip)
> > The main issue I have with this patch is the continued confusion in
> > variable naming between 'stream' and 'direction'. It's problematic on
> > multiple platforms where a stream is typically identified by a DMA
> > channel or ID of some sort. There's also the SoundWire 'stream' which
> > has nothing to do with PCM devices. In the end people end-up drowning in
> > too many 'streams', no one knows if the code refers to the data flow or
> > the data direction.
(snip)
> Oh yes, so I'm not the only one :D, I also would very much prefer if 
> there was 'direction' instead of 'stream'.

For now, unfortunately, using _Generic() makes code more complex, because
many drivers are using own direction variables (with unsigned, const, short,
bitfield, etc), and _Generic() need to know it.

Not _Generic() code is not convenience, but not so bad (?).
If so, can below acceptable ?

	snd_pcm_direction_is_playback(const int direction);
	snd_pcm_direction_is_capture(const int direction);

	snd_pcm_substream_is_playback(const struct snd_pcm_substream *);
	snd_pcm_substream_is_capture(const struct snd_pcm_substream *);



... BTW, I noticed some drivers are using below, is there any difference ??

	substream->pstr->stream
	substream->stream


Thank you for your help !!

Best regards
---
Kuninori Morimoto



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux