# 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
#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>
} // namespace cv
+#if defined _MSC_VER
+#pragma warning(pop)
+#endif
+
#endif // OPENCV_GAPI_GCPUKERNEL_HPP
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");
}
};
{
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
{
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
kinds.emplace_back(cv::detail::OpaqueKind::CV_UNKNOWN);
break;
default:
- GAPI_Assert(false);
+ GAPI_Error("InternalError");
}
}
}
kinds.emplace_back(cv::detail::OpaqueKind::CV_RECT);
break;
default:
- GAPI_Assert(false);
+ GAPI_Error("InternalError");
}
}
// 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.");
}
};
# define GAPI_DbgAssert(expr) GAPI_DbgAssertNoOp(expr)
#endif
+#define GAPI_Error(msg) CV_Error(cv::Error::StsError, msg)
+
#else
#include <stdexcept>
#include <sstream>
# 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
// 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.");
}
};
#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
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>
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>
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{};
}
} // namespace gapi
} // namespace cv
+#if defined _MSC_VER
+#pragma warning(pop)
+#endif
+
#endif // OPENCV_GAPI_S11N_HPP
* 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.
* 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!");
}
};
case StereoOutputFormat::DISPARITY_FIXED16_12_4:
return left.withDepth(CV_16SC1);
default:
- GAPI_Assert(false && "Unknown output format!");
+ GAPI_Error("Unknown output format!");
}
}
};
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
else
{
// Seems to be impossible case.
- GAPI_Assert(false);
+ GAPI_Error("InternalError");
}
}
catch (...)
switch(type) { \
LIST_G(HC, HC) \
default: \
- GAPI_Assert(false && "Unsupported type"); \
+ GAPI_Error("Unsupported type"); \
}
using cv::gapi::wip::draw::Prim;
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; }
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; }
const std::vector<ade::NodeHandle> &) const
{
// ...and this method is here for the same reason!
- GAPI_Assert(false);
+ GAPI_Error("InternalError");
return {};
}
break;
default:
- GAPI_Assert(false);
+ GAPI_Error("InternalError");
}
}
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;
break;
default:
- GAPI_Assert(false);
+ GAPI_Error("InternalError");
}
return os;
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;
}
}
{
#if !defined(GAPI_STANDALONE)
case T::index_of<cv::UMat*>() :
- GAPI_Assert(false && "Please implement this!");
+ GAPI_Error("Please implement this!");
break;
#endif
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();
// 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");
}
}
}
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;
}
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;
}
}
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) {
#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 &)
{
static void put(IOStream&, const Ref &)
{
- GAPI_Assert(false && "Unsupported type for GArray/GOpaque serialization");
+ GAPI_Error("Unsupported type for GArray/GOpaque serialization");
}
};
{
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");
}
};
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;
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;
{
static void init(cv::gimpl::Data&)
{
- GAPI_Assert(false && "Unsupported type for GArray/GOpaque deserialization");
+ GAPI_Error("Unsupported type for GArray/GOpaque deserialization");
}
};
#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
} // namespace gapi
} // namespace cv
+#if defined _MSC_VER
+#pragma warning(pop)
+#endif
+
#endif // OPENCV_GAPI_COMMON_SERIALIZATION_HPP
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!");
}
}
};
}
} break;
case cv::GFluidKernel::Kind::YUV420toRGB: return inPort == 0 ? 2 : 1; break;
- default: GAPI_Assert(false); return 0;
+ default: GAPI_Error("InternalError"); return 0;
}
}
// 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;
}
}
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;
};
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
last_agent++;
break;
}
- default: GAPI_Assert(false);
+ default: GAPI_Error("InternalError");
}
}
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;
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,
case NodeKind::EMIT:
case NodeKind::SINK:
break; // do nothing for Streaming nodes
- default: GAPI_Assert(false);
+ default: GAPI_Error("InternalError");
} // switch
} // for (gim.nodes())
});
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>;
}
};
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");
}
}
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;
}
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;
}
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{};
}
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>
mat.total());
break;
}
- default: GAPI_Assert(false && "IE. Unsupported data type");
+ default: GAPI_Error("IE. Unsupported data type");
}
}
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]);
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 >>");
default:
GAPI_Assert("Unsupported input shape for IE backend");
}
- GAPI_Assert(false);
+ GAPI_Error("InternalError");
}
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));
}
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);
// 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;
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,
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,
// 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;
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");
}
}
[](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");
}
}
}
}
// 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);
// 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)};
}
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
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;
}
mat.total());
break;
}
- default: GAPI_Assert(false && "ONNX. Unsupported data type");
+ default: GAPI_Error("ONNX. Unsupported data type");
}
}
"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;
break;
}
default:
- GAPI_Assert(false && "Unsupported media format for ONNX backend");
+ GAPI_Error("Unsupported media format for ONNX backend");
}
}
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};
}
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:
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)
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,
break;
}
default:
- GAPI_Assert(false && "Unsupported output type");
+ GAPI_Error("Unsupported output type");
}
}
{
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,
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));
return util::holds_alternative<cv::GOpaqueDesc>(meta);
default:
- GAPI_Assert(false);
+ GAPI_Error("InternalError");
}
return false; // should never happen
};
// 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;
}
}
// 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
{
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)
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
default:
// Unsupported node shape
- GAPI_Assert(false);
+ GAPI_Error("InternalError");
break;
}
}
}
}
break;
- default: GAPI_Assert(false);
+ default: GAPI_Error("InternalError");
}
}
}
break;
default:
- GAPI_Assert(false);
+ GAPI_Error("InternalError");
break;
}
}
// 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.
}
testNodeMeta,
isAlreadyVisited);
default:
- GAPI_Assert(false && "Unsupported Node type!");
+ break;
}
-
- return false;
+ GAPI_Error("Unsupported Node type!");
});
if (testIt == testOutputNodesLabeled.end()) {
{
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);
break;
default:
- GAPI_Assert(false);
+ GAPI_Error("InternalError");
break;
} // switch(kind)
} // for(gim nodes)
break;
}
default:
- GAPI_Assert(false);
+ GAPI_Error("InternalError");
}
}
*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;
}
}
} 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;
}
}
break;
}
default:
- GAPI_Assert(false && "Unsupported cmd type in getInputVector()");
+ GAPI_Error("Unsupported cmd type in getInputVector()");
}
} // for(in_queues)
m_stops_sent++;
break;
default:
- GAPI_Assert(false && "Unreachable code");
+ GAPI_Error("Unreachable code");
}
for (auto &&q : m_out_queues[out_idx])
out_queue.push(Cmd{cv::util::get<cv::gimpl::Exception>(result)});
break;
default:
- GAPI_Assert(false && "Unreachable code");
+ GAPI_Error("Unreachable code");
}
}
}
}
break;
default:
- GAPI_Assert(false);
+ GAPI_Error("InternalError");
break;
} // switch(kind)
} // for(gim nodes)
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)
return true;
}
}
- GAPI_Assert(false && "Unreachable code");
+ GAPI_Error("Unreachable code");
}
cv::gimpl::GAbstractStreamingExecutor::PyPullResult cv::gimpl::GStreamingExecutor::pull()
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;
}
}
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;
}
}
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;
}
}
}
cv::util::any GStreamerMediaAdapter::blobParams() const {
- GAPI_Assert(false && "No implementation for GStreamerMediaAdapter::blobParams()");
+ GAPI_Error("No implementation for GStreamerMediaAdapter::blobParams()");
}
} // namespace gst
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()
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&,
break;
}
default: {
- GAPI_Assert(false && "Unsupported GStreamerSource FRAME type.");
+ GAPI_Error("Unsupported GStreamerSource FRAME type.");
}
}
break;
break;
}
default: {
- GAPI_Assert(false && "retrieveFrame - unsupported GStreamerSource FRAME type.");
+ GAPI_Error("retrieveFrame - unsupported GStreamerSource FRAME type.");
}
}
}
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&)
", 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);
", 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);
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;
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;
}
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 {
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
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__
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
// 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;
// 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");
}
}
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 ;
}
}
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();
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) {
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;
}
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;
}
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:
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");
}
};
[&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()));
}),
((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;
}
((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;
}
((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;
}
#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
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();
#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
// 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
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,
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
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
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");
}
} 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
default:
GAPI_LOG_WARNING(nullptr, "Unsupported FourCC format requested: " << value <<
". Cannot cast to cv::MediaFrame");
- GAPI_Assert(false && "Unsupported FOURCC");
+ GAPI_Error("Unsupported FOURCC");
}
}
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) {
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");
}
}
template<typename SpecificPreprocEngine, typename ...PreprocEngineArgs >
std::unique_ptr<SpecificPreprocEngine>
IPreprocEngine::create_preproc_engine_impl(const PreprocEngineArgs& ...) {
- GAPI_Assert(false && "Unsupported ");
+ GAPI_Error("Unsupported ");
}
template <>
}
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;
" 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) {
" 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) {
" 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) {
" 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");
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
#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
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;
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;
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");
}
}
CASE(SUB);
CASE(MUL);
CASE(DIV);
- default: GAPI_Assert(false && "unknown mathOp value");
+ default: GAPI_Error("unknown mathOp value");
}
#undef CASE
return os;
CASE(OR);
CASE(XOR);
CASE(NOT);
- default: GAPI_Assert(false && "unknown bitwiseOp value");
+ default: GAPI_Error("unknown bitwiseOp value");
}
#undef CASE
return os;
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;
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
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
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);
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));
initMatByPointsVectorRandU<Pt<cv::float16_t>>(sz_in);
break;
default:
- GAPI_Assert(false && "Unsupported depth");
+ GAPI_Error("Unsupported depth");
break;
}
}
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;
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;
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;
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;
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;
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;
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;
}
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&,
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&,
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&,
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
{
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;
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;
}
[](int64_t el) { return static_cast<int>(el); });
break;
}
- default: GAPI_Assert(false && "ONNX. Unsupported data type");
+ default: GAPI_Error("ONNX. Unsupported data type");
}
}
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++;
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;
}
}
_C(OCL);
_C(OCL_FLUID);
#undef _C
- default: GAPI_Assert(false);
+ default: GAPI_Error("InternalError");
}
return os;
}
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));
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());