Merge pull request #22935 from alalek:gapi_error
authorAlexander Alekhin <alexander.a.alekhin@gmail.com>
Mon, 19 Dec 2022 06:05:15 +0000 (09:05 +0300)
committerGitHub <noreply@github.com>
Mon, 19 Dec 2022 06:05:15 +0000 (06:05 +0000)
G-API: replace GAPI_Assert() with 'false' and '0' to GAPI_Error()

* gapi: GAPI_Error() macro

* gapi: replace GAPI_Assert() with 'false' and '0' to GAPI_Error()

* build: eliminate 'unreachable code' after CV_Error() (MSVC 2015)

* build: eliminate 'unreachable code' warning for MSVS 2015/2017

- observed in constructors stubs with throwing exception

72 files changed:
modules/gapi/CMakeLists.txt
modules/gapi/include/opencv2/gapi/cpu/gcpukernel.hpp
modules/gapi/include/opencv2/gapi/fluid/gfluidkernel.hpp
modules/gapi/include/opencv2/gapi/garray.hpp
modules/gapi/include/opencv2/gapi/gopaque.hpp
modules/gapi/include/opencv2/gapi/infer.hpp
modules/gapi/include/opencv2/gapi/media.hpp
modules/gapi/include/opencv2/gapi/own/assert.hpp
modules/gapi/include/opencv2/gapi/rmat.hpp
modules/gapi/include/opencv2/gapi/s11n.hpp
modules/gapi/include/opencv2/gapi/s11n/base.hpp
modules/gapi/include/opencv2/gapi/stereo.hpp
modules/gapi/include/opencv2/gapi/streaming/cap.hpp
modules/gapi/misc/python/pyopencv_gapi.hpp
modules/gapi/misc/python/python_bridge.hpp
modules/gapi/src/api/gbackend.cpp
modules/gapi/src/api/gframe.cpp
modules/gapi/src/api/gproto.cpp
modules/gapi/src/api/s11n.cpp
modules/gapi/src/backends/common/gcompoundkernel.cpp
modules/gapi/src/backends/common/serialization.cpp
modules/gapi/src/backends/common/serialization.hpp
modules/gapi/src/backends/cpu/gcpustereo.cpp
modules/gapi/src/backends/fluid/gfluidbackend.cpp
modules/gapi/src/backends/fluid/gfluidbuffer.cpp
modules/gapi/src/backends/ie/giebackend.cpp
modules/gapi/src/backends/ie/giebackend.hpp
modules/gapi/src/backends/oak/goakbackend.cpp
modules/gapi/src/backends/onnx/gonnxbackend.cpp
modules/gapi/src/backends/onnx/gonnxbackend.hpp
modules/gapi/src/backends/python/gpythonbackend.cpp
modules/gapi/src/backends/streaming/gstreamingbackend.cpp
modules/gapi/src/compiler/gcompiler.cpp
modules/gapi/src/compiler/gislandmodel.cpp
modules/gapi/src/compiler/gislandmodel.hpp
modules/gapi/src/compiler/gmodelbuilder.cpp
modules/gapi/src/compiler/passes/dump_dot.cpp
modules/gapi/src/compiler/passes/intrin.cpp
modules/gapi/src/compiler/passes/pattern_matching.cpp
modules/gapi/src/compiler/transactions.hpp
modules/gapi/src/executor/gexecutor.cpp
modules/gapi/src/executor/gstreamingexecutor.cpp
modules/gapi/src/streaming/gstreamer/gstreamer_media_adapter.cpp
modules/gapi/src/streaming/gstreamer/gstreamerenv.cpp
modules/gapi/src/streaming/gstreamer/gstreamerpipeline.cpp
modules/gapi/src/streaming/gstreamer/gstreamersource.cpp
modules/gapi/src/streaming/onevpl/accelerators/accel_policy_cpu.cpp
modules/gapi/src/streaming/onevpl/accelerators/accel_policy_dx11.cpp
modules/gapi/src/streaming/onevpl/accelerators/accel_policy_va_api.cpp
modules/gapi/src/streaming/onevpl/accelerators/dx11_alloc_resource.cpp
modules/gapi/src/streaming/onevpl/accelerators/surface/dx11_frame_adapter.cpp
modules/gapi/src/streaming/onevpl/cfg_param_device_selector.cpp
modules/gapi/src/streaming/onevpl/cfg_params_parser.cpp
modules/gapi/src/streaming/onevpl/data_provider_defines.hpp
modules/gapi/src/streaming/onevpl/demux/async_mfp_demux_data_provider.cpp
modules/gapi/src/streaming/onevpl/engine/decode/decode_engine_legacy.cpp
modules/gapi/src/streaming/onevpl/engine/preproc/preproc_dispatcher.cpp
modules/gapi/src/streaming/onevpl/engine/preproc/preproc_engine.cpp
modules/gapi/src/streaming/onevpl/engine/preproc/utils.cpp
modules/gapi/src/streaming/onevpl/engine/preproc_engine_interface.cpp
modules/gapi/src/streaming/onevpl/engine/transcode/transcode_engine_legacy.cpp
modules/gapi/src/streaming/onevpl/file_data_provider.cpp
modules/gapi/src/streaming/onevpl/source.cpp
modules/gapi/src/streaming/onevpl/source_priv.cpp
modules/gapi/test/common/gapi_core_tests.hpp
modules/gapi/test/common/gapi_operators_tests.hpp
modules/gapi/test/common/gapi_stereo_tests_inl.hpp
modules/gapi/test/common/gapi_tests_common.hpp
modules/gapi/test/common/gapi_video_tests_common.hpp
modules/gapi/test/infer/gapi_infer_onnx_test.cpp
modules/gapi/test/s11n/gapi_s11n_tests.cpp
modules/gapi/test/streaming/gapi_streaming_tests.cpp

index a25af7a5c2adbc89e2a4746c2cb9e69b863fc3d8..3deb518d6288924776e6f285bf2ce76599ebf724 100644 (file)
@@ -41,6 +41,9 @@ if(MSVC)
     # and IE deprecated code warning C4996
     ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4503 /wd4996)
   endif()
+  if(MSVC_VERSION LESS 1920)  # MSVS 2015/2017
+    ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702)  # 'unreachable code'
+  endif()
 endif()
 
 file(GLOB gapi_ext_hdrs
index ff3ee45ed3a8cf3b933b06ae50d8326c979a54c3..eb5f7847478c658fe50c202296d161ec2ec5f380 100644 (file)
@@ -8,9 +8,9 @@
 #ifndef OPENCV_GAPI_GCPUKERNEL_HPP
 #define OPENCV_GAPI_GCPUKERNEL_HPP
 
-#ifdef _MSC_VER
-#pragma warning(disable: 4702)  // "Unreachable code"
-// on postprocess(...) call inside OCVCallHelper
+#if defined _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 4702)  // "Unreachable code" on postprocess(...) call inside OCVCallHelper
 #endif
 
 #include <functional>
@@ -535,4 +535,8 @@ gapi::cpu::GOCVFunctor gapi::cpu::ocv_kernel(const Callable& c)
 
 } // namespace cv
 
+#if defined _MSC_VER
+#pragma warning(pop)
+#endif
+
 #endif // OPENCV_GAPI_GCPUKERNEL_HPP
index 92f1ccc87f6f5d36c140b00b34a3643c2b2c50f4..c3ae9dfdd6e02ac8a090f0fff6b918b054f09645 100644 (file)
@@ -248,11 +248,11 @@ struct scratch_helper<false, Impl, Ins...>
                           const cv::GArgs     &,
                           gapi::fluid::Buffer &)
     {
-        GAPI_Assert(false);
+        GAPI_Error("InternalError");
     }
     static void help_reset(gapi::fluid::Buffer &)
     {
-        GAPI_Assert(false);
+        GAPI_Error("InternalError");
     }
 };
 
index 55f4d11b122314a092b47112615dcca1c2a738e8..b6aa715518049e08a8a183eefa10a20aea09b80a 100644 (file)
@@ -177,7 +177,7 @@ namespace detail
             {
                 util::get<rw_own_t>(m_ref).clear();
             }
-            else GAPI_Assert(false); // shouldn't be called in *EXT modes
+            else GAPI_Error("InternalError"); // shouldn't be called in *EXT modes
         }
 
         // Obtain a WRITE reference to underlying object
index f77795c5069c45498403e367b07dc1b6be712adb..1d12f127da1b543a33d7e549db2a55eed6334c64 100644 (file)
@@ -171,7 +171,7 @@ namespace detail
             {
                 util::get<rw_own_t>(m_ref) = {};
             }
-            else GAPI_Assert(false); // shouldn't be called in *EXT modes
+            else GAPI_Error("InternalError"); // shouldn't be called in *EXT modes
         }
 
         // Obtain a WRITE reference to underlying object
index 807c82d31f8992733defcd22c997402da802e883..c1f9501873945b43853f54e2c360463f7000c5b8 100644 (file)
@@ -397,7 +397,7 @@ void inline unpackBlobs(const cv::GInferInputs::Map& blobs,
                 kinds.emplace_back(cv::detail::OpaqueKind::CV_UNKNOWN);
                 break;
             default:
-                GAPI_Assert(false);
+                GAPI_Error("InternalError");
         }
     }
 }
@@ -629,7 +629,7 @@ infer2(const std::string& tag,
                 kinds.emplace_back(cv::detail::OpaqueKind::CV_RECT);
                 break;
             default:
-                GAPI_Assert(false);
+                GAPI_Error("InternalError");
         }
     }
 
index 19aaef3fd1a5b802593667096722dea8ba8f71f3..5da8eeab48a2d1f090a2bcc6719ab418713d3725 100644 (file)
@@ -242,11 +242,11 @@ public:
     // The default implementation does nothing
     virtual cv::util::any blobParams() const;
     virtual void serialize(cv::gapi::s11n::IOStream&) {
-        GAPI_Assert(false && "Generic serialize method of MediaFrame::IAdapter does nothing by default. "
+        GAPI_Error("Generic serialize method of MediaFrame::IAdapter does nothing by default. "
                              "Please, implement it in derived class to properly serialize the object.");
     }
     virtual void deserialize(cv::gapi::s11n::IIStream&) {
-        GAPI_Assert(false && "Generic deserialize method of MediaFrame::IAdapter does nothing by default. "
+        GAPI_Error("Generic deserialize method of MediaFrame::IAdapter does nothing by default. "
                              "Please, implement it in derived class to properly deserialize the object.");
     }
 };
index 4bd3eaaf507d4ccd1a9c0bbe0ebcbbb8a84c6456..ab2fb896f127d77bb31ac0fb4d0d293853be5b40 100644 (file)
@@ -25,6 +25,8 @@
 #  define GAPI_DbgAssert(expr) GAPI_DbgAssertNoOp(expr)
 #endif
 
+#define GAPI_Error(msg) CV_Error(cv::Error::StsError, msg)
+
 #else
 #include <stdexcept>
 #include <sstream>
@@ -49,6 +51,10 @@ namespace detail
 #  define GAPI_DbgAssert(expr) GAPI_Assert(expr)
 #endif
 
+#define GAPI_Error(msg) { \
+    ::detail::assert_abort(msg, __LINE__, __FILE__, __func__); \
+}
+
 #endif // GAPI_STANDALONE
 
 #endif // OPENCV_GAPI_OWN_ASSERT_HPP
index 38668d67a589e6903eb78314628f38084321612a..46989191b34d7c906dbb0c4435a4fd0b4afce426 100644 (file)
@@ -112,11 +112,11 @@ public:
         // is transferred to the device when the view is destroyed
         virtual View access(Access) = 0;
         virtual void serialize(cv::gapi::s11n::IOStream&) {
-            GAPI_Assert(false && "Generic serialize method of RMat::IAdapter does nothing by default. "
+            GAPI_Error("Generic serialize method of RMat::IAdapter does nothing by default. "
                                  "Please, implement it in derived class to properly serialize the object.");
         }
         virtual void deserialize(cv::gapi::s11n::IIStream&) {
-            GAPI_Assert(false && "Generic deserialize method of RMat::IAdapter does nothing by default. "
+            GAPI_Error("Generic deserialize method of RMat::IAdapter does nothing by default. "
                                  "Please, implement it in derived class to properly deserialize the object.");
         }
     };
index 3157a18b841570fccac55861007fdebe8f03961c..0bf368a8562dd708109d26ca493fc5599048e548 100644 (file)
@@ -17,7 +17,8 @@
 #include <opencv2/gapi/util/util.hpp>
 
 // FIXME: caused by deserialize_runarg
-#if (defined _WIN32 || defined _WIN64) && defined _MSC_VER
+#if defined _MSC_VER
+#pragma warning(push)
 #pragma warning(disable: 4702)
 #endif
 
@@ -335,7 +336,7 @@ IIStream& operator>> (IIStream& is, std::vector<T> &ts) {
 namespace detail {
 template<typename V>
 IOStream& put_v(IOStream&, const V&, std::size_t) {
-    GAPI_Assert(false && "variant>>: requested index is invalid");
+    GAPI_Error("variant>>: requested index is invalid");
 };
 
 template<typename V, typename X, typename... Xs>
@@ -347,7 +348,7 @@ IOStream& put_v(IOStream& os, const V& v, std::size_t x) {
 
 template<typename V>
 IIStream& get_v(IIStream&, V&, std::size_t, std::size_t) {
-    GAPI_Assert(false && "variant<<: requested index is invalid");
+    GAPI_Error("variant<<: requested index is invalid");
 }
 
 template<typename V, typename X, typename... Xs>
@@ -423,7 +424,7 @@ static GRunArg exec(cv::gapi::s11n::IIStream& is) {
 template<typename RA>
 struct deserialize_arg_with_adapter<RA, void> {
 static GRunArg exec(cv::gapi::s11n::IIStream&) {
-    GAPI_Assert(false && "No suitable adapter class found during RMat/MediaFrame deserialization. "
+    GAPI_Error("No suitable adapter class found during RMat/MediaFrame deserialization. "
                          "Please, make sure you've passed them in cv::gapi::deserialize() template");
     return GRunArg{};
 }
@@ -505,4 +506,8 @@ cv::GRunArgs getRunArgsWithAdapters(const std::vector<char> &bytes) {
 } // namespace gapi
 } // namespace cv
 
+#if defined _MSC_VER
+#pragma warning(pop)
+#endif
+
 #endif // OPENCV_GAPI_S11N_HPP
index 6cea94156eef03e74c5831dc6e098ff57aba1c61..760e8515f6ac2c8449b9b2b16780b943375e2b0c 100644 (file)
@@ -52,7 +52,7 @@ struct S11N: public NotImplemented {
      * properly overload the function to use it.
      */
     static void serialize(IOStream &, const T &) {
-        GAPI_Assert(false && "No serialization routine is provided!");
+        GAPI_Error("No serialization routine is provided!");
     }
     /**
      * @brief This function allows user to deserialize their custom type.
@@ -61,7 +61,7 @@ struct S11N: public NotImplemented {
      * properly overload the function to use it.
      */
     static T deserialize(IIStream &) {
-        GAPI_Assert(false && "No deserialization routine is provided!");
+        GAPI_Error("No deserialization routine is provided!");
     }
 };
 
index dcf8f4d260112c0aff3c0d229f690a9ca70d3570..9b00267082caaf97c19bdb7b055baa537972ae5f 100644 (file)
@@ -62,7 +62,7 @@ G_TYPED_KERNEL(GStereo, <GMat(GMat, GMat, const StereoOutputFormat)>, "org.openc
             case StereoOutputFormat::DISPARITY_FIXED16_12_4:
                 return left.withDepth(CV_16SC1);
             default:
-                GAPI_Assert(false && "Unknown output format!");
+                GAPI_Error("Unknown output format!");
         }
     }
 };
index 73d5bfcbeb9f6309d4cdc68b958bd6f69b102217..adf1133c3fce2f5df1e103ebb129713515080697 100644 (file)
@@ -67,7 +67,7 @@ protected:
         cv::Mat tmp;
         if (!cap.read(tmp))
         {
-            GAPI_Assert(false && "Couldn't grab the very first frame");
+            GAPI_Error("Couldn't grab the very first frame");
         }
         // NOTE: Some decode/media VideoCapture backends continue
         // owning the video buffer under cv::Mat so in order to
index 8fda308ab8cd4127b07864be7bb8263f8b6c26fa..49b2ddd1eb3be703ed6cb294bf21be56654ae241 100644 (file)
@@ -738,7 +738,7 @@ static cv::GRunArgs run_py_kernel(cv::detail::PyObjectHolder kernel,
         else
         {
             // Seems to be impossible case.
-            GAPI_Assert(false);
+            GAPI_Error("InternalError");
         }
     }
     catch (...)
index 9cbea7f753b8614708e0034da27826bc4b14d25a..07d056abb7908963920955d0f8b2f6c0d3edb1f7 100644 (file)
@@ -22,7 +22,7 @@
     switch(type) { \
         LIST_G(HC, HC)  \
         default: \
-            GAPI_Assert(false && "Unsupported type"); \
+            GAPI_Error("Unsupported type"); \
     }
 
 using cv::gapi::wip::draw::Prim;
@@ -157,7 +157,7 @@ public:
         SWITCH(m_arg.index(), GOPAQUE_TYPE_LIST_G, HC)
 #undef HC
 
-            GAPI_Assert(false);
+            GAPI_Error("InternalError");
     }
 
     GAPI_WRAP gapi::ArgType type() { return m_type; }
@@ -195,7 +195,7 @@ public:
         SWITCH(m_arg.index(), GARRAY_TYPE_LIST_G, HC)
 #undef HC
 
-        GAPI_Assert(false);
+        GAPI_Error("InternalError");
     }
 
     GAPI_WRAP gapi::ArgType type() { return m_type; }
index e3b1e7123df17a8e960d0b30d386d1c45e395bed..efbe17a3059d6339303d0b9fa09b1aa73506f076 100644 (file)
@@ -35,7 +35,7 @@ cv::gapi::GBackend::Priv::compile(const ade::Graph&,
                                   const std::vector<ade::NodeHandle> &) const
 {
     // ...and this method is here for the same reason!
-    GAPI_Assert(false);
+    GAPI_Error("InternalError");
     return {};
 }
 
@@ -391,7 +391,7 @@ void unbind(Mag& mag, const RcDesc &rc)
         break;
 
     default:
-        GAPI_Assert(false);
+        GAPI_Error("InternalError");
     }
 }
 
index b0830b7a63a325603edca070017747e3dcacc383..6e9347c32d1a1e3855d5f649c90b848370f2bb70 100644 (file)
@@ -45,7 +45,7 @@ std::ostream& operator<<(std::ostream& os, const cv::GFrameDesc &d) {
     case MediaFormat::BGR:  os << "BGR"; break;
     case MediaFormat::NV12: os << "NV12"; break;
     case MediaFormat::GRAY: os << "GRAY"; break;
-    default: GAPI_Assert(false && "Invalid media format");
+    default: GAPI_Error("Invalid media format");
     }
     os << ' ' << d.size << ']';
     return os;
index 9b012770caee047742fc88433854799c818145fe..43bcfb9c14a96c2df3a5740572f1aa8ba761c839 100644 (file)
@@ -313,7 +313,7 @@ std::ostream& operator<<(std::ostream& os, const cv::GMetaArg &arg)
         break;
 
     default:
-        GAPI_Assert(false);
+        GAPI_Error("InternalError");
     }
 
     return os;
index bd7f46c88aecb3b6a24dd5a963578d5f89417937..989cc791185135e4ae0277d9c5f82a7f7c150859 100644 (file)
@@ -98,7 +98,7 @@ cv::GRunArgsP cv::gapi::bind(cv::GRunArgs &out_args)
             outputs.emplace_back(&(cv::util::get<cv::MediaFrame>(res_obj)));
             break;
         default:
-            GAPI_Assert(false && "This value type is not supported!"); // ...maybe because of STANDALONE mode.
+            GAPI_Error("This value type is not supported!"); // ...maybe because of STANDALONE mode.
             break;
         }
     }
@@ -114,7 +114,7 @@ cv::GRunArg cv::gapi::bind(cv::GRunArgP &out)
     {
 #if !defined(GAPI_STANDALONE)
     case T::index_of<cv::UMat*>() :
-        GAPI_Assert(false && "Please implement this!");
+        GAPI_Error("Please implement this!");
         break;
 #endif
 
@@ -138,7 +138,7 @@ cv::GRunArg cv::gapi::bind(cv::GRunArgP &out)
 
     default:
         // ...maybe our types were extended
-        GAPI_Assert(false && "This value type is UNKNOWN!");
+        GAPI_Error("This value type is UNKNOWN!");
         break;
     }
     return cv::GRunArg();
index 20467117b26964c827baf83a7ac01ce42cdf8be5..d9410f98ebbd140450b3a87abc48cf74eb9a2fa3 100644 (file)
@@ -37,7 +37,7 @@ cv::detail::GCompoundContext::GCompoundContext(const cv::GArgs& in_args)
                     // do nothing - as handled in a special way, see gcompoundkernel.hpp for details
                     // same applies to GMatP
                     break;
-                default: GAPI_Assert(false);
+                default: GAPI_Error("InternalError");
             }
         }
     }
index 13a74c17b510d8f586f936d090ab2507888cb85e..2a71a782b0ad33f859a132e54e7c8ac4c5a6d1e3 100644 (file)
@@ -290,7 +290,7 @@ IOStream& operator<< (IOStream& os, const cv::Mat &m) {
     case CV_32S: write_mat_data< int32_t>(os, m); break;
     case CV_32F: write_mat_data<   float>(os, m); break;
     case CV_64F: write_mat_data<  double>(os, m); break;
-    default: GAPI_Assert(false && "Unsupported Mat depth");
+    default: GAPI_Error("Unsupported Mat depth");
     }
     return os;
 }
@@ -306,7 +306,7 @@ IIStream& operator>> (IIStream& is, cv::Mat& m) {
     case CV_32S: read_mat_data< int32_t>(is, m); break;
     case CV_32F: read_mat_data<   float>(is, m); break;
     case CV_64F: read_mat_data<  double>(is, m); break;
-    default: GAPI_Assert(false && "Unsupported Mat depth");
+    default: GAPI_Error("Unsupported Mat depth");
     }
     return is;
 }
@@ -319,10 +319,10 @@ IIStream& operator>> (IIStream& is,       cv::gapi::wip::draw::Text &t) {
 }
 
 IOStream& operator<< (IOStream&, const cv::gapi::wip::draw::FText &) {
-    GAPI_Assert(false && "Serialization: Unsupported << for FText");
+    GAPI_Error("Serialization: Unsupported << for FText");
 }
 IIStream& operator>> (IIStream&,       cv::gapi::wip::draw::FText &) {
-    GAPI_Assert(false && "Serialization: Unsupported >> for FText");
+    GAPI_Error("Serialization: Unsupported >> for FText");
 }
 
 IOStream& operator<< (IOStream& os, const cv::gapi::wip::draw::Circle &c) {
@@ -398,19 +398,19 @@ IIStream& operator>> (IIStream& is,       cv::GArrayDesc &) {return is;}
 #if !defined(GAPI_STANDALONE)
 IOStream& operator<< (IOStream& os, const cv::UMat &)
 {
-    GAPI_Assert(false && "Serialization: Unsupported << for UMat");
+    GAPI_Error("Serialization: Unsupported << for UMat");
     return os;
 }
 IIStream& operator >> (IIStream& is, cv::UMat &)
 {
-    GAPI_Assert(false && "Serialization: Unsupported >> for UMat");
+    GAPI_Error("Serialization: Unsupported >> for UMat");
     return is;
 }
 #endif // !defined(GAPI_STANDALONE)
 
 IOStream& operator<< (IOStream& os, const cv::gapi::wip::IStreamSource::Ptr &)
 {
-    GAPI_Assert(false && "Serialization: Unsupported << for IStreamSource::Ptr");
+    GAPI_Error("Serialization: Unsupported << for IStreamSource::Ptr");
     return os;
 }
 IIStream& operator >> (IIStream& is, cv::gapi::wip::IStreamSource::Ptr &)
@@ -429,7 +429,7 @@ struct putToStream<Ref, std::tuple<>>
 {
     static void put(IOStream&, const Ref &)
     {
-        GAPI_Assert(false && "Unsupported type for GArray/GOpaque serialization");
+        GAPI_Error("Unsupported type for GArray/GOpaque serialization");
     }
 };
 
@@ -454,7 +454,7 @@ struct getFromStream<Ref, std::tuple<>>
 {
     static void get(IIStream&, Ref &, cv::detail::OpaqueKind)
     {
-        GAPI_Assert(false && "Unsupported type for GArray/GOpaque deserialization");
+        GAPI_Error("Unsupported type for GArray/GOpaque deserialization");
     }
 };
 
@@ -560,7 +560,7 @@ IOStream& operator<< (IOStream& os, const cv::GArg &arg) {
         case cv::detail::OpaqueKind::CV_RECT:    os << arg.get<cv::Rect>();     break;
         case cv::detail::OpaqueKind::CV_SCALAR:  os << arg.get<cv::Scalar>();   break;
         case cv::detail::OpaqueKind::CV_MAT:     os << arg.get<cv::Mat>();      break;
-        default: GAPI_Assert(false && "GArg: Unsupported (unknown?) opaque value type");
+        default: GAPI_Error("GArg: Unsupported (unknown?) opaque value type");
         }
     }
     return os;
@@ -597,7 +597,7 @@ IIStream& operator>> (IIStream& is, cv::GArg &arg) {
             HANDLE_CASE(SCALAR  , cv::Scalar);
             HANDLE_CASE(MAT     , cv::Mat);
 #undef HANDLE_CASE
-        default: GAPI_Assert(false && "GArg: Unsupported (unknown?) opaque value type");
+        default: GAPI_Error("GArg: Unsupported (unknown?) opaque value type");
         }
     }
     return is;
@@ -665,7 +665,7 @@ struct initCtor<Ref, std::tuple<>>
 {
     static void init(cv::gimpl::Data&)
     {
-        GAPI_Assert(false && "Unsupported type for GArray/GOpaque deserialization");
+        GAPI_Error("Unsupported type for GArray/GOpaque deserialization");
     }
 };
 
index 3ba2e83581ab43b013498717d37111e500650995..a64805e25c94a49adc0326d6297a71898aa314f1 100644 (file)
@@ -18,7 +18,8 @@
 #include "opencv2/gapi/render/render_types.hpp"
 #include "opencv2/gapi/s11n.hpp" // basic interfaces
 
-#if (defined _WIN32 || defined _WIN64) && defined _MSC_VER
+#if defined _MSC_VER
+#pragma warning(push)
 #pragma warning(disable: 4702)
 #endif
 
@@ -232,4 +233,8 @@ GAPI_EXPORTS std::vector<std::string> vector_of_strings_deserialize(IIStream& is
 } // namespace gapi
 } // namespace cv
 
+#if defined _MSC_VER
+#pragma warning(pop)
+#endif
+
 #endif // OPENCV_GAPI_COMMON_SERIALIZATION_HPP
index 6aec90d30a7b0ca619c850c7cd96f4d437a6d9c5..385fc500194eedfbc1e2823638998b7ce1c2ef88 100644 (file)
@@ -63,9 +63,9 @@ GAPI_OCV_KERNEL_ST(GCPUStereo, cv::gapi::calib3d::GStereo, StereoSetup)
                 stereoSetup.stereoBM->compute(left, right, out_mat);
                 break;
             case cv::gapi::StereoOutputFormat::DISPARITY_FIXED16_11_5:
-                GAPI_Assert(false && "This case may be supported in future.");
+                GAPI_Error("This case may be supported in future.");
             default:
-                GAPI_Assert(false && "Unknown output format!");
+                GAPI_Error("Unknown output format!");
         }
     }
 };
index ed4dda7d498b74cc468cd5f4b2419576e1bbfce5..d24dcd599a9acb80be869a34e48f1a86bc716e14 100644 (file)
@@ -313,7 +313,7 @@ static int maxLineConsumption(const cv::GFluidKernel::Kind kind, int window, int
         }
     } break;
     case cv::GFluidKernel::Kind::YUV420toRGB: return inPort == 0 ? 2 : 1; break;
-    default: GAPI_Assert(false); return 0;
+    default: GAPI_Error("InternalError"); return 0;
     }
 }
 
@@ -325,7 +325,7 @@ static int borderSize(const cv::GFluidKernel::Kind kind, int window)
     // Resize never reads from border pixels
     case cv::GFluidKernel::Kind::Resize: return 0; break;
     case cv::GFluidKernel::Kind::YUV420toRGB: return 0; break;
-    default: GAPI_Assert(false); return 0;
+    default: GAPI_Error("InternalError"); return 0;
     }
 }
 
@@ -685,7 +685,7 @@ void cv::gimpl::GFluidExecutable::initBufferRois(std::vector<int>& readStarts,
                         case 0: roi = produced; break;
                         case 1:
                         case 2: roi = cv::Rect{ produced.x/2, produced.y/2, produced.width/2, produced.height/2 }; break;
-                        default: GAPI_Assert(false);
+                        default: GAPI_Error("InternalError");
                         }
                         return roi;
                     };
@@ -699,7 +699,7 @@ void cv::gimpl::GFluidExecutable::initBufferRois(std::vector<int>& readStarts,
                     case GFluidKernel::Kind::Filter:      resized = produced; break;
                     case GFluidKernel::Kind::Resize:      resized = adjResizeRoi(produced, in_meta.size, meta.size); break;
                     case GFluidKernel::Kind::YUV420toRGB: resized = adj420Roi(produced, m_gm.metadata(in_edge).get<Input>().port); break;
-                    default: GAPI_Assert(false);
+                    default: GAPI_Error("InternalError");
                     }
 
                     // All below transformations affect roi of the writer, preserve read start position here
@@ -814,7 +814,7 @@ cv::gimpl::FluidGraphInputData cv::gimpl::fluidExtractInputDataFromGraph(const a
             last_agent++;
             break;
         }
-        default: GAPI_Assert(false);
+        default: GAPI_Error("InternalError");
         }
     }
 
@@ -844,7 +844,7 @@ cv::gimpl::GFluidExecutable::GFluidExecutable(const ade::Graph
             case GFluidKernel::Kind::Filter:      agent_ptr.reset(new FluidFilterAgent(g, agent_data.nh));      break;
             case GFluidKernel::Kind::Resize:      agent_ptr.reset(new FluidResizeAgent(g, agent_data.nh));      break;
             case GFluidKernel::Kind::YUV420toRGB: agent_ptr.reset(new Fluid420toRGBAgent(g, agent_data.nh));    break;
-            default: GAPI_Assert(false);
+            default: GAPI_Error("InternalError");
         }
         std::tie(agent_ptr->in_buffer_ids, agent_ptr->out_buffer_ids) = std::tie(agent_data.in_buffer_ids, agent_data.out_buffer_ids);
         return agent_ptr;
@@ -1388,7 +1388,7 @@ cv::gimpl::GParallelFluidExecutable::GParallelFluidExecutable(const ade::Graph
 void cv::gimpl::GParallelFluidExecutable::reshape(ade::Graph&, const GCompileArgs& )
 {
     //TODO: implement ?
-    GAPI_Assert(false && "Not Implemented;");
+    GAPI_Error("Not Implemented;");
 }
 
 void cv::gimpl::GParallelFluidExecutable::run(std::vector<InObj>  &&input_objs,
@@ -1474,7 +1474,7 @@ void GFluidBackendImpl::addMetaSensitiveBackendPasses(ade::ExecutionEngineSetupC
             case NodeKind::EMIT:
             case NodeKind::SINK:
                 break; // do nothing for Streaming nodes
-            default: GAPI_Assert(false);
+            default: GAPI_Error("InternalError");
             } // switch
         } // for (gim.nodes())
     });
index 9c2ec000ba7565719d0a8d042992e2eff12526b3..2bdbbbecd6647b03c0fb1c4294f84b61d8fb66e0 100644 (file)
@@ -90,7 +90,7 @@ void fillBorderConstant(int borderSize, cv::Scalar borderValue, cv::Mat& mat)
         case CV_16S: return &fillConstBorderRow< int16_t>; break;
         case CV_16U: return &fillConstBorderRow<uint16_t>; break;
         case CV_32F: return &fillConstBorderRow< float  >; break;
-        default: GAPI_Assert(false); return &fillConstBorderRow<uint8_t>;
+        default: GAPI_Error("InternalError"); return &fillConstBorderRow<uint8_t>;
         }
     };
 
@@ -231,7 +231,7 @@ void fluid::BufferStorageWithBorder::init(int dtype, int border_size, Border bor
     case cv::BORDER_REFLECT_101:
         m_borderHandler.reset(new BorderHandlerT<cv::BORDER_REFLECT_101>(border_size, dtype)); break;
     default:
-        GAPI_Assert(false);
+        GAPI_Error("InternalError");
     }
 }
 
index e95543e71d3998186bb269efae3d8ab7c07bc6b8..ad9de097e8313e4d3f5a54f0a7ad4ea555d7927d 100644 (file)
@@ -114,7 +114,7 @@ inline IE::Precision toIE(int depth) {
     case CV_32S: return IE::Precision::I32;
     case CV_32F: return IE::Precision::FP32;
     case CV_16F: return IE::Precision::FP16;
-    default:     GAPI_Assert(false && "IE. Unsupported data type");
+    default:     GAPI_Error("IE. Unsupported data type");
     }
     return IE::Precision::UNSPECIFIED;
 }
@@ -125,7 +125,7 @@ inline int toCV(IE::Precision prec) {
     case IE::Precision::I32:  return CV_32S;
     case IE::Precision::I64:  return CV_32S;
     case IE::Precision::FP16: return CV_16F;
-    default:     GAPI_Assert(false && "IE. Unsupported data type");
+    default:     GAPI_Error("IE. Unsupported data type");
     }
     return -1;
 }
@@ -167,7 +167,7 @@ inline IE::Blob::Ptr wrapIE(const cv::Mat &mat, cv::gapi::ie::TraitAs hint) {
         HANDLE(32S, int);
         HANDLE(16F, int16_t);
 #undef HANDLE
-    default: GAPI_Assert(false && "IE. Unsupported data type");
+    default: GAPI_Error("IE. Unsupported data type");
     }
     return IE::Blob::Ptr{};
 }
@@ -190,9 +190,9 @@ inline IE::Blob::Ptr wrapIE(const cv::MediaFrame::View& view,
             return wrapIE(gray, cv::gapi::ie::TraitAs::IMAGE);
         }
         default:
-            GAPI_Assert(false && "Unsupported media format for IE backend");
+            GAPI_Error("Unsupported media format for IE backend");
     }
-    GAPI_Assert(false);
+    GAPI_Error("InternalError");
 }
 
 template<class MatType>
@@ -225,7 +225,7 @@ inline void copyFromIE(const IE::Blob::Ptr &blob, MatType &mat) {
                                            mat.total());
             break;
         }
-    default: GAPI_Assert(false && "IE. Unsupported data type");
+    default: GAPI_Error("IE. Unsupported data type");
     }
 }
 
@@ -439,7 +439,7 @@ void IEUnit::InputFramesDesc::set_param(const input_name_type &input,
     if (layout != InferenceEngine::NHWC && layout != InferenceEngine::NCHW) {
         GAPI_LOG_WARNING(nullptr, "Unsupported layout for VPP preproc: " << layout <<
                                   ", input name: " << input);
-        GAPI_Assert(false && "Unsupported layout for VPP preproc");
+        GAPI_Error("Unsupported layout for VPP preproc");
     }
     GAPI_Assert(inDims.size() == 4u);
     ret.size.width = static_cast<int>(inDims[3]);
@@ -754,7 +754,7 @@ inline IE::Blob::Ptr extractBlob(IECallContext& ctx,
 
                 NV12ParamType* blob_params = cv::util::any_cast<NV12ParamType>(&any_blob_params);
                 if (blob_params == nullptr) {
-                    GAPI_Assert(false && "Incorrect type of blobParams:"
+                    GAPI_Error("Incorrect type of blobParams:"
                                          "expected std::pair<ParamType, ParamType>,"
                                          "with ParamType std::pair<InferenceEngine::TensorDesc,"
                                          "InferenceEngine::ParamMap >>");
@@ -782,7 +782,7 @@ inline IE::Blob::Ptr extractBlob(IECallContext& ctx,
         default:
             GAPI_Assert("Unsupported input shape for IE backend");
     }
-    GAPI_Assert(false);
+    GAPI_Error("InternalError");
 }
 
 
@@ -967,7 +967,7 @@ cv::gimpl::ie::RequestPool::RequestPool(cv::gapi::ie::InferMode
                                                              std::bind(&RequestPool::release, this, i));
                 break;
             default:
-                GAPI_Assert(false && "Unsupported cv::gapi::ie::InferMode");
+                GAPI_Error("Unsupported cv::gapi::ie::InferMode");
         }
         m_requests.emplace_back(std::move(iexec));
     }
@@ -1144,7 +1144,7 @@ static void configureInputReshapeByImage(const IE::InputInfo::Ptr& ii,
     auto input_dims = ii->getTensorDesc().getDims();
     const auto size = input_dims.size();
     if (size <= 1) {
-        GAPI_Assert(false && "Unsupported number of dimensions for reshape by image");
+        GAPI_Error("Unsupported number of dimensions for reshape by image");
     }
     input_dims.at(size - 2) = static_cast<size_t>(image_sz.height);
     input_dims.at(size - 1) = static_cast<size_t>(image_sz.width);
@@ -1173,7 +1173,7 @@ static void configureInputInfo(const IE::InputInfo::Ptr& ii, const cv::GMetaArg
                     // NB: Do nothing
                     break;
                 default:
-                    GAPI_Assert(false && "Unsupported media format for IE backend");
+                    GAPI_Error("Unsupported media format for IE backend");
             }
             ii->setPrecision(toIE(CV_8U));
             break;
index fbfeeccd61543a8cd372b5eb81ae18b61019fc36..c7d938878dfa3f39bff1705087bf582f23d9add4 100644 (file)
@@ -62,12 +62,12 @@ public:
 
     virtual inline bool canReshape() const override { return false; }
     virtual inline void reshape(ade::Graph&, const GCompileArgs&) override {
-        GAPI_Assert(false); // Not implemented yet
+        GAPI_Error("InternalError"); // Not implemented yet
     }
 
     virtual void run(std::vector<InObj>  &&,
                      std::vector<OutObj> &&) override {
-        GAPI_Assert(false && "Not implemented");
+        GAPI_Error("Not implemented");
     }
 
     virtual void run(GIslandExecutable::IInput  &in,
index e159160ba9718d7190b98b0f292905b0377f8853..bb99c21fcf02c6186d287c1c0bb1ca8f9c64dbc4 100644 (file)
@@ -39,7 +39,7 @@ class GOAKExecutable final: public GIslandExecutable {
     friend class OAKKernelParams;
     virtual void run(std::vector<InObj>&&,
                      std::vector<OutObj>&&) override {
-        GAPI_Assert(false && "Not implemented");
+        GAPI_Error("Not implemented");
     }
 
     virtual void run(GIslandExecutable::IInput &in,
@@ -121,7 +121,7 @@ public:
     // FIXME: could it reshape?
     virtual bool canReshape() const override { return false; }
     virtual void reshape(ade::Graph&, const GCompileArgs&) override {
-        GAPI_Assert(false && "GOAKExecutable::reshape() is not supported");
+        GAPI_Error("GOAKExecutable::reshape() is not supported");
     }
 
     virtual void handleNewStream() override;
@@ -391,7 +391,7 @@ void cv::gimpl::GOAKExecutable::linkCopy(ade::NodeHandle handle) {
     for (const auto& copy_next_op : copy_out.front().get()->outNodes()) {
         const auto& op = m_gm.metadata(copy_next_op).get<Op>();
         if (op.k.name == "org.opencv.oak.copy") {
-            GAPI_Assert(false && "Back-to-back Copy operations are not supported in graph");
+            GAPI_Error("Back-to-back Copy operations are not supported in graph");
         }
     }
 
@@ -701,14 +701,14 @@ cv::gimpl::GOAKExecutable::GOAKExecutable(const ade::Graph& g,
                                     [](ExtractTypeHelper::InputPtr ptr) {
                             return ptr == nullptr;
                         })) {
-                        GAPI_Assert(false && "DAI input are not set");
+                        GAPI_Error("DAI input are not set");
                     }
 
                     if (std::any_of(node_info.outputs.cbegin(), node_info.outputs.cend(),
                                     [](ExtractTypeHelper::OutputPtr ptr) {
                             return ptr == nullptr;
                         })) {
-                        GAPI_Assert(false && "DAI outputs are not set");
+                        GAPI_Error("DAI outputs are not set");
                     }
                 }
             }
@@ -907,7 +907,7 @@ void cv::gimpl::GOAKExecutable::run(GIslandExecutable::IInput  &in,
         }
         // FIXME: Add support for remaining types
         default:
-            GAPI_Assert(false && "Unsupported type in OAK backend");
+            GAPI_Error("Unsupported type in OAK backend");
         }
 
         out.meta(out_arg, meta);
@@ -1080,7 +1080,7 @@ class GOAKBackendImpl final : public cv::gapi::GBackend::Priv {
         // NB: how could we have non-OAK source in streaming mode, then OAK backend in
         //     streaming mode but without camera input?
         if (!gm.metadata().contains<cv::gimpl::Streaming>()) {
-            GAPI_Assert(false && "OAK backend only supports Streaming mode for now");
+            GAPI_Error("OAK backend only supports Streaming mode for now");
         }
         return EPtr{new cv::gimpl::GOAKExecutable(graph, args, nodes, ins_data, outs_data)};
     }
@@ -1118,14 +1118,11 @@ namespace gapi {
 namespace oak {
 
 cv::gapi::GKernelPackage kernels() {
-    GAPI_Assert(false && "Built without OAK support");
-    return {};
+    GAPI_Error("Built without OAK support");
 }
 
 cv::gapi::GBackend backend() {
-    GAPI_Assert(false && "Built without OAK support");
-    static cv::gapi::GBackend this_backend(nullptr);
-    return this_backend;
+    GAPI_Error("Built without OAK support");
 }
 
 } // namespace oak
index a99d38654fb720eaf629816bc753c6b0fa6bf01a..b78ba6d05e55095b82cf393aa20d7b1297a3c4db 100644 (file)
@@ -171,7 +171,7 @@ inline int toCV(ONNXTensorElementDataType prec) {
     case ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT: return CV_32F;
     case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32: return CV_32S;
     case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64: return CV_32S;
-    default: GAPI_Assert(false && "ONNX. Unsupported data type");
+    default: GAPI_Error("ONNX. Unsupported data type");
     }
     return -1;
 }
@@ -207,7 +207,7 @@ inline void copyFromONNX(Ort::Value &v, cv::Mat& mat) {
                                            mat.total());
             break;
         }
-    default: GAPI_Assert(false && "ONNX. Unsupported data type");
+    default: GAPI_Error("ONNX. Unsupported data type");
     }
 }
 
@@ -233,7 +233,7 @@ inline void preprocess(const cv::Mat& src,
                             "32F tensor dimensions should match with all non-dynamic NN input dimensions");
             }
         } else {
-            GAPI_Assert(false && "32F tensor size should match with NN input");
+            GAPI_Error("32F tensor size should match with NN input");
         }
 
         dst = src;
@@ -338,7 +338,7 @@ void preprocess(const cv::MediaFrame::View& view,
             break;
         }
         default:
-            GAPI_Assert(false && "Unsupported media format for ONNX backend");
+            GAPI_Error("Unsupported media format for ONNX backend");
     }
 }
 
@@ -367,7 +367,7 @@ inline Ort::Value createTensor(const Ort::MemoryInfo& memory_info,
     case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32:
         return createTensor<int32_t>(memory_info, tensor_params, data);
     default:
-        GAPI_Assert(false && "ONNX. Unsupported data type");
+        GAPI_Error("ONNX. Unsupported data type");
     }
     return Ort::Value{nullptr};
 }
@@ -858,7 +858,7 @@ static void checkInputMeta(const cv::GMetaArg mm) {
                 case cv::MediaFormat::NV12: break;
                 case cv::MediaFormat::BGR:  break;
                 default:
-                    GAPI_Assert(false && "Unsupported media format for ONNX backend");
+                    GAPI_Error("Unsupported media format for ONNX backend");
             } break;
         } break;
         default:
@@ -1101,7 +1101,7 @@ struct InferList2: public cv::detail::KernelTag {
                     const auto &vec = this_vec.rref<cv::Mat>();
                     uu.oc->setInput(in_idx, vec[list_idx]);
                 } else {
-                    GAPI_Assert(false && "Only Rect and Mat types are supported for infer list 2!");
+                    GAPI_Error("Only Rect and Mat types are supported for infer list 2!");
                 }
                 // }}} (Prepare input)
             } // }}} (For every input of the net)
index a3cc897030915f6c2ac4234eddb3b984d5263214..8c67df1e1e39cb70dfc4daf552f90993ff378f13 100644 (file)
@@ -43,7 +43,7 @@ public:
 
     virtual inline bool canReshape() const override { return false; }
     virtual inline void reshape(ade::Graph&, const GCompileArgs&) override {
-        GAPI_Assert(false); // Not implemented yet
+        GAPI_Error("InternalError"); // Not implemented yet
     }
 
     virtual void run(std::vector<InObj>  &&input_objs,
index 0c65f4cba860dfd188f5907f0ae3dffee4ca8f00..54fbf7decdf85048da3c983947467304befce84d 100644 (file)
@@ -150,7 +150,7 @@ static void writeBack(cv::GRunArg& arg, cv::GRunArgP& out)
             break;
         }
         default:
-            GAPI_Assert(false && "Unsupported output type");
+            GAPI_Error("Unsupported output type");
     }
 }
 
index 69b5f6c72b3701c5f312c1ac3e3bae72941aaab0..ae7125f2e502c09e5f5d81d0d428de9df72092ef 100644 (file)
@@ -42,7 +42,7 @@ class GStreamingIntrinExecutable final: public cv::gimpl::GIslandExecutable
 {
     virtual void run(std::vector<InObj>  &&,
                      std::vector<OutObj> &&) override {
-        GAPI_Assert(false && "Not implemented");
+        GAPI_Error("Not implemented");
     }
 
     virtual void run(GIslandExecutable::IInput &in,
@@ -188,7 +188,7 @@ void Copy::Actor::run(cv::gimpl::GIslandExecutable::IInput  &in,
         break;
     // FIXME: Add support for remaining types
     default:
-        GAPI_Assert(false && "Copy: unsupported data type");
+        GAPI_Error("Copy: unsupported data type");
     }
     out.meta(out_arg, in_arg.meta);
     out.post(std::move(out_arg));
index bcf91f7dcd6e3c9496180f6887827b1c2664cf5b..526b2746dcd69c41b7cb05df7a23305213753d56 100644 (file)
@@ -338,7 +338,7 @@ void cv::gimpl::GCompiler::validateInputMeta()
             return util::holds_alternative<cv::GOpaqueDesc>(meta);
 
         default:
-            GAPI_Assert(false);
+            GAPI_Error("InternalError");
         }
         return false; // should never happen
     };
@@ -485,7 +485,7 @@ cv::GStreamingCompiled cv::gimpl::GCompiler::produceStreamingCompiled(GPtr &&pg)
         // Otherwise, set it up with executor object only
         compiled.priv().setup(std::move(pE));
     }
-    else GAPI_Assert(false && "Impossible happened -- please report a bug");
+    else GAPI_Error("Impossible happened -- please report a bug");
     return compiled;
 }
 
index 0567a90e3a23cc9e750e0bb7739e7c348c38a8f6..736e4f7170826cb87016f49fdf77c889162845fb 100644 (file)
@@ -120,7 +120,7 @@ ade::NodeHandle GIsland::producer(const ade::Graph &g,
     }
     // Consistency: A GIsland requested for producer() of slot_nh should
     // always had the appropriate GModel node handle in its m_out_ops vector.
-    GAPI_Assert(false && "Broken GIslandModel ?.");
+    GAPI_Error("Broken GIslandModel ?.");
 }
 
 std::string GIsland::name() const
@@ -164,7 +164,7 @@ void GIslandModel::generateInitial(GIslandModel::Graph &g,
         {
         case NodeType::OP:   all_operations.insert(src_nh);                break;
         case NodeType::DATA: data_to_slot[src_nh] = mkSlotNode(g, src_nh); break;
-        default: GAPI_Assert(false); break;
+        default: GAPI_Error("InternalError"); break;
         }
     } // for (src_g.nodes)
 
index 565b3c4f214133c47690a01b4117e356a5f0f3d4..3a1a8d5ab9de28618f8399b9fa837d219344ffca 100644 (file)
@@ -122,7 +122,7 @@ public:
     virtual bool canReshape() const = 0;
     virtual void reshape(ade::Graph& g, const GCompileArgs& args) = 0;
     virtual bool allocatesOutputs() const { return false; }
-    virtual cv::RMat allocate(const cv::GMatDesc&) const { GAPI_Assert(false && "should never be called"); }
+    virtual cv::RMat allocate(const cv::GMatDesc&) const { GAPI_Error("should never be called"); }
 
     // This method is called when the GStreamingCompiled gets a new
     // input source to process. Normally this method is called once
index f0e4917d7a005231622b62cfc7cf33cf57df1f26..aed342869396ace63af0612b3acc9b58a15f8f2e 100644 (file)
@@ -162,7 +162,7 @@ cv::gimpl::Unrolled cv::gimpl::unrollExpr(const GProtoArgs &ins,
 
         default:
             // Unsupported node shape
-            GAPI_Assert(false);
+            GAPI_Error("InternalError");
             break;
         }
     }
index b7f5ea96d3f4f05f424da23f806018d80fd6e6e6..f7284fb362dbd998e5f750cafa4b6a43147ea29b 100644 (file)
@@ -149,7 +149,7 @@ void dumpDot(const ade::Graph &g, std::ostream& os)
             }
         }
         break;
-        default: GAPI_Assert(false);
+        default: GAPI_Error("InternalError");
         }
     }
 
@@ -209,7 +209,7 @@ void dumpDot(const ade::Graph &g, std::ostream& os)
             }
             break;
         default:
-            GAPI_Assert(false);
+            GAPI_Error("InternalError");
             break;
         }
     }
index 8920be6d4e2029acb2eda8d7500d2b5ddf8b16c7..a6c1dd289c87f663e4861154af98cb96d93c80ca 100644 (file)
@@ -128,7 +128,7 @@ void traceUp(cv::gimpl::GModel::Graph &g,
         // this recursive process (e.g. via some other output or branch in the
         // subgraph)
         if (g.metadata(nh).get<DesyncPath>().index != desync_id) {
-            GAPI_Assert(false && "Desynchronization can't be nested!");
+            GAPI_Error("Desynchronization can't be nested!");
         }
         return; // This object belongs to the desync path - exit early.
     }
index 7be2da73ae35af402aa96d72d0deb794c1ba8bec..d52b48a63130ec7ae909108dc9cc2bba1700547d 100644 (file)
@@ -371,10 +371,9 @@ cv::gimpl::findMatches(const cv::gimpl::GModel::Graph& patternGraph,
                                                   testNodeMeta,
                                                   isAlreadyVisited);
                         default:
-                            GAPI_Assert(false && "Unsupported Node type!");
+                            break;
                         }
-
-                        return false;
+                        GAPI_Error("Unsupported Node type!");
                     });
 
                     if (testIt == testOutputNodesLabeled.end()) {
index 9092c6629119af1a82a37e95622d87dd330cff8a..200cfcd1b14aa3ec2dc458aaacffb6e4daba9bf7 100644 (file)
@@ -117,7 +117,7 @@ struct ChangeT
             {
             case Direction::In:  eh = g.link(m_sibling, m_node); break;
             case Direction::Out: eh = g.link(m_node, m_sibling); break;
-            default: GAPI_Assert(false);
+            default: GAPI_Error("InternalError");
             }
             GAPI_Assert(eh != nullptr);
             m_meta.copyTo(g, eh);
index 6853c30d3e3382088e0912480be5fa351c16b47f..bf25302b758eeeaf7aa685e6bc6624eeb93762e5 100644 (file)
@@ -75,7 +75,7 @@ cv::gimpl::GExecutor::GExecutor(std::unique_ptr<ade::Graph> &&g_model)
             break;
 
         default:
-            GAPI_Assert(false);
+            GAPI_Error("InternalError");
             break;
         } // switch(kind)
     } // for(gim nodes)
@@ -248,7 +248,7 @@ void cv::gimpl::GExecutor::initResource(const ade::NodeHandle & nh, const ade::N
         break;
     }
     default:
-        GAPI_Assert(false);
+        GAPI_Error("InternalError");
     }
 }
 
index 66aad906976bf6f07f1f67fdb8e4505e075fd493..124b27f39ca6ad1a39b47f46f114776ee310d207 100644 (file)
@@ -157,7 +157,7 @@ void sync_data(cv::GRunArgs &results, cv::GRunArgsP &outputs)
             *cv::util::get<cv::MediaFrame*>(out_obj) = std::move(cv::util::get<cv::MediaFrame>(res_obj));
             break;
         default:
-            GAPI_Assert(false && "This value type is not supported!"); // ...maybe because of STANDALONE mode.
+            GAPI_Error("This value type is not supported!"); // ...maybe because of STANDALONE mode.
             break;
         }
     }
@@ -227,7 +227,7 @@ void sync_data(cv::gimpl::stream::Result &r, cv::GOptRunArgsP &outputs)
         } break;
         default:
             // ...maybe because of STANDALONE mode.
-            GAPI_Assert(false && "This value type is not supported!");
+            GAPI_Error("This value type is not supported!");
             break;
         }
     }
@@ -446,7 +446,7 @@ cv::gimpl::StreamMsg QueueReader::getInputVector(std::vector<Q*> &in_queues,
               break;
           }
           default:
-              GAPI_Assert(false && "Unsupported cmd type in getInputVector()");
+              GAPI_Error("Unsupported cmd type in getInputVector()");
        }
     } // for(in_queues)
 
@@ -920,7 +920,7 @@ class StreamingOutput final: public cv::gimpl::GIslandExecutable::IOutput
                     m_stops_sent++;
                     break;
                 default:
-                    GAPI_Assert(false && "Unreachable code");
+                    GAPI_Error("Unreachable code");
             }
 
             for (auto &&q : m_out_queues[out_idx])
@@ -1115,7 +1115,7 @@ void collectorThread(std::vector<Q*>   in_queues,
                 out_queue.push(Cmd{cv::util::get<cv::gimpl::Exception>(result)});
                 break;
             default:
-                GAPI_Assert(false && "Unreachable code");
+                GAPI_Error("Unreachable code");
         }
     }
 }
@@ -1479,7 +1479,7 @@ cv::gimpl::GStreamingExecutor::GStreamingExecutor(std::unique_ptr<ade::Graph> &&
             }
             break;
         default:
-            GAPI_Assert(false);
+            GAPI_Error("InternalError");
             break;
         } // switch(kind)
     } // for(gim nodes)
@@ -1820,9 +1820,9 @@ bool cv::gimpl::GStreamingExecutor::pull(cv::GRunArgsP &&outs)
             return true;
         }
         default:
-            GAPI_Assert(false && "Unsupported cmd type in pull");
+            GAPI_Error("Unsupported cmd type in pull");
     }
-    GAPI_Assert(false && "Unreachable code");
+    GAPI_Error("Unreachable code");
 }
 
 bool cv::gimpl::GStreamingExecutor::pull(cv::GOptRunArgsP &&outs)
@@ -1853,7 +1853,7 @@ bool cv::gimpl::GStreamingExecutor::pull(cv::GOptRunArgsP &&outs)
             return true;
         }
     }
-    GAPI_Assert(false && "Unreachable code");
+    GAPI_Error("Unreachable code");
 }
 
 cv::gimpl::GAbstractStreamingExecutor::PyPullResult cv::gimpl::GStreamingExecutor::pull()
index 188f162ffd5c2097fc94e9c4ba38ecfa87a52faf..b9fce834276e502658cd894dc90466ae4e0a53d6 100644 (file)
@@ -40,7 +40,7 @@ GStreamerMediaAdapter::GStreamerMediaAdapter(const cv::GFrameDesc& frameDesc,
                 break;
             }
             default: {
-                GAPI_Assert(false && "Non NV12 or GRAY Media format is not expected here");
+                GAPI_Error("Non NV12 or GRAY Media format is not expected here");
                 break;
             }
         }
@@ -59,7 +59,7 @@ GStreamerMediaAdapter::GStreamerMediaAdapter(const cv::GFrameDesc& frameDesc,
                 break;
             }
             default: {
-                GAPI_Assert(false && "Non NV12 or GRAY Media format is not expected here");
+                GAPI_Error("Non NV12 or GRAY Media format is not expected here");
                 break;
             }
         }
@@ -160,7 +160,7 @@ cv::MediaFrame::View GStreamerMediaAdapter::access(cv::MediaFrame::Access access
             break;
         }
         default: {
-            GAPI_Assert(false && "Non NV12 or GRAY Media format is not expected here");
+            GAPI_Error("Non NV12 or GRAY Media format is not expected here");
             break;
         }
     }
@@ -171,7 +171,7 @@ cv::MediaFrame::View GStreamerMediaAdapter::access(cv::MediaFrame::Access access
 }
 
 cv::util::any GStreamerMediaAdapter::blobParams() const {
-    GAPI_Assert(false && "No implementation for GStreamerMediaAdapter::blobParams()");
+    GAPI_Error("No implementation for GStreamerMediaAdapter::blobParams()");
 }
 
 } // namespace gst
index 138589b9a6263ca0dd3be149c6b1485e18710db8..5575c436f9fac64165df0a26a3f960fc1d17bee6 100644 (file)
@@ -69,12 +69,12 @@ GStreamerEnv::~GStreamerEnv()
 
 const GStreamerEnv& GStreamerEnv::init()
 {
-    GAPI_Assert(false && "Built without GStreamer support!");
+    GAPI_Error("Built without GStreamer support!");
 }
 
 GStreamerEnv::GStreamerEnv()
 {
-    GAPI_Assert(false && "Built without GStreamer support!");
+    GAPI_Error("Built without GStreamer support!");
 }
 
 GStreamerEnv::~GStreamerEnv()
index 6687076c7ebc727b4066a4b740ca06814e4c9933..aaa9b82a34e2d4f200f639bee5faa1222bf4f908 100644 (file)
@@ -73,7 +73,7 @@ GStreamerPipeline::Priv::~Priv() { }
 
 GStreamerPipeline::Priv::Priv(const std::string&)
 {
-    GAPI_Assert(false && "Built without GStreamer support!");
+    GAPI_Error("Built without GStreamer support!");
 }
 
 IStreamSource::Ptr GStreamerPipeline::Priv::getStreamingSource(const std::string&,
index f1bd438ce2c047fa5340fa1317c719ef627ed52d..9fb15729b45ab7512bb08cb9d298650fa76d9bcb 100644 (file)
@@ -205,7 +205,7 @@ void GStreamerSource::Priv::prepareVideoMeta()
                         break;
                     }
                     default: {
-                        GAPI_Assert(false && "Unsupported GStreamerSource FRAME type.");
+                        GAPI_Error("Unsupported GStreamerSource FRAME type.");
                     }
                 }
                 break;
@@ -317,7 +317,7 @@ bool GStreamerSource::Priv::retrieveFrame(cv::Mat& data)
                 break;
             }
             default: {
-                GAPI_Assert(false && "retrieveFrame - unsupported GStreamerSource FRAME type.");
+                GAPI_Error("retrieveFrame - unsupported GStreamerSource FRAME type.");
             }
         }
     }
@@ -354,13 +354,13 @@ GStreamerSource::Priv::~Priv() { }
 
 GStreamerSource::Priv::Priv(const std::string&, const GStreamerSource::OutputType)
 {
-    GAPI_Assert(false && "Built without GStreamer support!");
+    GAPI_Error("Built without GStreamer support!");
 }
 
 GStreamerSource::Priv::Priv(std::shared_ptr<GStreamerPipelineFacade>, const std::string&,
                             const GStreamerSource::OutputType)
 {
-    GAPI_Assert(false && "Built without GStreamer support!");
+    GAPI_Error("Built without GStreamer support!");
 }
 
 bool GStreamerSource::Priv::pull(cv::gapi::wip::Data&)
index d81c66b901748547bbfe8e60dc03e2469ddd89aa..893d8f1fa1bce30997883d089e1329b38fa8d9a1 100644 (file)
@@ -65,7 +65,7 @@ static surface_ptr_t create_surface_RGB4_(mfxFrameInfo frameInfo,
                                   ", offset: " << out_buf_ptr_offset <<
                                   ", W: " << surfW <<
                                   ", H: " << surfH);
-        GAPI_Assert(false && "Invalid offset");
+        GAPI_Error("Invalid offset");
     }
 
     std::unique_ptr<mfxFrameSurface1> handle(new mfxFrameSurface1);
@@ -98,7 +98,7 @@ static surface_ptr_t create_surface_other_(mfxFrameInfo frameInfo,
                                   ", offset: " << out_buf_ptr_offset <<
                                   ", W: " << surfW <<
                                   ", H: " << surfH);
-        GAPI_Assert(false && "Invalid offset");
+        GAPI_Error("Invalid offset");
     }
 
     std::unique_ptr<mfxFrameSurface1> handle(new mfxFrameSurface1);
@@ -209,7 +209,7 @@ VPLCPUAccelerationPolicy::create_surface_pool(size_t pool_size, size_t surface_s
     if (!pool_table.emplace(preallocated_pool_memory_ptr, std::move(pool)).second) {
         GAPI_LOG_WARNING(nullptr, "Cannot insert pool, table size: " + std::to_string(pool_table.size()) <<
                                   ", key: " << preallocated_pool_memory_ptr << " exists");
-        GAPI_Assert(false && "Cannot create pool in VPLCPUAccelerationPolicy");
+        GAPI_Error("Cannot create pool in VPLCPUAccelerationPolicy");
     }
 
     return preallocated_pool_memory_ptr;
@@ -248,7 +248,7 @@ VPLCPUAccelerationPolicy::surface_weak_ptr_t VPLCPUAccelerationPolicy::get_free_
     if (pool_it == pool_table.end()) {
         GAPI_LOG_WARNING(nullptr, "key is not found, table size: " <<
                                   pool_table.size());
-        GAPI_Assert(false && "Invalid surface key requested in VPLCPUAccelerationPolicy");
+        GAPI_Error("Invalid surface key requested in VPLCPUAccelerationPolicy");
     }
 
     pool_t& requested_pool = pool_it->second;
index 456e01d6769ca9826d112a7048a6c6fbeef5a2a7..9fc1f4dc7286524958ed1e97a1b0c2e4e8392b59 100644 (file)
@@ -152,7 +152,7 @@ VPLDX11AccelerationPolicy::surface_weak_ptr_t VPLDX11AccelerationPolicy::get_fre
 }
 
 size_t VPLDX11AccelerationPolicy::get_free_surface_count(pool_key_t) const {
-    GAPI_Assert(false && "get_free_surface_count() is not implemented");
+    GAPI_Error("get_free_surface_count() is not implemented");
 }
 
 size_t VPLDX11AccelerationPolicy::get_surface_count(pool_key_t key) const {
@@ -448,39 +448,39 @@ namespace wip {
 namespace onevpl {
 VPLDX11AccelerationPolicy::VPLDX11AccelerationPolicy(device_selector_ptr_t selector) :
     VPLAccelerationPolicy(selector) {
-    GAPI_Assert(false && "VPLDX11AccelerationPolicy unavailable in current configuration");
+    GAPI_Error("VPLDX11AccelerationPolicy unavailable in current configuration");
 }
 
 VPLDX11AccelerationPolicy::~VPLDX11AccelerationPolicy() = default;
 
 void VPLDX11AccelerationPolicy::init(session_t ) {
-    GAPI_Assert(false && "VPLDX11AccelerationPolicy unavailable in current configuration");
+    GAPI_Error("VPLDX11AccelerationPolicy unavailable in current configuration");
 }
 
 void VPLDX11AccelerationPolicy::deinit(session_t) {
-    GAPI_Assert(false && "VPLDX11AccelerationPolicy unavailable in current configuration");
+    GAPI_Error("VPLDX11AccelerationPolicy unavailable in current configuration");
 }
 
 VPLDX11AccelerationPolicy::pool_key_t VPLDX11AccelerationPolicy::create_surface_pool(const mfxFrameAllocRequest&,
                                                                                      mfxFrameInfo&) {
-    GAPI_Assert(false && "VPLDX11AccelerationPolicy unavailable in current configuration");
+    GAPI_Error("VPLDX11AccelerationPolicy unavailable in current configuration");
 }
 
 VPLDX11AccelerationPolicy::surface_weak_ptr_t VPLDX11AccelerationPolicy::get_free_surface(pool_key_t) {
-    GAPI_Assert(false && "VPLDX11AccelerationPolicy unavailable in current configuration");
+    GAPI_Error("VPLDX11AccelerationPolicy unavailable in current configuration");
 }
 
 size_t VPLDX11AccelerationPolicy::get_free_surface_count(pool_key_t) const {
-    GAPI_Assert(false && "VPLDX11AccelerationPolicy unavailable in current configuration");
+    GAPI_Error("VPLDX11AccelerationPolicy unavailable in current configuration");
 }
 
 size_t VPLDX11AccelerationPolicy::get_surface_count(pool_key_t) const {
-    GAPI_Assert(false && "VPLDX11AccelerationPolicy unavailable in current configuration");
+    GAPI_Error("VPLDX11AccelerationPolicy unavailable in current configuration");
 }
 
 cv::MediaFrame::AdapterPtr VPLDX11AccelerationPolicy::create_frame_adapter(pool_key_t,
                                                                           const FrameConstructorArgs &) {
-    GAPI_Assert(false && "VPLDX11AccelerationPolicy unavailable in current configuration");
+    GAPI_Error("VPLDX11AccelerationPolicy unavailable in current configuration");
 }
 } // namespace onevpl
 } // namespace wip
index 0ded06613743d9c3c876a90aa4355e094afc9dbd..93657b49be4eb32ead9e30f4ab702230dfbdc043 100644 (file)
@@ -39,13 +39,13 @@ VPLVAAPIAccelerationPolicy::VPLVAAPIAccelerationPolicy(device_selector_ptr_t sel
 
     va_handle = reinterpret_cast<VADisplay>(devices.begin()->second.get_ptr());
 #else  // defined(HAVE_VA) || defined(HAVE_VA_INTEL)
-    GAPI_Assert(false && "VPLVAAPIAccelerationPolicy unavailable in current configuration");
+    GAPI_Error("VPLVAAPIAccelerationPolicy unavailable in current configuration");
 #endif // defined(HAVE_VA) || defined(HAVE_VA_INTEL)
 }
 #else // __linux__
 VPLVAAPIAccelerationPolicy::VPLVAAPIAccelerationPolicy(device_selector_ptr_t selector) :
     VPLAccelerationPolicy(selector) {
-    GAPI_Assert(false && "VPLVAAPIAccelerationPolicy unavailable in current configuration");
+    GAPI_Error("VPLVAAPIAccelerationPolicy unavailable in current configuration");
 }
 #endif // __linux__
 
@@ -102,33 +102,33 @@ cv::MediaFrame::AdapterPtr VPLVAAPIAccelerationPolicy::create_frame_adapter(pool
 VPLVAAPIAccelerationPolicy::~VPLVAAPIAccelerationPolicy() = default;
 
 void VPLVAAPIAccelerationPolicy::init(session_t ) {
-    GAPI_Assert(false && "VPLVAAPIAccelerationPolicy unavailable in current configuration");
+    GAPI_Error("VPLVAAPIAccelerationPolicy unavailable in current configuration");
 }
 
 void VPLVAAPIAccelerationPolicy::deinit(session_t) {
-    GAPI_Assert(false && "VPLVAAPIAccelerationPolicy unavailable in current configuration");
+    GAPI_Error("VPLVAAPIAccelerationPolicy unavailable in current configuration");
 }
 
 VPLVAAPIAccelerationPolicy::pool_key_t VPLVAAPIAccelerationPolicy::create_surface_pool(const mfxFrameAllocRequest&,
                                                                                      mfxFrameInfo&) {
-    GAPI_Assert(false && "VPLVAAPIAccelerationPolicy unavailable in current configuration");
+    GAPI_Error("VPLVAAPIAccelerationPolicy unavailable in current configuration");
 }
 
 VPLVAAPIAccelerationPolicy::surface_weak_ptr_t VPLVAAPIAccelerationPolicy::get_free_surface(pool_key_t) {
-    GAPI_Assert(false && "VPLVAAPIAccelerationPolicy unavailable in current configuration");
+    GAPI_Error("VPLVAAPIAccelerationPolicy unavailable in current configuration");
 }
 
 size_t VPLVAAPIAccelerationPolicy::get_free_surface_count(pool_key_t) const {
-    GAPI_Assert(false && "VPLVAAPIAccelerationPolicy unavailable in current configuration");
+    GAPI_Error("VPLVAAPIAccelerationPolicy unavailable in current configuration");
 }
 
 size_t VPLVAAPIAccelerationPolicy::get_surface_count(pool_key_t) const {
-    GAPI_Assert(false && "VPLVAAPIAccelerationPolicy unavailable in current configuration");
+    GAPI_Error("VPLVAAPIAccelerationPolicy unavailable in current configuration");
 }
 
 cv::MediaFrame::AdapterPtr VPLVAAPIAccelerationPolicy::create_frame_adapter(pool_key_t,
                                                                           const FrameConstructorArgs &) {
-    GAPI_Assert(false && "VPLVAAPIAccelerationPolicy unavailable in current configuration");
+    GAPI_Error("VPLVAAPIAccelerationPolicy unavailable in current configuration");
 }
 #endif // defined(HAVE_VA) || defined(HAVE_VA_INTEL)
 } // namespace onevpl
index 77cfbb18b1dc129b916c41118feca46a00d15107..940c704c623960dd77481e5746af75a30b7218dc 100644 (file)
@@ -46,7 +46,7 @@ size_t LockAdapter::read_lock(mfxMemId mid, mfxFrameData &data) {
     // adapter will throw error if VPL frame allocator fails
     if (sts != MFX_ERR_NONE) {
         impl->unlock_shared();
-        GAPI_Assert(false && "Cannot lock frame on READ using VPL allocator");
+        GAPI_Error("Cannot lock frame on READ using VPL allocator");
     }
 
     return prev_lock_count;
@@ -76,7 +76,7 @@ void LockAdapter::write_lock(mfxMemId mid, mfxFrameData &data) {
     // adapter will throw error if VPL frame allocator fails
     if (sts != MFX_ERR_NONE) {
         impl->unlock();
-        GAPI_Assert(false && "Cannot lock frame on WRITE using VPL allocator");
+        GAPI_Error("Cannot lock frame on WRITE using VPL allocator");
     }
 }
 
@@ -199,13 +199,13 @@ void DX11AllocationItem::on_first_in_impl(mfxFrameData *ptr) {
         err = shared_device_context->Map(get_staging_texture_ptr(), 0, mapType, mapFlags, &lockedRect);
         if (S_OK != err && DXGI_ERROR_WAS_STILL_DRAWING != err) {
             GAPI_LOG_WARNING(nullptr, "Cannot Map staging texture in device context, error: " << std::to_string(HRESULT_CODE(err)));
-            GAPI_Assert(false && "Cannot Map staging texture in device context");
+            GAPI_Error("Cannot Map staging texture in device context");
         }
     } while (DXGI_ERROR_WAS_STILL_DRAWING == err);
 
     if (FAILED(err)) {
         GAPI_LOG_WARNING(nullptr, "Cannot lock frame");
-        GAPI_Assert(false && "Cannot lock frame");
+        GAPI_Error("Cannot lock frame");
         return ;
     }
 
index 3744ddc8ce68cc109e0f54dbcc19342b6d994566..01a9a14d43612c565a6e231660529e0eb4fa772c 100644 (file)
@@ -125,7 +125,7 @@ mfxHDLPair VPLMediaFrameDX11Adapter::getHandle() const {
 }
 
 cv::util::any VPLMediaFrameDX11Adapter::blobParams() const {
-    /*GAPI_Assert(false && "VPLMediaFrameDX11Adapter::blobParams() is not fully integrated"
+    /*GAPI_Error("VPLMediaFrameDX11Adapter::blobParams() is not fully integrated"
                          "in OpenVINO InferenceEngine and would be temporary disable.");*/
 #ifdef HAVE_INF_ENGINE
     mfxHDLPair handle = getHandle();
@@ -162,16 +162,16 @@ cv::util::any VPLMediaFrameDX11Adapter::blobParams() const {
     return std::make_pair(std::make_pair(y_tdesc, y_params),
                           std::make_pair(uv_tdesc, uv_params));
 #else
-    GAPI_Assert(false && "VPLMediaFrameDX11Adapter::blobParams() is not implemented");
+    GAPI_Error("VPLMediaFrameDX11Adapter::blobParams() is not implemented");
 #endif // HAVE_INF_ENGINE
 }
 
 void VPLMediaFrameDX11Adapter::serialize(cv::gapi::s11n::IOStream&) {
-    GAPI_Assert(false && "VPLMediaFrameDX11Adapter::serialize() is not implemented");
+    GAPI_Error("VPLMediaFrameDX11Adapter::serialize() is not implemented");
 }
 
 void VPLMediaFrameDX11Adapter::deserialize(cv::gapi::s11n::IIStream&) {
-    GAPI_Assert(false && "VPLMediaFrameDX11Adapter::deserialize() is not implemented");
+    GAPI_Error("VPLMediaFrameDX11Adapter::deserialize() is not implemented");
 }
 
 DXGI_FORMAT VPLMediaFrameDX11Adapter::get_dx11_color_format(uint32_t mfx_fourcc) {
index d43b9068f384ee2ca00728b6651f5dca7e2bba96..83ed99ad916a26332a1802bc6863d50df11c4909 100644 (file)
@@ -244,10 +244,10 @@ CfgParamDeviceSelector::CfgParamDeviceSelector(const CfgParams& cfg_params) :
             suggested_device = IDeviceSelector::create<Device>(va_handle, "GPU", AccelType::VAAPI);
             suggested_context = IDeviceSelector::create<Context>(nullptr, AccelType::VAAPI);
 #else  // defined(HAVE_VA) || defined(HAVE_VA_INTEL)
-            GAPI_Assert(false && "VPLVAAPIAccelerationPolicy unavailable in current linux configuration");
+            GAPI_Error("VPLVAAPIAccelerationPolicy unavailable in current linux configuration");
 #endif // defined(HAVE_VA) || defined(HAVE_VA_INTEL)
 #else // #ifdef __linux__
-            GAPI_Assert(false && "MFX_IMPL_VIA_VAAPI is supported on linux only");
+            GAPI_Error("MFX_IMPL_VIA_VAAPI is supported on linux only");
 #endif // #ifdef __linux__
             break;
         }
@@ -335,10 +335,10 @@ CfgParamDeviceSelector::CfgParamDeviceSelector(Device::Ptr device_ptr,
             suggested_device = IDeviceSelector::create<Device>(device_ptr, device_id, AccelType::VAAPI);
             suggested_context = IDeviceSelector::create<Context>(nullptr, AccelType::VAAPI);
 #else  // defined(HAVE_VA) || defined(HAVE_VA_INTEL)
-            GAPI_Assert(false && "VPLVAAPIAccelerationPolicy unavailable in current linux configuration");
+            GAPI_Error("VPLVAAPIAccelerationPolicy unavailable in current linux configuration");
 #endif // defined(HAVE_VA) || defined(HAVE_VA_INTEL)
 #else // #ifdef __linux__
-            GAPI_Assert(false && "MFX_IMPL_VIA_VAAPI is supported on linux only");
+            GAPI_Error("MFX_IMPL_VIA_VAAPI is supported on linux only");
 #endif // #ifdef __linux__
             break;
         }
@@ -394,10 +394,10 @@ CfgParamDeviceSelector::CfgParamDeviceSelector(const Device &device,
         case AccelType::VAAPI:
 #ifdef __linux__
 #if !defined(HAVE_VA) || !defined(HAVE_VA_INTEL)
-            GAPI_Assert(false && "VPLVAAPIAccelerationPolicy unavailable in current linux configuration");
+            GAPI_Error("VPLVAAPIAccelerationPolicy unavailable in current linux configuration");
 #endif // defined(HAVE_VA) || defined(HAVE_VA_INTEL)
 #else // #ifdef __linux__
-            GAPI_Assert(false && "MFX_IMPL_VIA_VAAPI is supported on linux only");
+            GAPI_Error("MFX_IMPL_VIA_VAAPI is supported on linux only");
 #endif // #ifdef __linux__
             break;
         case AccelType::HOST:
index 9f5a68a43117b70da756c75318ffdc3af8ad445a..a40564aceb2139f254ab455e7c81ced5b0ecf96d 100644 (file)
@@ -60,7 +60,7 @@ private:
         return ret;
     }
     mfxVariant create_impl(const std::string&, const std::string&) {
-        GAPI_Assert(false && "Something wrong: you should not create mfxVariant "
+        GAPI_Error("Something wrong: you should not create mfxVariant "
                              "from string directly - native type is lost in this case");
     }
 };
@@ -173,7 +173,7 @@ void extract_optional_param_by_name(const std::string &name,
             [&out_param](int64_t value)   { out_param = cv::util::make_optional(static_cast<size_t>(value));   },
             [&out_param](float_t value)   { out_param = cv::util::make_optional(static_cast<size_t>(value));   },
             [&out_param](double_t value)  { out_param = cv::util::make_optional(static_cast<size_t>(value));   },
-            [&out_param](void*)     { GAPI_Assert(false && "`void*` is unsupported type");  },
+            [&out_param](void*)     { GAPI_Error("`void*` is unsupported type");  },
             [&out_param](const std::string& value) {
                 out_param = cv::util::make_optional(strtoull_or_throw(value.c_str()));
             }),
@@ -189,7 +189,7 @@ unsigned long strtoul_or_throw(const char* str) {
         ((ret == ULONG_MAX) && errno == ERANGE)) {
             // nothing parsed from the string, handle errors or exit
         GAPI_LOG_WARNING(nullptr, "strtoul failed for: " << str);
-        GAPI_Assert(false && "strtoul_or_throw");
+        GAPI_Error("strtoul_or_throw");
     }
     return ret;
 }
@@ -202,7 +202,7 @@ size_t strtoull_or_throw(const char* str) {
         ((ret == ULLONG_MAX) && errno == ERANGE)) {
             // nothing parsed from the string, handle errors or exit
         GAPI_LOG_WARNING(nullptr, "strtoull failed for: " << str);
-        GAPI_Assert(false && "strtoull_or_throw");
+        GAPI_Error("strtoull_or_throw");
     }
     return ret;
 }
@@ -215,7 +215,7 @@ int64_t strtoll_or_throw(const char* str) {
         ((ret == LONG_MAX || ret == LONG_MIN) && errno == ERANGE)) {
             // nothing parsed from the string, handle errors or exit
         GAPI_LOG_WARNING(nullptr, "strtoll failed for: " << str);
-        GAPI_Assert(false && "strtoll_or_throw");
+        GAPI_Error("strtoll_or_throw");
     }
     return ret;
 }
index 5a4c66fef263a0b24cb22f365f46803a2f992c6e..2d2bbd05a0553a36ce62dff29bec92296928dd38 100644 (file)
@@ -18,7 +18,7 @@ struct IDataProvider::mfx_bitstream : public mfxBitstream {};
 #else // HAVE_ONEVPL
 struct IDataProvider::mfx_bitstream {
     mfx_bitstream() {
-        GAPI_Assert(false && "Reject to create `mfxBitstream` because library compiled without VPL/MFX support");
+        GAPI_Error("Reject to create `mfxBitstream` because library compiled without VPL/MFX support");
     }
 };
 #endif // HAVE_ONEVPL
index 108f8258ab568f0f1220a83698961a2961e3c319..becd893e09512ee185f8121c862ded0f9a3e5898 100644 (file)
@@ -745,7 +745,7 @@ bool MFPAsyncDemuxDataProvider::fetch_bitstream_data(std::shared_ptr<mfx_bitstre
             GAPI_LOG_WARNING(nullptr, "[" << this << "] " <<
                                       "cannot find appropriate dmux buffer by key: " <<
                                       static_cast<void*>(out_bitsream->Data));
-            GAPI_Assert(false && "invalid bitstream key");
+            GAPI_Error("invalid bitstream key");
         }
         if (it->second) {
             it->second->Unlock();
@@ -788,20 +788,20 @@ bool MFPAsyncDemuxDataProvider::empty() const {
 #else // _WIN32
 
 MFPAsyncDemuxDataProvider::MFPAsyncDemuxDataProvider(const std::string&) {
-    GAPI_Assert(false && "Unsupported: Microsoft Media Foundation is not available");
+    GAPI_Error("Unsupported: Microsoft Media Foundation is not available");
 }
 IDataProvider::mfx_codec_id_type MFPAsyncDemuxDataProvider::get_mfx_codec_id() const {
-    GAPI_Assert(false && "Unsupported: Microsoft Media Foundation is not available");
+    GAPI_Error("Unsupported: Microsoft Media Foundation is not available");
     return std::numeric_limits<mfx_codec_id_type>::max();
 }
 
 bool MFPAsyncDemuxDataProvider::fetch_bitstream_data(std::shared_ptr<mfx_bitstream> &) {
-    GAPI_Assert(false && "Unsupported: Microsoft Media Foundation is not available");
+    GAPI_Error("Unsupported: Microsoft Media Foundation is not available");
     return false;
 }
 
 bool MFPAsyncDemuxDataProvider::empty() const {
-    GAPI_Assert(false && "Unsupported: Microsoft Media Foundation is not available");
+    GAPI_Error("Unsupported: Microsoft Media Foundation is not available");
     return true;
 }
 #endif // _WIN32
index 8a35cca063c9cc9fcb1cf4cb4959928cc73ffed6..7b0ad8c83d91ad17b30956a22e70a2b5a0eae6ac 100644 (file)
@@ -190,7 +190,7 @@ VPLLegacyDecodeEngine::SessionParam VPLLegacyDecodeEngine::prepare_session_param
         // TODO make proper direction
         mfxDecParams.IOPattern = MFX_IOPATTERN_OUT_SYSTEM_MEMORY;
     } else {
-        GAPI_Assert(false && "unsupported AccelType from device selector");
+        GAPI_Error("unsupported AccelType from device selector");
     }
 
     // try fetch & decode input data
index 5a08f2bd093db2046201d7419cf92e3b4ddd72f3..c3f63efc550821f12c34482d4bcd2ca9050a13f4 100644 (file)
@@ -66,7 +66,7 @@ pp_session VPPPreprocDispatcher::initialize_preproc(const pp_params& initial_fra
             return sess;
         }
     }
-    GAPI_Assert(false && "Cannot initialize VPP preproc in dispatcher, no suitable worker");
+    GAPI_Error("Cannot initialize VPP preproc in dispatcher, no suitable worker");
 }
 
 cv::MediaFrame VPPPreprocDispatcher::run_sync(const pp_session &session_handle,
@@ -80,7 +80,7 @@ cv::MediaFrame VPPPreprocDispatcher::run_sync(const pp_session &session_handle,
             return w->run_sync(session_handle, in_frame, opt_roi);
         }
     }
-    GAPI_Assert(false && "Cannot invoke VPP preproc in dispatcher, no suitable worker");
+    GAPI_Error("Cannot invoke VPP preproc in dispatcher, no suitable worker");
 }
 
 #else // HAVE_ONEVPL
@@ -90,13 +90,13 @@ cv::util::optional<pp_params> VPPPreprocDispatcher::is_applicable(const cv::Medi
 
 pp_session VPPPreprocDispatcher::initialize_preproc(const pp_params&,
                                                     const GFrameDesc&) {
-    GAPI_Assert(false && "Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
+    GAPI_Error("Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
 }
 
 cv::MediaFrame VPPPreprocDispatcher::run_sync(const pp_session &,
                                               const cv::MediaFrame&,
                                               const cv::util::optional<cv::Rect> &) {
-    GAPI_Assert(false && "Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
+    GAPI_Error("Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
 }
 #endif // HAVE_ONEVPL
 } // namespace onevpl
index d0c4a85f38e13d548c793e014d01a5b651d11d2f..cc81df06261caabf734a88d7922891d72dca76a2 100644 (file)
@@ -249,13 +249,13 @@ pp_session VPPPreprocEngine::initialize_preproc(const pp_params& initial_frame_p
     sts = MFXCreateSession(mfx_handle, impl_number, &mfx_vpp_session);
     if (sts != MFX_ERR_NONE) {
         GAPI_LOG_WARNING(nullptr, "Cannot clone VPP session, error: " << mfxstatus_to_string(sts));
-        GAPI_Assert(false && "Cannot continue VPP preprocessing");
+        GAPI_Error("Cannot continue VPP preprocessing");
     }
 
     sts = MFXJoinSession(params.handle, mfx_vpp_session);
     if (sts != MFX_ERR_NONE) {
         GAPI_LOG_WARNING(nullptr, "Cannot join VPP sessions, error: " << mfxstatus_to_string(sts));
-        GAPI_Assert(false && "Cannot continue VPP preprocessing");
+        GAPI_Error("Cannot continue VPP preprocessing");
     }
 
     GAPI_LOG_INFO(nullptr, "[" << mfx_vpp_session << "] starting pool allocation");
@@ -301,7 +301,7 @@ pp_session VPPPreprocEngine::initialize_preproc(const pp_params& initial_frame_p
         }
     } catch (const std::exception&) {
         MFXClose(mfx_vpp_session);
-        GAPI_Assert(false && "Cannot init preproc resources");
+        GAPI_Error("Cannot init preproc resources");
     }
 
     // create engine session after all
index 6cf7212f3e8de4e00ccb31e569597ccc6a368aa7..f6c210ad9dfad322cabf4b6dd3682de676c7d3c4 100644 (file)
@@ -28,7 +28,7 @@ cv::MediaFormat fourcc_to_MediaFormat(int value) {
         default:
             GAPI_LOG_WARNING(nullptr, "Unsupported FourCC format requested: " << value <<
                                      ". Cannot cast to cv::MediaFrame");
-            GAPI_Assert(false && "Unsupported FOURCC");
+            GAPI_Error("Unsupported FOURCC");
 
     }
 }
@@ -44,7 +44,7 @@ int MediaFormat_to_fourcc(cv::MediaFormat value) {
             GAPI_LOG_WARNING(nullptr, "Unsupported cv::MediaFormat format requested: " <<
                                       static_cast<typename std::underlying_type<cv::MediaFormat>::type>(value) <<
                                      ". Cannot cast to FourCC");
-            GAPI_Assert(false && "Unsupported cv::MediaFormat");
+            GAPI_Error("Unsupported cv::MediaFormat");
     }
 }
 int MediaFormat_to_chroma(cv::MediaFormat value) {
@@ -58,7 +58,7 @@ int MediaFormat_to_chroma(cv::MediaFormat value) {
             GAPI_LOG_WARNING(nullptr, "Unsupported cv::MediaFormat format requested: " <<
                                       static_cast<typename std::underlying_type<cv::MediaFormat>::type>(value) <<
                                      ". Cannot cast to ChromaFormateIdc");
-            GAPI_Assert(false && "Unsupported cv::MediaFormat");
+            GAPI_Error("Unsupported cv::MediaFormat");
     }
 }
 
index b5787320d6669db99458b18e22ff8cbfcabfc239..62d03e1440a5e3018f1247bc928eac73fc1c7684 100644 (file)
@@ -30,7 +30,7 @@ namespace wip {
 template<typename SpecificPreprocEngine, typename ...PreprocEngineArgs >
 std::unique_ptr<SpecificPreprocEngine>
 IPreprocEngine::create_preproc_engine_impl(const PreprocEngineArgs& ...) {
-    GAPI_Assert(false && "Unsupported ");
+    GAPI_Error("Unsupported ");
 }
 
 template <>
@@ -91,7 +91,7 @@ IPreprocEngine::create_preproc_engine_impl(const onevpl::Device &device,
     }
     if (!pp_is_created) {
         GAPI_LOG_WARNING(nullptr, "Cannot create VPP preprocessing engine: configuration unsupported");
-        GAPI_Assert(false && "VPP preproc unsupported");
+        GAPI_Error("VPP preproc unsupported");
     }
 #endif // HAVE_ONEVPL
     return dispatcher;
index 23703bf172ed20fb9c8fbb271b1d9ed40d24bdc7..41feb5c7fe171c52d10e833f5f364fd6067e5775 100644 (file)
@@ -404,7 +404,7 @@ void VPLLegacyTranscodeEngine::validate_vpp_param(const mfxVideoParam& mfxVPPPar
                                   " must be less or equal to \"" <<
                                   CfgParam::vpp_in_width_name() << "\": " <<
                                   mfxVPPParams.vpp.In.Width);
-        GAPI_Assert(false && "Invalid VPP params combination: Width & Crop");
+        GAPI_Error("Invalid VPP params combination: Width & Crop");
     }
 
     if (mfxVPPParams.vpp.In.Height < mfxVPPParams.vpp.In.CropH + mfxVPPParams.vpp.In.CropY) {
@@ -416,7 +416,7 @@ void VPLLegacyTranscodeEngine::validate_vpp_param(const mfxVideoParam& mfxVPPPar
                                   " must be less or equal to \"" <<
                                   CfgParam::vpp_in_height_name() << "\": " <<
                                   mfxVPPParams.vpp.In.Height);
-        GAPI_Assert(false && "Invalid VPP params combination: Height & Crop");
+        GAPI_Error("Invalid VPP params combination: Height & Crop");
     }
 
     if (mfxVPPParams.vpp.Out.Width < mfxVPPParams.vpp.Out.CropW + mfxVPPParams.vpp.Out.CropX) {
@@ -428,7 +428,7 @@ void VPLLegacyTranscodeEngine::validate_vpp_param(const mfxVideoParam& mfxVPPPar
                                   " must be less or equal to \"" <<
                                   CfgParam::vpp_out_width_name() << "\": " <<
                                   mfxVPPParams.vpp.Out.Width);
-        GAPI_Assert(false && "Invalid VPP params combination: Width & Crop");
+        GAPI_Error("Invalid VPP params combination: Width & Crop");
     }
 
     if (mfxVPPParams.vpp.Out.Height < mfxVPPParams.vpp.Out.CropH + mfxVPPParams.vpp.Out.CropY) {
@@ -440,7 +440,7 @@ void VPLLegacyTranscodeEngine::validate_vpp_param(const mfxVideoParam& mfxVPPPar
                                   " must be less or equal to \"" <<
                                   CfgParam::vpp_out_height_name() << "\": " <<
                                   mfxVPPParams.vpp.Out.Height);
-        GAPI_Assert(false && "Invalid VPP params combination: Height & Crop");
+        GAPI_Error("Invalid VPP params combination: Height & Crop");
     }
 
     GAPI_LOG_INFO(nullptr, "Finished VPP param validation");
index a86d5419043084143b1726e1186e4f166e694385..189cb3b0701d24ab58a80e3643f7607c07d59868 100644 (file)
@@ -127,26 +127,23 @@ FileDataProvider::FileDataProvider(const std::string&,
     source_handle(nullptr, &fclose),
     codec(std::numeric_limits<mfx_codec_id_type>::max()),
     bitstream_data_size(bitstream_data_size_value) {
-    GAPI_Assert(false && "Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
+    GAPI_Error("Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
 }
 
 FileDataProvider::~FileDataProvider() = default;
 
 IDataProvider::mfx_codec_id_type FileDataProvider::get_mfx_codec_id() const {
     cv::util::suppress_unused_warning(codec);
-    GAPI_Assert(false && "Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
-    return codec;
+    GAPI_Error("Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
 }
 
 bool FileDataProvider::fetch_bitstream_data(std::shared_ptr<mfx_bitstream> &) {
     cv::util::suppress_unused_warning(bitstream_data_size);
-    GAPI_Assert(false && "Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
-    return false;
+    GAPI_Error("Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
 }
 
 bool FileDataProvider::empty() const {
-    GAPI_Assert(false && "Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
-    return true;
+    GAPI_Error("Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
 }
 #endif // HAVE_ONEVPL
 } // namespace onevpl
index efcc9bf8509304742f686639e7d7029b537c100d..b25edb6e5d5564c7dbd96175b9597171beb03633 100644 (file)
@@ -73,33 +73,33 @@ GSource::GSource(std::shared_ptr<IDataProvider> source,
 
 #else
 GSource::GSource(const std::string&, const CfgParams&) {
-    GAPI_Assert(false && "Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
+    GAPI_Error("Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
 }
 
 GSource::GSource(const std::string&, const CfgParams&, const std::string&,
                  void*, void*) {
-    GAPI_Assert(false && "Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
+    GAPI_Error("Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
 }
 
 GSource::GSource(const std::string&, const CfgParams&, const Device &, const Context &) {
-    GAPI_Assert(false && "Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
+    GAPI_Error("Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
 }
 
 GSource::GSource(const std::string&, const CfgParams&, std::shared_ptr<IDeviceSelector>) {
-    GAPI_Assert(false && "Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
+    GAPI_Error("Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
 }
 
 GSource::GSource(std::shared_ptr<IDataProvider>, const CfgParams&) {
-    GAPI_Assert(false && "Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
+    GAPI_Error("Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
 }
 
 GSource::GSource(std::shared_ptr<IDataProvider>, const CfgParams&,
                  const std::string&, void*, void*) {
-    GAPI_Assert(false && "Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
+    GAPI_Error("Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
 }
 
 GSource::GSource(std::shared_ptr<IDataProvider>, const CfgParams&, std::shared_ptr<IDeviceSelector>) {
-    GAPI_Assert(false && "Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
+    GAPI_Error("Unsupported: G-API compiled without `WITH_GAPI_ONEVPL=ON`");
 }
 #endif
 
index bd74ca0a25b9f724755687ffe30d1238881e355b..ce7bca8435555e95d58e5eba215c52ad3e9dd57c 100644 (file)
@@ -109,7 +109,7 @@ GSource::Priv::Priv(std::shared_ptr<IDataProvider> provider,
             GAPI_LOG_WARNING(nullptr, "MFXSetConfigFilterProperty failed, error: " <<
                                       mfxstatus_to_string(sts) <<
                                       " - for \"" << cfg_param_it->get_name() << "\"");
-            GAPI_Assert(false && "MFXSetConfigFilterProperty failed");
+            GAPI_Error("MFXSetConfigFilterProperty failed");
         }
 
         mfx_param.Type     = MFX_VARIANT_TYPE_U32;
@@ -123,7 +123,7 @@ GSource::Priv::Priv(std::shared_ptr<IDataProvider> provider,
             GAPI_LOG_WARNING(nullptr, "MFXSetConfigFilterProperty failed, error: " <<
                                       mfxstatus_to_string(sts) <<
                                       " - for \"mfxImplDescription.mfxVPPDescription.filter.FilterFourCC\"");
-            GAPI_Assert(false && "MFXSetConfigFilterProperty failed");
+            GAPI_Error("MFXSetConfigFilterProperty failed");
         }
 
         ++cfg_param_it;
@@ -317,7 +317,7 @@ std::unique_ptr<VPLAccelerationPolicy> GSource::Priv::initializeHWAccel(std::sha
             GAPI_LOG_WARNING(nullptr, "Cannot initialize HW Accel: "
                                       "invalid accelerator type: " <<
                                       std::to_string(accel_mode.Data.U32));
-            GAPI_Assert(false && "Cannot initialize HW Accel");
+            GAPI_Error("Cannot initialize HW Accel");
         }
     }
 
index b5a46282122f7bcc7564e8666c8fc4930de9e36d..6d4a4bd41b918e57a1ba92011a882f0d832a893d 100644 (file)
@@ -41,7 +41,7 @@ inline std::ostream& operator<<(std::ostream& os, mathOp op)
         CASE(SUB);
         CASE(MUL);
         CASE(DIV);
-        default: GAPI_Assert(false && "unknown mathOp value");
+        default: GAPI_Error("unknown mathOp value");
     }
 #undef CASE
     return os;
@@ -57,7 +57,7 @@ inline std::ostream& operator<<(std::ostream& os, bitwiseOp op)
         CASE(OR);
         CASE(XOR);
         CASE(NOT);
-        default: GAPI_Assert(false && "unknown bitwiseOp value");
+        default: GAPI_Error("unknown bitwiseOp value");
     }
 #undef CASE
     return os;
index 9a195e068833543e1831f5d50edd8ffa33cb51ea..1f2fdc7df6108679699cba524097238a47ba6ce7 100644 (file)
@@ -34,7 +34,7 @@ inline std::ostream& operator<<(std::ostream& os, operation op)
         CASE(GTR); CASE(LTR); CASE(GER); CASE(LER); CASE(EQR); CASE(NER);
         CASE(AND);  CASE(OR);  CASE(XOR);
         CASE(ANDR); CASE(ORR); CASE(XORR);
-        default: GAPI_Assert(false && "unknown operation value");
+        default: GAPI_Error("unknown operation value");
     }
 #undef CASE
     return os;
@@ -187,7 +187,7 @@ struct g_api_ocv_pair_mat_scalar {
             CASE(GTR); CASE(LTR); CASE(GER); CASE(LER); CASE(EQR); CASE(NER);
             CASE(AND);  CASE(OR);  CASE(XOR);
             CASE(ANDR); CASE(ORR); CASE(XORR);
-            default: GAPI_Assert(false && "unknown operation value");
+            default: GAPI_Error("unknown operation value");
         }
     }
 #undef CASE
@@ -214,7 +214,7 @@ struct g_api_ocv_pair_mat_mat {
             CASE(ADD);  CASE(SUB);  CASE(DIV);
             CASE(GT); CASE(LT); CASE(GE); CASE(LE); CASE(EQ); CASE(NE);
             CASE(AND); CASE(OR); CASE(XOR);
-            default: GAPI_Assert(false && "unknown operation value");
+            default: GAPI_Error("unknown operation value");
         }
     }
 #undef CASE
index 79505317bc2a559dbc62ca170e41ad17f77fac7f..8e3664616148491ee3aaecfe376b65ff114cc15f 100644 (file)
@@ -25,7 +25,7 @@ TEST_P(TestGAPIStereo, DisparityDepthTest)
         case format::DEPTH_FLOAT16: dtype = CV_16FC1; break;
         case format::DEPTH_FLOAT32: dtype = CV_32FC1; break;
         case format::DISPARITY_FIXED16_12_4: dtype = CV_16SC1; break;
-        default: GAPI_Assert(false && "Unsupported format in test");
+        default: GAPI_Error("Unsupported format in test");
     }
     initOutMats(sz, dtype);
 
@@ -61,7 +61,7 @@ TEST_P(TestGAPIStereo, DisparityDepthTest)
         case format::DISPARITY_FIXED16_12_4:
             break;
         default:
-            GAPI_Assert(false && "Unsupported format in test");
+            GAPI_Error("Unsupported format in test");
     }
 
     EXPECT_TRUE(cmpF(out_mat_gapi, out_mat_ocv));
index 4c9c2d97006649853214888fdba5e3c5a763e0f9..f84ee05f4984b938c825a3d2fa1cb6884b108fc9 100644 (file)
@@ -373,7 +373,7 @@ public:
             initMatByPointsVectorRandU<Pt<cv::float16_t>>(sz_in);
             break;
         default:
-            GAPI_Assert(false && "Unsupported depth");
+            GAPI_Error("Unsupported depth");
             break;
         }
     }
@@ -1065,7 +1065,7 @@ inline std::ostream& operator<<(std::ostream& os, CmpTypes op)
         CASE(CMP_LT);
         CASE(CMP_LE);
         CASE(CMP_NE);
-        default: GAPI_Assert(false && "unknown CmpTypes value");
+        default: GAPI_Error("unknown CmpTypes value");
     }
 #undef CASE
     return os;
@@ -1084,7 +1084,7 @@ inline std::ostream& operator<<(std::ostream& os, NormTypes op)
         CASE(NORM_HAMMING2);
         CASE(NORM_RELATIVE);
         CASE(NORM_MINMAX);
-        default: GAPI_Assert(false && "unknown NormTypes value");
+        default: GAPI_Error("unknown NormTypes value");
     }
 #undef CASE
     return os;
@@ -1100,7 +1100,7 @@ inline std::ostream& operator<<(std::ostream& os, RetrievalModes op)
         CASE(RETR_CCOMP);
         CASE(RETR_TREE);
         CASE(RETR_FLOODFILL);
-        default: GAPI_Assert(false && "unknown RetrievalModes value");
+        default: GAPI_Error("unknown RetrievalModes value");
     }
 #undef CASE
     return os;
@@ -1115,7 +1115,7 @@ inline std::ostream& operator<<(std::ostream& os, ContourApproximationModes op)
         CASE(CHAIN_APPROX_SIMPLE);
         CASE(CHAIN_APPROX_TC89_L1);
         CASE(CHAIN_APPROX_TC89_KCOS);
-        default: GAPI_Assert(false && "unknown ContourApproximationModes value");
+        default: GAPI_Error("unknown ContourApproximationModes value");
     }
 #undef CASE
     return os;
@@ -1134,7 +1134,7 @@ inline std::ostream& operator<<(std::ostream& os, MorphTypes op)
         CASE(MORPH_TOPHAT);
         CASE(MORPH_BLACKHAT);
         CASE(MORPH_HITMISS);
-        default: GAPI_Assert(false && "unknown MorphTypes value");
+        default: GAPI_Error("unknown MorphTypes value");
     }
 #undef CASE
     return os;
@@ -1153,7 +1153,7 @@ inline std::ostream& operator<<(std::ostream& os, DistanceTypes op)
         CASE(DIST_FAIR);
         CASE(DIST_WELSCH);
         CASE(DIST_HUBER);
-        default: GAPI_Assert(false && "unknown DistanceTypes value");
+        default: GAPI_Error("unknown DistanceTypes value");
     }
 #undef CASE
     return os;
@@ -1176,7 +1176,7 @@ inline std::ostream& operator<<(std::ostream& os, KmeansFlags op)
     case KmeansFlags::KMEANS_PP_CENTERS | KmeansFlags::KMEANS_USE_INITIAL_LABELS:
         os << "KMEANS_PP_CENTERS | KMEANS_USE_INITIAL_LABELS";
         break;
-    default: GAPI_Assert(false && "unknown KmeansFlags value");
+    default: GAPI_Error("unknown KmeansFlags value");
     }
     return os;
 }
index f3e7e5aa6c947083dfec8fc17ef591c48adb841d..0f755439c29ca5a8fba6bdb36b75ef2097ec7eec 100644 (file)
@@ -435,7 +435,7 @@ inline cv::GComputation runOCVnGAPIBuildOptFlowPyramid(TestFunctional&,
                                                        BuildOpticalFlowPyramidTestOutput&,
                                                        BuildOpticalFlowPyramidTestOutput&)
 {
-    GAPI_Assert(0 && "This function shouldn't be called without opencv_video");
+    GAPI_Error("This function shouldn't be called without opencv_video");
 }
 
 inline cv::GComputation runOCVnGAPIOptFlowLK(TestFunctional&,
@@ -444,7 +444,7 @@ inline cv::GComputation runOCVnGAPIOptFlowLK(TestFunctional&,
                                              OptFlowLKTestOutput&,
                                              OptFlowLKTestOutput&)
 {
-    GAPI_Assert(0 && "This function shouldn't be called without opencv_video");
+    GAPI_Error("This function shouldn't be called without opencv_video");
 }
 
 inline cv::GComputation runOCVnGAPIOptFlowLKForPyr(TestFunctional&,
@@ -454,7 +454,7 @@ inline cv::GComputation runOCVnGAPIOptFlowLKForPyr(TestFunctional&,
                                                    OptFlowLKTestOutput&,
                                                    OptFlowLKTestOutput&)
 {
-    GAPI_Assert(0 && "This function shouldn't be called without opencv_video");
+    GAPI_Error("This function shouldn't be called without opencv_video");
 }
 
 inline GComputation runOCVnGAPIOptFlowPipeline(TestFunctional&,
@@ -463,7 +463,7 @@ inline GComputation runOCVnGAPIOptFlowPipeline(TestFunctional&,
                                                OptFlowLKTestOutput&,
                                                std::vector<Point2f>&)
 {
-    GAPI_Assert(0 && "This function shouldn't be called without opencv_video");
+    GAPI_Error("This function shouldn't be called without opencv_video");
 }
 
 #endif // HAVE_OPENCV_VIDEO
@@ -481,7 +481,7 @@ inline std::ostream& operator<<(std::ostream& os, const BackgroundSubtractorType
     {
         CASE(TYPE_BS_MOG2);
         CASE(TYPE_BS_KNN);
-        default: GAPI_Assert(false && "unknown BackgroundSubtractor type");
+        default: GAPI_Error("unknown BackgroundSubtractor type");
     }
 #undef CASE
     return os;
index 5b1e6c9d4fe0968e727f835c98f7d3fc54ff172d..110ae7d9640503c7368c4a5fbe9fc7c75365e16b 100644 (file)
@@ -114,7 +114,7 @@ inline int toCV(ONNXTensorElementDataType prec) {
     case ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT: return CV_32F;
     case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32: return CV_32S;
     case ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64: return CV_32S;
-    default: GAPI_Assert(false && "Unsupported data type");
+    default: GAPI_Error("Unsupported data type");
     }
     return -1;
 }
@@ -142,7 +142,7 @@ void copyFromONNX(Ort::Value &v, cv::Mat& mat) {
                    [](int64_t el) { return static_cast<int>(el); });
             break;
         }
-    default: GAPI_Assert(false && "ONNX. Unsupported data type");
+    default: GAPI_Error("ONNX. Unsupported data type");
     }
 }
 
index 22398ec92ccff39fd6c4ee33e4d02fec0c39f554..0dd88cd5b80b7e78fcb7f18cfcf3cf20bbf7f695 100644 (file)
@@ -554,7 +554,7 @@ TEST_F(S11N_Basic, Test_RunArgs_MatScalar) {
             EXPECT_EQ(scalar, out_scalar);
         } break;
         default:
-            GAPI_Assert(false && "This value type is not supported!"); // ...maybe because of STANDALONE mode.
+            GAPI_Error("This value type is not supported!"); // ...maybe because of STANDALONE mode.
             break;
         }
         i++;
@@ -587,7 +587,7 @@ TEST_F(S11N_Basic, Test_Bind_RunArgs_MatScalar) {
             EXPECT_EQ(out_scalar->val[2], scalar.val[2]);
         } break;
         default:
-            GAPI_Assert(false && "This value type is not supported!"); // ...maybe because of STANDALONE mode.
+            GAPI_Error("This value type is not supported!"); // ...maybe because of STANDALONE mode.
             break;
         }
     }
index 111f43bd194ecb521449aeceed9d5ceaa0d2679b..c27ebe3ca2486f5551bee2203d340bf433aba587 100644 (file)
@@ -49,7 +49,7 @@ std::ostream& operator<< (std::ostream &os, const KernelPackage &e)
         _C(OCL);
         _C(OCL_FLUID);
 #undef _C
-    default: GAPI_Assert(false);
+    default: GAPI_Error("InternalError");
     }
     return os;
 }
@@ -298,7 +298,7 @@ void checkPullOverload(const cv::Mat& ref,
             out_mat = *opt_mat;
             break;
         }
-        default: GAPI_Assert(false && "Incorrect type of Args");
+        default: GAPI_Error("Incorrect type of Args");
     }
 
     EXPECT_EQ(0., cv::norm(ref, out_mat, cv::NORM_INF));
@@ -2420,7 +2420,7 @@ TEST(GAPI_Streaming, TestPythonAPI)
     switch (args.index()) {
         case RunArgs::index_of<cv::GRunArgs>():
             out_args = util::get<cv::GRunArgs>(args); break;
-        default: GAPI_Assert(false && "Incorrect type of return value");
+        default: GAPI_Error("Incorrect type of return value");
     }
 
     ASSERT_EQ(1u, out_args.size());