]> git.sesse.net Git - pkanalytics/blobdiff - video_widget.h
Make persistent PBOs for faster texture upload.
[pkanalytics] / video_widget.h
index 24aaea3b6a8129e179ff6c7c23343b7dc4872874..30b4b9b4747343258cc3da68aa7ba8148e72a67b 100644 (file)
@@ -44,13 +44,14 @@ public:
        void mouseReleaseEvent(QMouseEvent *e);
        void mouseMoveEvent(QMouseEvent *e);
 
-       // Should really have a PBO, but this is OK for now.
        // public due to shared_ptr.
        struct Frame {
                unsigned width, height;
                unsigned chroma_width, chroma_height;
-               std::unique_ptr<uint8_t[]> data;  // Y, followed by Cb, followed by Cr.
                VideoWidget *owner;  // For the freelist.
+               GLuint pbo;
+               uint8_t *data;  // Persistently mapped into the PBO. Y, followed by Cb, followed by Cr.
+               size_t need_flush_len;  // 0 = no flush needed.
        };
 
 signals: