JSON File Based Configuration
This is the more versatile means of configuring Stream-Server. Any number of inputs and outputs may be created and connected.
A JSON formatted file must be referenced at startup using the -c, --config option. The JSON file is broken into sections, one per component to initialize.
Here is a sample test.json configuration file:
{
"Inputs": [{
"name": "CrossProcInput1",
"type": "CrossProcInput",
"output": "EGLOutputOutput1",
"socket": "/tmp/ss/ss1"
},{
"name": "CrossPartInput1",
"type": "CrossPartInput",
"output": "EGLOutputOutput2",
"port": "8889"
}],
"Outputs": [{
"name": "EGLOutputOutput1",
"type": "EGLOutputOutput",
"windowSize": "1920X1080",
"dispNo": "1",
"layerNo": "0"
},{
"name": "EGLOutputOutput2",
"type": "EGLOutputOutput",
"windowSize": "1080X720",
"dispNo": "1",
"layerNo": "1"
}]
}
There are two input and two output plugins that are mentioned in the test.json configuration file above. Between the two input plugins, one is of type CrossProcInput and the second is of type CrossPartInput, named CrossProcInput1 and CrossPartInput1, respectively. For the output plugins, both plugins have the same type, EGLOutputOutput, and are named EGLOutputOutput1 and EGLOutputOutput2.
For the input plugin, there is a parameter called output that tells the Stream-Server to form mapping between input and output plugins. CrossProcInput1 and CrossPartInput1 connect to EGLOutputOutput1 and EGLOutputOutput2, respectively.
The CrossprocInput1 plugin uses path /tmp/ss to create a socket name ss1 to listen for the incoming cross-process EGLStream producer client's connect request. In the same manner, CrossPartInput1 uses port number 8889 to bind a socket and uses this socket to listen for the incoming cross-partition EGLStream producer client's connect request.
- Create socket path on VM0:
$ mkdir –p /tmp/ss/ - Run Stream-Server with this configuration file on
VM0:
$ stream-server -c test.json - Run first producer on
VM0:
$ ./gears –eglstreamsocket /tmp/ss/ss1 -1 - Run second producer on VM1, assuming the IP of VM0 as seen by VM1 is
12.0.0.1:
$ ./gears –proctype producer –ip 12.0.0.1 –port 8889 -1
The first gears instance is now connected to CrossProcInput1, which in turn is connected to EGLOutputOutput1. The parameters windowsize, dispNo, and layerNo of EGLOutputOutput1 determine the display number and overlay layer number of connected displays on which a window of dimension windowsize appears.
The first gears instance appears in a window of dimension 1920 x 1080 on the 0th layer of 0th display. Likewise, the second gears instance appears in a window of dimensions 1080 x 720 on the 1st layer of 0th display.
There are many more parameters for different kinds of plugins, which are explained in the table below.
| Plugin | Parameters | Optional | Description | Example |
|---|---|---|---|---|
|
For All Plugins |
name |
Required |
Name of the plugin. |
"name": "EGLOutputOutput1" |
|
type |
Required |
Type of the plugin. |
"type": "EGLOutputOutput" |
|
|
For All Input Plugins |
output |
Required |
Name of the output plugin to connect with this input plugin. |
"output": "EGLOutputOutput1" |
|
For All Output Plugins |
windowSize |
Optional |
Size of window to appear on the display or to send out through EGLStream. |
"windowSize": "1920X1080" |
|
CrossPartInput |
port |
Required |
Port number to listen for incoming EGLStream producer. |
{ "name": " CrossPartInput1", "type": " CrossPartInput ", "output": "ImageFileWriter", "port": "8889" } |
|
CrossProcInput |
socketName |
Required |
Socket path to listen for incoming EGLStream producer. This socket path must be created explicitly. |
{ "name": " CrossProcInput1", "type": " CrossProcInput ", "output": "ImageFileWriter", "socketName": "/tmp/ss/ss1" } |
|
TestInput |
size |
Required |
Size of frames to be generated. |
{ "name": " TestInput1", "type": " TestInput ", "output": "ImageFileWriter", "size": "600X400", "frames": "10" } |
|
frames |
Required |
Number of frames to be generated. |
||
|
EGLOutputOutput |
dispNo |
Optional |
Number of displays to show window. |
{ "name": "EGLOutputOutput1", "type": "EGLOutputOutput", "windowSize": "1920X1080", "dispNo": "1", "layerNo": "0" } |
|
layerNo |
Optional |
Number of layers to show window. |
||
|
ImageFileWriter |
frames |
Required |
Number of frames to dump of disk. |
{ "name": "ImageFileWriter1", "type": "ImageFileWriter", "windowSize": "1920X1080", "frames": "10", "outpath": "/tmp/ss/out" } |
|
outpath |
Required |
Directory path to dump frames into. This path must be explicitly created prior to invoking Stream-Server. |
||
|
ScreenOutput |
dispNo |
Optional |
Specifies which display to show Screen window on. |
{ "name": "ScreenOutput1", "type": "ScreenOutput", "windowSize": "1920X1080", "dispNo": "1", "layerNo": "0" } |
|
layerNo |
Optional |
Specifies which layer number to show Screen window on. |
||
|
WaylandOutput |
ivisurfaceid |
Optional |
ID number of an IVI surface when used with ivi-shell. |
{ "name": "WaylandOutput1", "type": "WaylandOutput", "windowSize": "1920X1080", "x": "100", "y": "100" } |
|
x |
Optional |
x offset (ivi-shell only) |
||
|
y |
Optional |
y offset (ivi-shell only) |
||
|
CrossProcOutput |
socketName |
Required |
Socket path on which cross-process consumer client is listening. |
{ "name": "CrossProcOutput1", "type": "CrossProcOutput", "windowSize": "1920X1080", "socketName": "/tmp/ss/ss1" } |
|
CrossPartOutput |
ip |
Required |
IP address VM where cross- partition consumer client is running. |
{ "name": "CrossPartOutput1", "type": "CrossProcOutput", "windowSize": "1920X1080", "ip": "12.1", "port": "8888" } |
|
port |
Required |
Port number on which cross-partition consumer client is listening. |
Every plugin has a name and type attribute associated with it that uniquely identifies it in the config object. The other options for the plugin are either optional or required, as indicated in the table.