]> git.sesse.net Git - nageru/blob - nageru/va_display_with_cleanup.h
Fix some overly repetitive code in PBOFrameAllocator.
[nageru] / nageru / va_display_with_cleanup.h
1 #ifndef _VA_DISPLAY_WITH_CLEANUP
2 #define _VA_DISPLAY_WITH_CLEANUP 1
3
4 #include <va/va.h>
5 #include <X11/Xlib.h>
6
7 #include <memory>
8
9 struct VADisplayWithCleanup {
10         ~VADisplayWithCleanup();
11
12         VADisplay va_dpy;
13         Display *x11_display = nullptr;
14         bool can_use_zerocopy = true;
15         int drm_fd = -1;
16 };
17 std::unique_ptr<VADisplayWithCleanup> va_open_display(const std::string &va_display);  // Can return nullptr on failure.
18
19 #endif  // !defined(_VA_DISPLAY_WITH_CLEANUP)