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

Upstream fixes from release

This commit is contained in:
Anastasiya Pronina
2021-03-11 13:25:36 +03:00
parent fbb38cc245
commit 0f4b27c300
3 changed files with 23 additions and 12 deletions
@@ -30,9 +30,21 @@ public:
View access(Access) const;
cv::GFrameDesc desc() const;
// Cast underlying MediaFrame adapter to the particular adapter type,
// return nullptr if underlying type is different
template<typename T> T* get() const
{
static_assert(std::is_base_of<IAdapter, T>::value,
"T is not derived from cv::MediaFrame::IAdapter!");
auto* adapter = getAdapter();
GAPI_Assert(adapter != nullptr);
return dynamic_cast<T*>(adapter);
}
private:
struct Priv;
std::shared_ptr<Priv> m;
IAdapter* getAdapter() const;
};
template<class T, class... Args>