Remove duplicate information from duplex callbacks

Đang mở
#1,438 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
58/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
audio-video-rtc

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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,
}
Ngôn ngữ chính
Rust
Star
4k
Fork
554
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của RustAudio/cpal

Tất cả issue của RustAudio/cpal

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.