| 1 | #ifndef VAAPI_DISPLAY_DRM_H_ |
| 2 | #define VAAPI_DISPLAY_DRM_H_ |
| 3 | |
| 4 | #include <stdio.h> |
| 5 | #include <va/va.h> |
| 6 | |
| 7 | namespace livekit_ffi { |
| 8 | |
| 9 | // VAAPI drm display wrapper class |
| 10 | class VaapiDisplayDrm { |
| 11 | public: |
| 12 | VaapiDisplayDrm() = default; |
| 13 | VaapiDisplayDrm(const VaapiDisplayDrm&) = delete; |
| 14 | ~VaapiDisplayDrm(); |
| 15 | |
| 16 | // Initialize the VAAPI display |
| 17 | bool Open(); |
| 18 | |
| 19 | // Check if the VAAPI display is open |
| 20 | bool isOpen() const; |
| 21 | |
| 22 | // Close the VAAPI display |
| 23 | void Close(); |
| 24 | |
| 25 | // Get the VAAPI display handle |
| 26 | VADisplay display() const { return va_display_; } |
| 27 | |
| 28 | private: |
| 29 | VADisplay va_display_ = nullptr; |
| 30 | int drm_fd_ = -1; |
| 31 | }; |
| 32 | |
| 33 | } // namespace livekit_ffi |
| 34 | |
| 35 | #endif // VAAPI_DISPLAY_DRM_H_ |