diff --git a/jarust_plugins/src/video_room/events.rs b/jarust_plugins/src/video_room/events.rs index 4e7bfc9..8580016 100644 --- a/jarust_plugins/src/video_room/events.rs +++ b/jarust_plugins/src/video_room/events.rs @@ -1,6 +1,6 @@ use jarust::error::JaError; +use jarust::prelude::JaResponse; use jarust_transport::japrotocol::GenericEvent; -use jarust_transport::japrotocol::JaResponse; #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] pub enum PluginEvent { diff --git a/jarust_plugins/src/video_room/handle.rs b/jarust_plugins/src/video_room/handle.rs index 4b54c1b..434d0f4 100644 --- a/jarust_plugins/src/video_room/handle.rs +++ b/jarust_plugins/src/video_room/handle.rs @@ -1,11 +1,14 @@ +use std::ops::Deref; +use std::time::Duration; + +use serde_json::json; + +use jarust::prelude::*; +use jarust_rt::JaTask; + use crate::video_room::msg_options::*; use crate::video_room::responses::*; use crate::Identifier; -use jarust::prelude::*; -use jarust_rt::JaTask; -use serde_json::json; -use std::ops::Deref; -use std::time::Duration; pub struct VideoRoomHandle { handle: JaHandle, diff --git a/jarust_plugins/src/video_room/jahandle_ext.rs b/jarust_plugins/src/video_room/jahandle_ext.rs index f2ea4bf..6ee128c 100644 --- a/jarust_plugins/src/video_room/jahandle_ext.rs +++ b/jarust_plugins/src/video_room/jahandle_ext.rs @@ -1,11 +1,15 @@ -use super::events::PluginEvent; -use super::handle::VideoRoomHandle; -use crate::AttachPluginParams; -use jarust::japlugin::AttachHandleParams; -use jarust::prelude::*; use std::ops::Deref; + +use jarust::japlugin::AttachHandleParams; use tokio::sync::mpsc; +use jarust::prelude::*; + +use crate::AttachPluginParams; + +use super::events::PluginEvent; +use super::handle::VideoRoomHandle; + #[async_trait::async_trait] pub trait VideoRoom: Attach { type Event: TryFrom + Send + Sync + 'static; diff --git a/jarust_plugins/src/video_room/msg_options.rs b/jarust_plugins/src/video_room/msg_options.rs index 21fb4c5..3894cac 100644 --- a/jarust_plugins/src/video_room/msg_options.rs +++ b/jarust_plugins/src/video_room/msg_options.rs @@ -1,6 +1,7 @@ -use crate::Identifier; use serde::Serialize; +use crate::Identifier; + // // Create Message // @@ -533,3 +534,19 @@ pub struct VideoRoomConfigureSubscriberStream { #[serde(skip_serializing_if = "Option::is_none")] pub max_delay: Option, } + +// +// Switch Message +// + +#[derive(Serialize)] +pub struct VideoRoomSwitchStream { + /// unique ID of the publisher the new source is from + pub feed: Identifier, + + /// unique mid of the source we want to switch to + pub mid: u64, + + /// unique mid of the stream we want to pipe the new source to + pub sub_mid: u64, +} diff --git a/jarust_plugins/src/video_room/responses.rs b/jarust_plugins/src/video_room/responses.rs index 66e3bb8..24b8c82 100644 --- a/jarust_plugins/src/video_room/responses.rs +++ b/jarust_plugins/src/video_room/responses.rs @@ -1,6 +1,7 @@ -use crate::Identifier; use serde::Deserialize; +use crate::Identifier; + #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Deserialize)] pub struct Room { /// unique numeric ID