YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.sendspin.session.PlayerMessages Class Reference

The player role seen from the client (this app as a player that servers play to): what it says (client/hello with the player@v1 support object, client/state with the player object) and what it reads of a server (server/command for the player, stream/start, stream/clear, the binary audio chunk). More...

Collaboration diagram for de.yaacc.sendspin.session.PlayerMessages:
Collaboration graph

Classes

class  AudioChunk
 The audio chunk (the body after the message id): timestamp, send-ahead and the audio.
 
class  Command
 A command for the player of server/command.
 
class  Offer
 One audio format the player offers: the codec (pcm or flac), the rate, the channels and the bit depth.
 
class  StreamStart
 The format of a stream to the player of stream/start.
 

Static Public Member Functions

static String clientHello (String name, String productName, boolean unpairedAccess, List< Offer > formats, long bufferCapacity, List< String > roles)
 
static String clientHello (String name, String productName, boolean unpairedAccess, List< Offer > formats, long bufferCapacity, List< String > roles, de.yaacc.sendspin.pairing.CodePairingClient.Offer codes)
 As above; codes adds the code-based pairing methods the client offers (the formats of the dynamic flow, the static flow): the descriptors of supported_pair_methods (spec, "client/hello pair-method descriptor").
 
static String clientState (boolean available, int volume, boolean muted, int outputDelayMs, int requiredLeadTimeMs, int minBufferMs, List< String > commands)
 client/state with the player object.
 
static String clientStateUnavailable ()
 
static Command parseCommand (JSONObject p) throws ProtocolException
 
static StreamStart parseStreamStart (JSONObject p) throws ProtocolException
 
static boolean clearsPlayer (JSONObject p) throws ProtocolException
 True if a stream/clear or stream/end concerns the player: it names the player role or no role at all.
 
static Long clearFrom (JSONObject p) throws ProtocolException
 The from_timestamp of a stream/clear (everything from that time on), null for everything buffered.
 
static AudioChunk parseAudioChunk (byte[] body)
 

Detailed Description

The player role seen from the client (this app as a player that servers play to): what it says (client/hello with the player@v1 support object, client/state with the player object) and what it reads of a server (server/command for the player, stream/start, stream/clear, the binary audio chunk).

Everything read from the network is bounded and checked. Pure.

Member Function Documentation

◆ clientHello() [1/2]

static String de.yaacc.sendspin.session.PlayerMessages.clientHello ( String name,
String productName,
boolean unpairedAccess,
List< Offer > formats,
long bufferCapacity,
List< String > roles )
static
Parameters
formatsPCM formats as {sample rate, channels, bit depth}, in the order of preference
bufferCapacitythe bytes the player can hold (buffer_capacity)
rolesthe roles it offers, for example player@v1

The commands the player takes are not in the hello: the current wire schema puts them in the client/state player object (the reference library rejects other values at the hello level; found against it, 2026-11-25).

Referenced by de.yaacc.sendspin.session.PlayerMessages.clientHello().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clientHello() [2/2]

static String de.yaacc.sendspin.session.PlayerMessages.clientHello ( String name,
String productName,
boolean unpairedAccess,
List< Offer > formats,
long bufferCapacity,
List< String > roles,
de.yaacc.sendspin.pairing.CodePairingClient.Offer codes )
static

As above; codes adds the code-based pairing methods the client offers (the formats of the dynamic flow, the static flow): the descriptors of supported_pair_methods (spec, "client/hello pair-method descriptor").

Null: the Pairing PSK only.

Here is the call graph for this function:

◆ clientState()

static String de.yaacc.sendspin.session.PlayerMessages.clientState ( boolean available,
int volume,
boolean muted,
int outputDelayMs,
int requiredLeadTimeMs,
int minBufferMs,
List< String > commands )
static

client/state with the player object.

Parameters
requiredLeadTimeMshow far ahead of the play time a chunk has to arrive at least
minBufferMsthe audio the player wants to hold at least

◆ parseAudioChunk()

static AudioChunk de.yaacc.sendspin.session.PlayerMessages.parseAudioChunk ( byte[] body)
static
Returns
the chunk, or null if the body is too short to hold the two numbers

◆ parseCommand()

static Command de.yaacc.sendspin.session.PlayerMessages.parseCommand ( JSONObject p) throws ProtocolException
static
Returns
the command for the player, or null if the message is for no player role; a malformed one is a protocol error

◆ parseStreamStart()

static StreamStart de.yaacc.sendspin.session.PlayerMessages.parseStreamStart ( JSONObject p) throws ProtocolException
static
Returns
the format, or null if the start is for no player role

The documentation for this class was generated from the following file: