mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
feat(video): add accessor functions for sourceID and frameID
Additionally refactors some code to be more optimized.
This commit is contained in:
parent
80a776475c
commit
8952208e8a
|
@ -410,12 +410,12 @@ void VideoFrame::storeAVFrame(AVFrame* frame, const QSize& dimensions, const int
|
||||||
|
|
||||||
void VideoFrame::deleteFrameBuffer()
|
void VideoFrame::deleteFrameBuffer()
|
||||||
{
|
{
|
||||||
for(auto frameIterator = frameBuffer.begin(); frameIterator != frameBuffer.end(); ++frameIterator)
|
for(const auto& frameIterator : frameBuffer)
|
||||||
{
|
{
|
||||||
AVFrame* frame = frameIterator->second;
|
AVFrame* frame = frameIterator.second;
|
||||||
|
|
||||||
// Treat source frame and derived frames separately
|
// Treat source frame and derived frames separately
|
||||||
if(sourceFrameKey == frameIterator->first)
|
if(sourceFrameKey == frameIterator.first)
|
||||||
{
|
{
|
||||||
if(freeSourceFrame)
|
if(freeSourceFrame)
|
||||||
{
|
{
|
||||||
|
|
|
@ -152,11 +152,32 @@ public:
|
||||||
*/
|
*/
|
||||||
const AVFrame* getAVFrame(QSize frameSize, const int pixelFormat, const bool requireAligned);
|
const AVFrame* getAVFrame(QSize frameSize, const int pixelFormat, const bool requireAligned);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the ID for the given frame.
|
||||||
|
*
|
||||||
|
* Frame IDs are globally unique (with respect to the running instance).
|
||||||
|
*
|
||||||
|
* @return an integer representing the ID of this frame.
|
||||||
|
*/
|
||||||
|
inline IDType getFrameID() const
|
||||||
|
{
|
||||||
|
return frameID;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the ID for the VideoSource which created this frame.
|
||||||
|
* @return an integer representing the ID of the VideoSource which created this frame.
|
||||||
|
*/
|
||||||
|
inline IDType getSourceID() const
|
||||||
|
{
|
||||||
|
return sourceID;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Retrieves a copy of the source VideoFrame's dimensions.
|
* @brief Retrieves a copy of the source VideoFrame's dimensions.
|
||||||
* @return QRect copy representing the source VideoFrame's dimensions.
|
* @return QRect copy representing the source VideoFrame's dimensions.
|
||||||
*/
|
*/
|
||||||
inline QRect getSourceDimensions()
|
inline QRect getSourceDimensions() const
|
||||||
{
|
{
|
||||||
return sourceDimensions;
|
return sourceDimensions;
|
||||||
}
|
}
|
||||||
|
@ -165,7 +186,7 @@ public:
|
||||||
* @brief Retrieves a copy of the source VideoFormat's pixel format.
|
* @brief Retrieves a copy of the source VideoFormat's pixel format.
|
||||||
* @return integer copy represetning the source VideoFrame's pixel format.
|
* @return integer copy represetning the source VideoFrame's pixel format.
|
||||||
*/
|
*/
|
||||||
inline int getSourcePixelFormat()
|
inline int getSourcePixelFormat() const
|
||||||
{
|
{
|
||||||
return sourcePixelFormat;
|
return sourcePixelFormat;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user