1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

Merge pull request #20329 from smirnov-alexey:as/mediaframe_serialization

[G-API]: Add serialization mechanism for cv::MediaFrame

* Stub initial interface

* Fix templates for deserialization

* Fix tests

* Disable a warning on windows

* Address review comments

* Change enable_ifs to other template helpers

* Resolve ambiguous template

* Fix warnings in docs
This commit is contained in:
Alexey Smirnov
2021-07-13 22:31:46 +03:00
committed by GitHub
parent a7b17bfaf0
commit 5179e37bd1
8 changed files with 243 additions and 34 deletions
@@ -201,18 +201,20 @@ IOStream& operator<< (IOStream& os, const cv::RMat& mat) {
return os;
}
IIStream& operator>> (IIStream& is, cv::RMat&) {
util::throw_error(std::logic_error("operator>> for RMat should never be called"));
util::throw_error(std::logic_error("operator>> for RMat should never be called. "
"Instead, cv::gapi::deserialize<cv::GRunArgs, AdapterTypes...>() "
"should be used"));
return is;
}
IOStream& operator<< (IOStream& os, const cv::MediaFrame &) {
// Stub
GAPI_Assert(false && "cv::MediaFrame serialization is not supported!");
IOStream& operator<< (IOStream& os, const cv::MediaFrame &frame) {
frame.serialize(os);
return os;
}
IIStream& operator>> (IIStream& is, cv::MediaFrame &) {
// Stub
GAPI_Assert(false && "cv::MediaFrame serialization is not supported!");
util::throw_error(std::logic_error("operator>> for MediaFrame should never be called. "
"Instead, cv::gapi::deserialize<cv::GRunArgs, AdapterTypes...>() "
"should be used"));
return is;
}