00001 #ifndef FRAMECACHE_H
00002 #define FRAMECACHE_H
00003
00004
00005 #include "cachebase.h"
00006 #include "mutex.inc"
00007 #include "vframe.inc"
00008
00009
00010 #include <stdint.h>
00011
00012
00013
00014
00015
00016
00017
00018
00019 class FrameCacheItem : public CacheItemBase
00020 {
00021 public:
00022 FrameCacheItem();
00023 ~FrameCacheItem();
00024
00025 int get_size();
00026
00027 VFrame *data;
00028 double frame_rate;
00029 int layer;
00030 };
00031
00032 class FrameCache : public CacheBase
00033 {
00034 public:
00035 FrameCache();
00036 ~FrameCache();
00037
00038
00039 int get_frame(VFrame *frame,
00040 int64_t position,
00041 int layer,
00042 double frame_rate,
00043 int asset_id = -1);
00044
00045
00046
00047
00048
00049 VFrame* get_frame_ptr(int64_t position,
00050 int layer,
00051 double frame_rate,
00052 int color_model,
00053 int w,
00054 int h,
00055 int asset_id = -1);
00056
00057
00058
00059
00060 void put_frame(VFrame *frame,
00061 int64_t position,
00062 int layer,
00063 double frame_rate,
00064 int use_copy,
00065 Asset *asset = 0);
00066
00067 void dump();
00068
00069
00070
00071
00072
00073
00074 private:
00075
00076
00077 int frame_exists(VFrame *format,
00078 int64_t position,
00079 int layer,
00080 double frame_rate,
00081 FrameCacheItem **item_return,
00082 int asset_id);
00083 int frame_exists(int64_t position,
00084 int layer,
00085 double frame_rate,
00086 int color_model,
00087 int w,
00088 int h,
00089 FrameCacheItem **item_return,
00090 int asset_id);
00091 };
00092
00093
00094
00095 #endif