Remove duplicate information from duplex callbacks

Abierto
#1,438 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
58/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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,
}
Lenguaje dominante
Rust
Estrellas
4k
Forks
554
Merge medio
1 d 3 h
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de RustAudio/cpal

Todos los issues de RustAudio/cpal

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.