Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Pick up new cameras as they are plugged in

Aperta
#13 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
linux, rust

Direzione di ricerca

Start in main, where v4l::context::enum_devices currently scans cameras only during startup. Read the Tokio setup and the existing Device::new flow, then implement the requested background scan of /dev/v4l/by-id/ using Device::with_path. Done means newly plugged-in cameras are detected without restarting, while stable paths preserve camera settings when devices are unplugged and reconnected.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

backend

The following code is present in main:

    // available_camera_paths is only updated at initial start, however, this could be better changed to run when a camera is plugged in or removed.
    for node in v4l::context::enum_devices() {
        let mut device = Device::new(node.index())?;
        let Ok(modes) = CameraMode::fetch_all(&device) else {
            continue;
        };
        let initial_mode = *modes.first().ok_or("Error Creating a CameraThreadHandle: Failed to initialize camera as no valid Camera operating modes were provided by video4linux. (Check the camera as this was an OS-level issue!)")?;

        // If can't query or create a stream, then it can't be displayed.
        if H264CameraReader::new(&mut device, initial_mode).is_ok() {
            available_camera_paths.push(node.path().to_path_buf());
        }

This means that new video capture devices won't be detected if they're plugged in, making testing rather difficult.

We should make it such that a background thread refreshes the available cameras when a new one is plugged in. However, we're already using Tokio here, so we could use an async task instead!

Either way, the cameras should update for ease of use (and to prevent having to restart the backend at comp!)

Edit:

A quick implementation checklist:

  • Add a new background thread/task to scan /dev/v4l/by-id/ for new entries
  • Initialize devices via Device::with_path
    • Right now, we just use Device::new, which uses indices. That won't work for competition -- if cameras unplug, we'll lose the settings for that camera alongside its assigned index!!
Lingua principale
Rust
Stelle
1
Fork
3
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Sooner-Rover-Team/RoverGUI

Tutte le issue di Sooner-Rover-Team/RoverGUI

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.