问题
What i do:
1.I generated so for the kms-opencv-plugin-sample(using link https://github.com/Kurento/kms-opencv-plugin-sample.)
2.To call the opencv-plugin from client-js,i modified crowddetector-client-js "https://github.com/Kurento/kurento-tutorial-js/tree/master/kurento-crowddetector"(renamed the folder name to kurento-module-opencvpluginsample).
3.Modification i have done:
1.Updated the opencv js file path in the index.html
2.Replaced the "kurento-module-crowddetector" to "kurento-module-opencvpluginsample"(with the newly generated JS files)
3.Modified the module name in the index.js
4.Removed the old reference to crowddetector.
4.I started the "KurentoMediaServer" and then "http-server",load the page in browser
http://10.10.1.3:8080/index.html?ws_uri=ws://10.10.1.3:8888/kurento#
5.It works successsfully.
6.Also i tried with replace the opencv face detection code with the default given code in opencv-plugin-sample,It also works.
What i need to know:
1.What i need to do,if i want to add extra arguments in the process()?
2.What i have to do if i want to add another method in the cpp?
回答1:
Process method cannot be be modified, you need to have object attributes modified by properties or methods in kmd.json
file. This way an API is created that can be accessed from remote clients.
Just modify kmd.json
, this will generate the basic stub in c++. Solve compilation issues and then use this properties according to your needs.
See how this method works in example filter. The same can be also done with properties instead of methods.
来源:https://stackoverflow.com/questions/36015747/how-to-pass-extra-parameter-in-to-kms-plugin