Remove duplicate information from duplex callbacks

Aperta
#1,438 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
58/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start by locating DuplexCallbackInfo, CallbackInfo, and StreamTimestamp::callback, then trace the duplex callback data flow and their dependencies on #1437. Confirm that the refactor leaves one callback timestamp, one xrun, and one shared data length, potentially using a separate duplex data struct with distinct input and output pointers. No specific files or tests are named in the issue.

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

Descrizione

API design
  1. DuplexCallbackInfo is composed of 2 CallbackInfos, which means it contains 2 distinct StreamTimestamp::callback values. But duplex streams use a single shared data callback, so there is only 1 callback timestamp to record. This doesn't apply to the device timestamp, as the output one is merely a prediction based on latency (which I think should be exposed separately, but that's another topic).
  2. Having 2 distinct xrun values is pointless, as a disjoint xrun would be, well, disjoint, but the whole point of duplex streams is making this impossible.
  3. Duplex callbacks take 2 distinct Data parameters, each with its own len. These being distinct from one another would again defeat the essence of a duplex stream, so there should only be 1 len.

If we follow through with #1437, then we could simply remove DuplexCallbackInfo and use the regular CallbackInfo in its place. As for the 3rd point, I suggest adding a struct like this:

struct DuplexData {
	input: *const (),
    output: *mut (),
    len: usize,
    input_format: SampleFormat,
    output_format: SampleFormat,
}
Lingua principale
Rust
Stelle
4k
Fork
554
Merge medio
1g 3h
PR unite (30g)
1

Preparare l'ambiente

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 RustAudio/cpal

Tutte le issue di RustAudio/cpal

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.