How to build a Node Service Node Composition
How to build a Node Service
Node Composition AGNode. Service Node Configuration & Management AGService. Manager AGService “Hosting Environment” AGService Base Class for Services on Nodes that provide access to collaboration resources, these are referred to as “Node Services”
Service Details • An AGService deals in the following data: • Capabilities • Configurable parameters • Stream descriptions
Capabilities • Each service describes its capabilities
Capabilities • Each service describes its capabilities • The Node Service aggregates the capabilities of its services to send to the venue • The venue matches the capabilities of the user with its current media streams • allocates a new stream description when a match is not found • returns appropriate stream descriptions Venue Client aggregated capabilities matching stream descriptions
Capabilities • Capabilities are set in the constructor of the service self. capabilities = [ Capability( Capability. PRODUCER, Capability. VIDEO ) ] • Venue Client retrieves Capabilities using AGService. Get. Capabilities method
Configurable Parameters • The operation of a service is likely configurable • For example, the Video. Producer. Service runs vic internally, so many vic parameters are configurable through the Video. Producer. Service
Configurable Parameters • Configurable parameters are set in the constructor of the service • Example: Video. Producer. Service self. streamname = Text. Parameter( "streamname", "Video" ) self. port = Text. Parameter( "port", "" ) self. encoding = Option. Set. Parameter( "encoding", "h 261", Video. Producer. Service. encodings ) self. bandwidth = Range. Parameter( "bandwidth", 800, 0, 3072 ) self. framerate = Range. Parameter( "framerate", 25, 1, 30 ) self. configuration. append( self. streamname ) self. configuration. append( self. port ) self. configuration. append( self. encoding ) self. configuration. append( self. bandwidth ) self. configuration. append( self. framerate ) • UI presentation depends on parameter type • Node Management retrieves configurable parameters with AGService. Get. Configuration method, and sets parameters with AGService. Set. Configuration method
Stream Descriptions • When the venue client has entered a venue, and received stream descriptions from the venue, it passes the stream descriptions to the Node Service • The Node Service passes the stream descriptions to the individual services via the AGService. Configure. Stream method • Services reconfigure internally to use new stream descriptions • In our case, that means restarting the media tools with the new multicast addresses Venue Client aggregated capabilities matching stream descriptions
AGService Interface for Services to implement • • • • def def def def __init__() Start() Stop() Configure. Stream(stream. Description) Get. Capabilities() Get. Configuration() Set. Configuration(configuration) Set. Authorized. Users(authorized. Users) Get. Resource() Set. Resource(resource) Get. Executable() Set. Executable(executable) Is. Started() Set. Identity(profile)
Specialization of AGService. py • Using Python • AGService base class implements most of the AGService interface • Minimum specialization includes the following methods: • __init__ – to set configuration parameters and capabilities for the Node Service • Start – to start underlying software
Services to consider • High/Low resolution audio/video services • Display service • Describe display dimensions, windows thereon, free space • Video service with camera control • Cameras swing into prescribed positions when node configuration is loaded
Example • Venue allocates multicast addresses based on Capabilities • Current Capability description is sooo simplified • Alternate video producer service • New video service: • Assign a new Capability. type (e. g. video_h 263) • Alter AGService. Start method to send h 263 • Implementation of a new service should be nearly as simple as this example • Capabilities need to be described more richly
With richer capabilities • Video. Producer. Service might claim capability to produce video in multiple encodings (h 261, h 263, jpeg) • Venue would resolve which encoding this user should use, by comparing with capabilities of other users in the venue • According to some policy, like ‘enable highest bandwidth collaboration’, or ‘ensure that all participants can see each other’ • User’s services would be configured using the venuebrokered encoding • Extend this example from encoding to other parameters
Service Packaging • Node Services are provided as packages • The package is a zip file of: • a. svc file that describes the service [Service. Description] name = Video. Producer. Service description = Vic-based video service to send video to multicast address capabilities = Capability 1 executable = Video. Producer. Service. py platform = neutral [Capability 1] role = producer type = video • an implementation file • Package location is defined in System. Config. Dir/AGNode. Service. cfg
- Slides: 15