added tracking message type

This commit is contained in:
Nickiel12 2024-09-09 00:31:31 +00:00
parent ffe25b54d2
commit c5050c8e99
2 changed files with 15 additions and 1 deletions

View file

@ -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<String>),
ChangeTrackingID(u16),
TrackingBoxes(Vec<NormalizedBoxCoords>),
TrackingBoxes(TrackingUpdate),
ManualMovementOverride((i32, i32)),
WebRTCPacket(RTCSessionDescription),

10
src/tracking_events.rs Normal file
View file

@ -0,0 +1,10 @@
use serde::{Serialize, Deserialize};
use crate::NormalizedBoxCoords;
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct TrackingUpdate {
target_id: Option<u16>,
boxes: Vec<NormalizedBoxCoords>
}