22 #ifndef QTAV_VIDEOSHADER_P_H 23 #define QTAV_VIDEOSHADER_P_H 27 #include "ColorTransform.h" 29 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) 30 #include <QtGui/QOpenGLBuffer> 31 #include <QtGui/QOpenGLShaderProgram> 32 #include <QtGui/QOpenGLFunctions> 34 #if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0) 35 #include <QtOpenGL/QGLFunctions> 37 #include <QtOpenGL/QGLBuffer> 38 #include <QtOpenGL/QGLShaderProgram> 39 typedef QGLBuffer QOpenGLBuffer;
40 #define QOpenGLShaderProgram QGLShaderProgram 41 #define QOpenGLShader QGLShader 42 #define QOpenGLFunctions QGLFunctions 43 #define QOpenGLContext QGLContext 60 , rebuild_program(false)
61 , update_builtin_uniforms(true)
69 , texture_target(GL_TEXTURE_2D)
72 if (owns_program && program) {
73 if (QOpenGLContext::currentContext()) {
75 program->removeAllShaders();
107 : update_texure(true)
108 , init_textures_required(true)
114 , effective_tex_width_ratio(1.0)
115 , target(GL_TEXTURE_2D)
119 v_texel_size.reserve(4);
121 texture_size.reserve(4);
122 texture_upload_size.reserve(4);
123 effective_tex_width.reserve(4);
124 internal_format.reserve(4);
125 data_format.reserve(4);
126 data_type.reserve(4);
127 texture_coords.reserve(4);
128 static bool enable_pbo = qgetenv(
"QTAV_PBO").toInt() > 0;
130 try_pbo = enable_pbo;
135 bool initPBO(
int plane,
int size);
136 bool initTexture(GLuint tex, GLint internal_format, GLenum format, GLenum dataType,
int width,
int height);
137 bool updateTextureParameters(
const VideoFormat& fmt);
138 bool ensureResources();
139 bool ensureTextures();
157 quint8 workaround_vector_crash_on_linux[8];
181 QVector<QOpenGLBuffer>
pbo;
190 #endif // QTAV_VideoShader_P_H
QVector< GLenum > data_type
Definition: VideoShader_p.h:175
int u_Matrix
Definition: VideoShader_p.h:86
QByteArray vert
Definition: VideoShader_p.h:98
bool dirty
Definition: VideoShader_p.h:178
int plane1_linesize
Definition: VideoShader_p.h:154
VideoFormat video_format
Definition: VideoShader_p.h:96
QVector< QVector2D > v_texture_size
Definition: VideoShader_p.h:185
Definition: VideoShader_p.h:51
QOpenGLShaderProgram * program
Definition: VideoShader_p.h:85
QVector< QOpenGLBuffer > pbo
Definition: VideoShader_p.h:181
int u_opacity
Definition: VideoShader_p.h:89
size_t size
Definition: mem.h:207
QVector< QSize > texture_upload_size
Definition: VideoShader_p.h:168
bool init_textures_required
Definition: VideoShader_p.h:143
Definition: VideoShader_p.h:50
#define Q_AV_PRIVATE_EXPORT
Definition: QtAV_Global.h:43
QVector< GLfloat > texture_coords
Definition: VideoShader_p.h:177
VideoMaterialPrivate()
Definition: VideoShader_p.h:106
VideoShaderPrivate()
Definition: VideoShader_p.h:58
VideoFormat video_format
Definition: VideoShader_p.h:151
VideoFrame frame
Definition: VideoShader_p.h:146
int width
Definition: VideoShader_p.h:145
bool owns_program
Definition: VideoShader_p.h:82
ColorTransform colorTransform
Definition: VideoShader_p.h:179
QVector< QVector2D > v_texel_size
Definition: VideoShader_p.h:184
int bpc
Definition: VideoShader_p.h:144
QVector< GLuint > textures
Definition: VideoShader_p.h:158
int u_to8
Definition: VideoShader_p.h:88
Definition: VideoShader_p.h:103
Definition: VideoShader_p.h:49
The VideoShader class Represents a shader for rendering a video frame.
Definition: VideoShader.h:53
QSize plane0Size
Definition: VideoShader_p.h:152
Definition: VideoShader_p.h:55
Definition: VideoFrame.h:32
ShaderType
Definition: VideoShader_p.h:48
GLenum texture_target
Definition: VideoShader_p.h:95
QHash< GLuint, bool > owns_texture
Definition: VideoShader_p.h:159
qreal effective_tex_width_ratio
Definition: VideoShader_p.h:171
QVector< GLint > internal_format
Definition: VideoShader_p.h:173
QVector< GLenum > data_format
Definition: VideoShader_p.h:174
int u_textureSize
Definition: VideoShader_p.h:92
The VideoMaterial class Encapsulates rendering state for a video shader program.
Definition: VideoShader.h:179
int u_texelSize
Definition: VideoShader_p.h:91
GLenum target
Definition: VideoShader_p.h:172
int u_colorMatrix
Definition: VideoShader_p.h:87
QVector< int > effective_tex_width
Definition: VideoShader_p.h:170
qint32 material_type
Definition: VideoShader_p.h:93
QVector< int > u_Texture
Definition: VideoShader_p.h:94
bool update_texure
Definition: VideoShader_p.h:142
int u_c
Definition: VideoShader_p.h:90
QByteArray planar_frag
Definition: VideoShader_p.h:97
bool try_pbo
Definition: VideoShader_p.h:180
AudioOutput ao; ao.setAudioFormat(fmt); ao.open(); while (has_data) { data = read_data(ao->bufferSize...
Definition: AudioDecoder.h:31
QVector< QSize > texture_size
Definition: VideoShader_p.h:160
virtual ~VideoShaderPrivate()
Definition: VideoShader_p.h:71
Definition: QtAV_Global.h:124
bool update_builtin_uniforms
Definition: VideoShader_p.h:84
QMatrix4x4 channel_map
Definition: VideoShader_p.h:183
bool rebuild_program
Definition: VideoShader_p.h:83
QVector2D vec_to8
Definition: VideoShader_p.h:182