#[non_exhaustive]pub enum GpuVideoFrame {
}Implementations§
Source§impl GpuVideoFrame
impl GpuVideoFrame
pub fn backend(&self) -> GpuBackend
pub fn dimensions(&self) -> (u32, u32)
pub fn pts(&self) -> Option<i64>
Sourcepub fn estimated_rgba_bytes(&self) -> u64
pub fn estimated_rgba_bytes(&self) -> u64
Examples found in repository?
examples/decode_file.rs (line 119)
102fn receive_frame(
103 decoder: &mut VideoDecoder,
104 mode: DecodeMode,
105 receive: ReceiveMode,
106 cuda: Option<&mut CudaRgbaState>,
107) -> lumen_ffmpeg::Result<Option<usize>> {
108 match receive {
109 ReceiveMode::Rgba => Ok(decoder.receive_rgba_frame()?.map(|frame| frame.data.len())),
110 ReceiveMode::CudaRgba => match decoder.receive_gpu_frame()? {
111 Some(frame) => {
112 let Some(cuda) = cuda else {
113 return Err(lumen_ffmpeg::FfmpegError::new(
114 "decode_file",
115 "cuda-rgba receive mode requires a CUDA conversion state",
116 ));
117 };
118 cuda.convert(&frame)?;
119 Ok(Some(frame.estimated_rgba_bytes() as usize))
120 }
121 None => Ok(None),
122 },
123 ReceiveMode::Gpu => match mode {
124 DecodeMode::Cpu => Ok(decoder.receive_cpu_frame()?.map(|frame| frame.data.len())),
125 DecodeMode::Gpu(_) => Ok(decoder.receive_gpu_frame()?.map(|_| 0)),
126 },
127 }
128}Trait Implementations§
Auto Trait Implementations§
impl Freeze for GpuVideoFrame
impl RefUnwindSafe for GpuVideoFrame
impl Send for GpuVideoFrame
impl Sync for GpuVideoFrame
impl Unpin for GpuVideoFrame
impl UnsafeUnpin for GpuVideoFrame
impl UnwindSafe for GpuVideoFrame
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more