Skip to content

Support opening a pipeline via frame callback#17

Draft
w-utter wants to merge 1 commit into
Tangram-Vision:mainfrom
w-utter:main
Draft

Support opening a pipeline via frame callback#17
w-utter wants to merge 1 commit into
Tangram-Vision:mainfrom
w-utter:main

Conversation

@w-utter

@w-utter w-utter commented Apr 19, 2024

Copy link
Copy Markdown

This would add the ability to open a pipeline by providing a callback by using the rs2_pipeline_start_with_callback sys fn. Its usage would look something along the lines of

use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;

let context = Context::new().unwrap();
let pipeline = InactivePipeline::try_from(&context).unwrap();

let frame_count = Arc::new(AtomicUsize::new(0));

let stream_handle = pipeline.start_streaming(move |frame| {
    let frame_count = frame_count.clone();
    frame_count.fetch_add(1, Ordering::Relaxed);
    let _frame = frame.of_type::<CompositeFrame>().unwrap();
})

@w-utter w-utter marked this pull request as draft April 20, 2024 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant