Use Gstreamer Buffer map in StreamCapture #216
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After discussion: https://discourse.gstreamer.org/t/zero-copy-video-frames/3856/2
This pull request includes several changes to improve the functionality and reliability of the stream capture pipeline in the
kornia-io
crate. The most significant changes involve updating dependencies, introducing a newFrameBuffer
struct, and modifying theStreamCapture
implementation to use this new struct. Additionally, there are minor changes to example files to ensure proper mutability of capture objects.Updates and Dependency Changes:
gst
andgst-app
dependencies to version0.23.4
inCargo.toml
.Stream Capture Improvements:
FrameBuffer
struct to store the frame buffer, width, and height.StreamCapture
struct to include alast_frame
field, which is anArc<Mutex<Option<FrameBuffer>>>
.StreamCapture::new
method to set callbacks onappsink
for capturing new samples and storing them inlast_frame
.StreamCapture::grab
method to retrieve the last frame fromlast_frame
and convert it to anImage
.extract_frame_buffer
method to extract aFrameBuffer
from theAppSink
.Error Handling:
LockError
variant to theStreamCaptureError
enum to handle errors when locking thelast_frame
mutex.Example Code Adjustments:
let mut
instead oflet
. [1] [2] [3] [4] [5]