pub struct FfprobeCommandMediaStreamClassifier { /* private fields */ }Expand description
Media stream classifier backed by the ffprobe command.
Implementations§
Source§impl FfprobeCommandMediaStreamClassifier
impl FfprobeCommandMediaStreamClassifier
Sourcepub const VIDEO_STREAM: &'static str = "video"
pub const VIDEO_STREAM: &'static str = "video"
FFprobe stream name for video streams.
Sourcepub const AUDIO_STREAM: &'static str = "audio"
pub const AUDIO_STREAM: &'static str = "audio"
FFprobe stream name for audio streams.
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a FFprobe-backed classifier.
§Returns
A classifier using the current process working directory.
Sourcepub fn command_runner(&self) -> &CommandRunner
pub fn command_runner(&self) -> &CommandRunner
Gets the command runner used by this classifier.
§Returns
Runner used for ffprobe command executions.
Sourcepub fn set_command_runner(&mut self, command_runner: CommandRunner)
pub fn set_command_runner(&mut self, command_runner: CommandRunner)
Replaces the command runner used by this classifier.
§Parameters
command_runner: New runner configuration.
Sourcepub fn with_command_runner(self, command_runner: CommandRunner) -> Self
pub fn with_command_runner(self, command_runner: CommandRunner) -> Self
Sourcepub fn set_working_directory(&mut self, working_directory: Option<String>)
pub fn set_working_directory(&mut self, working_directory: Option<String>)
Sets the working directory used to execute FFprobe.
§Parameters
working_directory: Optional working directory path.
Sourcepub fn working_directory(&self) -> Option<&str>
pub fn working_directory(&self) -> Option<&str>
Sourcepub fn classify_stream_listing(output: &str) -> MediaStreamType
pub fn classify_stream_listing(output: &str) -> MediaStreamType
Sourcepub fn is_available() -> bool
pub fn is_available() -> bool
Checks whether the ffprobe command is available.
Availability is checked by executing ffprobe -version with the default
quiet command runner. The result only describes whether the command can
be started successfully; a particular media file may still be unreadable
or unsupported.
§Returns
true when ffprobe -version executes successfully.
Trait Implementations§
Source§impl Clone for FfprobeCommandMediaStreamClassifier
impl Clone for FfprobeCommandMediaStreamClassifier
Source§fn clone(&self) -> FfprobeCommandMediaStreamClassifier
fn clone(&self) -> FfprobeCommandMediaStreamClassifier
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl FileBasedMediaStreamClassifier for FfprobeCommandMediaStreamClassifier
impl FileBasedMediaStreamClassifier for FfprobeCommandMediaStreamClassifier
Source§fn classify_by_local_file(&self, file: &Path) -> MimeResult<MediaStreamType>
fn classify_by_local_file(&self, file: &Path) -> MimeResult<MediaStreamType>
Classifies a readable local media file using FFprobe.
Auto Trait Implementations§
impl Freeze for FfprobeCommandMediaStreamClassifier
impl RefUnwindSafe for FfprobeCommandMediaStreamClassifier
impl Send for FfprobeCommandMediaStreamClassifier
impl Sync for FfprobeCommandMediaStreamClassifier
impl Unpin for FfprobeCommandMediaStreamClassifier
impl UnsafeUnpin for FfprobeCommandMediaStreamClassifier
impl UnwindSafe for FfprobeCommandMediaStreamClassifier
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, D> IntoConfigDefault<T> for Dwhere
D: IntoValueDefault<T>,
impl<T, D> IntoConfigDefault<T> for Dwhere
D: IntoValueDefault<T>,
Source§fn into_config_default(self) -> T
fn into_config_default(self) -> T
T.Source§impl<T> IntoValueDefault<T> for T
impl<T> IntoValueDefault<T> for T
Source§fn into_value_default(self) -> T
fn into_value_default(self) -> T
Source§impl<T> MediaStreamClassifier for Twhere
T: MediaStreamClassifierBackend,
impl<T> MediaStreamClassifier for Twhere
T: MediaStreamClassifierBackend,
Source§fn classify_file(&self, file: &Path) -> Result<MediaStreamType, MimeError>
fn classify_file(&self, file: &Path) -> Result<MediaStreamType, MimeError>
Validates the local file and delegates to the backend hook.
Source§fn classify_reader(
&self,
reader: &mut dyn Read,
) -> Result<MediaStreamType, MimeError>
fn classify_reader( &self, reader: &mut dyn Read, ) -> Result<MediaStreamType, MimeError>
Delegates stream classification to the backend hook.
Source§fn classify_content(&self, content: &[u8]) -> MimeResult<MediaStreamType>
fn classify_content(&self, content: &[u8]) -> MimeResult<MediaStreamType>
Source§impl<T> MediaStreamClassifierBackend for Twhere
T: FileBasedMediaStreamClassifier,
impl<T> MediaStreamClassifierBackend for Twhere
T: FileBasedMediaStreamClassifier,
Source§fn classify_by_local_file(
&self,
file: &Path,
) -> Result<MediaStreamType, MimeError>
fn classify_by_local_file( &self, file: &Path, ) -> Result<MediaStreamType, MimeError>
Delegates local-file classification to the file-based hook.
Source§fn classify_by_content(
&self,
reader: &mut dyn Read,
) -> Result<MediaStreamType, MimeError>
fn classify_by_content( &self, reader: &mut dyn Read, ) -> Result<MediaStreamType, MimeError>
Stages stream content to a temporary local file before classification.