[−][src]Struct os_balloon::raspicam::Camera
Camera structure.
This structure controls the use of the camera.
Fields
video_dir: PathBuf
Directory to save video files.
picture_dir: PathBuf
Directory to save picture files.
process: Option<Child>
Video process handle.
Methods
impl Camera
[src]
pub fn record<T, P, FN>(&mut self, time: T, file_name: FN) -> Result<(), Error> where
T: Into<Option<Duration>>,
P: AsRef<Path>,
FN: Into<Option<P>>,
[src]
T: Into<Option<Duration>>,
P: AsRef<Path>,
FN: Into<Option<P>>,
Starts recording video with the camera.
If Some(Duration)
is passed, the camera will stop recording after that time. This should
be the default behaviour, and it will block for the given time. If no duration is given, it
will record indefinitely, and the thread won't block. To stop the camera recording anytime,
Camera::stop_recording()
can be used.
An optional second parameter can be provided to specify a file name for the video recording,
useful in case of testing. If that file name is provided, or if the method is executed
as a test, the file will be removed after the recording, except if the maintain_test_video
feature is used. If a file name is provided, a time should be provided too, and it will
throw a warning if not.
Panics if the duration is less than 1 second.
fn generate_video_command(time: Option<Duration>, file: PathBuf) -> Command
[src]
Generates the video command with the configured parameters.
pub fn stop_recording(&mut self) -> Result<(), Error>
[src]
Stops the video recording.
pub fn is_recording(&self) -> bool
[src]
Checks if the camera is recording.
fn is_really_recording() -> Result<bool, Error>
[src]
Checks if there is a raspivid
process currently recording video.
fn kill_process() -> Result<(), Error>
[src]
Forcefully kills the raspivid
process.
pub fn take_picture<P, FN>(&mut self, file_name: FN) -> Result<(), Error> where
P: AsRef<Path>,
FN: Into<Option<P>>,
[src]
P: AsRef<Path>,
FN: Into<Option<P>>,
Takes a picture with the camera.
fn generate_picture_command(file: PathBuf) -> Command
[src]
Generates the picture command with the configured parameters.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
[src]
impl<T> DebugAny for T where
T: Any + Debug,
[src]
T: Any + Debug,
impl<T> UnsafeAny for T where
T: Any,
[src]
T: Any,