Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fbs RTP trace info #1183

Merged
merged 3 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion npm-scripts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ function flatcNode(clean = false)
const extension = IS_WINDOWS ? '.exe' : '';
const flatc = path.resolve(path.join(
'worker', 'out', buildType, 'build', 'subprojects', `flatbuffers-${FLATBUFFERS_VERSION}`, `flatc${extension}`));
const src = path.resolve(path.join('worker', 'fbs', '*'));
const src = path.resolve(path.join('worker', 'fbs', '*.fbs'));
const out = path.resolve(path.join('node', 'src'));
const options = '--ts-no-import-ext --gen-object-api';
const command = `${flatc} --ts ${options} -o ${out} `;
Expand Down
36 changes: 23 additions & 13 deletions rust/src/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#[cfg(test)]
mod tests;

use crate::fbs::{common, sctp_association, transport, web_rtc_transport};
use crate::fbs::{common, rtp_packet, sctp_association, transport, web_rtc_transport};
use serde::de::{MapAccess, Visitor};
use serde::ser::SerializeStruct;
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
Expand Down Expand Up @@ -1114,8 +1114,6 @@ pub enum OwnedWebRtcMessage {
EmptyBinary,
}

/**
* TODO. Implement FBS conversion.
/// RTP packet info in trace event.
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
Expand All @@ -1133,9 +1131,9 @@ pub struct RtpPacketTraceInfo {
/// Whether packet contains a key frame.
pub is_key_frame: bool,
/// Packet size.
pub size: usize,
pub size: u64,
jmillan marked this conversation as resolved.
Show resolved Hide resolved
/// Payload size.
pub payload_size: usize,
pub payload_size: u64,
/// The spatial layer index (from 0 to N).
pub spatial_layer: u8,
/// The temporal layer index (from 0 to N).
Expand All @@ -1152,15 +1150,27 @@ pub struct RtpPacketTraceInfo {
#[serde(default)]
pub is_rtx: bool,
}
*/

/// RTP packet info in trace event.
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct RtpPacketTraceInfo {
/// Whether this is an RTX packet.
#[serde(default)]
pub is_rtx: bool,
impl RtpPacketTraceInfo {
pub(crate) fn from_fbs(rtp_packet: rtp_packet::Dump, is_rtx: bool) -> Self {
Self {
payload_type: rtp_packet.payload_type,
sequence_number: rtp_packet.sequence_number,
timestamp: rtp_packet.timestamp,
marker: rtp_packet.marker,
ssrc: rtp_packet.ssrc,
is_key_frame: rtp_packet.is_key_frame,
size: rtp_packet.size,
payload_size: rtp_packet.payload_size,
spatial_layer: rtp_packet.spatial_layer,
temporal_layer: rtp_packet.temporal_layer,
mid: rtp_packet.mid,
rid: rtp_packet.rid,
rrid: rtp_packet.rrid,
wide_sequence_number: rtp_packet.wide_sequence_number,
is_rtx,
}
}
}

/// SSRC info in trace event.
Expand Down
Loading
Loading