Class cv::MediaFrame::View#

Provides access to the MediaFrame's underlying data. View details

Collaboration diagram for cv::MediaFrame::View:

cv::MediaFrame::View Node1 cv::MediaFrame::View   + ~View() Node2 size_t     Node2->Node1 +MAX_PLANES Node3 std::array< void *, MAX_PLANES >     Node3->Node1 +ptr Node4 void *     Node4->Node3 +elements Node5 std::array< T >     Node5->Node3 < void *, MAX_PLANES > Node7 std::array< std::size _t, MAX_PLANES >     Node5->Node7 < std::size_t, MAX _PLANES > Node6 T     Node6->Node5 +elements Node7->Node1 +stride Node8 size_t     Node8->Node7 +elements

cv::MediaFrame::View Node1 cv::MediaFrame::View   + ~View() Node2 size_t     Node2->Node1 +MAX_PLANES Node3 std::array< void *, MAX_PLANES >     Node3->Node1 +ptr Node4 void *     Node4->Node3 +elements Node5 std::array< T >     Node5->Node3 < void *, MAX_PLANES > Node7 std::array< std::size _t, MAX_PLANES >     Node5->Node7 < std::size_t, MAX _PLANES > Node6 T     Node6->Node5 +elements Node7->Node1 +stride Node8 size_t     Node8->Node7 +elements

Detailed Description#

Provides access to the MediaFrame’s underlying data.

This object contains the necessary information to access the pixel data of the associated MediaFrame: arrays of pointers and strides (distance between every plane row, in bytes) for every image plane, as defined in cv::MediaFormat. There may be up to four image planes in MediaFrame.

Depending on the MediaFrame::Access flag passed in MediaFrame::access(), a MediaFrame::View may be read- or write-only.

Depending on the MediaFrame::IAdapter implementation associated with the parent MediaFrame, writing to memory with MediaFrame::Access::R flag may have no effect or lead to undefined behavior. Same applies to reading the memory with MediaFrame::Access::W flag &#8212; again, depending on the IAdapter implementation, the host-side buffer the view provides access to may have no current data stored in (so in-place editing of the buffer contents may not be possible).

MediaFrame::View objects must be handled carefully, as an external resource associated with MediaFrame may be locked for the time the MediaFrame::View object exists. Obtaining MediaFrame::View should be seen as “map” and destroying it as “unmap” in the “map/unmap” idiom (applicable to OpenCL, device memory, remote memory).

When a MediaFrame buffer is accessed for writing, and the memory under MediaFrame::View::Ptrs is altered, the data synchronization of a host-side and device/remote buffer is not guaranteed until the MediaFrame::View is destroyed. In other words, the real data on the device or in a remote target may be updated at the MediaFrame::View destruction only &#8212; but it depends on the associated MediaFrame::IAdapter implementation.

Member Typedef Documentation#

Callback#

typedef std::function< void()> cv::MediaFrame::View::Callback

Ptrs#

typedef std::array< void *, MAX_PLANES > cv::MediaFrame::View::Ptrs

Strides#

typedef std::array< std::size_t, MAX_PLANES > cv::MediaFrame::View::Strides

Constructor & Destructor Documentation#

View()#

cv::MediaFrame::View::View(const View &)

View()#

cv::MediaFrame::View::View(
Ptrs && ptrs,
Strides && strs,
Callback && cb = )

View()#

cv::MediaFrame::View::View(View &&)

~View()#

cv::MediaFrame::View::~View()

Member Function Documentation#

operator=()#

View & cv::MediaFrame::View::operator=(const View &)

Member Data Documentation#

MAX_PLANES#

static const size_t cv::MediaFrame::View::MAX_PLANES = 4

ptr#

Ptrs cv::MediaFrame::View::ptr

Array of image plane pointers.

stride#

Strides cv::MediaFrame::View::stride

Array of image plane strides, in bytes.

m_cb#

Callback cv::MediaFrame::View::m_cb

Source file#

The documentation for this class was generated from the following file: