Rework internals of how VSE caching is done. Primarily to make all the caching logic more understandable from development point of view, but also has several user visible implications (more details in the PR): - Simpler and fewer caching UI options, - Disk cache is gone (primary reason: proxies are kinda the same thing), - VSE cache size set in preferences is actual size used for VSE caches now (previously caching stopped as soon as whole Blender used that much memory, even if some memory usage was not about VSE at all), - Certain scenarios of cache invalidation are faster now. Pull Request: https://projects.blender.org/blender/blender/pulls/137926
46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
/* SPDX-FileCopyrightText: 2025 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup sequencer
|
|
*
|
|
* Cache source images for strips.
|
|
* - Keyed by (strip + frame index within strip media + view ID).
|
|
* - Caching is only done for strips that are independent of
|
|
* any other strips (images, movies, no-input effect strips like
|
|
* Text and Color).
|
|
* - When full, cache eviction policy is to remove frames furthest
|
|
* from the current playhead, biasing towards removal of
|
|
* frames behind the playhead.
|
|
* - Invalidated fairly rarely, since the cached items only change
|
|
* when the source content changes.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
struct ImBuf;
|
|
struct Strip;
|
|
struct Scene;
|
|
struct RenderData;
|
|
|
|
namespace blender::seq {
|
|
|
|
void source_image_cache_put(const RenderData *context,
|
|
const Strip *strip,
|
|
float timeline_frame,
|
|
ImBuf *image);
|
|
|
|
ImBuf *source_image_cache_get(const RenderData *context, const Strip *strip, float timeline_frame);
|
|
|
|
void source_image_cache_invalidate_strip(Scene *scene, const Strip *strip);
|
|
|
|
void source_image_cache_clear(Scene *scene);
|
|
void source_image_cache_destroy(Scene *scene);
|
|
|
|
bool source_image_cache_evict(Scene *scene);
|
|
|
|
size_t source_image_cache_get_image_count(const Scene *scene);
|
|
|
|
} // namespace blender::seq
|