decoder/renderer: use memory cache and single decoder to optimize frames for

cycles
This commit is contained in:
itsmattkc
2020-02-20 15:32:12 +11:00
parent 71048f40a8
commit 2145efa2a0
19 changed files with 150 additions and 135 deletions
+6 -5
View File
@@ -95,8 +95,8 @@ private:
virtual QString GetIndexFilename() override;
void UnconditionalAudioIndex(AVPacket* pkt, AVFrame* frame, const QAtomicInt* cancelled);
void UnconditionalVideoIndex(AVPacket* pkt, AVFrame* frame, const QAtomicInt* cancelled);
void UnconditionalAudioIndex(const QAtomicInt* cancelled);
void UnconditionalVideoIndex(const QAtomicInt* cancelled);
void ValidateVideoIndex(const QAtomicInt* cancelled);
@@ -104,6 +104,8 @@ private:
void CacheFrameToDisk(AVFrame* f);
void ClearFrameCache();
AVFormatContext* fmt_ctx_;
AVCodecContext* codec_ctx_;
AVStream* avstream_;
@@ -113,10 +115,9 @@ private:
SwsContext* scale_ctx_;
AVPacket* pkt_;
QList<AVFrame*> cached_frames_;
AVFrame* frames_[2];
AVFrame* last_retrieved_frame_;
int64_t second_ts_;
AVDictionary* opts_;