YAACC - UPNP Client and Server
Loading...
Searching...
No Matches
de.yaacc.upnp.UpnpClient Class Reference

A client facade to the upnp lookup and access framework. More...

Inheritance diagram for de.yaacc.upnp.UpnpClient:
Inheritance graph
Collaboration diagram for de.yaacc.upnp.UpnpClient:
Collaboration graph

Classes

class  LocalDummyDevice
 

Public Member Functions

 UpnpClient (Context context)
 
boolean initialize (Context context)
 Initialize the Object.
 
boolean attach (Context context)
 The first half of initialize: takes the context and registers what needs no service.
 
boolean bindServerService ()
 The second half of initialize: binds (and so creates) the server service.
 
boolean startService ()
 
void onServiceConnected (ComponentName className, IBinder service)
 
YaaccUpnpServerService getYaaccUpnpServerService ()
 
void onServiceDisconnected (ComponentName componentName)
 
void remoteDeviceDiscoveryStarted (Registry registry, RemoteDevice remotedevice)
 
void remoteDeviceDiscoveryFailed (Registry registry, RemoteDevice remotedevice, Exception exception)
 
void remoteDeviceAdded (Registry registry, RemoteDevice remotedevice)
 
void remoteDeviceUpdated (Registry registry, RemoteDevice remotedevice)
 
void remoteDeviceRemoved (Registry registry, RemoteDevice remotedevice)
 
void localDeviceAdded (Registry registry, LocalDevice localdevice)
 
void localDeviceRemoved (Registry registry, LocalDevice localdevice)
 
void beforeShutdown (Registry registry)
 
void afterShutdown ()
 
Service<?, ?> getAVTransportService (Device<?, ?, ?> device)
 Returns a Service of type AVTransport.
 
Service<?, ?> getRenderingControlService (Device<?, ?, ?> device)
 Returns a Service of type RenderingControl.
 
void addUpnpClientListener (UpnpClientListener listener)
 Add an listener.
 
void removeUpnpClientListener (UpnpClientListener listener)
 Removes a listener added with addUpnpClientListener(UpnpClientListener), so a destroyed screen is no longer called.
 
Collection< Device<?, ?, ?> > getDevices ()
 Returns all registered UpnpDevices.
 
Collection< Device<?, ?, ?> > getDevicesProvidingContentDirectoryService ()
 Returns all registered UpnpDevices with a ContentDirectory Service.
 
Collection< Device<?, ?, ?> > getDevicesProvidingAvTransportService ()
 Returns all registered UpnpDevices with an AVTransport Service, and those that offer an OpenHome playlist without one.
 
Device<?, ?, ?> getDevice (String identifier)
 Returns a registered UpnpDevice.
 
boolean isInitialized ()
 True if the client is initialized.
 
Registry getRegistry ()
 Returns the upnp registry.
 
Context getContext ()
 
ContentDirectoryBrowseResult browseSync (Position pos)
 Browse ContenDirctory synchronous.
 
ContentDirectoryBrowseResult browseSync (Position pos, Long firstResult, Long maxResult, SortCriterion... orderBy)
 
ContentDirectoryBrowseResult browseSync (Device<?, ?, ?> device, String objectID, BrowseFlag flag, String filter, long firstResult, Long maxResults, SortCriterion... orderBy)
 Browse ContenDirctory synchronous.
 
boolean supportsSearch (Device<?, ?, ?> device)
 Whether the server can search at all: it has the search action and lists at least one property that a free text is looked for in.
 
ContentDirectoryBrowseResult searchSync (Device<?, ?, ?> device, String freeText, long firstResult, Long maxResults)
 Searches the whole server from its root for the free text (issue #336): every word in at least one of the properties the server can search, see SearchCriteria.
 
HttpRequestSender getHttpRequestSender ()
 
void addNetworkRecoveryListener (NetworkRecoveryListener listener)
 Registers for "the network is back" (see NetworkRecoveryListener).
 
void removeNetworkRecoveryListener (NetworkRecoveryListener listener)
 
NetworkRecoveryListener getNetworkRecoveryRelay ()
 
void searchDevices ()
 Search asynchronously for all devices.
 
void refreshAfterResume ()
 A browser screen came back to the foreground, maybe after the device or the app was suspended (screen off, Doze, a long time in the background): checks the network listener and searches the devices again if the last search is not recent.
 
Player attachOpenHomePlayer (Device<?, ?, ?> device)
 Returns all player instances initialized with the given didl object.
 
List< Player > initializePlayers (DIDLObject didlObject)
 
List< Player > initializePlayers (List< Item > items)
 Returns all player instances initialized with the given didl object.
 
List< Player > initializePlayers (AvTransport transport)
 Returns all player instances initialized with the given transport object.
 
Player initializeLocalPlayer (List< PlayableItem > items)
 Creates a player on this device for the items (the OpenHome renderer's queue); not started.
 
Collection< Player > getCurrentPlayers ()
 Returns all current player instances.
 
void addPlayerListChangeListener (PlayerListChangeNotifier.Listener listener)
 Registers a listener for players being added to or removed from the player service; see PlayerService#addPlayerListChangeListener.
 
void removePlayerListChangeListener (PlayerListChangeNotifier.Listener listener)
 
long getPlayerCreationSequence (Player player)
 Creation sequence of an active player (higher = added later), or 0 if the player isn't active or the player service isn't bound.
 
List< Player > getCurrentPlayers (AvTransport transport)
 Returns all current player instances for the given transport object.
 
List< Item > toItemList (DIDLContent didlContent)
 returns a list of all items including items in containers for the given didlContent
 
List< Item > toItemList (DIDLObject didlObject)
 Converts the content of a didlObject into a list of cling items.
 
int getResultSetSize ()
 The setting "result set size": the most items that are loaded from a server to play a folder or the result of a search.
 
ChildPager.Result loadAllChildren (Position position, long start, SortCriterion... orderBy)
 All children of a folder from start on, page after page, in the order the server gives them for orderBy (the screen loads a folder in batches of 50; what plays must be the whole folder).
 
Set< String > getReceiverDeviceIds ()
 Gets the receiver IDs, if none is defined the local device will be returned.
 
void setReceiverDeviceIds (Set< String > receiverDeviceIds)
 Set the list of receiver device ids.
 
Collection< Device<?, ?, ?> > getReceiverDevices ()
 Returns the receiverIds stored in the preferences.
 
Collection< Device<?, ?, ?> > awaitReceiverDevices ()
 Like getReceiverDevices(), but first gives a selected receiver that is not in the registry right now a few seconds to come back (ReceiverAvailabilityPolicy: three looks, 2.5 s apart, a search before each wait).
 
void clearReceiverDevices ()
 Clears the receiver selection: the stored set becomes empty (and stays empty, it is not replaced by the local device) and a "receiver removed" event is fired for every receiver that was selected, so views that follow the selection refresh.
 
int getReceiverDevicesReadyCount ()
 
void setReceiverDevices (Collection< Device<?, ?, ?> > receiverDevices)
 set the receiverDevices to the devices in the given collection.
 
void addReceiverDevice (Device<?, ?, ?> receiverDevice)
 add a receiver device
 
void removeReceiverDevice (Device<?, ?, ?> receiverDevice)
 remove a receiver device
 
String getProviderDeviceId ()
 
Device<?, ?, ?> getProviderDevice ()
 
void setProviderDevice (Device<?, ?, ?> provider)
 
void shutdown ()
 Shutdown the upnp client and all players.
 
void unbindServices ()
 Lets go of the bindings to the server service and the player service.
 
int getDefaultDuration ()
 Return the configured default duration.
 
int getSilenceDuration ()
 Return the configured silence duration.
 
boolean isMute ()
 returns the mute state
 
void setMute (boolean mute)
 set the mute state
 
int getVolume ()
 returns the current volume level
 
void setVolume (int desired)
 set the volume in the range of 0-100
 
void downloadItem (DIDLObject selectedDIDLObject)
 
List< Player > initializePlayersWithPlayableItems (List< PlayableItem > items)
 
List< Player > initializeQueuePlayers (de.yaacc.share.PickedQueue.Result queue)
 Creates the players of a picked queue on the stored receiver selection (one player per receiver and media type, see PlayerService#createQueuePlayers); worker thread.
 
boolean getMute (Device<?, ?, ?> device)
 
boolean hasActionGetMute (Device<?, ?, ?> device)
 
void setMute (Device<?, ?, ?> device, boolean mute)
 
int getVolume (Device<?, ?, ?> device)
 
boolean hasActionGetVolume (Device<?, ?, ?> device)
 
void setVolume (Device<?, ?, ?> device, int volume)
 
boolean hasActionSetVolume (Service<?, ?> service)
 
Optional< Player > getPlayer (int id)
 
void addToPlaylist (DIDLObject item)
 Adds the item to the chosen receivers: the playlist of a receiver that already has a player gets it, a receiver without a player gets a new one (see PlaylistTargets).
 
PlayableItem createPlayableItem (Uri uri) throws IOException
 Makes the item for a shared http(s) link (shared text).
 
PlayableItem createPlayableItem (Uri uri, Set< String > receiverIds) throws IOException
 Same as createPlayableItem(Uri), with the receivers the share is made for given explicitly: the addresses a proxied link is served to are built from exactly these ids, never from the stored selection, which another action may have replaced or cleared during the network work.
 
ProxyAvailability.Decision linkProxyDecision ()
 How a shared link is handed to the receivers, from the preferences: the media proxy checkbox AND the master switch "UPnP Server" (see ProxyAvailability).
 
PlayableItem createLiveStreamShare (boolean audio, Set< String > receiverIds)
 Makes the live stream of this phone (device audio or screen) available to the chosen receivers as a share: the capture is started for it, a short-lived address under the media proxy path is registered and the item that plays it is returned.
 
void discardShareOf (PlayableItem item)
 Gives up the share an item was made for (no player took it): removes its registry key, which closes the source of a file.
 
boolean isHttpServerRunning ()
 Whether the local HTTP server accepts connections (it runs whenever the app process lives, whatever the "local server" setting says).
 
boolean isPlayerServiceInitialized ()
 
- Public Member Functions inherited from de.yaacc.upnp.registry.RegistryListener

Static Public Member Functions

static boolean isSearchUnsupported (ContentDirectoryBrowseResult result)
 

Static Public Attributes

static String LOCAL_UID = "LOCAL_UID"
 
static final String SEARCH_UNSUPPORTED = "Search not supported"
 The message of the failure of a search that the server can not do (no search action, no property it can search).
 

Detailed Description

A client facade to the upnp lookup and access framework.

This class provides all services to manage devices.

Author
Tobias Schoene (TheOpenBit)

Member Function Documentation

◆ addNetworkRecoveryListener()

void de.yaacc.upnp.UpnpClient.addNetworkRecoveryListener ( NetworkRecoveryListener listener)

Registers for "the network is back" (see NetworkRecoveryListener).

Held weakly: the caller keeps the listener and calls removeNetworkRecoveryListener when it stops.

◆ addPlayerListChangeListener()

void de.yaacc.upnp.UpnpClient.addPlayerListChangeListener ( PlayerListChangeNotifier.Listener listener)

Registers a listener for players being added to or removed from the player service; see PlayerService#addPlayerListChangeListener.

Works before the service is bound: the listener is attached once it is. Callers must call removePlayerListChangeListener when done.

Referenced by de.yaacc.upnp.UpnpClient.attach().

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

◆ addReceiverDevice()

void de.yaacc.upnp.UpnpClient.addReceiverDevice ( Device<?, ?, ?> receiverDevice)

add a receiver device

Parameters
receiverDevicereceiverDevice
Here is the call graph for this function:

◆ addUpnpClientListener()

void de.yaacc.upnp.UpnpClient.addUpnpClientListener ( UpnpClientListener listener)

Add an listener.

Parameters
listenerthe listener to be added

◆ afterShutdown()

void de.yaacc.upnp.UpnpClient.afterShutdown ( )

◆ attach()

boolean de.yaacc.upnp.UpnpClient.attach ( Context context)

The first half of initialize: takes the context and registers what needs no service.

The application does only this when its process was created right after an explicit exit (task 12.2); bindServerService() follows when the user starts the app.

Returns
false without a context

Referenced by de.yaacc.upnp.UpnpClient.initialize().

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

◆ attachOpenHomePlayer()

Player de.yaacc.upnp.UpnpClient.attachOpenHomePlayer ( Device<?, ?, ?> device)

Returns all player instances initialized with the given didl object.

Parameters
didlObjectthe object which describes the content to be played
Returns
the player The player of an OpenHome device that plays already, for its playlist screen: the device keeps its queue, the player only shows it. Starts the player service when it is not running (it is only started when something is played), and waits for it: not for the main thread.
the player, null if the player service did not come up
Here is the call graph for this function:

◆ awaitReceiverDevices()

Collection< Device<?, ?, ?> > de.yaacc.upnp.UpnpClient.awaitReceiverDevices ( )

Like getReceiverDevices(), but first gives a selected receiver that is not in the registry right now a few seconds to come back (ReceiverAvailabilityPolicy: three looks, 2.5 s apart, a search before each wait).

After a suspend the registry may have dropped the renderer; getReceiverDevices() would remove it from the stored selection for good. What is still missing after the last look is dropped as before. A pending Snapcast group (its server has not answered yet) is neither waited for nor dropped; its connection is woken once.

Waits, so worker threads only; on the main thread it does not wait.

Referenced by de.yaacc.upnp.UpnpClient.addToPlaylist(), de.yaacc.player.PlayerService.createPlayer(), and de.yaacc.upnp.UpnpClient.initializeQueuePlayers().

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

◆ beforeShutdown()

void de.yaacc.upnp.UpnpClient.beforeShutdown ( Registry registry)

◆ browseSync() [1/2]

ContentDirectoryBrowseResult de.yaacc.upnp.UpnpClient.browseSync ( Device<?, ?, ?> device,
String objectID,
BrowseFlag flag,
String filter,
long firstResult,
Long maxResults,
SortCriterion... orderBy )

Browse ContenDirctory synchronous.

Parameters
devicethe device to be browsed
objectIDthe browsing root
flagkind of browsing
See also
BrowseFlag
Parameters
filtera filter
firstResultfirst result
maxResultsmax result count
orderBysorting criteria
See also
SortCriterion
Returns
the browsing result
Here is the call graph for this function:

◆ browseSync() [2/2]

ContentDirectoryBrowseResult de.yaacc.upnp.UpnpClient.browseSync ( Position pos)

Browse ContenDirctory synchronous.

Parameters
posPosition the device and object to be browsed
Returns
the browsing result

◆ clearReceiverDevices()

void de.yaacc.upnp.UpnpClient.clearReceiverDevices ( )

Clears the receiver selection: the stored set becomes empty (and stays empty, it is not replaced by the local device) and a "receiver removed" event is fired for every receiver that was selected, so views that follow the selection refresh.

Does nothing to running players or to the allowed set of an existing share (that was fixed when the share was registered).

Here is the call graph for this function:

◆ createLiveStreamShare()

PlayableItem de.yaacc.upnp.UpnpClient.createLiveStreamShare ( boolean audio,
Set< String > receiverIds )

Makes the live stream of this phone (device audio or screen) available to the chosen receivers as a share: the capture is started for it, a short-lived address under the media proxy path is registered and the item that plays it is returned.

It needs neither the UPnP Server switch nor the media provider (like a shared file); the capture stops when the share ends, unless the stream setting of the server card keeps it. Null if no share could be made (no network address, the local server is not ready, the registry is full, the capture did not start: the permission of the system is missing). Worker thread only; nothing here logs the key.

Here is the call graph for this function:

◆ createPlayableItem() [1/2]

PlayableItem de.yaacc.upnp.UpnpClient.createPlayableItem ( Uri uri) throws IOException

Makes the item for a shared http(s) link (shared text).

Worker thread only: it reads the link's metadata over the network and, with the media proxy option on, registers the link with the share registry.

The media type comes from the metadata reader; if that fails it comes from a bounded HTTP HEAD (concrete audio, video or image type); only if that fails too the link is assumed to be an image, as before, and a payload-free line says so. With the proxy option on a target the phone must not fetch (loopback, link-local, this phone's own address, see LinkTargetPolicy) is refused. Nothing here logs the link or the exceptions' text.

Returns
the item, or null if the link is refused (the caller plays nothing)

Referenced by de.yaacc.upnp.UpnpClient.createPlayableItem().

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

◆ createPlayableItem() [2/2]

PlayableItem de.yaacc.upnp.UpnpClient.createPlayableItem ( Uri uri,
Set< String > receiverIds ) throws IOException

Same as createPlayableItem(Uri), with the receivers the share is made for given explicitly: the addresses a proxied link is served to are built from exactly these ids, never from the stored selection, which another action may have replaced or cleared during the network work.

Parameters
receiverIdsthe receivers chosen for this share, captured at confirm time
Here is the call graph for this function:

◆ discardShareOf()

void de.yaacc.upnp.UpnpClient.discardShareOf ( PlayableItem item)

Gives up the share an item was made for (no player took it): removes its registry key, which closes the source of a file.

Does nothing for an item without a proxy URL. Never throws.

Here is the call graph for this function:

◆ getAVTransportService()

Service<?, ?> de.yaacc.upnp.UpnpClient.getAVTransportService ( Device<?, ?, ?> device)

Returns a Service of type AVTransport.

Parameters
devicethe device which provides the service
Returns
the service of null

◆ getContext()

◆ getCurrentPlayers() [1/2]

Collection< Player > de.yaacc.upnp.UpnpClient.getCurrentPlayers ( )

Returns all current player instances.

Returns
the player

Referenced by de.yaacc.upnp.UpnpClient.addToPlaylist(), de.yaacc.upnp.server.openhome.AndroidOpenHomeHost.isAlive(), de.yaacc.browser.BrowserActivity.onKeyDown(), and de.yaacc.upnp.server.avtransport.AvTransportMediaRendererPaused.seek().

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

◆ getCurrentPlayers() [2/2]

List< Player > de.yaacc.upnp.UpnpClient.getCurrentPlayers ( AvTransport transport)

Returns all current player instances for the given transport object.

Parameters
transportthe object which describes the content to be played
Returns
the player
Here is the call graph for this function:

◆ getDefaultDuration()

int de.yaacc.upnp.UpnpClient.getDefaultDuration ( )

Return the configured default duration.

Returns
the duration

Referenced by de.yaacc.upnp.UpnpClient.getCurrentPlayers(), and de.yaacc.upnp.server.openhome.AndroidOpenHomeHost.toPlayableItem().

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

◆ getDevice()

Device<?, ?, ?> de.yaacc.upnp.UpnpClient.getDevice ( String identifier)

Returns a registered UpnpDevice.

Returns
the upnpDevice null if not found

Referenced by de.yaacc.upnp.UpnpClient.getProviderDevice(), de.yaacc.upnp.UpnpClient.getReceiverDevices(), and de.yaacc.share.ShareAddressResolver.resolve().

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

◆ getDevices()

Collection< Device<?, ?, ?> > de.yaacc.upnp.UpnpClient.getDevices ( )

Returns all registered UpnpDevices.

Returns
the upnpDevices

Referenced by de.yaacc.upnp.UpnpClient.getDevices(), de.yaacc.upnp.UpnpClient.getDevicesProvidingAvTransportService(), and de.yaacc.upnp.UpnpClient.getDevicesProvidingContentDirectoryService().

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

◆ getDevicesProvidingAvTransportService()

Collection< Device<?, ?, ?> > de.yaacc.upnp.UpnpClient.getDevicesProvidingAvTransportService ( )

Returns all registered UpnpDevices with an AVTransport Service, and those that offer an OpenHome playlist without one.

Returns
the upnpDevices
Here is the call graph for this function:

◆ getDevicesProvidingContentDirectoryService()

Collection< Device<?, ?, ?> > de.yaacc.upnp.UpnpClient.getDevicesProvidingContentDirectoryService ( )

Returns all registered UpnpDevices with a ContentDirectory Service.

Returns
the upnpDevices
Here is the call graph for this function:

◆ getHttpRequestSender()

HttpRequestSender de.yaacc.upnp.UpnpClient.getHttpRequestSender ( )
Returns
the sender of the server service's network listener, or null when there is none (yet): no service bound, the listener not created or no network came up since the start

Referenced by de.yaacc.upnp.UpnpClient.browseSync(), de.yaacc.player.OpenHomePlayer.createControl(), de.yaacc.player.AVTransportPlayer.getHttpRequestSender(), and de.yaacc.upnp.UpnpClient.searchSync().

Here is the caller graph for this function:

◆ getNetworkRecoveryRelay()

NetworkRecoveryListener de.yaacc.upnp.UpnpClient.getNetworkRecoveryRelay ( )
Returns
the listener the server service registers at its network listener, it passes the "network is back" on to the listeners added with addNetworkRecoveryListener

◆ getProviderDevice()

Device<?, ?, ?> de.yaacc.upnp.UpnpClient.getProviderDevice ( )
Returns
the provider device
Here is the call graph for this function:

◆ getProviderDeviceId()

String de.yaacc.upnp.UpnpClient.getProviderDeviceId ( )
Returns
the providerDeviceId

Referenced by de.yaacc.upnp.UpnpClient.getProviderDevice().

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

◆ getReceiverDeviceIds()

Set< String > de.yaacc.upnp.UpnpClient.getReceiverDeviceIds ( )

Gets the receiver IDs, if none is defined the local device will be returned.

Returns
the receiverDeviceIds, a copy the caller may modify (the set that SharedPreferences.getStringSet returns must never be changed); an empty stored set stays empty

Referenced by de.yaacc.upnp.UpnpClient.awaitReceiverDevices(), de.yaacc.upnp.UpnpClient.createPlayableItem(), de.yaacc.upnp.UpnpClient.getReceiverDevices(), and de.yaacc.share.ShareAddressResolver.resolve().

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

◆ getReceiverDevices()

Collection< Device<?, ?, ?> > de.yaacc.upnp.UpnpClient.getReceiverDevices ( )

Returns the receiverIds stored in the preferences.

If an receiver id is unknown it will be removed.

Returns
the receiverDevices

Referenced by de.yaacc.upnp.UpnpClient.addReceiverDevice(), de.yaacc.upnp.UpnpClient.awaitReceiverDevices(), de.yaacc.upnp.UpnpClient.clearReceiverDevices(), and de.yaacc.upnp.UpnpClient.removeReceiverDevice().

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

◆ getRegistry()

Registry de.yaacc.upnp.UpnpClient.getRegistry ( )

Returns the upnp registry.

Returns
the registry

Referenced by de.yaacc.upnp.UpnpClient.getDevice(), de.yaacc.upnp.UpnpClient.getDevices(), de.yaacc.upnp.UpnpClient.getDevicesProvidingAvTransportService(), and de.yaacc.upnp.UpnpClient.getDevicesProvidingContentDirectoryService().

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

◆ getRenderingControlService()

Service<?, ?> de.yaacc.upnp.UpnpClient.getRenderingControlService ( Device<?, ?, ?> device)

Returns a Service of type RenderingControl.

Parameters
devicethe device which provides the service
Returns
the service of null

◆ getSilenceDuration()

int de.yaacc.upnp.UpnpClient.getSilenceDuration ( )

Return the configured silence duration.

Returns
the duration

Referenced by de.yaacc.player.AbstractPlayer.getSilenceDuration().

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

◆ getVolume()

int de.yaacc.upnp.UpnpClient.getVolume ( )

returns the current volume level

Returns
the value in the range of 0-100
Here is the call graph for this function:

◆ initialize()

boolean de.yaacc.upnp.UpnpClient.initialize ( Context context)

Initialize the Object.

Parameters
contextthe context
Returns
true if initialization completes correctly
Here is the call graph for this function:

◆ initializeLocalPlayer()

Player de.yaacc.upnp.UpnpClient.initializeLocalPlayer ( List< PlayableItem > items)

Creates a player on this device for the items (the OpenHome renderer's queue); not started.

Returns
the player, null if the player service is not there

Referenced by de.yaacc.upnp.server.openhome.AndroidOpenHomeHost.createPlayer().

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

◆ initializePlayers() [1/2]

List< Player > de.yaacc.upnp.UpnpClient.initializePlayers ( AvTransport transport)

Returns all player instances initialized with the given transport object.

Parameters
transportthe object which describes the content to be played
Returns
the player
Here is the call graph for this function:

◆ initializePlayers() [2/2]

List< Player > de.yaacc.upnp.UpnpClient.initializePlayers ( List< Item > items)

Returns all player instances initialized with the given didl object.

Parameters
itemsthe items to be played
Returns
the player
Here is the call graph for this function:

◆ initializeQueuePlayers()

List< Player > de.yaacc.upnp.UpnpClient.initializeQueuePlayers ( de.yaacc.share.PickedQueue.Result queue)

Creates the players of a picked queue on the stored receiver selection (one player per receiver and media type, see PlayerService#createQueuePlayers); worker thread.

Not started.

Here is the call graph for this function:

◆ isHttpServerRunning()

boolean de.yaacc.upnp.UpnpClient.isHttpServerRunning ( )

Whether the local HTTP server accepts connections (it runs whenever the app process lives, whatever the "local server" setting says).

A short loopback connect: call it only off the main thread. See HttpServerProbe.

Here is the call graph for this function:

◆ isInitialized()

◆ isMute()

boolean de.yaacc.upnp.UpnpClient.isMute ( )

returns the mute state

Returns
the state
Here is the call graph for this function:

◆ isSearchUnsupported()

static boolean de.yaacc.upnp.UpnpClient.isSearchUnsupported ( ContentDirectoryBrowseResult result)
static
Returns
true if the failure of a search says that the server can not search
Here is the call graph for this function:

◆ linkProxyDecision()

ProxyAvailability.Decision de.yaacc.upnp.UpnpClient.linkProxyDecision ( )

How a shared link is handed to the receivers, from the preferences: the media proxy checkbox AND the master switch "UPnP Server" (see ProxyAvailability).

The caller may ask this before building an item to tell the user why a link is refused.

Referenced by de.yaacc.upnp.UpnpClient.createPlayableItem().

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

◆ loadAllChildren()

ChildPager.Result de.yaacc.upnp.UpnpClient.loadAllChildren ( Position position,
long start,
SortCriterion... orderBy )

All children of a folder from start on, page after page, in the order the server gives them for orderBy (the screen loads a folder in batches of 50; what plays must be the whole folder).

Blocks: not for the main thread.

Parameters
startthe number of children the caller has already (they are skipped)

◆ localDeviceAdded()

void de.yaacc.upnp.UpnpClient.localDeviceAdded ( Registry registry,
LocalDevice localdevice )

◆ localDeviceRemoved()

void de.yaacc.upnp.UpnpClient.localDeviceRemoved ( Registry registry,
LocalDevice localdevice )

◆ refreshAfterResume()

void de.yaacc.upnp.UpnpClient.refreshAfterResume ( )

A browser screen came back to the foreground, maybe after the device or the app was suspended (screen off, Doze, a long time in the background): checks the network listener and searches the devices again if the last search is not recent.

Does its work on the client's executor and returns at once.

◆ remoteDeviceAdded()

void de.yaacc.upnp.UpnpClient.remoteDeviceAdded ( Registry registry,
RemoteDevice remotedevice )

◆ remoteDeviceDiscoveryFailed()

void de.yaacc.upnp.UpnpClient.remoteDeviceDiscoveryFailed ( Registry registry,
RemoteDevice remotedevice,
Exception exception )

◆ remoteDeviceDiscoveryStarted()

void de.yaacc.upnp.UpnpClient.remoteDeviceDiscoveryStarted ( Registry registry,
RemoteDevice remotedevice )

◆ remoteDeviceRemoved()

void de.yaacc.upnp.UpnpClient.remoteDeviceRemoved ( Registry registry,
RemoteDevice remotedevice )

◆ remoteDeviceUpdated()

void de.yaacc.upnp.UpnpClient.remoteDeviceUpdated ( Registry registry,
RemoteDevice remotedevice )

◆ removeReceiverDevice()

void de.yaacc.upnp.UpnpClient.removeReceiverDevice ( Device<?, ?, ?> receiverDevice)

remove a receiver device

Parameters
receiverDevicereceiverDevice
Here is the call graph for this function:

◆ removeUpnpClientListener()

void de.yaacc.upnp.UpnpClient.removeUpnpClientListener ( UpnpClientListener listener)

Removes a listener added with addUpnpClientListener(UpnpClientListener), so a destroyed screen is no longer called.

Removes one registration; does nothing if the listener is not registered.

Parameters
listenerthe listener to be removed

◆ searchSync()

ContentDirectoryBrowseResult de.yaacc.upnp.UpnpClient.searchSync ( Device<?, ?, ?> device,
String freeText,
long firstResult,
Long maxResults )

Searches the whole server from its root for the free text (issue #336): every word in at least one of the properties the server can search, see SearchCriteria.

Blocking, like browseSync; the result is paged the same way. A server that can not search gives the failure SEARCH_UNSUPPORTED. If a server refuses the criteria with several properties, the first property alone is tried once.

Here is the call graph for this function:

◆ setMute()

void de.yaacc.upnp.UpnpClient.setMute ( boolean mute)

set the mute state

Parameters
mutethe state
Here is the call graph for this function:

◆ setReceiverDeviceIds()

void de.yaacc.upnp.UpnpClient.setReceiverDeviceIds ( Set< String > receiverDeviceIds)

Set the list of receiver device ids.

Parameters
receiverDeviceIdsthe device ids.

Referenced by de.yaacc.upnp.UpnpClient.clearReceiverDevices(), de.yaacc.upnp.UpnpClient.getReceiverDevices(), de.yaacc.upnp.UpnpClient.setReceiverDevices(), and de.yaacc.browser.ContentListFragment.startPlayAction().

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

◆ setReceiverDevices()

void de.yaacc.upnp.UpnpClient.setReceiverDevices ( Collection< Device<?, ?, ?> > receiverDevices)

set the receiverDevices to the devices in the given collection.

Parameters
receiverDevicesthe devices

Referenced by de.yaacc.upnp.UpnpClient.addReceiverDevice(), and de.yaacc.upnp.UpnpClient.removeReceiverDevice().

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

◆ setVolume()

void de.yaacc.upnp.UpnpClient.setVolume ( int desired)

set the volume in the range of 0-100

Parameters
desiredvolume
Here is the call graph for this function:

◆ supportsSearch()

boolean de.yaacc.upnp.UpnpClient.supportsSearch ( Device<?, ?, ?> device)

Whether the server can search at all: it has the search action and lists at least one property that a free text is looked for in.

Asks the server once per device (blocking: worker thread only).

◆ toItemList() [1/2]

List< Item > de.yaacc.upnp.UpnpClient.toItemList ( DIDLContent didlContent)

returns a list of all items including items in containers for the given didlContent

Parameters
didlContentthe content
Returns
all items included in the content

Referenced by de.yaacc.upnp.UpnpClient.addToPlaylist(), de.yaacc.upnp.UpnpClient.toItemList(), and de.yaacc.upnp.UpnpClient.toItemList().

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

◆ toItemList() [2/2]

List< Item > de.yaacc.upnp.UpnpClient.toItemList ( DIDLObject didlObject)

Converts the content of a didlObject into a list of cling items.

Parameters
didlObjectthe content
Returns
the list of cling items
Here is the call graph for this function:

◆ unbindServices()

void de.yaacc.upnp.UpnpClient.unbindServices ( )

Lets go of the bindings to the server service and the player service.

A service that is bound does not end when it is stopped, so the exit calls this after shutdown() (task 12.2). One call ends both: the same connection object is registered for both.

Here is the call graph for this function:

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