Hi, I'm new to this library, so I apologise in advance if I'm using it wrong. Please feel free to point out any usage errors if that is the case.
I am trying to use a StatelessVideoDecoder to decode an H264 video stream. I've set this up and am repeatedly calling decode on the StatelessVideoDecoder and checking for events using next_event. On the FrameReady event, I call dyn_picture on the given DecodedHandle and then dyn_mappable_handle on the DynHandle.
Now, I can get data from the frame, but only using the read function. As far as I can tell, I can't downcast the DynHandle to an Image (although I'm not sure if that is the only implementation of the DynHandle trait), meaning I cannot get a direct [u8] reference to the buffer with the decoded frame.
As my application is performance-sensitive, I am trying to reduce the number of copies and would like to avoid copying the buffer on my end, so the read function won't cut it. Am I using the library wrong, or is something like this not possible at the moment? I would be interested in contributing a PR if this is the case.
Hi, I'm new to this library, so I apologise in advance if I'm using it wrong. Please feel free to point out any usage errors if that is the case.
I am trying to use a
StatelessVideoDecoder
to decode an H264 video stream. I've set this up and am repeatedly callingdecode
on theStatelessVideoDecoder
and checking for events usingnext_event
. On theFrameReady
event, I calldyn_picture
on the givenDecodedHandle
and thendyn_mappable_handle
on theDynHandle
.Now, I can get data from the frame, but only using the
read
function. As far as I can tell, I can't downcast theDynHandle
to anImage
(although I'm not sure if that is the only implementation of theDynHandle
trait), meaning I cannot get a direct[u8]
reference to the buffer with the decoded frame.As my application is performance-sensitive, I am trying to reduce the number of copies and would like to avoid copying the buffer on my end, so the
read
function won't cut it. Am I using the library wrong, or is something like this not possible at the moment? I would be interested in contributing a PR if this is the case.