问题
I'm new to Kurento media server, I am trying to send an event from kurento media server to the java application which I have.
I have created an event using the following steps:
edited the interface
json file:
"events": [{
"properties": [{
"name": "Total",
"doc": "Total",
"type": "float"
}],
"extends": "Media",
"name": "TotalDetected",
"doc": "Total Detected."
}]
then in my .hpp
file:
sigc::signal<void, TotalDetected> signalTotalDetected;
and in my .cpp
file:
try {
GST_WARNING ("Sending Event: TotalDetected");
TotalDetected event (shared_from_this(), "Total-detected", total);
signalTotalDetected (event);
GST_WARNING ("Sent Event: TotalDetected");
} catch (std::bad_weak_ptr &e) {
GST_WARNING ("EXCEPTION: Total detected ");
}
and in my java server I have registered to the event using:
totalFilter.addTotalDetectedListener(new EventListener<TotalDetectedEvent>() {
@Override
public void onEvent(TotalDetectedEvent event) {
log.info("\n\nTotal Detected Event By:"+event.getTotal());
}
});
but after doing all this, I am unable to receive any event from kms, I looked into the kms logs I am getting the logs of event being sent but I am not getting any event on java server side.
Is there anything I am missing in the code?
Edit 1: on eclipse console I get this log
[KurentoClient] Req-> { "id":17, "method":"subscribe", "params":{ "object":"fcffbeb5-4ee0-4b49-ba05-a7bc7e716b2f_kurento.MediaPipeline/cb218dbd-0d4a-48cd-88ee-e6ecaf9f4350_vadcustomfilter.VADCustomFilter", "type":"TotalReceived", "sessionId":"67361dad-bce7-4ad6-a4ce-a26090190bad" }, "jsonrpc":"2.0" }
[KurentoClient] <-Res { "id":17, "result":{ "value":"0f2a346b-49f1-4867-aa7d-45ac3780bbbd", "sessionId":"67361dad-bce7-4ad6-a4ce-a26090190bad" }, "jsonrpc":"2.0" }
Edit 2:
Following is the output of dpkg -l | egrep -i "kurento|nice|kms"
ii gstreamer0.10-nice:amd64 -> 0.1.4-1 ii gstreamer1.0-nice:amd64 -> 0.1.4-1 ii gstreamer1.5-nice:amd64 -> 0.1.13.1~20160224182402.77.g7bbb87a.trusty ii kms-cmake-utils -> 1.3.0.trusty ii kms-core-6.0 -> 6.4.0.trusty ii kms-core-6.0-dev -> 6.4.0.trusty ii kms-elements-6.0 -> 6.4.0.trusty ii kms-elements-6.0-dev -> 6.4.0.trusty ii kms-filters-6.0 -> 6.4.0.trusty ii kms-filters-6.0-dev -> 6.4.0.trusty ii kms-jsonrpc-1.0 -> 1.1.0.trusty ii kms-jsonrpc-1.0-dev -> 1.1.0.trusty ii kmsjsoncpp -> 1.6.3~20160119154506.38.g263929e.trusty ii kmsjsoncpp-dev -> 1.6.3~20160119154506.38.g263929e.trusty ii kurento-media-server-6.0 -> 6.4.0.trusty ii kurento-media-server-6.0-dev -> 6.4.0.trusty ii kurento-module-creator-4.0 -> 4.0.4.trusty ii libnice-dev -> 0.1.7.1~20160119154918.10.ge060eb5.trusty ii libnice10:amd64 -> 0.1.7.1~20160119154918.10.ge060eb5.trusty
回答1:
Try upgrading your libnice version to 0.1.13 this is the source of the errors with some ice candidates. Let's see if this solves the issue with the events.
回答2:
Everything seems OK. You just need to be sure if the event is fired.
If you change warnings by errors you will be able to see your log without configuring anything. This way you can know if the event is being fired.
If you can't see your logs, the you may have a problem firing the event from GStreamer element or maybe registering for the signal from cpp.
来源:https://stackoverflow.com/questions/35885158/events-not-reaching-kurento-java-server