]> git.sesse.net Git - nageru/blobdiff - nageru/pbo_frame_allocator.h
IWYU-fix nageru/*.h.
[nageru] / nageru / pbo_frame_allocator.h
index 5ea0ffee8f43f72a0abc4b0dcf3be01d8e998112..cff50aa6310036fe320f2f2021c9b445ec7e7a75 100644 (file)
@@ -4,14 +4,19 @@
 #include <epoxy/gl.h>
 #include <stdbool.h>
 #include <stddef.h>
+#include <stdint.h>
+#include <map>
 #include <memory>
 #include <mutex>
+#include <string>
 #include <queue>
 
+#include <movit/effect.h>
 #include <movit/ycbcr.h>
 
 #include "bmusb/bmusb.h"
 #include "mjpeg_encoder.h"
+#include "shared/va_resource_pool.h"
 
 class MJPEGEncoder;
 
@@ -89,8 +94,8 @@ public:
                //    from there into VA-API buffers (by MJPEGEncoder) if needed.
                enum { FROM_MALLOC, FROM_VA_API } data_copy_current_src;
                uint8_t *data_copy_malloc;
-               MJPEGEncoder::VAResources va_resources;
-               MJPEGEncoder::ReleaseVAResources va_resources_release;
+               VAResourcePool::VAResources va_resources;
+               ReleaseVAResources va_resources_release;
 
                int generation;
        };
@@ -114,6 +119,12 @@ private:
        GLenum permissions;
        GLenum map_bits;
        int generation = 0;  // Under freelist_mutex.
+
+       struct LingeringGeneration {
+               std::unique_ptr<Userdata[]> userdata;
+               size_t num_frames_left;
+       };
+       std::map<int, LingeringGeneration> lingering_generations;
 };
 
 #endif  // !defined(_PBO_FRAME_ALLOCATOR)