|
| | VideoCaptureMatSource (VideoCaptureFrameGrabber grabber, IFrameOrientationCorrector orientationCorrector=null) |
| | Initializes a new instance of the VideoCaptureMatSource class.
|
| |
| Task | InitializeAsync (VideoCaptureOpenOptions options, CancellationToken cancellationToken=default) |
| | Initializes the source using one-shot video capture open options projected onto RequestedVideoFilePath, Loop, and ApiPreference.
|
| |
| Task | InitializeAsync (VideoFileOpenOptions options, CancellationToken cancellationToken=default) |
| | Initializes the source using one-shot video file open options projected onto RequestedVideoFilePath and Loop.
|
| |
| override async Task | PauseAsync (CancellationToken cancellationToken=default) |
| | Pauses frame acquisition asynchronously. When already paused, completes immediately without error. When MatSourceState.Initializing, completes immediately without changing state.- Parameters
-
| cancellationToken | A token used to cancel the operation. |
- Returns
- A task that completes when playback has been paused.
When State is MatSourceState.Initializing, completes immediately without changing state and logs a one-time warning per process.
|
| |
| override async Task | PlayAsync (CancellationToken cancellationToken=default) |
| | Starts or resumes frame acquisition asynchronously. When already playing, completes immediately without error. When MatSourceState.Initializing, completes immediately without changing state.- Parameters
-
| cancellationToken | A token used to cancel the operation. |
- Returns
- A task that completes when playback has started.
When State is MatSourceState.Initializing, completes immediately without changing state and logs a one-time warning per process.
|
| |
| override async Task | StopAsync (CancellationToken cancellationToken=default) |
| | Stops frame acquisition asynchronously. When already in the ready (not playing) state, completes immediately without error. When MatSourceState.Initializing, completes immediately without changing state.- Parameters
-
| cancellationToken | A token used to cancel the operation. |
- Returns
- A task that completes when playback has stopped.
When State is MatSourceState.Initializing, completes immediately without changing state and logs a one-time warning per process.
|
| |
| override void | Tick (float deltaTime) |
| | Advances frame acquisition when the source is playing. Sets IMatSource.DidUpdateThisFrame only when a new frame is acquired.- Parameters
-
| deltaTime | Elapsed time since the previous tick, in seconds. |
Sets DidUpdateThisFrame only when IFrameGrabber.TryGrab returns a new frame. When IFrameGrabber.TryGrab returns false, this tick is a no-op (not an error). Does not call IFrameOrientationCorrector.NotifyDisplayOrientationChanged; the host is responsible for that. Registered DerivedFrames are still evaluated when IFrameGrabber.TryGrab does not succeed so per-tick derived-frame flags such as IDerivedFrame.DidUpdateThisFrame stay in sync. Sources without a native frame rate (for example still images) may throttle Tick in a derived type that implements IMatUpdateFPSControllable.
|
| |
| | MatSourceBase (IFrameGrabber grabber, IFrameOrientationCorrector orientationCorrector=null) |
| | Initializes a new instance of the MatSourceBase class.
|
| |
| PlaybackRestoreMode | CapturePlaybackRestoreMode () |
| | Captures the current playback state as a PlaybackRestoreMode for re-initialization.- Returns
- PlaybackRestoreMode.Playing when playing, PlaybackRestoreMode.Paused when paused, otherwise PlaybackRestoreMode.Ready.
|
| |
| void | Dispose () |
| |
| async ValueTask | DisposeAsync () |
| | Asynchronously releases resources. Required on single-threaded hosts (for example browser/WebAssembly targets); do not use Dispose on those hosts.
|
| |
| Task | InitializeAsync (CancellationToken cancellationToken=default) |
| | Initializes the source asynchronously and leaves playback in MatSourceState.Ready.- Parameters
-
| cancellationToken | A token used to cancel the operation. |
- Returns
- A task that completes when initialization finishes.
|
| |
| Task | InitializeAsync (PlaybackRestoreMode playbackRestoreMode, CancellationToken cancellationToken=default) |
| | Initializes the source asynchronously and restores the requested playback state before IMatSourceEvents.OnInitialized is raised.- Parameters
-
| playbackRestoreMode | Playback state to apply after the grabber is ready. |
| cancellationToken | A token used to cancel the operation. |
- Returns
- A task that completes when initialization finishes.
|
| |
| Task | ReinitializeAsync (PlaybackRestoreMode playbackRestoreMode, CancellationToken cancellationToken=default) |
| | Releases the source when initialized, then initializes again with the requested playback restore mode.- Parameters
-
| playbackRestoreMode | Playback state to apply after the grabber is ready. |
| cancellationToken | A token used to cancel the operation. |
- Returns
- A task that completes when re-initialization finishes.
|
| |
| Task | ReleaseAsync (CancellationToken cancellationToken=default) |
| |
| void | SyncDerivedFrameBuffersIfStale (IList< string > pendingLayoutChanges=null) |
| | Re-applies derived frame outputs whose buffers are stale relative to the current source layout or derived settings.
|
| |
| bool | TryGetMeta (string key, out object value) |
| | Attempts to get a meta property value by key.- Parameters
-
| key | The meta key. |
| value | When this method returns true, the retrieved value; otherwise the default value. |
- Returns
true when the key is supported and a value is available; otherwise false.
|
| |
| bool | TrySetMeta (string key, object value) |
| | Attempts to set a meta property value by key.- Parameters
-
| key | The meta key. |
| value | The value to set. |
- Returns
true when the key is supported and the value was applied; otherwise false.
|
| |
|
| int | ApiPreference [get] |
| | Gets the OpenCV Videoio API preference used when opening the capture. Set only via Options.VideoCaptureOpenOptions during initialization.
|
| |
| float | FPS [get] |
| | Gets the current playback frame rate in frames per second.
|
| |
| int | FrameCount [get] |
| | Gets the total frame count of the video.
|
| |
| int | FrameIndex [get, set] |
| | Gets or sets the current frame index.
|
| |
| float | FramePosRatio [get, set] |
| | Gets or sets the current frame position as a ratio from 0.0 to 1.0.
|
| |
| bool | Loop [get, set] |
| | Gets or sets whether the video loops after reaching the end.
|
| |
| string | RequestedVideoFilePath = string.Empty [get, set] |
| | Gets or sets the requested video file path.
|
| |
| SourceToMatColorFormat | BaseColorFormat [get] |
| | Gets the native color format produced by the underlying grabber before output conversion.
|
| |
| DerivedFrameCollection | DerivedFrames [get] |
| | Gets the optional derived frame collection. When empty, tick processing matches the source layer only.
|
| |
| bool | DidUpdateThisFrame [get] |
| |
| bool | FlipHorizontal [get, set] |
| | Gets or sets whether to flip the image horizontally.
|
| |
| bool | FlipVertical [get, set] |
| | Gets or sets whether to flip the image vertically.
|
| |
| Mat | FrameMat [get] |
| |
| int | Height [get] |
| | Gets the current frame height in pixels.
|
| |
| int | InitTimeoutMs [get, set] |
| | Gets or sets the initialization wait timeout in milliseconds.
|
| |
| bool | IsInitialized [get] |
| | Gets a value indicating whether the source has been initialized and is ready for playback control. Does not include MatSourceState.Initializing.
|
| |
| bool | IsInitializing [get] |
| | Gets a value indicating whether initialization is in progress (MatSourceState.Initializing).
|
| |
| bool | IsPaused [get] |
| | Gets a value indicating whether frame acquisition is paused.
|
| |
| bool | IsPlaying [get] |
| | Gets a value indicating whether frame acquisition is active.
|
| |
| Task | LifecycleTask [get] |
| | Gets a task that completes when the current lifecycle operation finishes. Queued operations run sequentially; this reflects the tail of that chain.
|
| |
| SourceToMatColorFormat | OutputColorFormat [get, set] |
| | Gets or sets the output color format. When changed after initialization, the output FrameMat channel layout (Mat type) may change and implementations that raise IMatSourceEvents.OnFrameMatLayoutChanged do so after the new layout is committed.
|
| |
| bool | Rotate90Degree [get, set] |
| | Gets or sets whether to rotate the image 90 degrees clockwise. When changed after initialization, the output IMatSource.FrameMat layout (width, height) changes and implementations that raise IMatSourceEvents.OnFrameMatLayoutChanged do so after the new layout is committed.
|
| |
| MatSourceState | State [get] |
| | Gets the current lifecycle state.
|
| |
| int | Width [get] |
| | Gets the current frame width in pixels.
|
| |
|
| Action< string > | OnDerivedFrameLayoutChanged |
| |
| Action | OnDisposed |
| |
| Action< SourceToMatErrorCode, string > | OnErrorOccurred |
| |
| Action | OnFrameMatLayoutChanged |
| |
| Action | OnFrameMatUpdated |
| |
| Action | OnInitialized |
| |
| Action | OnReleased |
| |
| Action< string > | OnDerivedFrameLayoutChanged |
| | Occurs after initialization when a derived frame output layout (columns, rows, type) changes without removing the derived frame, on the thread that commits the layout change. Not raised on the first derived layout establishment during IMatSource.InitializeAsync. At invocation, the derived frame's FrameMat matches the committed output layout. Layout-affecting settings updates may commit immediately without waiting for the next IMatSourceTickable.Tick.
|
| |
| Action | OnDisposed |
| | Occurs when IDisposable.Dispose or IAsyncDisposable.DisposeAsync completes and the source enters MatSourceState.Destroyed.
|
| |
| Action< SourceToMatErrorCode, string > | OnErrorOccurred |
| | Occurs for expected runtime failures with a SourceToMatErrorCode and message, on the thread that detected the failure.
|
| |
| Action | OnFrameMatLayoutChanged |
| | Occurs after initialization when the output IMatSource.FrameMat layout (cols, rows, type) changes without a full release cycle, on the thread that commits the layout change. Not raised on the first layout establishment during IMatSource.InitializeAsync. When derived frames are registered, their output buffers are synced to the new primary layout before this event is raised.
|
| |
| Action | OnFrameMatUpdated |
| | Occurs at the end of IMatSourceTickable.Tick when IMatSource.DidUpdateThisFrame is true for that tick, after any registered derived frames are evaluated.
|
| |
| Action | OnInitialized |
| | Occurs when an initialization cycle completes and playback state (Ready / Playing / Paused) is determined, on the thread that completes the underlying async operation.
|
| |
| Action | OnReleased |
| | Occurs when IMatSource.ReleaseAsync completes and the source returns to MatSourceState.Uninitialized, on the thread that completes the underlying async operation.
|
| |
OpenCV VideoCapture-backed MatSourceBase that implements IVideoCaptureMatSource.
ConfigureAwait(false) is used only after MatSourceBase.PlayAsync, MatSourceBase.PauseAsync, and MatSourceBase.StopAsync complete (post-restore playback-state chain). It is not used before grabber open/close on initialization paths.
| override void OpenCVForUnity.Extensions.SourceToMat.VideoCaptureMatSource.Tick |
( |
float | deltaTime | ) |
|
|
virtual |