mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
Merge pull request #22935 from alalek:gapi_error
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
This commit is contained in:
committed by
GitHub
parent
420db56ffd
commit
91998d6424
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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&,
|
||||
|
||||
@@ -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&)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ;
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user