Skip to content

Commit 4d84c46

Browse files
committed
Add JSON serialize functionality
There was only possibility to serialize topology to gstreamer format. Added JSON serialize functionality. JSON format is is compatible with VAS. Signed-off-by: Emilia Dominiak <emilia.dominiak@intel.com>
1 parent f9986c8 commit 4d84c46

File tree

18 files changed

+386
-29
lines changed

18 files changed

+386
-29
lines changed

org.sofproject.alsa.topo/.classpath

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
4+
<accessrules>
5+
<accessrule kind="accessible" pattern="javafx/**"/>
6+
</accessrules>
7+
</classpathentry>
48
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
59
<classpathentry kind="src" path="src"/>
610
<classpathentry kind="output" path="bin"/>

org.sofproject.alsa.topo/src/org/sofproject/alsa/topo/model/AlsaTopoGraph.java

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -490,37 +490,16 @@ public void serialize() throws CoreException, IOException {
490490
ByteArrayOutputStream os = new ByteArrayOutputStream();
491491

492492
Writer writer = new BufferedWriter(new OutputStreamWriter(os));
493-
// tlv-s
494493
tlvs.serialize(writer);
495-
496-
// vendor tokens
497494
vTokensIndex.serialize(writer);
498-
499-
// vendor tuples
500495
vTuplesIndex.serialize(writer);
501-
502-
// data
503496
dataIndex.serialize(writer);
504-
505-
// control bytes
506497
controlBytes.serialize(writer);
507-
508-
// control mixers
509498
controlMixers.serialize(writer);
510-
511-
// pcm capabilities
512499
pcmCapsIndex.serialize(writer);
513-
514-
// pcm-s
515500
pcms.serialize(writer);
516-
517-
// be-s
518501
beIndex.serialize(writer);
519-
520-
// hw-configs
521502
hwConfigs.serialize(writer);
522-
523-
// pipelines (widgets + graphs)
524503
pipelines.serialize(writer);
525504
interConnections.serialize(writer);
526505

@@ -536,7 +515,35 @@ public void serialize() throws CoreException, IOException {
536515
}
537516
outputFile.getParent().refreshLocal(1, null);
538517
}
539-
518+
519+
@Override
520+
public String getPipelineString() {
521+
try {
522+
ByteArrayOutputStream os = new ByteArrayOutputStream();
523+
Writer writer = new BufferedWriter(new OutputStreamWriter(os));
524+
tlvs.serialize(writer);
525+
vTokensIndex.serialize(writer);
526+
vTuplesIndex.serialize(writer);
527+
dataIndex.serialize(writer);
528+
controlBytes.serialize(writer);
529+
controlMixers.serialize(writer);
530+
pcmCapsIndex.serialize(writer);
531+
pcms.serialize(writer);
532+
beIndex.serialize(writer);
533+
hwConfigs.serialize(writer);
534+
pipelines.serialize(writer);
535+
interConnections.serialize(writer);
536+
537+
writer.close();
538+
os.close();
539+
540+
return os.toString();
541+
} catch (IOException e) {
542+
e.printStackTrace();
543+
return null;
544+
}
545+
}
546+
540547
@Override
541548
public IRemoteOpsProvider getRemoteOpsProvider() {
542549
return null; // no extra ops

org.sofproject.alsa.topo/src/org/sofproject/alsa/topo/model/AlsaTopoPipeline.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@
2929

3030
package org.sofproject.alsa.topo.model;
3131

32+
import java.io.BufferedWriter;
33+
import java.io.ByteArrayOutputStream;
3234
import java.io.IOException;
35+
import java.io.OutputStreamWriter;
3336
import java.io.Writer;
3437
import java.util.Collection;
3538
import java.util.HashMap;

org.sofproject.fw.ui/.classpath

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
4+
<accessrules>
5+
<accessrule kind="accessible" pattern="javafx/**"/>
6+
</accessrules>
7+
</classpathentry>
48
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
59
<classpathentry kind="src" path="src"/>
610
<classpathentry kind="output" path="bin"/>

org.sofproject.gst.topo/.classpath

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
4+
<accessrules>
5+
<accessrule kind="accessible" pattern="javafx/**"/>
6+
</accessrules>
7+
</classpathentry>
48
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
9+
<classpathentry exported="true" kind="lib" path="lib/jackson-annotations-2.10.1.jar"/>
10+
<classpathentry exported="true" kind="lib" path="lib/jackson-core-2.10.1.jar"/>
11+
<classpathentry exported="true" kind="lib" path="lib/jackson-databind-2.10.1.jar"/>
512
<classpathentry kind="src" path="src"/>
613
<classpathentry kind="output" path="bin"/>
714
</classpath>

org.sofproject.gst.topo/META-INF/MANIFEST.MF

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,8 @@ Require-Bundle: org.sofproject.core,
1010
org.sofproject.ui,
1111
org.sofproject.topo.ui,
1212
com.jcraft.jsch
13+
Bundle-ClassPath: lib/jackson-annotations-2.10.1.jar,
14+
lib/jackson-core-2.10.1.jar,
15+
lib/jackson-databind-2.10.1.jar,
16+
.
17+
Export-Package: org.sofproject.gst.json

org.sofproject.gst.topo/build.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@ source.. = src/
22
output.. = bin/
33
bin.includes = META-INF/,\
44
.,\
5-
plugin.xml
5+
plugin.xml,\
6+
lib/jackson-annotations-2.10.1.jar,\
7+
lib/jackson-core-2.10.1.jar,\
8+
lib/jackson-databind-2.10.1.jar
66.5 KB
Binary file not shown.
340 KB
Binary file not shown.
1.34 MB
Binary file not shown.

0 commit comments

Comments
 (0)