-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
604d470
commit edd44f6
Showing
1 changed file
with
3 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,19 @@ | ||
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(); | ||
pub fn new(packet: &rtcp::goodbye::Goodbye) -> Self { | ||
let reason = std::str::from_utf8(&packet.reason[..]).unwrap().to_string(); | ||
|
||
Self { | ||
sources: goodbye.sources.clone(), | ||
sources: packet.sources.clone(), | ||
reason, | ||
timestamp: packet.timestamp, | ||
} | ||
} | ||
} |