/
githubmirror
/
servo
Обзор
Документация
Войти
/
githubmirror
/
servo
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
components/media/audio/destination_node.rs
44 строки
1 KB
Martin Robinson
audio: Rename `node.rs` to `audio_node.rs` (#46913)
31 июл 2026, 17:25
Не верифицирован
31 июл 2026, 17:25
40044ec
Код
Авторство
О чём код?
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use crate::audio_node::{AudioNodeEngine, AudioNodeType, BlockInfo, ChannelCountMode, ChannelInfo}; use crate::block::Chunk; #[derive(AudioNodeCommon)] pub(crate) struct DestinationNode { channel_info: ChannelInfo, chunk: Option<Chunk>, } impl DestinationNode { pub fn new(channel_count: u8) -> Self { DestinationNode { channel_info: ChannelInfo { mode: ChannelCountMode::Explicit, count: channel_count, ..Default::default() }, chunk: None, } } } impl AudioNodeEngine for DestinationNode { fn node_type(&self) -> AudioNodeType { AudioNodeType::DestinationNode } fn process(&mut self, inputs: Chunk, _: &BlockInfo) -> Chunk { self.chunk = Some(inputs); Chunk::default() } fn destination_data(&mut self) -> Option<Chunk> { self.chunk.take() } fn output_count(&self) -> u32 { 0 } }