Skip to content

Commit

Permalink
Merge pull request #5 from Storykit/chore/expose_stream_dims
Browse files Browse the repository at this point in the history
chore: expose width/height of a stream
  • Loading branch information
tistatos authored Oct 28, 2024
2 parents 7a19f92 + 1223085 commit eb7ec2c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/codec/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ impl Parameters {
pub fn id(&self) -> Id {
unsafe { Id::from((*self.as_ptr()).codec_id) }
}

pub fn width(&self) -> Option<i32> {
(self.medium() == media::Type::Video).then(|| unsafe { (*self.as_ptr()).width })
}

pub fn height(&self) -> Option<i32> {
(self.medium() == media::Type::Video).then(|| unsafe { (*self.as_ptr()).height })
}
}

impl Default for Parameters {
Expand Down

0 comments on commit eb7ec2c

Please sign in to comment.