Get a frame from the cache (or NULL shared_ptr if no frame is found)
| 82 | |
| 83 | // Get a frame from the cache (or NULL shared_ptr if no frame is found) |
| 84 | std::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 |
| 100 | std::vector<std::shared_ptr<openshot::Frame>> CacheMemory::GetFrames() |
nothing calls this directly
no outgoing calls
no test coverage detected