/// Begin a stream, use the callback to save the frames
///
/// This function is non-blocking
Begin a stream, use the callback to save the frames
This function is non-blocking
Begin a stream use the callback to save the frames This function is non - blocking
pub fn start_stream<F, U>(&'a mut self, cb: F, user_data: U) -> Result<ActiveStream<'a, U>>
    where
        F: 'static + Send + Sync + Fn(&Frame, &mut U),
        U: 'static + Send + Sync,
    {
        let tuple = Box::new(Vtable::<U> {
            func: Box::new(cb),
            data: user_data,
        });
        let tuple = Box::into_raw(tuple);
        unsafe {
            let err = uvc_start_streaming(
                self.devh.devh.as_ptr(),
                &mut self.handle,
                Some(trampoline::<F, U>),
                tuple as *mut c_void,
                0,
            )
            .into();
            if err == Error::Success {
                Ok(ActiveStream {
                    devh: self.devh,
                    vtable: tuple,
                })
            } else {
                Err(err)
            }
        }
    }
pub fn start_stream < F , U > ( & ' a mut self , cb : F , user_data : U ) -> Result < ActiveStream < ' a , U > > where F : ' static + Send + Sync + Fn ( & Frame , & mut U ) , U : ' static + Send + Sync , { let tuple = Box :: new ( Vtable :: < U > { func : Box :: new ( cb ) , data : user_data , } ) ; let tuple = Box :: into_raw ( tuple ) ; unsafe { let err = uvc_start_streaming ( self . devh . devh . as_ptr ( ) , & mut self . handle , Some ( trampoline :: < F , U > ) , tuple as * mut c_void , 0 , ) . into ( ) ; if err == Error :: Success { Ok ( ActiveStream { devh : self . devh , vtable : tuple , } ) } else { Err ( err ) } } }
Begin a stream, use the callback to save the frames
This function is non-blocking
Begin a stream use the callback to save the frames This function is non - blocking
&'a mut self
cb
F
user_data
U