ladybird/Servers/AudioServer/AudioServer.ipc
Andreas Kling f93c0dc489 LibIPC: Get client/server PIDs using getsockopt(SO_PEERCRED)
Instead of passing the PIDs back and forth in a handshake "Greet"
message, just use getsockopt(SO_PEERCRED) on both sides to get the same
information from the kernel.

This is a nice little simplification of the IPC protocol, although it
does not get rid of the handshake since we still have to pass the
"client ID" from the server to each client so they know how to refer
to themselves. This might not be necessary and we might be able to get
rid of this later on.
2019-12-06 18:39:59 +01:00

22 lines
576 B
Plaintext

endpoint AudioServer = 85
{
// Basic protocol
Greet() => (i32 client_id)
// Mixer functions
SetMuted(bool muted) => ()
GetMuted() => (bool muted)
GetMainMixVolume() => (i32 volume)
SetMainMixVolume(i32 volume) => ()
// Buffer playback
EnqueueBuffer(i32 buffer_id, int sample_count) => (bool success)
SetPaused(bool paused) => ()
ClearBuffer(bool paused) => ()
//Buffer information
GetRemainingSamples() => (int remaining_samples)
GetPlayedSamples() => (int played_samples)
GetPlayingBuffer() => (i32 buffer_id)
}