Closed lattice0 closed 2 years ago
Size of AVFrame.data[0] is not well-defined by FFmpeg. Due to this limitation, there is no way to exposed the data safely(as slice).
Can I do versions for &self?
&AVFrame
derefs to &ffi::AVFrame
, which means you can immutably access all fields of &ffi::AVFrame
, including the data
and line_size
by frame.data
and frame.line_size
.
Ref: https://docs.rs/rsmpeg/0.8.0/rsmpeg/ffi/struct.AVFrame.html#structfield.data Example: https://github.com/larksuite/rsmpeg/blob/6ed7c7e71bbe92771d219e5f198d45988266e2ed/tests/tutorial01.rs#L26
Feel free to reopen this issue if it doesn't work. :-)
at https://github.com/larksuite/rsmpeg/blob/master/src/avutil/frame.rs#L76, these two
are mutable. Can I do versions for
&self
? Also, why it returns&mut [*mut u8; 8]
and not&mut [&mut[u8]]
? I have to rely on usafe outside of the library to dostd::slice::from_raw_parts
(is it even safe?)