Skip to content

Commit

Permalink
Revert deleting goodbye
Browse files Browse the repository at this point in the history
  • Loading branch information
damian-tworek committed Nov 24, 2023
1 parent 3167dc7 commit 604d470
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
1 change: 1 addition & 0 deletions common/src/rtcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub use sender_report::SenderReport;
use serde::{Deserialize, Serialize};
pub use source_description::SourceDescription;

pub mod goodbye;
pub mod receiver_report;
pub mod reception_report;
pub mod sender_report;
Expand Down
25 changes: 25 additions & 0 deletions common/src/rtcp/goodbye.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use std::time::Duration;

use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct Goodbye {
pub sources: Vec<u32>,
pub reason: String,
pub timestamp: Duration,
}

#[cfg(not(target_arch = "wasm32"))]
impl Goodbye {
pub fn new(goodbye: &rtcp::goodbye::Goodbye, packet: &Packet) -> Self {
let reason = std::str::from_utf8(&goodbye.reason[..])
.unwrap()
.to_string();

Self {
sources: goodbye.sources.clone(),
reason,
timestamp: packet.timestamp,
}
}
}
17 changes: 0 additions & 17 deletions common/src/rtcp/payload_specific_feedback.rs

This file was deleted.

0 comments on commit 604d470

Please sign in to comment.