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.
This commit is contained in:
wm4 2013-02-24 23:32:51 +01:00
parent c61f1ff61b
commit 423c0b13c4
12 changed files with 31 additions and 31 deletions

View File

@ -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);

View File

@ -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)
{

View File

@ -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;

View File

@ -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.

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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) {

View File

@ -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)

View File

@ -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)
{

View File

@ -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);