]> git.sesse.net Git - nageru/blob - vaapi_jpeg_decoder.h
Decode 4:2:2 JPEGs via VA-API if available.
[nageru] / vaapi_jpeg_decoder.h
1 #ifndef _VAAPI_JPEG_DECODER_H
2 #define _VAAPI_JPEG_DECODER_H 1
3
4 #include <X11/Xlib.h>
5 #include <va/va.h>
6
7 #include <string>
8 #include <memory>
9
10 struct Frame;
11   
12 struct VADisplayWithCleanup {
13         ~VADisplayWithCleanup();
14
15         VADisplay va_dpy;
16         Display *x11_display = nullptr;
17         int drm_fd = -1;
18 };
19 std::unique_ptr<VADisplayWithCleanup> va_open_display(const std::string &va_display);  // Can return nullptr on failure.
20 std::string get_usable_va_display();
21
22 void init_jpeg_vaapi();
23 std::shared_ptr<Frame> decode_jpeg_vaapi(const std::string &filename);
24
25 extern bool vaapi_jpeg_decoding_usable;
26   
27 #endif  // !defined(_VAAPI_JPEG_DECODER_H)