libavformatdep = dependency('libavformat')
libavutildep = dependency('libavutil')
libswscaledep = dependency('libswscale')
-gldep = dependency('gl')
qt_files = qt6.preprocess(
moc_headers: ['mainwindow.h', 'clickable_label.h', 'video_widget.h'],
executable('stats',
['main.cpp', 'mainwindow.cpp', 'events.cpp', 'players.cpp', 'formations.cpp', 'json.cpp', 'video_widget.cpp', 'ffmpeg_raii.cpp'],
qt_files,
- dependencies: [qt6deps, sqlite3dep, libavcodecdep, libavformatdep, libavutildep, libswscaledep, gldep])
+ dependencies: [qt6deps, sqlite3dep, libavcodecdep, libavformatdep, libavutildep, libswscaledep])
{
gl = QOpenGLVersionFunctionsFactory::get<QOpenGLFunctions_4_5_Compatibility>(context());
- glDisable(GL_BLEND);
- glDisable(GL_DEPTH_TEST);
- glDepthMask(GL_FALSE);
+ gl->glDisable(GL_BLEND);
+ gl->glDisable(GL_DEPTH_TEST);
+ gl->glDepthMask(GL_FALSE);
gl->glCreateTextures(GL_TEXTURE_2D, 3, tex);
ycbcr_vertex_shader = compile_shader(gl, R"(
void VideoWindow::resizeGL(int w, int h)
{
- glViewport(0, 0, w, h);
+ gl->glViewport(0, 0, w, h);
display_aspect = double(w) / h;
}
frame = current_frame;
}
if (frame == nullptr) {
- glClear(GL_COLOR_BUFFER_BIT);
+ gl->glClear(GL_COLOR_BUFFER_BIT);
return;
}
frame->need_flush_len = 0;
}
- glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+ gl->glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
gl->glTextureSubImage2D(tex[0], 0, 0, 0, frame->width, frame->height, GL_RED, GL_UNSIGNED_BYTE, BUFFER_OFFSET(0));
gl->glGenerateTextureMipmap(tex[0]);
ty2 = 1.0 + 0.5 * extra_height / frame->height;
}
- glBegin(GL_QUADS);
+ gl->glBegin(GL_QUADS);
// (0,0)
gl->glVertexAttrib2f(1, tx1, ty1);
- glVertex2f(zoom_matrix[2 * 3 + 0], zoom_matrix[2 * 3 + 1]);
+ gl->glVertex2f(zoom_matrix[2 * 3 + 0], zoom_matrix[2 * 3 + 1]);
// (0,1)
gl->glVertexAttrib2f(1, tx1, ty2);
- glVertex2f(zoom_matrix[1 * 3 + 0] + zoom_matrix[2 * 3 + 0], zoom_matrix[1 * 3 + 1] + zoom_matrix[2 * 3 + 1]);
+ gl->glVertex2f(zoom_matrix[1 * 3 + 0] + zoom_matrix[2 * 3 + 0], zoom_matrix[1 * 3 + 1] + zoom_matrix[2 * 3 + 1]);
// (1,1)
gl->glVertexAttrib2f(1, tx2, ty2);
- glVertex2f(zoom_matrix[0 * 3 + 0] + zoom_matrix[1 * 3 + 0] + zoom_matrix[2 * 3 + 0],
+ gl->glVertex2f(zoom_matrix[0 * 3 + 0] + zoom_matrix[1 * 3 + 0] + zoom_matrix[2 * 3 + 0],
zoom_matrix[1 * 3 + 0] + zoom_matrix[1 * 3 + 1] + zoom_matrix[2 * 3 + 1]);
// (1,0)
gl->glVertexAttrib2f(1, tx2, ty1);
- glVertex2f(zoom_matrix[0 * 3 + 0] + zoom_matrix[2 * 3 + 0],
+ gl->glVertex2f(zoom_matrix[0 * 3 + 0] + zoom_matrix[2 * 3 + 0],
zoom_matrix[1 * 3 + 0] + zoom_matrix[2 * 3 + 1]);
- glEnd();
+ gl->glEnd();
}
void VideoWindow::set_current_frame(shared_ptr<VideoWidget::Frame> new_frame)