@brief Get an array of all Frames
| 225 | |
| 226 | // @brief Get an array of all Frames |
| 227 | std::vector<std::shared_ptr<openshot::Frame>> CacheDisk::GetFrames() |
| 228 | { |
| 229 | // Create a scoped lock, to protect the cache from multiple threads |
| 230 | const std::lock_guard<std::recursive_mutex> lock(*cacheMutex); |
| 231 | |
| 232 | std::vector<std::shared_ptr<openshot::Frame>> all_frames; |
| 233 | std::vector<int64_t>::iterator itr_ordered; |
| 234 | for(itr_ordered = ordered_frame_numbers.begin(); itr_ordered != ordered_frame_numbers.end(); ++itr_ordered) |
| 235 | { |
| 236 | int64_t frame_number = *itr_ordered; |
| 237 | all_frames.push_back(GetFrame(frame_number)); |
| 238 | } |
| 239 | |
| 240 | return all_frames; |
| 241 | } |
| 242 | |
| 243 | // Get the smallest frame number (or NULL shared_ptr if no frame is found) |
| 244 | std::shared_ptr<Frame> CacheDisk::GetSmallestFrame() |