Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

General purpose camera pipeline in checkbox_support (New) #1741

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

tomli380576
Copy link
Contributor

@tomli380576 tomli380576 commented Feb 20, 2025

Description

(This PR is the 1st part of the previously implemented automatic gstreamer pipeline that was too big)

This PR adds a general purpose pipeline runner run_pipeline in checkbox_support and an example driver code take_photo that takes a photo using this runner

Resolved issues

#1676 <-- was too big for review

Documentation

I drafted a short design doc to explain some of the weirdness/quirks in the code that might not be fully explained by the comments. Hopefully this helps with the review :)

Tests

Unit tests. Also tested on real devices with USB cameras using the following driver code

if __name__ == "__main__":
    Gst.init([])
    # replace the element with what's available on your system
    elem = Gst.parse_launch("pipewiresrc target-object=47")
    assert type(elem) is Gst.Element
    take_photo(elem, file_path=Path("/tmp/photo.jpg"), delay_seconds=3)

Intel MIPI are expected to fail for now since they are only accessible with v4l2src, which isn't exposed in DeviceMonitor.

This also plays well with checkbox timeout:

# normal termination
timeout(10)(take_photo)(elem, file_path=Path("/tmp/photo.jpg"), delay_seconds=3)
# force stop
timeout(3)(take_photo)(elem, file_path=Path("/tmp/photo.jpg"), delay_seconds=10)

@tomli380576 tomli380576 marked this pull request as draft February 20, 2025 06:21
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant