Skip to content

Commit

Permalink
chore: revert video plugin changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghamza-Jd committed Aug 27, 2024
1 parent bc2165d commit 4a760b5
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 13 deletions.
2 changes: 1 addition & 1 deletion jarust_plugins/src/video_room/events.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
13 changes: 8 additions & 5 deletions jarust_plugins/src/video_room/handle.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
14 changes: 9 additions & 5 deletions jarust_plugins/src/video_room/jahandle_ext.rs
Original file line number Diff line number Diff line change
@@ -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<JaResponse, Error = JaError> + Send + Sync + 'static;
Expand Down
19 changes: 18 additions & 1 deletion jarust_plugins/src/video_room/msg_options.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::Identifier;
use serde::Serialize;

use crate::Identifier;

//
// Create Message
//
Expand Down Expand Up @@ -533,3 +534,19 @@ pub struct VideoRoomConfigureSubscriberStream {
#[serde(skip_serializing_if = "Option::is_none")]
pub max_delay: Option<u64>,
}

//
// 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,
}
3 changes: 2 additions & 1 deletion jarust_plugins/src/video_room/responses.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 4a760b5

Please sign in to comment.