diff options
Diffstat (limited to 'src/v4l2abst.rs')
| -rw-r--r-- | src/v4l2abst.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/v4l2abst.rs b/src/v4l2abst.rs index 03983bc..a4103fc 100644 --- a/src/v4l2abst.rs +++ b/src/v4l2abst.rs @@ -23,6 +23,18 @@ impl<'a> Frame<'a>{ dst.write_all(self.buf)?; Ok(()) } + pub fn clone_in<'b, 'c>(&'b self, buf: &'c mut Vec<u8>) + -> Frame<'c>{ + *buf = self.buf.into(); + Frame{ + format: self.format, + width: self.width, + height: self.height, + stride: self.stride, + buf, + timestamp: self.timestamp, + } + } pub fn deserialize<'b>(src: &'b mut impl Read, buf: &'a mut Vec<u8>) -> Result<Self>{ struct Rh<'c>(&'c mut dyn Read); |
