virtio-snd channels are not tubes

The virtio-snd spec uses 'channel' in both descriptions an struct
definitions, we should keep that naming.

Change-Id: I90f4640e4d5f64fc452a2812d69821ca86505bc1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2802974
Tested-by: Jorge Moreira Broche <jemoreira@google.com>
Auto-Submit: Jorge Moreira Broche <jemoreira@google.com>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Commit-Queue: Jorge Moreira Broche <jemoreira@google.com>
This commit is contained in:
Jorge E. Moreira 2021-04-02 12:55:13 -07:00 committed by Commit Bot
parent c30b36e35c
commit 5018cef82d
3 changed files with 10 additions and 10 deletions

View file

@ -39,8 +39,8 @@ pub struct virtio_snd_pcm_info {
pub formats: Le64,
pub rates: Le64,
pub direction: u8,
pub tubes_min: u8,
pub tubes_max: u8,
pub channels_min: u8,
pub channels_max: u8,
pub padding: [u8; 5],
}
@ -63,7 +63,7 @@ pub struct virtio_snd_pcm_set_params {
pub buffer_bytes: Le32,
pub period_bytes: Le32,
pub features: Le32,
pub tubes: u8,
pub channels: u8,
pub format: u8,
pub rate: u8,
pub padding: u8,

View file

@ -116,7 +116,7 @@ impl ShmStreamSource for VioSShmStreamSource {
buffer_bytes: 2 * period_bytes,
period_bytes,
features: 0u32,
tubes: num_channels as u8,
channels: num_channels as u8,
format: from_sample_format(format),
rate: virtio_frame_rate(frame_rate)?,
};

View file

@ -617,8 +617,8 @@ pub struct VioSStreamInfo {
pub formats: u64,
pub rates: u64,
pub direction: u8,
pub tubes_min: u8,
pub tubes_max: u8,
pub channels_min: u8,
pub channels_max: u8,
state: StreamState,
}
@ -631,8 +631,8 @@ impl VioSStreamInfo {
formats: info.formats.to_native(),
rates: info.rates.to_native(),
direction: info.direction,
tubes_min: info.tubes_min,
tubes_max: info.tubes_max,
channels_min: info.channels_min,
channels_max: info.channels_max,
state: StreamState::Available,
}
}
@ -650,7 +650,7 @@ pub struct VioSStreamParams {
pub buffer_bytes: u32,
pub period_bytes: u32,
pub features: u32,
pub tubes: u8,
pub channels: u8,
pub format: u8,
pub rate: u8,
}
@ -667,7 +667,7 @@ impl Into<virtio_snd_pcm_set_params> for (u32, VioSStreamParams) {
buffer_bytes: self.1.buffer_bytes.into(),
period_bytes: self.1.period_bytes.into(),
features: self.1.features.into(),
tubes: self.1.tubes,
channels: self.1.channels,
format: self.1.format,
rate: self.1.rate,
padding: 0u8,