From 423c0b13c4ffaf8ba619a4412b90a4b94fccce3c Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 24 Feb 2013 23:32:51 +0100 Subject: video/out: rename create_window to config_window create_window is really bad naming, because this function can be called multiple times, while the name implies that it always creates a new window. At least the name config_window is not actively misleading. --- video/out/cocoa_common.h | 2 +- video/out/cocoa_common.m | 2 +- video/out/gl_common.c | 22 +++++++++++----------- video/out/gl_common.h | 8 ++++---- video/out/vo_corevideo.m | 2 +- video/out/vo_opengl.c | 8 ++++---- video/out/vo_opengl_old.c | 8 ++++---- video/out/vo_vdpau.c | 2 +- video/out/vo_x11.c | 2 +- video/out/vo_xv.c | 2 +- video/out/x11_common.c | 2 +- video/out/x11_common.h | 2 +- 12 files changed, 31 insertions(+), 31 deletions(-) diff --git a/video/out/cocoa_common.h b/video/out/cocoa_common.h index 4227782251..3450ebd547 100644 --- a/video/out/cocoa_common.h +++ b/video/out/cocoa_common.h @@ -33,7 +33,7 @@ void vo_cocoa_uninit(struct vo *vo); void vo_cocoa_update_xinerama_info(struct vo *vo); int vo_cocoa_change_attributes(struct vo *vo); -int vo_cocoa_create_window(struct vo *vo, uint32_t d_width, +int vo_cocoa_config_window(struct vo *vo, uint32_t d_width, uint32_t d_height, uint32_t flags, int gl3profile); diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index ca8844aaaa..67b16772d0 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -448,7 +448,7 @@ static void update_window(struct vo *vo) } } -int vo_cocoa_create_window(struct vo *vo, uint32_t d_width, +int vo_cocoa_config_window(struct vo *vo, uint32_t d_width, uint32_t d_height, uint32_t flags, int gl3profile) { diff --git a/video/out/gl_common.c b/video/out/gl_common.c index 0edcbfae0a..b72f9ae0d2 100644 --- a/video/out/gl_common.c +++ b/video/out/gl_common.c @@ -843,10 +843,10 @@ mp_image_t *glGetWindowScreenshot(GL *gl) #ifdef CONFIG_GL_COCOA #include "cocoa_common.h" -static bool create_window_cocoa(struct MPGLContext *ctx, uint32_t d_width, +static bool config_window_cocoa(struct MPGLContext *ctx, uint32_t d_width, uint32_t d_height, uint32_t flags) { - int rv = vo_cocoa_create_window(ctx->vo, d_width, d_height, flags, + int rv = vo_cocoa_config_window(ctx->vo, d_width, d_height, flags, ctx->requested_gl_version >= MPGL_VER(3, 0)); if (rv != 0) return false; @@ -1024,7 +1024,7 @@ out: return false; } -static bool create_window_w32(struct MPGLContext *ctx, uint32_t d_width, +static bool config_window_w32(struct MPGLContext *ctx, uint32_t d_width, uint32_t d_height, uint32_t flags) { if (!vo_w32_config(ctx->vo, d_width, d_height, flags)) @@ -1200,7 +1200,7 @@ static GLXFBConfig select_fb_config(struct vo *vo, const int *attribs) return fbconfig; } -static bool create_window_x11(struct MPGLContext *ctx, uint32_t d_width, +static bool config_window_x11(struct MPGLContext *ctx, uint32_t d_width, uint32_t d_height, uint32_t flags) { struct vo *vo = ctx->vo; @@ -1209,7 +1209,7 @@ static bool create_window_x11(struct MPGLContext *ctx, uint32_t d_width, if (glx_ctx->context) { // GL context and window already exist. // Only update window geometry etc. - vo_x11_create_vo_window(vo, glx_ctx->vinfo, vo->dx, vo->dy, d_width, + vo_x11_config_vo_window(vo, glx_ctx->vinfo, vo->dx, vo->dy, d_width, d_height, flags, "gl"); return true; } @@ -1261,7 +1261,7 @@ static bool create_window_x11(struct MPGLContext *ctx, uint32_t d_width, glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_GREEN_SIZE, &ctx->depth_g); glXGetFBConfigAttrib(vo->x11->display, fbc, GLX_BLUE_SIZE, &ctx->depth_b); - vo_x11_create_vo_window(vo, glx_ctx->vinfo, vo->dx, vo->dy, d_width, + vo_x11_config_vo_window(vo, glx_ctx->vinfo, vo->dx, vo->dy, d_width, d_height, flags, "gl"); bool success = false; @@ -1347,7 +1347,7 @@ MPGLContext *mpgl_init(enum MPGLType type, struct vo *vo) switch (ctx->type) { #ifdef CONFIG_GL_COCOA case GLTYPE_COCOA: - ctx->create_window = create_window_cocoa; + ctx->config_window = config_window_cocoa; ctx->releaseGlContext = releaseGlContext_cocoa; ctx->swapGlBuffers = swapGlBuffers_cocoa; ctx->check_events = vo_cocoa_check_events; @@ -1363,7 +1363,7 @@ MPGLContext *mpgl_init(enum MPGLType type, struct vo *vo) #ifdef CONFIG_GL_WIN32 case GLTYPE_W32: ctx->priv = talloc_zero(ctx, struct w32_context); - ctx->create_window = create_window_w32; + ctx->config_window = config_window_w32; ctx->releaseGlContext = releaseGlContext_w32; ctx->swapGlBuffers = swapGlBuffers_w32; ctx->update_xinerama_info = w32_update_xinerama_info; @@ -1378,7 +1378,7 @@ MPGLContext *mpgl_init(enum MPGLType type, struct vo *vo) #ifdef CONFIG_GL_X11 case GLTYPE_X11: ctx->priv = talloc_zero(ctx, struct glx_context); - ctx->create_window = create_window_x11; + ctx->config_window = config_window_x11; ctx->releaseGlContext = releaseGlContext_x11; ctx->swapGlBuffers = swapGlBuffers_x11; ctx->update_xinerama_info = vo_x11_update_screeninfo; @@ -1408,7 +1408,7 @@ bool mpgl_destroy_window(struct MPGLContext *ctx) return ctx->vo_init_ok; } -bool mpgl_create_window(struct MPGLContext *ctx, int gl_caps, uint32_t d_width, +bool mpgl_config_window(struct MPGLContext *ctx, int gl_caps, uint32_t d_width, uint32_t d_height, uint32_t flags) { if (!ctx->vo_init_ok) @@ -1419,7 +1419,7 @@ bool mpgl_create_window(struct MPGLContext *ctx, int gl_caps, uint32_t d_width, ctx->requested_gl_version = (gl_caps & MPGL_CAP_GL_LEGACY) ? MPGL_VER(2, 1) : MPGL_VER(3, 0); - if (ctx->create_window(ctx, d_width, d_height, flags)) { + if (ctx->config_window(ctx, d_width, d_height, flags)) { int missing = (ctx->gl->mpgl_caps & gl_caps) ^ gl_caps; if (!missing) return true; diff --git a/video/out/gl_common.h b/video/out/gl_common.h index a3ab8bf287..cda99b9bff 100644 --- a/video/out/gl_common.h +++ b/video/out/gl_common.h @@ -108,7 +108,7 @@ typedef struct MPGLContext { // Bit size of each component in the created framebuffer. 0 if unknown. int depth_r, depth_g, depth_b; - // GL version requested from create_window_gl3 backend (MPGL_VER mangled). + // GL version requested from config_window_gl3 backend (MPGL_VER mangled). // (Might be different from the actual version in gl->version.) int requested_gl_version; @@ -126,7 +126,7 @@ typedef struct MPGLContext { // GL context. (The caller must check if the created GL version is ok. The // callee must try to fall back to an older version if the requested // version is not available, and newer versions are incompatible.) - bool (*create_window)(struct MPGLContext *ctx, uint32_t d_width, + bool (*config_window)(struct MPGLContext *ctx, uint32_t d_width, uint32_t d_height, uint32_t flags); // optional @@ -147,11 +147,11 @@ MPGLContext *mpgl_init(enum MPGLType type, struct vo *vo); void mpgl_uninit(MPGLContext *ctx); // Create a VO window and create a GL context on it. -// (Calls create_window_gl3 or create_window+setGlWindow.) +// (Calls config_window_gl3 or config_window+setGlWindow.) // gl_caps: bitfield of MPGL_CAP_* (required GL version and feature set) // flags: passed to the backend's create window function // Returns success. -bool mpgl_create_window(struct MPGLContext *ctx, int gl_caps, uint32_t d_width, +bool mpgl_config_window(struct MPGLContext *ctx, int gl_caps, uint32_t d_width, uint32_t d_height, uint32_t flags); // Destroy the window, without resetting GL3 vs. GL2 context choice. diff --git a/video/out/vo_corevideo.m b/video/out/vo_corevideo.m index 0166c8ac10..ab3bf4ac99 100644 --- a/video/out/vo_corevideo.m +++ b/video/out/vo_corevideo.m @@ -145,7 +145,7 @@ static int config(struct vo *vo, uint32_t width, uint32_t height, p->image_height = height; int mpgl_caps = MPGL_CAP_GL_LEGACY; - if (!mpgl_create_window(p->mpglctx, mpgl_caps, d_width, d_height, flags)) + if (!mpgl_config_window(p->mpglctx, mpgl_caps, d_width, d_height, flags)) return -1; init_gl(vo, vo->dwidth, vo->dheight); diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c index cc67187a0f..f2c78392ba 100644 --- a/video/out/vo_opengl.c +++ b/video/out/vo_opengl.c @@ -1624,7 +1624,7 @@ static int query_format(struct vo *vo, uint32_t format) return caps; } -static bool create_window(struct gl_priv *p, uint32_t d_width, +static bool config_window(struct gl_priv *p, uint32_t d_width, uint32_t d_height, uint32_t flags) { if (p->stereo_mode == GL_3D_QUADBUFFER) @@ -1636,7 +1636,7 @@ static bool create_window(struct gl_priv *p, uint32_t d_width, int mpgl_caps = MPGL_CAP_GL21 | MPGL_CAP_TEX_RG; if (!p->allow_sw) mpgl_caps |= MPGL_CAP_NO_SW; - return mpgl_create_window(p->glctx, mpgl_caps, d_width, d_height, flags); + return mpgl_config_window(p->glctx, mpgl_caps, d_width, d_height, flags); } static int config(struct vo *vo, uint32_t width, uint32_t height, @@ -1645,7 +1645,7 @@ static int config(struct vo *vo, uint32_t width, uint32_t height, { struct gl_priv *p = vo->priv; - if (!create_window(p, d_width, d_height, flags)) + if (!config_window(p, d_width, d_height, flags)) return -1; if (!p->vertex_buffer) @@ -2185,7 +2185,7 @@ static int preinit(struct vo *vo, const char *arg) goto err_out; p->gl = p->glctx->gl; - if (!create_window(p, 320, 200, VOFLAG_HIDDEN)) + if (!config_window(p, 320, 200, VOFLAG_HIDDEN)) goto err_out; check_gl_features(p); // We created a window to test whether the GL context could be diff --git a/video/out/vo_opengl_old.c b/video/out/vo_opengl_old.c index c7a7312974..3934bb3806 100644 --- a/video/out/vo_opengl_old.c +++ b/video/out/vo_opengl_old.c @@ -1723,7 +1723,7 @@ static int initGl(struct vo *vo, uint32_t d_width, uint32_t d_height) return 1; } -static bool create_window(struct vo *vo, uint32_t d_width, uint32_t d_height, +static bool config_window(struct vo *vo, uint32_t d_width, uint32_t d_height, uint32_t flags) { struct gl_priv *p = vo->priv; @@ -1734,7 +1734,7 @@ static bool create_window(struct vo *vo, uint32_t d_width, uint32_t d_height, int mpgl_caps = MPGL_CAP_GL_LEGACY; if (!p->allow_sw) mpgl_caps |= MPGL_CAP_NO_SW; - return mpgl_create_window(p->glctx, mpgl_caps, d_width, d_height, flags); + return mpgl_config_window(p->glctx, mpgl_caps, d_width, d_height, flags); } static int config(struct vo *vo, uint32_t width, uint32_t height, @@ -1760,7 +1760,7 @@ static int config(struct vo *vo, uint32_t width, uint32_t height, if (vo->config_count) uninitGl(vo); - if (!create_window(vo, d_width, d_height, flags)) + if (!config_window(vo, d_width, d_height, flags)) return -1; initGl(vo, vo->dwidth, vo->dheight); @@ -2272,7 +2272,7 @@ static int preinit(struct vo *vo, const char *arg) p->gl = p->glctx->gl; if (p->use_yuv == -1) { - if (!create_window(vo, 320, 200, VOFLAG_HIDDEN)) + if (!config_window(vo, 320, 200, VOFLAG_HIDDEN)) goto err_out; autodetectGlExtensions(vo); // We created a window to test whether the GL context supports hardware diff --git a/video/out/vo_vdpau.c b/video/out/vo_vdpau.c index d97a4ac48d..9890db13ea 100644 --- a/video/out/vo_vdpau.c +++ b/video/out/vo_vdpau.c @@ -856,7 +856,7 @@ static int config(struct vo *vo, uint32_t width, uint32_t height, if (IMGFMT_IS_VDPAU(vc->image_format) && !create_vdp_decoder(vo, 2)) return -1; - vo_x11_create_vo_window(vo, NULL, vo->dx, vo->dy, d_width, d_height, + vo_x11_config_vo_window(vo, NULL, vo->dx, vo->dy, d_width, d_height, flags, "vdpau"); if (initialize_vdpau_objects(vo) < 0) diff --git a/video/out/vo_x11.c b/video/out/vo_x11.c index 26abcef332..0ab3c9ebcb 100644 --- a/video/out/vo_x11.c +++ b/video/out/vo_x11.c @@ -362,7 +362,7 @@ static int config(struct vo *vo, uint32_t width, uint32_t height, p->image_width = (width + 7) & (~7); p->image_height = height; - vo_x11_create_vo_window(vo, &p->vinfo, vo->dx, vo->dy, vo->dwidth, + vo_x11_config_vo_window(vo, &p->vinfo, vo->dx, vo->dy, vo->dwidth, vo->dheight, flags, "x11"); if (WinID > 0) { diff --git a/video/out/vo_xv.c b/video/out/vo_xv.c index a8f95bb87b..e98af7350e 100644 --- a/video/out/vo_xv.c +++ b/video/out/vo_xv.c @@ -526,7 +526,7 @@ static int config(struct vo *vo, uint32_t width, uint32_t height, if (!ctx->xv_format) return -1; - vo_x11_create_vo_window(vo, NULL, vo->dx, vo->dy, vo->dwidth, + vo_x11_config_vo_window(vo, NULL, vo->dx, vo->dy, vo->dwidth, vo->dheight, flags, "xv"); if (ctx->xv_ck_info.method == CK_METHOD_BACKGROUND) diff --git a/video/out/x11_common.c b/video/out/x11_common.c index 6b34e1cc65..b6ee15f95d 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -984,7 +984,7 @@ static Window vo_x11_create_smooth_window(struct vo_x11_state *x11, * * If the window already exists, it just moves and resizes it. */ -void vo_x11_create_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y, +void vo_x11_config_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y, unsigned int width, unsigned int height, int flags, const char *classname) { diff --git a/video/out/x11_common.h b/video/out/x11_common.h index 5553c070f5..71868cd11d 100644 --- a/video/out/x11_common.h +++ b/video/out/x11_common.h @@ -123,7 +123,7 @@ uint32_t vo_x11_set_equalizer(struct vo *vo, const char *name, int value); uint32_t vo_x11_get_equalizer(struct vo *vo, const char *name, int *value); bool vo_x11_screen_is_composited(struct vo *vo); void fstype_help(void); -void vo_x11_create_vo_window(struct vo *vo, XVisualInfo *vis, +void vo_x11_config_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y, unsigned int width, unsigned int height, int flags, const char *classname); -- cgit v1.2.3