/
githubmirror
/
servo
Обзор
Документация
Войти
/
githubmirror
/
servo
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
components/media/streams/lib.rs
36 строк
1 KB
Martin Robinson
deps: Merge the servo/media repository (#42369)
06 фев 2026, 20:00
Не верифицирован
06 фев 2026, 20:00
eeb31a3
Код
Авторство
О чём код?
/* 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/. */ pub mod capture; pub mod device_monitor; pub mod registry; use std::any::Any; pub use registry::*; pub trait MediaStream: Any + Send { fn as_any(&self) -> &dyn Any; fn as_mut_any(&mut self) -> &mut dyn Any; fn set_id(&mut self, id: registry::MediaStreamId); fn ty(&self) -> MediaStreamType; } /// A MediaSocket is a way for a backend to represent a /// yet-to-be-connected source side of a MediaStream pub trait MediaSocket: Any + Send { fn as_any(&self) -> &dyn Any; } /// This isn't part of the webrtc spec; it's a leaky abstaction while media streams /// are under development and example consumers need to be able to inspect them. pub trait MediaOutput: Send { fn add_stream(&mut self, stream: ®istry::MediaStreamId); } #[derive(Clone, Copy, Debug, PartialEq)] pub enum MediaStreamType { Video, Audio, }