Skip to content

Commit

Permalink
fn dav1d_submit_frame: Cleanup mostly (#431)
Browse files Browse the repository at this point in the history
There's still some more things left to clean up, but they're more
cross-cutting so I'm saving them until later.
  • Loading branch information
kkysen authored Sep 8, 2023
2 parents 695f058 + a404850 commit 5ebf3e4
Show file tree
Hide file tree
Showing 4 changed files with 406 additions and 550 deletions.
13 changes: 12 additions & 1 deletion include/dav1d/common.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::ptr;

use crate::include::stddef::size_t;
use crate::include::stdint::int64_t;
use crate::include::stdint::uint8_t;
Expand All @@ -10,7 +12,16 @@ pub struct Dav1dUserData {
pub r#ref: *mut Dav1dRef,
}

#[derive(Clone)]
impl Default for Dav1dUserData {
fn default() -> Self {
Self {
data: ptr::null(),
r#ref: ptr::null_mut(),
}
}
}

#[derive(Clone, Default)]
#[repr(C)]
pub struct Dav1dDataProps {
pub timestamp: int64_t,
Expand Down
13 changes: 13 additions & 0 deletions include/dav1d/data.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::ptr;

use crate::include::dav1d::common::Dav1dDataProps;
use crate::include::stddef::size_t;
use crate::include::stdint::uint8_t;
Expand All @@ -11,3 +13,14 @@ pub struct Dav1dData {
pub r#ref: *mut Dav1dRef,
pub m: Dav1dDataProps,
}

impl Default for Dav1dData {
fn default() -> Self {
Self {
data: ptr::null(),
sz: Default::default(),
r#ref: ptr::null_mut(),
m: Default::default(),
}
}
}
Loading

0 comments on commit 5ebf3e4

Please sign in to comment.