[][src]Struct os_balloon::raspicam::Camera

pub struct Camera {
    video_dir: PathBuf,
    picture_dir: PathBuf,
    process: Option<Child>,
}

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]

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]

Takes a picture with the camera.

fn generate_picture_command(file: PathBuf) -> Command[src]

Generates the picture command with the configured parameters.

Trait Implementations

impl Drop for Camera[src]

impl Debug for Camera[src]

Auto Trait Implementations

impl Send for Camera

impl Sync for Camera

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]

impl<T> DebugAny for T where
    T: Any + Debug
[src]

impl<T> UnsafeAny for T where
    T: Any
[src]