mirror of
https://github.com/RGBCube/serenity
synced 2026-01-20 16:51:00 +00:00
Each client connection now sets up an ASBufferQueue, which is basically a queue of ABuffers. This allows us to immediately start streaming the next pending buffer whenever our current buffer runs out of samples. This makes the majority of the skippiness go away for me. :^) Also get rid of the old PlayBuffer API, since we don't need it anymore.
45 lines
811 B
C
45 lines
811 B
C
#pragma once
|
|
|
|
struct ASAPI_ServerMessage {
|
|
enum class Type {
|
|
Invalid,
|
|
Greeting,
|
|
PlayingBuffer,
|
|
FinishedPlayingBuffer,
|
|
EnqueueBufferResponse,
|
|
};
|
|
|
|
Type type { Type::Invalid };
|
|
unsigned extra_size { 0 };
|
|
bool success { true };
|
|
|
|
union {
|
|
struct {
|
|
int server_pid;
|
|
int your_client_id;
|
|
} greeting;
|
|
struct {
|
|
int buffer_id;
|
|
} playing_buffer;
|
|
};
|
|
};
|
|
|
|
struct ASAPI_ClientMessage {
|
|
enum class Type {
|
|
Invalid,
|
|
Greeting,
|
|
EnqueueBuffer,
|
|
};
|
|
|
|
Type type { Type::Invalid };
|
|
unsigned extra_size { 0 };
|
|
|
|
union {
|
|
struct {
|
|
int client_pid;
|
|
} greeting;
|
|
struct {
|
|
int buffer_id;
|
|
} play_buffer;
|
|
};
|
|
};
|