Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
wkazmierczak committed Dec 18, 2024
1 parent 6d42fb3 commit 07f3bfb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion compositor_pipeline/src/pipeline/input/whip/depayloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use webrtc::rtp_transceiver::rtp_codec::RTPCodecType;

use crate::pipeline::{
decoder,
types::{AudioCodec, EncodedChunk, EncodedChunkKind, VideoCodec},
types::{AudioCodec, EncodedChunk, EncodedChunkKind, IsKeyframe, VideoCodec},
VideoDecoder,
};

Expand Down Expand Up @@ -122,6 +122,7 @@ impl VideoDepayloader {
data: mem::take(buffer).concat().into(),
pts: Duration::from_secs_f64(timestamp as f64 / 90000.0),
dts: None,
is_keyframe: IsKeyframe::Unknown,
kind,
};

Expand All @@ -139,6 +140,12 @@ pub enum AudioDepayloader {
},
}

impl Default for AudioDepayloader {
fn default() -> Self {
Self::new()
}
}

impl AudioDepayloader {
pub fn new() -> Self {
AudioDepayloader::Opus {
Expand Down Expand Up @@ -167,6 +174,7 @@ impl AudioDepayloader {
data: opus_packet,
pts: Duration::from_secs_f64(timestamp as f64 / 48000.0),
dts: None,
is_keyframe: IsKeyframe::NoKeyframes,
kind,
}])
}
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/examples/whip_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ fn client_code() -> Result<()> {
"initial": {
"root": {
"type": "view",
"background_color_rgba": "#4d4d4dff",
"background_color": "#4d4d4dff",
"children": [
{
"type": "rescaler",
Expand Down

0 comments on commit 07f3bfb

Please sign in to comment.