pub trait InputPlugin:
Send
+ Sync
+ Sized {
type InputHandle: Any + Send + Sync;
Show 16 methods
// Required methods
fn new(info: AviUtl2Info) -> AnyResult<Self>;
fn plugin_info(&self) -> InputPluginTable;
fn open(&self, file: PathBuf) -> AnyResult<Self::InputHandle>;
fn close(&self, handle: Self::InputHandle) -> AnyResult<()>;
fn get_input_info(
&self,
handle: &mut Self::InputHandle,
video_track: u32,
audio_track: u32,
) -> AnyResult<InputInfo>;
// Provided methods
fn get_track_count(
&self,
handle: &mut Self::InputHandle,
) -> AnyResult<(u32, u32)> { ... }
fn read_video(
&self,
handle: &Self::InputHandle,
frame: u32,
returner: &mut ImageReturner,
) -> AnyResult<()> { ... }
fn read_video_mut(
&self,
handle: &mut Self::InputHandle,
frame: u32,
returner: &mut ImageReturner,
) -> AnyResult<()> { ... }
fn can_set_video_track(
&self,
_handle: &mut Self::InputHandle,
track: u32,
) -> AnyResult<u32> { ... }
fn time_to_frame(
&self,
handle: &mut Self::InputHandle,
track: u32,
time: f64,
) -> AnyResult<u32> { ... }
fn read_audio(
&self,
handle: &Self::InputHandle,
start: i32,
length: i32,
returner: &mut AudioReturner,
) -> AnyResult<()> { ... }
fn read_audio_mut(
&self,
handle: &mut Self::InputHandle,
start: i32,
length: i32,
returner: &mut AudioReturner,
) -> AnyResult<()> { ... }
fn can_set_audio_track(
&self,
_handle: &mut Self::InputHandle,
track: u32,
) -> AnyResult<u32> { ... }
fn config(&self, _hwnd: Win32WindowHandle) -> AnyResult<()> { ... }
fn with_instance<R>(f: impl FnOnce(&Self) -> R) -> R
where Self: InputSingleton { ... }
fn with_instance_mut<R>(f: impl FnOnce(&mut Self) -> R) -> R
where Self: InputSingleton { ... }
}input only.Expand description
入力プラグインのトレイト。
このトレイトを実装し、crate::register_input_plugin! マクロを使用してプラグインを登録します。
Required Associated Types§
Sourcetype InputHandle: Any + Send + Sync
type InputHandle: Any + Send + Sync
入力ハンドルの型。
Required Methods§
Sourcefn new(info: AviUtl2Info) -> AnyResult<Self>
fn new(info: AviUtl2Info) -> AnyResult<Self>
プラグインを初期化する。
Sourcefn plugin_info(&self) -> InputPluginTable
fn plugin_info(&self) -> InputPluginTable
プラグインの情報を返す。
Sourcefn open(&self, file: PathBuf) -> AnyResult<Self::InputHandle>
fn open(&self, file: PathBuf) -> AnyResult<Self::InputHandle>
入力を開く。
Sourcefn close(&self, handle: Self::InputHandle) -> AnyResult<()>
fn close(&self, handle: Self::InputHandle) -> AnyResult<()>
入力を閉じる。
Sourcefn get_input_info(
&self,
handle: &mut Self::InputHandle,
video_track: u32,
audio_track: u32,
) -> AnyResult<InputInfo>
fn get_input_info( &self, handle: &mut Self::InputHandle, video_track: u32, audio_track: u32, ) -> AnyResult<InputInfo>
入力の情報を取得する。
Provided Methods§
Sourcefn get_track_count(
&self,
handle: &mut Self::InputHandle,
) -> AnyResult<(u32, u32)>
fn get_track_count( &self, handle: &mut Self::InputHandle, ) -> AnyResult<(u32, u32)>
動画・音声のトラック数を取得する。
Sourcefn read_video(
&self,
handle: &Self::InputHandle,
frame: u32,
returner: &mut ImageReturner,
) -> AnyResult<()>
fn read_video( &self, handle: &Self::InputHandle, frame: u32, returner: &mut ImageReturner, ) -> AnyResult<()>
動画・画像を読み込む。
InputPluginTable::concurrent が true の場合に呼ばれます。
false の場合は Self::read_video_mut が呼ばれます。
Sourcefn read_video_mut(
&self,
handle: &mut Self::InputHandle,
frame: u32,
returner: &mut ImageReturner,
) -> AnyResult<()>
fn read_video_mut( &self, handle: &mut Self::InputHandle, frame: u32, returner: &mut ImageReturner, ) -> AnyResult<()>
動画・画像を読み込む。
InputPluginTable::concurrent が false の場合に呼ばれます。
true の場合は Self::read_video が呼ばれます。
Sourcefn can_set_video_track(
&self,
_handle: &mut Self::InputHandle,
track: u32,
) -> AnyResult<u32>
fn can_set_video_track( &self, _handle: &mut Self::InputHandle, track: u32, ) -> AnyResult<u32>
動画のトラックが利用可能かどうかを確認する。
§Returns
トラック番号を返します。基本的には track をそのまま返します。
これがErrを返した場合、トラックの変更が失敗したものとして扱われます。
Sourcefn time_to_frame(
&self,
handle: &mut Self::InputHandle,
track: u32,
time: f64,
) -> AnyResult<u32>
fn time_to_frame( &self, handle: &mut Self::InputHandle, track: u32, time: f64, ) -> AnyResult<u32>
現在の時刻からフレーム数を取得する。
VideoInputInfo::manual_frame_index が true の場合に使用されます。
Sourcefn read_audio(
&self,
handle: &Self::InputHandle,
start: i32,
length: i32,
returner: &mut AudioReturner,
) -> AnyResult<()>
fn read_audio( &self, handle: &Self::InputHandle, start: i32, length: i32, returner: &mut AudioReturner, ) -> AnyResult<()>
音声を読み込む。
InputPluginTable::concurrent が true の場合に呼ばれます。
false の場合は Self::read_audio_mut が呼ばれます。
Sourcefn read_audio_mut(
&self,
handle: &mut Self::InputHandle,
start: i32,
length: i32,
returner: &mut AudioReturner,
) -> AnyResult<()>
fn read_audio_mut( &self, handle: &mut Self::InputHandle, start: i32, length: i32, returner: &mut AudioReturner, ) -> AnyResult<()>
音声を読み込む。
InputPluginTable::concurrent が false の場合に呼ばれます。
true の場合は Self::read_audio が呼ばれます。
Sourcefn can_set_audio_track(
&self,
_handle: &mut Self::InputHandle,
track: u32,
) -> AnyResult<u32>
fn can_set_audio_track( &self, _handle: &mut Self::InputHandle, track: u32, ) -> AnyResult<u32>
音声のトラックが利用可能かどうかを確認する。
§Returns
トラック番号を返します。基本的には track をそのまま返します。
これがErrを返した場合、トラックの変更が失敗したものとして扱われます。
Sourcefn config(&self, _hwnd: Win32WindowHandle) -> AnyResult<()>
fn config(&self, _hwnd: Win32WindowHandle) -> AnyResult<()>
設定ダイアログを表示する。
Sourcefn with_instance<R>(f: impl FnOnce(&Self) -> R) -> Rwhere
Self: InputSingleton,
fn with_instance<R>(f: impl FnOnce(&Self) -> R) -> Rwhere
Self: InputSingleton,
Sourcefn with_instance_mut<R>(f: impl FnOnce(&mut Self) -> R) -> Rwhere
Self: InputSingleton,
fn with_instance_mut<R>(f: impl FnOnce(&mut Self) -> R) -> Rwhere
Self: InputSingleton,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.