]> git.sesse.net Git - nageru/blobdiff - futatabi/vaapi_jpeg_decoder.h
Move everything into a separate futatabi/ subdir, for the upcoming merge with Nageru.
[nageru] / futatabi / vaapi_jpeg_decoder.h
diff --git a/futatabi/vaapi_jpeg_decoder.h b/futatabi/vaapi_jpeg_decoder.h
new file mode 100644 (file)
index 0000000..4182cfc
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef _VAAPI_JPEG_DECODER_H
+#define _VAAPI_JPEG_DECODER_H 1
+
+#include <X11/Xlib.h>
+#include <memory>
+#include <string>
+#include <va/va.h>
+
+struct Frame;
+
+struct VADisplayWithCleanup {
+       ~VADisplayWithCleanup();
+
+       VADisplay va_dpy;
+       Display *x11_display = nullptr;
+       int drm_fd = -1;
+};
+std::unique_ptr<VADisplayWithCleanup> va_open_display(const std::string &va_display);  // Can return nullptr on failure.
+std::string get_usable_va_display();
+
+void init_jpeg_vaapi();
+std::shared_ptr<Frame> decode_jpeg_vaapi(const std::string &jpeg);
+
+extern bool vaapi_jpeg_decoding_usable;
+
+#endif  // !defined(_VAAPI_JPEG_DECODER_H)