moved decodercache to base folder for shared usage
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
#include "decodercache.h"
|
||||||
|
|
||||||
|
DecoderCache::DecoderCache()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void DecoderCache::Clear()
|
||||||
|
{
|
||||||
|
decoders_.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DecoderCache::AddDecoder(Stream *stream, DecoderPtr shader)
|
||||||
|
{
|
||||||
|
decoders_.insert(stream, shader);
|
||||||
|
}
|
||||||
|
|
||||||
|
DecoderPtr DecoderCache::GetDecoder(Stream *stream)
|
||||||
|
{
|
||||||
|
return decoders_.value(stream);
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
#ifndef DECODERCACHE_H
|
||||||
|
#define DECODERCACHE_H
|
||||||
|
|
||||||
|
#include "decoder/decoder.h"
|
||||||
|
#include "project/item/footage/stream.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Thread-safe cache of decoders
|
||||||
|
*/
|
||||||
|
class DecoderCache
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DecoderCache();
|
||||||
|
|
||||||
|
void Clear();
|
||||||
|
|
||||||
|
void AddDecoder(Stream* stream, DecoderPtr shader);
|
||||||
|
|
||||||
|
DecoderPtr GetDecoder(Stream* stream);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QMap<Stream*, DecoderPtr> decoders_;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // DECODERCACHE_H
|
||||||
Reference in New Issue
Block a user