@@ -117,15 +117,15 @@ struct CachePimpl
117117};
118118
119119
120- Cache::Cache (const PClip& _child, Device* device, std::mutex& CacheGuardMutex, InternalEnvironment* env) :
120+ AvsCache::AvsCache (const PClip& _child, Device* device, std::mutex& CacheGuardMutex, InternalEnvironment* env) :
121121 Env(env),
122122 _pimpl(NULL ),
123123 device(device),
124124 CacheGuardMutex(CacheGuardMutex)
125125{
126126 _pimpl = new CachePimpl (_child, env->GetCacheMode ());
127127 env->ManageCache (MC_RegisterCache, reinterpret_cast <void *>(this ));
128- _RPT5 (0 , " Cache::Cache registered. cache_id=%p child=%p w=%d h=%d VideoCacheSize=%Iu\n " , (void *)this , (void *)_child, _pimpl->vi .width , _pimpl->vi .height , _pimpl->VideoCache ->size ());
128+ _RPT5 (0 , " AvsCache::AvsCache registered. cache_id=%p child=%p w=%d h=%d VideoCacheSize=%Iu\n " , (void *)this , (void *)_child, _pimpl->vi .width , _pimpl->vi .height , _pimpl->VideoCache ->size ());
129129
130130 const int dummy = 0 ;
131131 // child is usually MTGuard, which forwards this request to its child filter - the real one
@@ -150,14 +150,14 @@ Cache::Cache(const PClip& _child, Device* device, std::mutex& CacheGuardMutex, I
150150 }
151151}
152152
153- Cache ::~Cache ()
153+ AvsCache ::~AvsCache ()
154154{
155- _RPT5 (0 , " Cache::Cache unregister. cache_id=%p child=%p w=%d h=%d VideoCacheSize=%Iu\n " , (void *)this , (void *)_pimpl->child , _pimpl->vi .width , _pimpl->vi .height , _pimpl->VideoCache ->size ()); // P.F.
155+ _RPT5 (0 , " AvsCache::AvsCache unregister. cache_id=%p child=%p w=%d h=%d VideoCacheSize=%Iu\n " , (void *)this , (void *)_pimpl->child , _pimpl->vi .width , _pimpl->vi .height , _pimpl->VideoCache ->size ()); // P.F.
156156 Env->ManageCache (MC_UnRegisterCache, reinterpret_cast <void *>(this ));
157157 delete _pimpl;
158158}
159159
160- PVideoFrame __stdcall Cache ::GetFrame (int n, IScriptEnvironment* env_)
160+ PVideoFrame __stdcall AvsCache ::GetFrame (int n, IScriptEnvironment* env_)
161161{
162162#ifdef _DEBUG
163163 constexpr auto BUFSIZE = 255 ;
@@ -186,10 +186,10 @@ PVideoFrame __stdcall Cache::GetFrame(int n, IScriptEnvironment* env_)
186186 LruLookupResult LruLookupRes = _pimpl->VideoCache ->lookup (n, &cache_handle, true , result, &env->GetSupressCaching ());
187187 /*
188188 std::string name = FuncName;
189- snprintf(buf.get(), BUFSIZE, "Cache ::GetFrame lookup follows: [%s] n=%6d Thread=%zu", name.c_str(), n, env->GetEnvProperty(AEP_THREAD_ID));
189+ snprintf(buf.get(), BUFSIZE, "AvsCache ::GetFrame lookup follows: [%s] n=%6d Thread=%zu", name.c_str(), n, env->GetEnvProperty(AEP_THREAD_ID));
190190 _RPT0(0, buf.get());
191191
192- snprintf(buf.get(), BUFSIZE, "Cache ::GetFrame lookup ready: [%s] n=%6d Thread=%zu res=%d", name.c_str(), n, env->GetEnvProperty(AEP_THREAD_ID), (int)LruLookupRes);
192+ snprintf(buf.get(), BUFSIZE, "AvsCache ::GetFrame lookup ready: [%s] n=%6d Thread=%zu res=%d", name.c_str(), n, env->GetEnvProperty(AEP_THREAD_ID), (int)LruLookupRes);
193193 _RPT0(0, buf.get());
194194 */
195195
@@ -208,7 +208,7 @@ PVideoFrame __stdcall Cache::GetFrame(int n, IScriptEnvironment* env_)
208208 try
209209 {
210210#ifdef _DEBUG
211- snprintf (buf.get (), BUFSIZE , " Cache ::GetFrame LRU_LOOKUP_NOT_FOUND: [%s] n=%6d child=%p\n " , name.c_str (), n, (void *)_pimpl->child ); // P.F.
211+ snprintf (buf.get (), BUFSIZE , " AvsCache ::GetFrame LRU_LOOKUP_NOT_FOUND: [%s] n=%6d child=%p\n " , name.c_str (), n, (void *)_pimpl->child ); // P.F.
212212 _RPT0 (0 , buf.get ());
213213#endif
214214 // cache_handle.first->value = _pimpl->child->GetFrame(n, env);
@@ -238,10 +238,10 @@ PVideoFrame __stdcall Cache::GetFrame(int n, IScriptEnvironment* env_)
238238 std::chrono::duration<double > elapsed_seconds = t_end - t_start;
239239 std::string name = FuncName;
240240 if (NULL == cache_handle.first ->value ) {
241- snprintf (buf.get (), BUFSIZE , " Cache ::GetFrame LRU_LOOKUP_NOT_FOUND: HEY! got nulled! [%s] n=%6d child=%p frame=%p framebefore=%p SeekTimeWithGetFrame:%f\n " , name.c_str (), n, (void *)_pimpl->child , (void *)cache_handle.first ->value , (void *)result, elapsed_seconds.count ()); // P.F.
241+ snprintf (buf.get (), BUFSIZE , " AvsCache ::GetFrame LRU_LOOKUP_NOT_FOUND: HEY! got nulled! [%s] n=%6d child=%p frame=%p framebefore=%p SeekTimeWithGetFrame:%f\n " , name.c_str (), n, (void *)_pimpl->child , (void *)cache_handle.first ->value , (void *)result, elapsed_seconds.count ()); // P.F.
242242 _RPT0 (0 , buf.get ());
243243 } else {
244- snprintf (buf.get (), BUFSIZE , " Cache ::GetFrame LRU_LOOKUP_NOT_FOUND: [%s] n=%6d child=%p frame=%p framebefore=%p videoCacheSize=%zu SeekTimeWithGetFrame:%f\n " , name.c_str (), n, (void *)_pimpl->child , (void *)cache_handle.first ->value , (void *)result, _pimpl->VideoCache ->size (), elapsed_seconds.count ()); // P.F.
244+ snprintf (buf.get (), BUFSIZE , " AvsCache ::GetFrame LRU_LOOKUP_NOT_FOUND: [%s] n=%6d child=%p frame=%p framebefore=%p videoCacheSize=%zu SeekTimeWithGetFrame:%f\n " , name.c_str (), n, (void *)_pimpl->child , (void *)cache_handle.first ->value , (void *)result, _pimpl->VideoCache ->size (), elapsed_seconds.count ()); // P.F.
245245 _RPT0 (0 , buf.get ());
246246 }
247247#endif
@@ -261,7 +261,7 @@ PVideoFrame __stdcall Cache::GetFrame(int n, IScriptEnvironment* env_)
261261 t_end = std::chrono::high_resolution_clock::now ();
262262 std::chrono::duration<double > elapsed_seconds = t_end - t_start;
263263 std::string name = FuncName;
264- snprintf (buf.get (), BUFSIZE , " Cache ::GetFrame LRU_LOOKUP_FOUND_AND_READY: [%s] n=%6d child=%p frame=%p vfb=%p videoCacheSize=%zu SeekTime :%f\n " , name.c_str (), n, (void *)_pimpl->child , (void *)result, (void *)result->GetFrameBuffer (), _pimpl->VideoCache ->size (), elapsed_seconds.count ());
264+ snprintf (buf.get (), BUFSIZE , " AvsCache ::GetFrame LRU_LOOKUP_FOUND_AND_READY: [%s] n=%6d child=%p frame=%p vfb=%p videoCacheSize=%zu SeekTime :%f\n " , name.c_str (), n, (void *)_pimpl->child , (void *)result, (void *)result->GetFrameBuffer (), _pimpl->VideoCache ->size (), elapsed_seconds.count ());
265265 _RPT0 (0 , buf.get ());
266266 assert (result != NULL );
267267#endif
@@ -270,14 +270,14 @@ PVideoFrame __stdcall Cache::GetFrame(int n, IScriptEnvironment* env_)
270270 case LRU_LOOKUP_NO_CACHE :
271271 {
272272#ifdef _DEBUG
273- snprintf (buf.get (), BUFSIZE , " Cache ::GetFrame <Before GetFrame> LRU_LOOKUP_NO_CACHE: [%s] n=%6d child=%p\n " , name.c_str (), n, (void *)_pimpl->child ); // P.F.
273+ snprintf (buf.get (), BUFSIZE , " AvsCache ::GetFrame <Before GetFrame> LRU_LOOKUP_NO_CACHE: [%s] n=%6d child=%p\n " , name.c_str (), n, (void *)_pimpl->child ); // P.F.
274274 _RPT0 (0 , buf.get ());
275275#endif
276276 result = _pimpl->child ->GetFrame (n, env);
277277#ifdef _DEBUG
278278 t_end = std::chrono::high_resolution_clock::now ();
279279 std::chrono::duration<double > elapsed_seconds = t_end - t_start;
280- snprintf (buf.get (), BUFSIZE , " Cache ::GetFrame <After GetFrame> LRU_LOOKUP_NO_CACHE: [%s] n=%6d child=%p frame=%p vfb=%p videoCacheSize=%zu SeekTime :%f\n " , name.c_str (), n, (void *)_pimpl->child , (void *)result, (void *)result->GetFrameBuffer (), _pimpl->VideoCache ->size (), elapsed_seconds.count ()); // P.F.
280+ snprintf (buf.get (), BUFSIZE , " AvsCache ::GetFrame <After GetFrame> LRU_LOOKUP_NO_CACHE: [%s] n=%6d child=%p frame=%p vfb=%p videoCacheSize=%zu SeekTime :%f\n " , name.c_str (), n, (void *)_pimpl->child , (void *)result, (void *)result->GetFrameBuffer (), _pimpl->VideoCache ->size (), elapsed_seconds.count ()); // P.F.
281281 _RPT0 (0 , buf.get ());
282282#endif
283283 break ;
@@ -293,13 +293,13 @@ PVideoFrame __stdcall Cache::GetFrame(int n, IScriptEnvironment* env_)
293293 return result;
294294}
295295
296- void Cache ::FillAudioZeros (void * buf, size_t start_offset, size_t count) {
296+ void AvsCache ::FillAudioZeros (void * buf, size_t start_offset, size_t count) {
297297 const int bps = _pimpl->vi .BytesPerAudioSample ();
298298 unsigned char * byte_buf = (unsigned char *)buf;
299299 memset (byte_buf + start_offset * bps, 0 , count * bps);
300300}
301301
302- void __stdcall Cache ::GetAudio (void * buf, int64_t start, int64_t count, IScriptEnvironment* env)
302+ void __stdcall AvsCache ::GetAudio (void * buf, int64_t start, int64_t count, IScriptEnvironment* env)
303303{
304304 if (count <= 0 )
305305 return ;
@@ -439,19 +439,19 @@ void __stdcall Cache::GetAudio(void* buf, int64_t start, int64_t count, IScriptE
439439
440440}
441441
442- const VideoInfo& __stdcall Cache ::GetVideoInfo ()
442+ const VideoInfo& __stdcall AvsCache ::GetVideoInfo ()
443443{
444444 return _pimpl->vi ;
445445}
446446
447- bool __stdcall Cache ::GetParity (int n)
447+ bool __stdcall AvsCache ::GetParity (int n)
448448{
449449 return _pimpl->child ->GetParity (n);
450450}
451451
452- int __stdcall Cache ::SetCacheHints (int cachehints, int frame_range)
452+ int __stdcall AvsCache ::SetCacheHints (int cachehints, int frame_range)
453453{
454- // _RPT3(0, "Cache ::SetCacheHints called. cache=%p hint=%d frame_range=%d\n", (void *)this, cachehints, frame_range);
454+ // _RPT3(0, "AvsCache ::SetCacheHints called. cache=%p hint=%d frame_range=%d\n", (void *)this, cachehints, frame_range);
455455 switch (cachehints)
456456 {
457457 /* ********************************************
@@ -490,7 +490,7 @@ int __stdcall Cache::SetCacheHints(int cachehints, int frame_range)
490490 _pimpl->VideoCache ->limits (&min, &max);
491491 max = frame_range;
492492 _pimpl->VideoCache ->set_limits (min, max);
493- _RPT3 (0 , " Cache ::SetCacheHints CACHE_SET_MAX_CAPACITY cache=%p hint=%d frame_range=%d\n " , (void *)this , cachehints, frame_range);
493+ _RPT3 (0 , " AvsCache ::SetCacheHints CACHE_SET_MAX_CAPACITY cache=%p hint=%d frame_range=%d\n " , (void *)this , cachehints, frame_range);
494494 break ;
495495 }
496496
@@ -636,7 +636,7 @@ PClip CacheGuard::GetCache(IScriptEnvironment* env_)
636636 }
637637
638638 // not found for current device, create it
639- Cache * cache = new Cache (child, device, /* ref*/ mutex, static_cast <InternalEnvironment*>(globalEnv));
639+ AvsCache * cache = new AvsCache (child, device, /* ref*/ mutex, static_cast <InternalEnvironment*>(globalEnv));
640640
641641 // apply cache hints if it is changed
642642 if (hints.min != hints.default_min )
0 commit comments