This package defines an SPI for selection of services and service components. The providers defined in this package allow the presentation of services whose location is not announced using standard signalling. One a SelectionProvider has been installed, the standard GEM APIs, such as the JavaTV service selection API, can be used to present those services.

Examples of API usage

Switched Digital

The following table shows the sequence of API calls involved in a service selection operation, both API calls between an application and the implementation and between the implementation and a SelectionProvider.

The table covers both the case when the service location is known and when the location is unknown. The first column indicates if the step applies when the service location is unknown. The second column indicates whether the step applies when the service location is known. Most steps either apply in both cases at the same point in the sequence or only apply when the service location is unknown. Two steps apply in both cases but at different points in the sequence.

Unknown Service Location

Known Service Location

Step

API call by application

API call to/from provider

Y Y Provider is installed {@link org.dvb.spi.ProviderRegistry#registerSystemBound ProviderRegistry.registerSystemBound} {@link org.dvb.spi.Provider#providerRegistered Provider.providerRegistered}
Y Y Provider is initialised None {@link org.dvb.spi.selection.SelectionProvider#init SelectionProvider.init}
Y Y Implementation asks provider for supported services None {@link org.dvb.spi.selection.SelectionProvider#getServiceList}
Y Y Each supported service is merged into the service list of the receiver None Methods on each ServiceReference returned from {@link org.dvb.spi.selection.SelectionProvider#getServiceList}
N Y Extract tuning information for service None For GEM, {@link org.dvb.locator.FrequencyLocator#getDeliverySystemDescriptor}

Some time later

Y Y Application obtains service object corresponding to locator of service SIManager.getService(LocatorFactory.createLocator( "dvb://'movie-channel-1.broadcaster-b.com'") None
Y Y Application asks for service to be presented ServiceContext.select(Service) None
Y N Create session for the presentation of the requested service. None 1) new ServiceReference(..)

2) {@link org.dvb.spi.selection.SelectionProvider#newSession SelectionProvider.newSession}

Y N Implementation asks provider to present channel. None {@link org.dvb.spi.selection.SelectionSession#select SelectionSession.select}
Y N Provider asks head-end for channel None Existing java.net APIs
Y N Head-end returns reference to channel location None Existing java.net APIs
Y N Provider passes on reference to channel location to implementation None 1a) For GEM, new FrequencyLocator(...)

1b) For OCAP, new OCAPLocator(int frequency, int programNumber,int modulationFormat, ...)

2) Return from call to {@link org.dvb.spi.selection.SelectionSession#select}

Y N Extract tuning information for service None For GEM, {@link org.dvb.locator.FrequencyLocator#getDeliverySystemDescriptor}
Y Y Implementation tunes to appropriate frequency etc None None
N Y Create session for the presentation of the requested service. None 1) new ServiceReference(..)

2) {@link org.dvb.spi.selection.SelectionProvider#newSession SelectionProvider.newSession}

Y N Inform provider that implementation is ready to receive content None {@link org.dvb.spi.selection.SelectionSession#selectionReady SelectionSession.selectionReady}
Y N Provider tells server to send content Provider sends message to switched digital server Existing java.net APIs
Y Y Content arrives 1) new NormalContentEvent

2) ServiceContextListener.receiveServiceContextEvent(..)

None

Some time later

Y Y Content stops being presented (change to new channel, ...) Either none or ServiceContext.select() with a different service. {@link org.dvb.spi.selection.SelectionSession#destroy SelectionSession.destroy}
Y Y Content may stop being delivered Provider may tell head-end that this content is no longer needed if the head-end is counting the number of users of the content Existing java.net APIs

Video on Demand using Non-Standard RTSP

The table below shows the use of a org.dvb.spi.selection.SelectionProvider with RTSP when content is presented using the GEM service selection API. The rows colour coded in grey are specific to content being presented using the the service selection API. Equivalents exist if JMF is used to present content using a provider.

Step

API call by application

API call to/from provider

Notes

Provider is installed {@link org.dvb.spi.ProviderRegistry#registerSystemBound ProviderRegistry.registerSystemBound} {@link org.dvb.spi.Provider#providerRegistered Provider.providerRegistered}
Provider is initialised None {@link org.dvb.spi.selection.SelectionProvider#init SelectionProvider.init}
Provider registers locator schemes it can select None Implementation calls {@link org.dvb.spi.selection.SelectionProvider#getSupportedLocatorSchemes} which returns new org.dvb.spi.selection.LocatorScheme("rtsp", true)

Some time later

Application decides which content is to be played back new RTSPLocator( ... ) None
Application asks for content to be presented SIManager.getService(Locator)
ServiceContext.select(Service)
None
Implementation decides whether to use built-in RTSP implementation or provider. None {@link org.dvb.spi.selection.LocatorScheme#getProviderFirst}
Create session for the presentation of the requested content. None New ServiceReference(..)

{@link org.dvb.spi.selection.SelectionProvider#newSession SelectionProvider.newSession}

Provider negotiates RTSP session with server. None Provider uses existing java.net APIs to issue SETUP command including GEM terminal IP address and UDP port chosen by the provider to receive the MPEG stream from the RTSP server

Provider tells implementation which port will be used for incoming content

None Provider returns new {@link org.dvb.locator.ip.UnicastLocator} from call to {@link org.dvb.spi.selection.SelectionSession#select}

Implementation listens on port identified by the UDPLocator returned from the provider and sets up MPEG demux / decoder chain as appropriate

None None
Server sends content when GEM terminal is ready to receive it. None Implementation calls {@link org.dvb.spi.selection.SelectionSession#selectionReady}

Provider uses existing java.net APIs to send PLAY command to server

Content arrives 1) new NormalContentEvent

2) ServiceContextListener.receiveServiceContextEvent(..)

None

Some time later

Application wants to pause playback Player.setRate(0) Implementation calls {@link org.dvb.spi.selection.SelectionSession#setRate}

Provider uses existing java.net APIs to send RTSP pause command to server.

Some time later

Application wants to resume playback Player.setRate(1.0) Implementation calls {@link org.dvb.spi.selection.SelectionSession#setRate}

Provider uses existing java.net APIs to send RTSP PLAY command to server.

Some time later

Application wants playback to jump to new location Player.setMediaTime() Implementation calls {@link org.dvb.spi.selection.SelectionSession#setPosition}

Provider uses existing java.net APIs to send PLAY command specifying new starting offset.

Some time later

Application wants playback to switch into fast forwards Player.setRate() Implementation calls {@link org.dvb.spi.selection.SelectionSession#setRate}

Provider uses existing java.net APIs to send PLAY command with desired playscale

Some time later

Content stops being presented (change to new channel, ...) Either none or ServiceContext.select() with a different service. {@link org.dvb.spi.selection.SelectionSession#destroy}
Provider sends TEARDOWN command to server and closes session None Existing java.net APIs