diff utilities/json-to-capnp.cpp @ 44:a98ef4c2616b

Make base64/text selectable when serialising process and feature blocks; add base64 version as an output format for vampipe-convert; make VamPipePluginLibrary switch to returning base64 encoding as soon as it is fed any as input
author Chris Cannam <c.cannam@qmul.ac.uk>
date Thu, 08 Sep 2016 15:27:48 +0100
parents 55d69b26d4db
children f4244a2d55ac
line wrap: on
line diff
--- a/utilities/json-to-capnp.cpp	Wed Aug 24 10:50:40 2016 +0100
+++ b/utilities/json-to-capnp.cpp	Thu Sep 08 15:27:48 2016 +0100
@@ -45,6 +45,7 @@
     Json j = json_input(input);
     string type = j["type"].string_value();
     Json payload = j["payload"];
+    VampJson::BufferSerialisation serialisation;
 
     if (type == "configurationrequest") {
 	auto req = message.initRoot<ConfigurationRequest>();
@@ -60,12 +61,12 @@
     } else if (type == "feature") {
 	auto f = message.initRoot<Feature>();
 	VampnProto::buildFeature
-	    (f, VampJson::toFeature(payload));
+	    (f, VampJson::toFeature(payload, serialisation));
 
     } else if (type == "featureset") {
 	auto fs = message.initRoot<FeatureSet>();
 	VampnProto::buildFeatureSet
-	    (fs, VampJson::toFeatureSet(payload));
+	    (fs, VampJson::toFeatureSet(payload, serialisation));
 
     } else if (type == "loadrequest") {
 	auto req = message.initRoot<LoadRequest>();
@@ -102,7 +103,7 @@
 	auto p = message.initRoot<ProcessRequest>();
 	PreservingPluginHandleMapper mapper;
 	VampnProto::buildProcessRequest
-	    (p, VampJson::toProcessRequest(payload, mapper), mapper);
+	    (p, VampJson::toProcessRequest(payload, mapper, serialisation), mapper);
 
     } else if (type == "realtime") {
 	auto b = message.initRoot<RealTime>();