-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wip: start working on vaapi glx interop
- Loading branch information
1 parent
07e8735
commit c63948b
Showing
18 changed files
with
525 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// Created by silenium-dev on 7/23/24. | ||
// | ||
|
||
#include "VAGLXInteropImage.hpp" | ||
|
||
#include <GL/glx.h> | ||
#include <va/va_glx.h> | ||
|
||
VAGLXInteropImage::VAGLXInteropImage( | ||
VADisplay display, | ||
VASurfaceID surface, | ||
void *glxSurface, | ||
unsigned int texture, | ||
Swizzles swizzles) | ||
: display(display), surface(surface), glxSurface(glxSurface), texture({texture}), swizzles({swizzles}) { | ||
} | ||
|
||
VAGLXInteropImage::~VAGLXInteropImage() { | ||
if (glxSurface != None) { | ||
vaDestroySurfaceGLX(display, glxSurface); | ||
} | ||
vaDestroySurfaces(display, &surface, 1); | ||
glDeleteTextures(1, &texture[0]); | ||
} | ||
|
||
const std::vector<GLuint> &VAGLXInteropImage::planeTextures() const { | ||
return texture; | ||
} | ||
|
||
const std::vector<Swizzles> &VAGLXInteropImage::planeSwizzles() const { | ||
return swizzles; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// Created by silenium-dev on 7/23/24. | ||
// | ||
|
||
#ifndef VAINTEROPIMAGE_HPP | ||
#define VAINTEROPIMAGE_HPP | ||
|
||
#include "helper/EGL.hpp" | ||
#include "render/GLInteropImage.hpp" | ||
#include <va/va.h> | ||
|
||
class VAGLXInteropImage final : public GLInteropImage { | ||
public: | ||
VAGLXInteropImage( | ||
VADisplay display, | ||
VASurfaceID surface, | ||
void *glxSurfaces, | ||
unsigned int textures, | ||
Swizzles swizzles); | ||
|
||
VAGLXInteropImage(VAGLXInteropImage &&) noexcept = default; | ||
|
||
VAGLXInteropImage &operator=(VAGLXInteropImage &&) noexcept = default; | ||
|
||
VAGLXInteropImage(const VAGLXInteropImage &) = delete; | ||
|
||
VAGLXInteropImage &operator=(const VAGLXInteropImage &) = delete; | ||
|
||
~VAGLXInteropImage() override; | ||
|
||
[[nodiscard]] const std::vector<unsigned int> &planeTextures() const override; | ||
|
||
[[nodiscard]] const std::vector<Swizzles> &planeSwizzles() const override; | ||
|
||
private: | ||
VADisplay display{nullptr}; | ||
VASurfaceID surface{0}; | ||
void *glxSurface{}; | ||
std::vector<unsigned int> texture{}; | ||
std::vector<Swizzles> swizzles{}; | ||
}; | ||
|
||
|
||
#endif//VAINTEROPIMAGE_HPP |
Oops, something went wrong.