Chamge[tʃɑmge] is a small crab in Korean and this module aims to provide control channel to the SRT relay server(hwangsae) and Edge(gaeguli).
This software is an AMQP client to gather information about edge and will instantiate the SRT relay on demand according to the current load.
The connection broker API consists of three modules: Edge, Arbiter and Hub. Each broker instance can find itself in one of the following states: null, enrolled and activated.
Edge is a connection broker module for SRT Source Devices.
Arbiter is a connection broker module for SRT Management Servers.
Hub is a connection broker module for SRT Relay Servers.
- null: this is the default initial state
- enrolled: in this state the instance is registered in the message broker and able to exchange messages
- activated: in this state the instance is ready to accept requests
In order to become an active part of the system the node
needs to transititon from the null
state to the active
one. Bellow is the list of requests the node
can send and the transitions.
- enroll: in the
null
orinitial
state thenode
performs this request using the backend to transition to theenrolled
state. - activate: in the
enrolled
state thenode
performs this request using the backend to transition to theactivated
state. - deactivate: in the
activated
state thenode
performs this request using the backend to transition to theenroll
state. - delist: in the
enrolled
state thenode
performs this request using the backend to transition to theinitial
state.
Role of agents are for communicating with another process. Agents include D-BUS API that is created by code generator from defined XML in the path of chamge/dbus/. Manager server's RESET API communicate with Arbiter via D-BUS(chamge-arbiter-agent).
Status Retrieves the agent state, possible values are:
- 0x0 = NULL
- 0x1 = ENROLLED
- 0x2 = ACTIVATED
Enroll Enrolls Edge device in the network
Delist Delists Edge device in the network
Activate Activates Edge device
Deactivate Deactivates Edge device
UserCommand Send user commamnd to a device
Arguments
- command (s): Command to send
Return
- result (i): Response status code
- response (s): Response data
Status Retrieves the agent state, possible values are:
- 0x0 = NULL
- 0x1 = ENROLLED
- 0x2 = ACTIVATED
Enroll Enrolls Edge device in the network
Delist Delists Edge device in the network
Activate Activates Edge device
Deactivate Deactivates Edge device
RequestSRTConnectionURI Request an SRT connection URI
Return
- URI (s): URI to use to access SRT streaming.
To build from sources follow the procedure described in
There are dummy files in examples folder. These are helper examples to implement edge/hub/arbiter.
- Run arbiter-dummy : Arbiter's status will go to activated status automatically. It will wait for the messages from edge/hub to enroll/activate.
- Run edge-dummy/hub-dummy : It will send enroll/activate to arbiter-dummy, and will be activated status after get response from arbiter-dummy.
- Input user-command : arbiter-dummy will send the sample user command according to user's key input. If you want to check what kind command you can use, try "h".
Experimental versions of Chamge are daily generated in launchpad.
$ sudo add-apt-repository ppa:hwangsaeul/nightly
$ sudo apt-get update
$ sudo apt-get install libchamge1 libchamge-dev chamge-tools