MCPcopy Create free account
hub / github.com/Stremio/stremio-shell / createFramebufferObject

Method createFramebufferObject

mpv.cpp:63–80  ·  view source on GitHub ↗

This function is called when a new FBO is needed. This happens on the initial frame.

Source from the content-addressed store, hash-verified

61 // This function is called when a new FBO is needed.
62 // This happens on the initial frame.
63 QOpenGLFramebufferObject *createFramebufferObject(const QSize &size)
64 {
65 // init mpv_gl:
66 if (!obj->mpv_gl)
67 {
68 mpv_opengl_init_params gl_init_params{get_proc_address_mpv, nullptr, nullptr};
69 mpv_render_param params[]{
70 {MPV_RENDER_PARAM_API_TYPE, const_cast<char *>(MPV_RENDER_API_TYPE_OPENGL)},
71 {MPV_RENDER_PARAM_OPENGL_INIT_PARAMS, &gl_init_params},
72 {MPV_RENDER_PARAM_INVALID, nullptr}};
73
74 if (mpv_render_context_create(&obj->mpv_gl, obj->mpv, params) < 0)
75 throw std::runtime_error("failed to initialize mpv GL context");
76 mpv_render_context_set_update_callback(obj->mpv_gl, on_mpv_redraw, obj);
77 }
78
79 return QQuickFramebufferObject::Renderer::createFramebufferObject(size);
80 }
81
82 void render()
83 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected