[G-API]: Introduce RMat serialization API#18584
Conversation
|
|
||
| template<typename... Ts> | ||
| IOStream& operator<< (IOStream& os, const cv::util::variant<Ts...> &v) { | ||
| os << (uint32_t)v.index(); |
There was a problem hiding this comment.
Hmm I believe it should be just os<< v.index(), isn't it?
There was a problem hiding this comment.
It returns size_t. We don't support operator<< for that type so the cast here is required
There was a problem hiding this comment.
Got it, but I'd use a static_cast instead
| } // namespace cv | ||
|
|
||
| namespace { | ||
| class MyRMatAdapter : public cv::RMat::Adapter { |
There was a problem hiding this comment.
No alignment between class (in OpenCV, namespaces don't increase the indent level)
| if (i == gi) { | ||
| X x{}; | ||
| is >> x; | ||
| v = std::move(x); |
There was a problem hiding this comment.
On windows build this code for some reason marked as unreachable which is not true I believe
There was a problem hiding this comment.
https://pullrequest.opencv.org/buildbot/builders/precommit_windows64/builds/26706 @alalek can you take a look, please? Can we suppress this or fix somehow? This code is surely reachable (not in .so but in tests)
There was a problem hiding this comment.
As it is a public header, so disabling of this warning in CMake scripts doesn't help with User applications (these CMake scripts are internal and not available for Users).
Try pragma push/disable/pop approach.
There was a problem hiding this comment.
Pushed an alternative solution
|
Build warnings must be fixed before merge. |
| } | ||
| }; | ||
|
|
||
| template<typename T> struct deserialize_runarg; |
There was a problem hiding this comment.
what is about to name structure above : deserialize_carg and this one deserialize_rarg?
It is only a suggestion, no actions required if you don't think that it is reasonable to do now
There was a problem hiding this comment.
carg and rarg are harder to understand
@alalek we have a little idea how to fix this particular warning, do you have any suggestions? |
modules/gapi/CMakeLists.txt
Outdated
| # Disable obsollete warning C4503 popping up on MSVC <<2017 | ||
| # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4503?view=vs-2019 | ||
| ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4503) | ||
| # FXIME: enable 4702 warning (unreachable code) when the issue is fixed |
|
@alalek required builds have passed. Can you please merge this? Our internal integration this WW depends on this feature. Thanks! |
|
@alalek @mshabunin is there anything else to do for merge? |
|
... |
|
@dmatveev See https://github.com/opencv/opencv/pull/18584/files#r508380384 |
Just noticed this, thanks. Alexey is on vacation currently. Let's see what's with push/pop |
|
@alalek thanks! |
[G-API]: Introduce RMat serialization API * Introduce RMat serialization API * Fix RunArgs deserialization * Address review comments * Export operators for GRunArg serialization * Fix warning and add handling for RMat in bind() * Update CMakeLists.txt * G-API: RMat S11N -- probably fix the Windows warning
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.