decoder: began implementation of a frame pool

This commit is contained in:
itsmattkc
2020-04-13 23:44:42 +10:00
parent 5c927ce7a4
commit 6bb972b4db
9 changed files with 274 additions and 292 deletions
+20 -18
View File
@@ -1,3 +1,23 @@
/***
Olive - Non-Linear Video Editor
Copyright (C) 2019 Olive Team
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
***/
#ifndef AVFRAMEPTR_H
#define AVFRAMEPTR_H
@@ -17,8 +37,6 @@ class AVFrameWrapper {
public:
AVFrameWrapper() {
frame_ = av_frame_alloc();
birthtime_ = QDateTime::currentMSecsSinceEpoch();
accessed_ = birthtime_;
}
virtual ~AVFrameWrapper() {
@@ -31,25 +49,9 @@ public:
return frame_;
}
inline const qint64& birthtime() const {
return birthtime_;
}
inline const qint64& last_accessed() const {
return accessed_;
}
void access() {
accessed_ = QDateTime::currentMSecsSinceEpoch();
}
private:
AVFrame* frame_;
qint64 birthtime_;
qint64 accessed_;
};
using AVFramePtr = std::shared_ptr<AVFrameWrapper>;