Blender V5.3
movie_reader_cache.hh File Reference
#include <cstdint>
#include "IMB_imbuf_enums.h"

Go to the source code of this file.

Classes

class  blender::seq::MovieReaderAccessor

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::seq

Functions

MovieReaderCache * blender::seq::movie_reader_cache_create ()
void blender::seq::movie_reader_cache_destroy (MovieReaderCache *cache)
void blender::seq::movie_reader_cache_timestamp_bump ()
void blender::seq::movie_reader_cache_invalidate (Scene &scene, const Strip &strip)
void blender::seq::movie_reader_cache_clear (Scene &scene)
MovieReaderAccessor blender::seq::movie_reader_cache_acquire (Scene &cache_scene, const Scene &key_scene, const Strip &strip, const int frame_index)
MovieReaderAccessor blender::seq::movie_reader_cache_acquire_view (Scene &cache_scene, const Scene &key_scene, const Strip &strip, const int view_id, const int frame_index)
MovieReaderAccessor blender::seq::movie_reader_cache_acquire_any (const Scene &scene, const Strip &strip)
bool blender::seq::movie_reader_cache_can_produce_frames (const Scene &scene, const Strip &strip)

Detailed Description

Cache open movie readers for reuse across rendered frames.

  • Readers are keyed by source file path and decode settings, not by strip. So neighboring strips that use the same media can use the same reader.
  • Each rendering thread (e.g. the main render and prefetch) keeps its own readers. Sharing one between concurrent renders could make each render re-seek (and re-decode) on every frame.
  • A reader is reserved after use until the next top-level frame render, so multiple strips using the same media do not seek one reader back and forth within the same frame.
  • From the available matching readers of the current thread, prefer the one closest to the requested source frame, with a penalty for readers that need to seek backwards.
  • Frame-independent queries can reuse any free matching reader. Querying an initialized reader does not change its decode position. Such queries may temporarily grow the cache beyond its soft size limit; stale entries are removed when subsequent frames are rendered.
  • Cache size uses #MovieReaderCache::max_entries as a soft limit. Readers above it are removed after they have not been used for #MovieReaderCache::stale_after_timestamps render timestamps.

Definition in file movie_reader_cache.hh.