devices/virtio/snd/
null_backend.rs

1// Copyright 2022 The ChromiumOS Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use audio_streams::NoopStreamSourceGenerator;
6
7use crate::virtio::snd::common_backend::SndData;
8use crate::virtio::snd::sys::SysAudioStreamSourceGenerator;
9
10pub(crate) fn create_null_stream_source_generators(
11    snd_data: &SndData,
12) -> Vec<SysAudioStreamSourceGenerator> {
13    let mut generators: Vec<SysAudioStreamSourceGenerator> = Vec::new();
14    generators.resize_with(snd_data.pcm_info_len(), || {
15        Box::new(NoopStreamSourceGenerator::new())
16    });
17    generators
18}