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

The artwork role of a client (spec, "Artwork messages"): the images that arrive as an announce and parts in binary messages of the types 8 to 11 (channels 0 to 3), one transfer in flight at a time for all channels. More...

Collaboration diagram for de.yaacc.sendspin.client.ArtworkStream:
Collaboration graph

Public Member Functions

void start (List< ArtworkChannel > configuration)
 A stream/start with an artwork object: the stream is active with this configuration.
 
void end ()
 A stream/end for the artwork role: the channels show no artwork and nothing is pending.
 
boolean isActive ()
 
long version ()
 Increases whenever the image of a channel changes, so that a display redraws only then.
 
void onMessage (int type, byte[] body, long serverNowMicros) throws ProtocolException
 One binary artwork message.
 
byte[] current (int channel, long serverNowMicros)
 The image the channel shows at this time (a pending one whose time has come is applied first), or null for none.
 
byte[] pending (int channel)
 The complete image that waits for its time (a coming-up display), or null.
 

Static Public Attributes

static final int MAX_IMAGE_BYTES = 2 * 1024 * 1024
 The largest encoded image the client keeps: a 600 by 600 JPEG is far below it.
 
static final int MAX_MESSAGE_BYTES = 65519
 The largest artwork message including its type byte (spec): it fits one transport message.
 
static final int MAX_CHANNELS = 4
 The channels of the role (binary message types 8 to 11).
 
static final int FIRST_TYPE = 8
 The first binary message type of the role.
 

Detailed Description

The artwork role of a client (spec, "Artwork messages"): the images that arrive as an announce and parts in binary messages of the types 8 to 11 (channels 0 to 3), one transfer in flight at a time for all channels.

Per channel the client keeps the current image and at most one pending image, which becomes current once it is complete and its timestamp (server clock) is reached; an announce discards the pending image of its channel, a cancel too. An image above MAX_IMAGE_BYTES is discarded but its parts are still counted. Malformed messages and sequences are ProtocolExceptions (the client closes). The server is untrusted: the memory of an image is bounded by the limit. Pure; used from one thread or locked by the caller.

Member Function Documentation

◆ onMessage()

void de.yaacc.sendspin.client.ArtworkStream.onMessage ( int type,
byte[] body,
long serverNowMicros ) throws ProtocolException

One binary artwork message.

Parameters
typethe message type, 8 to 11
bodythe bytes after the type byte: the flags and what follows
serverNowMicrosthe server clock now

Referenced by de.yaacc.sendspin.client.DisplayRoles.onArtworkMessage().

Here is the caller graph for this function:

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