mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
G-API: Integrated cv::MediaFrame as I/O type + CPU backend
This commit is contained in:
@@ -122,6 +122,9 @@ cv::GMetaArg cv::descr_of(const cv::GRunArg &arg)
|
||||
case GRunArg::index_of<cv::RMat>():
|
||||
return cv::GMetaArg(cv::util::get<cv::RMat>(arg).desc());
|
||||
|
||||
case GRunArg::index_of<cv::MediaFrame>():
|
||||
return cv::GMetaArg(cv::util::get<cv::MediaFrame>(arg).desc());
|
||||
|
||||
default: util::throw_error(std::logic_error("Unsupported GRunArg type"));
|
||||
}
|
||||
}
|
||||
@@ -133,6 +136,7 @@ cv::GMetaArgs cv::descr_of(const cv::GRunArgs &args)
|
||||
return metas;
|
||||
}
|
||||
|
||||
// FIXME: Is it tested for all types?
|
||||
cv::GMetaArg cv::descr_of(const cv::GRunArgP &argp)
|
||||
{
|
||||
switch (argp.index())
|
||||
@@ -148,6 +152,7 @@ cv::GMetaArg cv::descr_of(const cv::GRunArgP &argp)
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: Is it tested for all types??
|
||||
bool cv::can_describe(const GMetaArg& meta, const GRunArgP& argp)
|
||||
{
|
||||
switch (argp.index())
|
||||
@@ -164,6 +169,7 @@ bool cv::can_describe(const GMetaArg& meta, const GRunArgP& argp)
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: Is it tested for all types??
|
||||
bool cv::can_describe(const GMetaArg& meta, const GRunArg& arg)
|
||||
{
|
||||
switch (arg.index())
|
||||
@@ -179,6 +185,7 @@ bool cv::can_describe(const GMetaArg& meta, const GRunArg& arg)
|
||||
case GRunArg::index_of<cv::gapi::wip::IStreamSource::Ptr>(): return util::holds_alternative<GMatDesc>(meta); // FIXME(?) may be not the best option
|
||||
case GRunArg::index_of<cv::RMat>(): return util::holds_alternative<GMatDesc>(meta) &&
|
||||
util::get<GMatDesc>(meta).canDescribe(cv::util::get<cv::RMat>(arg));
|
||||
case GRunArg::index_of<cv::MediaFrame>(): return meta == cv::GMetaArg(util::get<cv::MediaFrame>(arg).desc());
|
||||
default: util::throw_error(std::logic_error("Unsupported GRunArg type"));
|
||||
}
|
||||
}
|
||||
@@ -192,6 +199,8 @@ bool cv::can_describe(const GMetaArgs &metas, const GRunArgs &args)
|
||||
});
|
||||
}
|
||||
|
||||
// FIXME: Is it tested for all types?
|
||||
// FIXME: Where does this validation happen??
|
||||
void cv::validate_input_arg(const GRunArg& arg)
|
||||
{
|
||||
// FIXME: It checks only Mat argument
|
||||
@@ -248,6 +257,11 @@ std::ostream& operator<<(std::ostream& os, const cv::GMetaArg &arg)
|
||||
case cv::GMetaArg::index_of<cv::GOpaqueDesc>():
|
||||
os << util::get<cv::GOpaqueDesc>(arg);
|
||||
break;
|
||||
|
||||
case cv::GMetaArg::index_of<cv::GFrameDesc>():
|
||||
os << util::get<cv::GFrameDesc>(arg);
|
||||
break;
|
||||
|
||||
default:
|
||||
GAPI_Assert(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user