VideoTextureCopierGStreamer.h [plain text]
#ifndef VideoTextureCopierGStreamer_h
#define VideoTextureCopierGStreamer_h
#if USE(GSTREAMER_GL)
#include "ImageOrientation.h"
#include "TextureMapperGLHeaders.h"
#include "TransformationMatrix.h"
#include <wtf/RefPtr.h>
namespace WebCore {
class TextureMapperShaderProgram;
class ImageOrientation;
class VideoTextureCopierGStreamer {
public:
enum class ColorConversion {
ConvertBGRAToRGBA,
ConvertARGBToRGBA
};
VideoTextureCopierGStreamer(ColorConversion);
~VideoTextureCopierGStreamer();
bool copyVideoTextureToPlatformTexture(GLuint inputTexture, IntSize& frameSize, GLuint outputTexture, GLenum outputTarget, GLint level, GLenum internalFormat, GLenum format, GLenum type, bool flipY, ImageOrientation& sourceOrientation);
void updateColorConversionMatrix(ColorConversion);
void updateTextureSpaceMatrix();
void updateTransformationMatrix();
GLuint resultTexture() { return m_resultTexture; }
private:
RefPtr<TextureMapperShaderProgram> m_shaderProgram;
GLuint m_framebuffer { 0 };
GLuint m_vbo { 0 };
#if !USE(OPENGL_ES)
GLuint m_vao { 0 };
#endif
bool m_flipY { false };
ImageOrientation m_orientation;
IntSize m_size;
TransformationMatrix m_modelViewMatrix;
TransformationMatrix m_projectionMatrix;
TransformationMatrix m_textureSpaceMatrix;
TransformationMatrix m_colorConversionMatrix;
GLuint m_resultTexture { 0 };
};
}
#endif // USE(GSTREAMER_GL)
#endif // VideoTextureCopierGStreamer_h