From d711d6482264e848abca5354b74b7b9a8dc11bb8 Mon Sep 17 00:00:00 2001 From: Victor Hidalgo Date: Fri, 22 Apr 2016 08:34:20 +0200 Subject: [PATCH] Bug Fixed: to send the events to the server --- .../nubomedia/nuboEyeJava/NuboEyeJavaHandler.java | 8 ++++---- .../nubo-eye-detector/src/gst-plugins/kmseyedetect.cpp | 4 ++-- .../nubo-face-detector/src/gst-plugins/kmsfacedetect.cpp | 4 ++-- .../implementation/objects/NuboFaceDetectorImpl.cpp | 3 ++- .../src/gst-plugins/kmsmouthdetect.cpp | 4 ++-- .../nubo-nose-detector/src/gst-plugins/kmsnosedetect.cpp | 3 +-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/NuboEyeJava/src/main/java/com/visual_tools/nubomedia/nuboEyeJava/NuboEyeJavaHandler.java b/apps/NuboEyeJava/src/main/java/com/visual_tools/nubomedia/nuboEyeJava/NuboEyeJavaHandler.java index 14741a6..eb5d265 100644 --- a/apps/NuboEyeJava/src/main/java/com/visual_tools/nubomedia/nuboEyeJava/NuboEyeJavaHandler.java +++ b/apps/NuboEyeJava/src/main/java/com/visual_tools/nubomedia/nuboEyeJava/NuboEyeJavaHandler.java @@ -116,8 +116,8 @@ public void onEvent(OnIceCandidateEvent event) { webRtcEndpoint.connect(eye); eye.connect(webRtcEndpoint); - //eye.activateServerEvents(1, 3000); - //addEyeListener(); + eye.activateServerEvents(1, 3000); + addEyeListener(); // SDP negotiation (offer and answer) String sdpOffer = jsonMessage.get("sdpOffer").getAsString(); String sdpAnswer = webRtcEndpoint.processOffer(sdpOffer); @@ -151,7 +151,7 @@ private void notEnoughResources(WebSocketSession session) { release(session); } - /* private void addEyeListener() + private void addEyeListener() { eye.addOnEyeListener(new EventListener() { @Override @@ -160,7 +160,7 @@ public void onEvent(OnEyeEvent event) System.out.println("---------------------Eyes Detected---------------------"); } }); - }*/ + } private void setVisualization(WebSocketSession session,JsonObject jsonObject) { diff --git a/modules/nubo_eye/nubo-eye-detector/src/gst-plugins/kmseyedetect.cpp b/modules/nubo_eye/nubo-eye-detector/src/gst-plugins/kmseyedetect.cpp index 8a82d63..2dd7ebc 100644 --- a/modules/nubo_eye/nubo-eye-detector/src/gst-plugins/kmseyedetect.cpp +++ b/modules/nubo_eye/nubo-eye-detector/src/gst-plugins/kmseyedetect.cpp @@ -893,8 +893,8 @@ kms_eye_detect_transform_frame_ip (GstVideoFilter *filter, kms_eye_detect_process_frame(eye_detect,width,height,scale_o2f, scale_o2e,scale_f2e,frame); - if (1==eye_detect->priv->meta_data) - kms_eye_send_event(eye_detect,frame); + + kms_eye_send_event(eye_detect,frame); gst_buffer_unmap (frame->buffer, &info); diff --git a/modules/nubo_face/nubo-face-detector/src/gst-plugins/kmsfacedetect.cpp b/modules/nubo_face/nubo-face-detector/src/gst-plugins/kmsfacedetect.cpp index 559dac1..fa174b0 100644 --- a/modules/nubo_face/nubo-face-detector/src/gst-plugins/kmsfacedetect.cpp +++ b/modules/nubo_face/nubo-face-detector/src/gst-plugins/kmsfacedetect.cpp @@ -214,6 +214,7 @@ static void kms_face_send_event(KmsFaceDetect *face_detect,GstVideoFrame *frame, if ((int)fd->size()>0) { + gettimeofday(&end,NULL); current_t= ((end.tv_sec * 1000.0) + ((end.tv_usec)/1000.0)); diff_time = current_t - face_detect->priv->time_events_ms; @@ -610,8 +611,7 @@ kms_face_detect_transform_frame_ip (GstVideoFilter *filter, kms_face_detect_process_frame(face_detect,width,height,scale,frame); - if (1 == face_detect->priv->meta_data) //delete this line to use metadata - kms_face_send_event(face_detect,frame,width_to_process); + kms_face_send_event(face_detect,frame,width_to_process); KMS_FACE_DETECT_UNLOCK (face_detect); diff --git a/modules/nubo_face/nubo-face-detector/src/server/implementation/objects/NuboFaceDetectorImpl.cpp b/modules/nubo_face/nubo-face-detector/src/server/implementation/objects/NuboFaceDetectorImpl.cpp index c1632da..403e32f 100644 --- a/modules/nubo_face/nubo-face-detector/src/server/implementation/objects/NuboFaceDetectorImpl.cpp +++ b/modules/nubo_face/nubo-face-detector/src/server/implementation/objects/NuboFaceDetectorImpl.cpp @@ -69,7 +69,8 @@ void NuboFaceDetectorImpl::onFace (gchar *message) bool register_completed=true; int i=0; - + + try { split_message(message,del1,faces); diff --git a/modules/nubo_mouth/nubo-mouth-detector/src/gst-plugins/kmsmouthdetect.cpp b/modules/nubo_mouth/nubo-mouth-detector/src/gst-plugins/kmsmouthdetect.cpp index d87cc63..8c403db 100644 --- a/modules/nubo_mouth/nubo-mouth-detector/src/gst-plugins/kmsmouthdetect.cpp +++ b/modules/nubo_mouth/nubo-mouth-detector/src/gst-plugins/kmsmouthdetect.cpp @@ -704,8 +704,8 @@ kms_mouth_detect_transform_frame_ip (GstVideoFilter *filter, kms_mouth_detect_process_frame(mouth_detect,width,height,scale_f2m, scale_m2o,scale_o2f,frame); - if (1==mouth_detect->priv->meta_data) - kms_mouth_send_event(mouth_detect,frame); + + kms_mouth_send_event(mouth_detect,frame); KMS_MOUTH_DETECT_UNLOCK (mouth_detect); diff --git a/modules/nubo_nose/nubo-nose-detector/src/gst-plugins/kmsnosedetect.cpp b/modules/nubo_nose/nubo-nose-detector/src/gst-plugins/kmsnosedetect.cpp index 098b9ca..460872e 100644 --- a/modules/nubo_nose/nubo-nose-detector/src/gst-plugins/kmsnosedetect.cpp +++ b/modules/nubo_nose/nubo-nose-detector/src/gst-plugins/kmsnosedetect.cpp @@ -716,8 +716,7 @@ kms_nose_detect_transform_frame_ip (GstVideoFilter *filter, KMS_NOSE_DETECT_UNLOCK (nose_detect); - if (1==nose_detect->priv->meta_data) - kms_nose_send_event(nose_detect,frame); + kms_nose_send_event(nose_detect,frame); gst_buffer_unmap (frame->buffer, &info);