From c5050c8e99f8ba119bd3903a6e2601fc4af6e9a5 Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Mon, 9 Sep 2024 00:31:31 +0000 Subject: [PATCH] added tracking message type --- src/lib.rs | 6 +++++- src/tracking_events.rs | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/tracking_events.rs diff --git a/src/lib.rs b/src/lib.rs index 760260a..e58c8e2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,10 +15,14 @@ use webrtc::peer_connection::sdp::session_description::RTCSessionDescription; use webrtc::ice_transport::ice_candidate::{RTCIceCandidate, RTCIceCandidateInit}; mod boxes; +mod tracking_events; + use boxes::NormalizedBoxCoords; +use tracking_events::TrackingUpdate; pub mod types { pub use crate::boxes::NormalizedBoxCoords; + pub use crate::tracking_events::TrackingUpdate; } static MAX_MESSAGE: usize = 50; @@ -32,7 +36,7 @@ pub enum ApplicationMessage { NameRequest(Option), ChangeTrackingID(u16), - TrackingBoxes(Vec), + TrackingBoxes(TrackingUpdate), ManualMovementOverride((i32, i32)), WebRTCPacket(RTCSessionDescription), diff --git a/src/tracking_events.rs b/src/tracking_events.rs new file mode 100644 index 0000000..cb70f07 --- /dev/null +++ b/src/tracking_events.rs @@ -0,0 +1,10 @@ +use serde::{Serialize, Deserialize}; + +use crate::NormalizedBoxCoords; + + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct TrackingUpdate { + target_id: Option, + boxes: Vec +}