Hellos,
Some changes (if you haven't followed the P/S users/developers threads
recently) have occurred to Javaclient2's way of dealing with data:
a) non-threaded mode
In a non-threaded mode (default, or when the client sets the
<PlayerClient>.setNotThreaded () explicitly), the user must call
<PlayerClient>.readAll (); whenever he wants to get new data from the
Player server.
b) threaded mode
In a threaded mode (when the client calls the <PlayerClient>.runThreaded
(...); method), the calls are automatically read by the PlayerClient
thread, so all the incoming data will be placed automatically in the
structures of the respective interfaces.
Besides these two basic operating modes (which are Javaclient-specific),
the Player server itself has two ways of sending data to the client:
PUSH and PULL.
Right now the default is PUSH, thus, you can consider that besides the
two options (a and b) mentioned above, we have two more:
c) non-threaded mode, PULL mode
The difference between this mode and a) is that the user must call:
<PlayerClient>.requestDataDeliveryMode
(PlayerConstants.PLAYER_DATAMODE_PUSH);
<PlayerClient>.readAll ();
and optionally:
<PlayerClient>.requestAddReplaceRule (-1, -1,
PlayerConstants.PLAYER_MSGTYPE_DATA, -1, 1);
<PlayerClient>.readAll ();
The requestAddReplaceRule is important for those cases where you
encounter "warning : tried to push onto a full message queue" messages
on the Player side. Basically it enables the new mechanism available in
Player2 and tries to deal with those situations where the link between
the server and the client is slow or the data is produced really fast,
and the client gets delayed data. So, an AddReplaceRule with the type
PLAYER_MSGTYPE_DATA will replace data with newer versions, ensuring that
the client gets data as up to date as possible.
d) threaded mode, PULL mode
Same as in case c), the client has to issue the requestDataDeliveryMode
and requestAddReplaceRule (optionally) explicitly. The difference is
that readAll () is not needed here, since the PlayerClient thread will
take care of it. So:
<PlayerClient>.requestDataDeliveryMode
(PlayerConstants.PLAYER_DATAMODE_PUSH);
and optionally:
<PlayerClient>.requestAddReplaceRule (-1, -1,
PlayerConstants.PLAYER_MSGTYPE_DATA, -1, 1);
.... suffices.
For any other questions don't hesitate to e-mail here on the java-player
lists, or directly on playerstage (if the question is not Javaclient2
generic).
Cheers,
Radu.
--
| Radu Bogdan Rusu | http://rbrusu.com/
| http://www9.cs.tum.edu/people/rusu/
| Intelligent Autonomous Systems
| Technische Universitaet Muenchen
|