1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-04 23:40:47 +00:00

vo_opengl: fix other minor namespace issues

See previous commit.
This commit is contained in:
wm4 2016-05-23 21:25:43 +02:00
parent e76aa7e8db
commit c4707cdee6
5 changed files with 12 additions and 12 deletions

View File

@ -76,14 +76,14 @@ static void destroy_objects(struct gl_hwdec *hw)
} }
p->vdp_surface = VDP_INVALID_HANDLE; p->vdp_surface = VDP_INVALID_HANDLE;
glCheckError(gl, hw->log, "Before uninitializing OpenGL interop"); gl_check_error(gl, hw->log, "Before uninitializing OpenGL interop");
if (p->vdpgl_initialized) if (p->vdpgl_initialized)
gl->VDPAUFiniNV(); gl->VDPAUFiniNV();
p->vdpgl_initialized = false; p->vdpgl_initialized = false;
glCheckError(gl, hw->log, "After uninitializing OpenGL interop"); gl_check_error(gl, hw->log, "After uninitializing OpenGL interop");
} }
static void destroy(struct gl_hwdec *hw) static void destroy(struct gl_hwdec *hw)
@ -164,7 +164,7 @@ static int reinit(struct gl_hwdec *hw, struct mp_image_params *params)
gl->VDPAUSurfaceAccessNV(p->vdpgl_surface, GL_READ_ONLY); gl->VDPAUSurfaceAccessNV(p->vdpgl_surface, GL_READ_ONLY);
glCheckError(gl, hw->log, "After initializing vdpau OpenGL interop"); gl_check_error(gl, hw->log, "After initializing vdpau OpenGL interop");
params->imgfmt = IMGFMT_RGB0; params->imgfmt = IMGFMT_RGB0;

View File

@ -40,7 +40,7 @@ static const char *gl_error_to_string(GLenum error)
} }
} }
void glCheckError(GL *gl, struct mp_log *log, const char *info) void gl_check_error(GL *gl, struct mp_log *log, const char *info)
{ {
for (;;) { for (;;) {
GLenum error = gl->GetError(); GLenum error = gl->GetError();
@ -100,7 +100,7 @@ void gl_upload_tex(GL *gl, GLenum target, GLenum format, GLenum type,
gl->PixelStorei(GL_UNPACK_ALIGNMENT, 4); gl->PixelStorei(GL_UNPACK_ALIGNMENT, 4);
} }
mp_image_t *glGetWindowScreenshot(GL *gl) mp_image_t *gl_read_window_contents(GL *gl)
{ {
if (gl->es) if (gl->es)
return NULL; // ES can't read from front buffer return NULL; // ES can't read from front buffer
@ -307,7 +307,7 @@ bool fbotex_change(struct fbotex *fbo, GL *gl, struct mp_log *log, int w, int h,
fbotex_set_filter(fbo, filter ? filter : GL_LINEAR); fbotex_set_filter(fbo, filter ? filter : GL_LINEAR);
glCheckError(gl, log, "after creating framebuffer texture"); gl_check_error(gl, log, "after creating framebuffer texture");
gl->BindFramebuffer(GL_FRAMEBUFFER, fbo->fbo); gl->BindFramebuffer(GL_FRAMEBUFFER, fbo->fbo);
gl->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, gl->FramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
@ -322,7 +322,7 @@ bool fbotex_change(struct fbotex *fbo, GL *gl, struct mp_log *log, int w, int h,
gl->BindFramebuffer(GL_FRAMEBUFFER, 0); gl->BindFramebuffer(GL_FRAMEBUFFER, 0);
glCheckError(gl, log, "after creating framebuffer"); gl_check_error(gl, log, "after creating framebuffer");
return res; return res;
} }

View File

@ -24,13 +24,13 @@
struct mp_log; struct mp_log;
void glCheckError(GL *gl, struct mp_log *log, const char *info); void gl_check_error(GL *gl, struct mp_log *log, const char *info);
void gl_upload_tex(GL *gl, GLenum target, GLenum format, GLenum type, void gl_upload_tex(GL *gl, GLenum target, GLenum format, GLenum type,
const void *dataptr, int stride, const void *dataptr, int stride,
int x, int y, int w, int h); int x, int y, int w, int h);
mp_image_t *glGetWindowScreenshot(GL *gl); mp_image_t *gl_read_window_contents(GL *gl);
const char* mp_sampler_type(GLenum texture_target); const char* mp_sampler_type(GLenum texture_target);

View File

@ -523,7 +523,7 @@ static struct bstr load_cached_file(struct gl_video *p, const char *path)
static void debug_check_gl(struct gl_video *p, const char *msg) static void debug_check_gl(struct gl_video *p, const char *msg)
{ {
if (p->gl_debug) if (p->gl_debug)
glCheckError(p->gl, p->log, msg); gl_check_error(p->gl, p->log, msg);
} }
void gl_video_set_debug(struct gl_video *p, bool enable) void gl_video_set_debug(struct gl_video *p, bool enable)
@ -2983,7 +2983,7 @@ static bool test_fbo(struct gl_video *p, GLint format)
success = true; success = true;
} }
fbotex_uninit(&fbo); fbotex_uninit(&fbo);
glCheckError(gl, p->log, "FBO test"); gl_check_error(gl, p->log, "FBO test");
return success; return success;
} }

View File

@ -311,7 +311,7 @@ static int control(struct vo *vo, uint32_t request, void *data)
return VO_NOTIMPL; return VO_NOTIMPL;
} }
case VOCTRL_SCREENSHOT_WIN: { case VOCTRL_SCREENSHOT_WIN: {
struct mp_image *screen = glGetWindowScreenshot(p->gl); struct mp_image *screen = gl_read_window_contents(p->gl);
// set image parameters according to the display, if possible // set image parameters according to the display, if possible
if (screen) { if (screen) {
screen->params.primaries = p->renderer_opts->target_prim; screen->params.primaries = p->renderer_opts->target_prim;