G-API: oneVPL (simplification) added surface & frame adapter#20601
G-API: oneVPL (simplification) added surface & frame adapter#20601alalek merged 8 commits intoopencv:masterfrom
Conversation
| @@ -0,0 +1,59 @@ | |||
| // This file is part of OpenCV project. | |||
There was a problem hiding this comment.
accelerators may be a way too long directory name
There was a problem hiding this comment.
May I put on it here before till final PRs? there are lot of changes will come
| // Copyright (C) 2021 Intel Corporation | ||
|
|
||
| #ifndef GAPI_STREAMING_ONEVPL_ACCELERATORS_ACCEL_POLICY_INTERFACE_HPP | ||
| #define GAPI_STREAMING_ONEVPL_ACCELERATORS_ACCEL_POLICY_INTERFACE_HPP |
There was a problem hiding this comment.
ACCELERATORS_ACCELI believe it can be simplified to just ACCEL. No need to repeat one
There was a problem hiding this comment.
as @smirnov-alexey mentioned before - it should take a form path/file_name if i understood correctly
to do not conflict with potential similar file names on uper-level
There was a problem hiding this comment.
Looks like some other headers are simplified to just file_name, so it can be applied here. I think only public header should follow path/file_name guideline. Sorry, if I was mistaken
There was a problem hiding this comment.
I faced with the situation sometimes:
sources
---component_1
------file_name.hpp
---component_2
-------<the same file_name>.hpp
in this case full path is an option, that's because i have been using path/filename solution.
If it is not a big problem, let's put it as is :) ?
modules/gapi/src/streaming/onevpl/accelerators/surface/cpu_frame_adapter.cpp
Show resolved
Hide resolved
modules/gapi/src/streaming/onevpl/accelerators/surface/cpu_frame_adapter.cpp
Outdated
Show resolved
Hide resolved
modules/gapi/src/streaming/onevpl/accelerators/surface/surface.hpp
Outdated
Show resolved
Hide resolved
| const Surface::data_t& data = parent_surface_ptr->get_data(); | ||
| const Surface::info_t& info = parent_surface_ptr->get_info(); | ||
| using stride_t = typename cv::MediaFrame::View::Strides::value_type; | ||
| GAPI_Assert(data.Pitch >= 0 && "Pitch is less than 0"); |
There was a problem hiding this comment.
Just to double-check: what is Pitch's type?
There was a problem hiding this comment.
good question
it's U16 type. in this case assert is redundant
|
|
||
| stride_t pitch = static_cast<stride_t>(data.Pitch); | ||
| switch(info.FourCC) { | ||
| case MFX_FOURCC_I420: |
There was a problem hiding this comment.
There is an assert in meta() on that format. Does it really work?
There was a problem hiding this comment.
access and meta looked as independent methods and could be invoked in different order, so check required both of them.
BUT, because surface is locked in ctor and must be not changed until dtor it is possible to move out this checking from meta and access and put it up into ctor - to keep invariant safe after MediaFrame construction.
i write down such proposal into Jira item to apply it in the last PRs (in series)
| // It is subject to the license terms in the LICENSE file found in the top-level directory | ||
| // of this distribution and at http://opencv.org/license.html. | ||
| // | ||
| // Copyright (C) 2019-2020 Intel Corporation |
|
|
||
| namespace opencv_test | ||
| { | ||
| namespace |
There was a problem hiding this comment.
Why do you need an additional namespace here?
There was a problem hiding this comment.
I adhered existing tests style
dmatveev
left a comment
There was a problem hiding this comment.
LGTM, please go ahead with the merge
G-API: oneVPL (simplification) added surface & frame adapter * added surface & frame adapter * Add FrameAdapter unut tests * Fix compilation after rebase * Fix compilation tests * Apply some review comments * Fix compile warning * Revert back CV_Func usage * Apply some comments
this PR is the single one in series of #20469
Introduce VPL Surface & CPU MediaFrame Adapter
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.
Build configuration