diff options
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/aclib_template.c | 18 | ||||
-rw-r--r-- | libvo/gl_common.c | 29 | ||||
-rw-r--r-- | libvo/osx_common.c | 2 | ||||
-rw-r--r-- | libvo/sub.c | 4 | ||||
-rw-r--r-- | libvo/vo_corevideo.m | 9 | ||||
-rw-r--r-- | libvo/vo_gl.c | 10 | ||||
-rw-r--r-- | libvo/vo_gl2.c | 4 |
7 files changed, 53 insertions, 23 deletions
diff --git a/libvo/aclib_template.c b/libvo/aclib_template.c index 0d486bdaec..d7b2201944 100644 --- a/libvo/aclib_template.c +++ b/libvo/aclib_template.c @@ -277,10 +277,10 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len) "xor %%"REG_a", %%"REG_a" \n\t" ASMALIGN(4) "1: \n\t" - "movl (%0, %%"REG_a"), %%ebx \n\t" - "movl 32(%0, %%"REG_a"), %%ebx \n\t" - "movl 64(%0, %%"REG_a"), %%ebx \n\t" - "movl 96(%0, %%"REG_a"), %%ebx \n\t" + "movl (%0, %%"REG_a"), %%ecx \n\t" + "movl 32(%0, %%"REG_a"), %%ecx \n\t" + "movl 64(%0, %%"REG_a"), %%ecx \n\t" + "movl 96(%0, %%"REG_a"), %%ecx \n\t" "add $128, %%"REG_a" \n\t" "cmp %3, %%"REG_a" \n\t" " jb 1b \n\t" @@ -313,10 +313,10 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len) // a few percent speedup on out of order executing CPUs "mov %5, %%"REG_a" \n\t" "2: \n\t" - "movl (%0), %%ebx \n\t" - "movl (%0), %%ebx \n\t" - "movl (%0), %%ebx \n\t" - "movl (%0), %%ebx \n\t" + "movl (%0), %%ecx \n\t" + "movl (%0), %%ecx \n\t" + "movl (%0), %%ecx \n\t" + "movl (%0), %%ecx \n\t" "dec %%"REG_a" \n\t" " jnz 2b \n\t" #endif @@ -329,7 +329,7 @@ static void * RENAME(fast_memcpy)(void * to, const void * from, size_t len) " jae 1b \n\t" : "+r" (from), "+r" (to), "+r" (i) : "r" ((long)BLOCK_SIZE), "i" (BLOCK_SIZE/64), "i" ((long)CONFUSION_FACTOR) - : "%"REG_a, "%ebx" + : "%"REG_a, "%ecx" ); for(; i>0; i--) diff --git a/libvo/gl_common.c b/libvo/gl_common.c index bb351f90d6..f827771a97 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -1564,6 +1564,21 @@ static XVisualInfo *getWindowVisualInfo(Window win) { return XGetVisualInfo(mDisplay, VisualIDMask, &vinfo_template, &tmp); } +static void appendstr(char **dst, const char *str) +{ + int newsize; + char *newstr; + if (!str) + return; + newsize = strlen(*dst) + 1 + strlen(str) + 1; + newstr = realloc(*dst, newsize); + if (!newstr) + return; + *dst = newstr; + strcat(*dst, " "); + strcat(*dst, str); +} + /** * \brief Changes the window in which video is displayed. * If possible only transfers the context to the new window, otherwise @@ -1620,6 +1635,7 @@ int setGlWindow(XVisualInfo **vinfo, GLXContext *context, Window win) if (!keep_context) { void *(*getProcAddress)(const GLubyte *); const char *(*glXExtStr)(Display *, int); + char *glxstr = strdup(""); if (*context) glXDestroyContext(mDisplay, *context); *context = new_context; @@ -1632,8 +1648,17 @@ int setGlWindow(XVisualInfo **vinfo, GLXContext *context, Window win) if (!getProcAddress) getProcAddress = (void *)getdladdr; glXExtStr = getdladdr("glXQueryExtensionsString"); - getFunctions(getProcAddress, !glXExtStr ? NULL : - glXExtStr(mDisplay, DefaultScreen(mDisplay))); + if (glXExtStr) + appendstr(&glxstr, glXExtStr(mDisplay, DefaultScreen(mDisplay))); + glXExtStr = getdladdr("glXGetClientString"); + if (glXExtStr) + appendstr(&glxstr, glXExtStr(mDisplay, GLX_EXTENSIONS)); + glXExtStr = getdladdr("glXGetServerString"); + if (glXExtStr) + appendstr(&glxstr, glXExtStr(mDisplay, GLX_EXTENSIONS)); + + getFunctions(getProcAddress, glxstr); + free(glxstr); // and inform that reinit is neccessary return SET_WINDOW_REINIT; diff --git a/libvo/osx_common.c b/libvo/osx_common.c index 377460346a..359e6a78f7 100644 --- a/libvo/osx_common.c +++ b/libvo/osx_common.c @@ -38,7 +38,7 @@ static const struct keymap keymap[] = { // navigation block {kVK_Help, KEY_INSERT}, {kVK_ForwardDelete, KEY_DELETE}, {kVK_Home, KEY_HOME}, - {kVK_End, KEY_END}, {kVK_PageUp, KEY_PAGE_UP}, {kVK_PageUp, KEY_PAGE_DOWN}, + {kVK_End, KEY_END}, {kVK_PageUp, KEY_PAGE_UP}, {kVK_PageDown, KEY_PAGE_DOWN}, // F-keys {kVK_F1, KEY_F + 1}, {kVK_F2, KEY_F + 2}, {kVK_F3, KEY_F + 3}, {kVK_F4, KEY_F + 4}, diff --git a/libvo/sub.c b/libvo/sub.c index f729f56ad8..744652086d 100644 --- a/libvo/sub.c +++ b/libvo/sub.c @@ -359,9 +359,9 @@ inline static void vo_update_text_teletext(mp_osd_obj_t *obj, int dxs, int dys) //very simple teletext font auto scaling if(!vo_osd_teletext_scale && hm*(max_rows+1)>dys){ - text_font_scale_factor*=1.0*(dys)/((max_rows+1)*hm); + osd_font_scale_factor*=1.0*(dys)/((max_rows+1)*hm); force_load_font=1; - vo_osd_teletext_scale=text_font_scale_factor; + vo_osd_teletext_scale=osd_font_scale_factor; obj->flags&=~OSDFLAG_VISIBLE; return; } diff --git a/libvo/vo_corevideo.m b/libvo/vo_corevideo.m index ed90f5b14c..1748e059ec 100644 --- a/libvo/vo_corevideo.m +++ b/libvo/vo_corevideo.m @@ -161,10 +161,6 @@ static void free_file_specific(void) static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) { free_file_specific(); - config_movie_aspect((float)d_width/d_height); - - vo_dwidth = d_width *= mpGLView->winSizeMult; - vo_dheight = d_height *= mpGLView->winSizeMult; //misc mplayer setup image_width = width; @@ -183,6 +179,11 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_ if(!shared_buffer) { + config_movie_aspect((float)d_width/d_height); + + vo_dwidth = d_width *= mpGLView->winSizeMult; + vo_dheight = d_height *= mpGLView->winSizeMult; + image_data = malloc(image_width*image_height*image_bytes); image_datas[0] = image_data; if (vo_doublebuffering) diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index a97b524c56..1bd908f22b 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -431,7 +431,7 @@ static void uninitGl(void) { DeleteBuffers(2, gl_buffer_uv); gl_buffer_uv[0] = gl_buffer_uv[1] = 0; gl_buffersize_uv = 0; gl_bufferptr_uv[0] = gl_bufferptr_uv[1] = 0; -#ifndef GL_WIN32 +#ifdef CONFIG_X11 if (mesa_bufferptr) FreeMemoryMESA(mDisplay, mScreen, mesa_bufferptr); #endif @@ -559,6 +559,10 @@ glconfig: uninitGl(); if (setGlWindow(&gl_vinfo, &gl_context, vo_window) == SET_WINDOW_FAILED) return -1; + if (mesa_buffer && !AllocateMemoryMESA) { + mp_msg(MSGT_VO, MSGL_ERR, "Can not enable mesa-buffer because AllocateMemoryMESA was not found\n"); + mesa_buffer = 0; + } initGl(vo_dwidth, vo_dheight); return 0; @@ -763,13 +767,13 @@ static uint32_t get_image(mp_image_t *mpi) { mpi->stride[0] = mpi->width * mpi->bpp / 8; needed_size = mpi->stride[0] * mpi->height; if (mesa_buffer) { -#ifndef GL_WIN32 +#ifdef CONFIG_X11 if (mesa_bufferptr && needed_size > mesa_buffersize) { FreeMemoryMESA(mDisplay, mScreen, mesa_bufferptr); mesa_bufferptr = NULL; } if (!mesa_bufferptr) - mesa_bufferptr = AllocateMemoryMESA(mDisplay, mScreen, needed_size, 0, 0, 0); + mesa_bufferptr = AllocateMemoryMESA(mDisplay, mScreen, needed_size, 0, 1.0, 1.0); mesa_buffersize = needed_size; #endif mpi->planes[0] = mesa_bufferptr; diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index 71361916f4..e72f735bcd 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -114,7 +114,7 @@ static GLint getInternalFormat(void) { #ifdef GL_WIN32 PIXELFORMATDESCRIPTOR pfd; - HDC vo_hdc = GetDC(vo_window); + HDC vo_hdc = GetDC(vo_w32_window); int pf = GetPixelFormat(vo_hdc); if (!DescribePixelFormat(vo_hdc, pf, sizeof pfd, &pfd)) { r_sz = g_sz = b_sz = a_sz = 0; @@ -124,7 +124,7 @@ static GLint getInternalFormat(void) b_sz = pfd.cBlueBits; a_sz = pfd.cAlphaBits; } - ReleaseDC(vo_window, vo_hdc); + ReleaseDC(vo_w32_window, vo_hdc); #else if (glXGetConfig(mDisplay, gl_vinfo, GLX_RED_SIZE, &r_sz) != 0) r_sz = 0; if (glXGetConfig(mDisplay, gl_vinfo, GLX_GREEN_SIZE, &g_sz) != 0) g_sz = 0; |