MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / GetFrame

Method GetFrame

src/CacheMemory.cpp:84–97  ·  view source on GitHub ↗

Get a frame from the cache (or NULL shared_ptr if no frame is found)

Source from the content-addressed store, hash-verified

82
83// Get a frame from the cache (or NULL shared_ptr if no frame is found)
84std::shared_ptr<Frame> CacheMemory::GetFrame(int64_t frame_number)
85{
86 // Create a scoped lock, to protect the cache from multiple threads
87 const std::lock_guard<std::recursive_mutex> lock(*cacheMutex);
88
89 // Does frame exists in cache?
90 if (frames.count(frame_number))
91 // return the Frame object
92 return frames[frame_number];
93
94 else
95 // no Frame found
96 return std::shared_ptr<Frame>();
97}
98
99// @brief Get an array of all Frames
100std::vector<std::shared_ptr<openshot::Frame>> CacheMemory::GetFrames()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected