Added QAbstractVideoBuffer::release virtual method
It's useful when the buffer pool stores QAbstractVideoBuffer instances instead of underlying system buffers and allows to avoid reallocation of QAbstractVideoBuffer instances. The default implementation deletes the buffer, so this change is source compatible. Change-Id: I7dadd7dac529748b5eb33e5aa7c2d0578b8b1634 Reviewed-by: Lev Zelenskiy <lev.zelenskiy@nokia.com> Reviewed-by: Jonas Rabbe <jonas.rabbe@gmail.com> Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
This commit is contained in:
committed by
Qt by Nokia
parent
62749d654d
commit
74383cb40c
@@ -148,6 +148,19 @@ QAbstractVideoBuffer::~QAbstractVideoBuffer()
|
|||||||
delete d_ptr;
|
delete d_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Releases the video buffer.
|
||||||
|
|
||||||
|
QVideoFrame calls QAbstractVideoBuffer::release when the buffer is not used
|
||||||
|
any more and can be destroyed or returned to the buffer pool.
|
||||||
|
|
||||||
|
The default implementation deletes the buffer instance.
|
||||||
|
*/
|
||||||
|
void QAbstractVideoBuffer::release()
|
||||||
|
{
|
||||||
|
delete this;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns the type of a video buffer's handle.
|
Returns the type of a video buffer's handle.
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ public:
|
|||||||
|
|
||||||
QAbstractVideoBuffer(HandleType type);
|
QAbstractVideoBuffer(HandleType type);
|
||||||
virtual ~QAbstractVideoBuffer();
|
virtual ~QAbstractVideoBuffer();
|
||||||
|
virtual void release();
|
||||||
|
|
||||||
HandleType handleType() const;
|
HandleType handleType() const;
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,8 @@ public:
|
|||||||
|
|
||||||
~QVideoFramePrivate()
|
~QVideoFramePrivate()
|
||||||
{
|
{
|
||||||
delete buffer;
|
if (buffer)
|
||||||
|
buffer->release();
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize size;
|
QSize size;
|
||||||
|
|||||||
Reference in New Issue
Block a user