Skip to content

Commit

Permalink
276 Remove any calls to CustomVCL class
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandoquesada committed Nov 21, 2024
1 parent dee7103 commit b2b01c6
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 180 deletions.
37 changes: 0 additions & 37 deletions include/vcl/CustomVCL.h

This file was deleted.

5 changes: 3 additions & 2 deletions include/vcl/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* The MIT License
*
* @copyright Copyright (c) 2017 Intel Corporation
* @copyright Copyright (c) 2024 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -29,9 +29,10 @@

#pragma once

#include <string>
#include <time.h>
#include <vector>
#include <cstdint>
#include <string>

namespace VCL {

Expand Down
3 changes: 1 addition & 2 deletions src/BlobCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* The MIT License
*
* @copyright Copyright (c) 2017 Intel Corporation
* @copyright Copyright (c) 2024 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"),
Expand All @@ -30,7 +30,6 @@
*/

#pragma once
#include "vcl/CustomVCL.h"
#include "vcl/Image.h"
#include <mutex>
#include <string>
Expand Down
16 changes: 0 additions & 16 deletions src/ImageCommand.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,6 @@ int ImageCommand::enqueue_operations(VCL::Image &img, const Json::Value &ops,
}
} else if (type == "userOp") {
img.userOperation(get_value<Json::Value>(op, "options"));
} else if (type == "custom") {
VCL::Image *tmp_image = new VCL::Image(img, true);
try {
if (custom_vcl_function(img, op) != 0) {
img.deep_copy_cv(tmp_image->get_cvmat(
true)); // function completed but error detected
delete tmp_image;
return -1;
}
} catch (...) {
img.deep_copy_cv(
tmp_image->get_cvmat(true)); // function threw exception
delete tmp_image;
return -1;
}
delete tmp_image;
} else {
throw ExceptionCommand(ImageError, "Operation not defined");
return -1;
Expand Down
1 change: 0 additions & 1 deletion src/ImageCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
*/

#pragma once
#include "vcl/CustomVCL.h"
#include "vcl/Image.h"
#include <mutex>
#include <string>
Expand Down
3 changes: 1 addition & 2 deletions src/vcl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ add_library(vcl SHARED
TDBSparseDescriptorSet.cc
utils.cc
Video.cc
CustomVCL.cc
RemoteConnection.cc
../../utils/src/timers/TimerMap.cc
../../utils/src/timers/TimerMap.cc
)
link_directories( /usr/local/lib )
target_link_libraries(vcl lapack faiss tiledb flinng avformat avcodec swscale ${OpenCV_LIBS})
Expand Down
111 changes: 0 additions & 111 deletions src/vcl/CustomVCL.cc

This file was deleted.

6 changes: 1 addition & 5 deletions src/vcl/Image.cc
Original file line number Diff line number Diff line change
Expand Up @@ -538,10 +538,6 @@ void Image::UserOperation::operator()(Image *img) {
zmq::context_t context(1);
zmq::socket_t socket(context, zmq::socket_type::req);

// This is setting a timeout for avoiding infinite loops
socket.setsockopt(ZMQ_SNDTIMEO, 10000); // milliseconds
socket.setsockopt(ZMQ_RCVTIMEO, 30000);

std::string port = _options["port"].asString();
std::string address = "tcp://127.0.0.1:" + port;

Expand Down Expand Up @@ -601,7 +597,7 @@ void Image::UserOperation::operator()(Image *img) {
} else {
if (response == "") {
std::string errorMessage =
"UserOperation error: Timeout, no response from the server";
"UserOperation error: empty response from the server";
std::cout << errorMessage << std::endl;
throw VCLException(SystemNotFound, errorMessage);
}
Expand Down
5 changes: 1 addition & 4 deletions src/vcl/Video.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1252,9 +1252,6 @@ void Video::UserOperation::operator()(Video *video, cv::Mat &frame,

zmq::context_t context(1);
zmq::socket_t socket(context, zmq::socket_type::req);
// This is setting a timeout for avoiding infinite loops
socket.setsockopt(ZMQ_SNDTIMEO, 10000); // milliseconds
socket.setsockopt(ZMQ_RCVTIMEO, 30000);

std::string port = _options["port"].asString();
std::string address = "tcp://127.0.0.1:" + port;
Expand Down Expand Up @@ -1296,7 +1293,7 @@ void Video::UserOperation::operator()(Video *video, cv::Mat &frame,
} else {
if (response == "") {
std::string errorMessage =
"UserOperation error: Timeout, no response from the server";
"UserOperation error: empty response from the server";
std::cout << errorMessage << std::endl;
throw VCLException(SystemNotFound, errorMessage);
}
Expand Down

0 comments on commit b2b01c6

Please sign in to comment.