diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-03-09 19:58:02 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-03-09 19:58:02 +0200 |
commit | 173beb5608d893c0d9b42c1043f1dfa2db2e4df2 (patch) | |
tree | 9d91be39eb1a2edb2eec45d537630f518e04378a | |
parent | ed0237e7d3c491282fbdc29c5ac294425055de57 (diff) | |
parent | c5b0ff1cfacfa502eb0647f329756ddf7c79fcb6 (diff) | |
download | mpv-173beb5608d893c0d9b42c1043f1dfa2db2e4df2.tar.bz2 mpv-173beb5608d893c0d9b42c1043f1dfa2db2e4df2.tar.xz |
Merge svn changes up to r30514
-rw-r--r-- | Changelog | 2 | ||||
-rw-r--r-- | libvo/video_out.h | 1 | ||||
-rw-r--r-- | libvo/vo_gl.c | 12 | ||||
-rw-r--r-- | libvo/w32_common.c | 50 | ||||
-rw-r--r-- | libvo/x11_common.c | 10 | ||||
-rw-r--r-- | libvo/x11_common.h | 1 | ||||
-rw-r--r-- | loader/wrapper.S | 56 |
7 files changed, 74 insertions, 58 deletions
@@ -41,7 +41,7 @@ MPlayer (1.0) * support for MPEG-4 ASP in VDPAU video output (non B-frame only) * support for live and non-live DVB teletext with demuxer lavf * -name, -title and -use-filename-title options for MPlayer - * support for stream handling via FFmpeg + * support for stream handling via FFmpeg, in particular rtmp and rtsp (use e.g. ffmpeg://http://example.com/test) * better support for 16-bit-per-component formats and formats with alpha channel. diff --git a/libvo/video_out.h b/libvo/video_out.h index 697cc4e0d5..0b5f71255c 100644 --- a/libvo/video_out.h +++ b/libvo/video_out.h @@ -118,6 +118,7 @@ typedef struct { #define VOFLAG_MODESWITCHING 0x02 #define VOFLAG_SWSCALE 0x04 #define VOFLAG_FLIPPING 0x08 +#define VOFLAG_HIDDEN 0x10 //< Use to create a hidden window #define VOFLAG_XOVERLAY_SUB_VO 0x10000 typedef struct vo_info_s diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 3101d51d9a..8611496a53 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -1148,20 +1148,20 @@ static int preinit(const char *arg) "\n" ); return -1; } - if (many_fmts) - mp_msg(MSGT_VO, MSGL_INFO, "[gl] using extended formats. " - "Use -vo gl:nomanyfmts if playback fails.\n"); - mp_msg(MSGT_VO, MSGL_V, "[gl] Using %d as slice height " - "(0 means image height).\n", slice_height); if (!init_mpglcontext(&glctx, gltype)) goto err_out; if (use_yuv == -1) { - if (create_window(320, 200, 0, NULL) < 0) + if (create_window(320, 200, VOFLAG_HIDDEN, NULL) < 0) goto err_out; if (glctx.setGlWindow(&glctx) == SET_WINDOW_FAILED) goto err_out; autodetectGlExtensions(); } + if (many_fmts) + mp_msg(MSGT_VO, MSGL_INFO, "[gl] using extended formats. " + "Use -vo gl:nomanyfmts if playback fails.\n"); + mp_msg(MSGT_VO, MSGL_V, "[gl] Using %d as slice height " + "(0 means image height).\n", slice_height); return 0; diff --git a/libvo/w32_common.c b/libvo/w32_common.c index 3b5f97de29..47c1d6198e 100644 --- a/libvo/w32_common.c +++ b/libvo/w32_common.c @@ -332,10 +332,7 @@ static void resetMode(void) { static int createRenderingContext(void) { HWND layer = HWND_NOTOPMOST; - PIXELFORMATDESCRIPTOR pfd; - HDC vo_hdc = vo_w32_get_dc(vo_window); RECT r; - int pf; if (WinID < 0) { int style = (vo_border && !vo_fs) ? (WS_OVERLAPPEDWINDOW | WS_SIZEBOX) : WS_POPUP; @@ -381,26 +378,6 @@ static int createRenderingContext(void) { AdjustWindowRect(&r, style, 0); SetWindowPos(vo_window, layer, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_SHOWWINDOW); } - - memset(&pfd, 0, sizeof pfd); - pfd.nSize = sizeof pfd; - pfd.nVersion = 1; - pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; - pfd.iPixelType = PFD_TYPE_RGBA; - pfd.cColorBits = 24; - pfd.iLayerType = PFD_MAIN_PLANE; - pf = ChoosePixelFormat(vo_hdc, &pfd); - if (!pf) { - mp_msg(MSGT_VO, MSGL_ERR, "vo: win32: unable to select a valid pixel format!\n"); - ReleaseDC(vo_window, vo_hdc); - return 0; - } - - SetPixelFormat(vo_hdc, pf, &pfd); - - mp_msg(MSGT_VO, MSGL_V, "vo: win32: running at %dx%d with depth %d\n", vo_screenwidth, vo_screenheight, depthonscreen); - - vo_w32_release_dc(vo_window, vo_hdc); return 1; } @@ -417,6 +394,9 @@ static int createRenderingContext(void) { * \return 1 - Success, 0 - Failure */ int vo_w32_config(uint32_t width, uint32_t height, uint32_t flags) { + // we already have a fully initialized window, so nothing needs to be done + if (flags & VOFLAG_HIDDEN) + return; // store original size for videomode switching o_dwidth = width; o_dheight = height; @@ -457,13 +437,15 @@ static char *get_display_name(void) { * * Global libvo variables changed: * vo_w32_window - * vo_depthonscreen * vo_screenwidth * vo_screenheight * * \return 1 = Success, 0 = Failure */ int vo_w32_init(void) { + PIXELFORMATDESCRIPTOR pfd; + HDC vo_hdc; + int pf; HICON mplayerIcon = 0; char exedir[MAX_PATH]; HINSTANCE user32; @@ -520,6 +502,26 @@ int vo_w32_init(void) { if (dev) dev_hdc = CreateDC(dev, NULL, NULL, NULL); updateScreenProperties(); + vo_hdc = vo_w32_get_dc(vo_window); + memset(&pfd, 0, sizeof pfd); + pfd.nSize = sizeof pfd; + pfd.nVersion = 1; + pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER; + pfd.iPixelType = PFD_TYPE_RGBA; + pfd.cColorBits = 24; + pfd.iLayerType = PFD_MAIN_PLANE; + pf = ChoosePixelFormat(vo_hdc, &pfd); + if (!pf) { + mp_msg(MSGT_VO, MSGL_ERR, "vo: win32: unable to select a valid pixel format!\n"); + vo_w32_release_dc(vo_window, vo_hdc); + return 0; + } + + SetPixelFormat(vo_hdc, pf, &pfd); + vo_w32_release_dc(vo_window, vo_hdc); + + mp_msg(MSGT_VO, MSGL_V, "vo: win32: running at %dx%d with depth %d\n", vo_screenwidth, vo_screenheight, depthonscreen); + return 1; } diff --git a/libvo/x11_common.c b/libvo/x11_common.c index f16c203a38..91431207a3 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -1044,13 +1044,19 @@ void vo_x11_create_vo_window(struct vo *vo, XVisualInfo *vis, int x, int y, goto final; } if (x11->window == None) { - XSizeHints hint; - XEvent xev; vo_fs = 0; vo->dwidth = width; vo->dheight = height; x11->window = vo_x11_create_smooth_window(x11, x11->rootwin, vis->visual, x, y, width, height, vis->depth, col_map); + x11->window_state = VOFLAG_HIDDEN; + } + if (flags & VOFLAG_HIDDEN) + goto final; + if (x11->window_state & VOFLAG_HIDDEN) { + XSizeHints hint; + XEvent xev; + x11->window_state &= ~VOFLAG_HIDDEN; vo_x11_classhint(vo, x11->window, classname); XStoreName(mDisplay, x11->window, title); vo_hidecursor(mDisplay, x11->window); diff --git a/libvo/x11_common.h b/libvo/x11_common.h index 677ee189db..6ae51f87c2 100644 --- a/libvo/x11_common.h +++ b/libvo/x11_common.h @@ -47,6 +47,7 @@ struct vo_x11_state { int vo_mouse_autohide; int wm_type; int fs_type; + int window_state; int fs_flip; GC f_gc; diff --git a/loader/wrapper.S b/loader/wrapper.S index f21001f392..fbf3ce2392 100644 --- a/loader/wrapper.S +++ b/loader/wrapper.S @@ -1,27 +1,33 @@ -.section .data -.globl caller_return -caller_return: +#include "config.h" + +#define GLUE(a, b) a ## b +#define JOIN(a, b) GLUE(a, b) +#define MANGLE(s) JOIN(EXTERN_ASM, s) + +.data +.globl MANGLE(caller_return) +MANGLE(caller_return): .long 0 -.globl report_entry -report_entry: - .long null_call -.globl report_ret -report_ret: - .long null_call -.global wrapper_target -wrapper_target: - .long null_call - -.section .text -.globl null_call - .type null_call, @function +.globl MANGLE(report_entry) +MANGLE(report_entry): + .long MANGLE(null_call) +.globl MANGLE(report_ret) +MANGLE(report_ret): + .long MANGLE(null_call) +.global MANGLE(wrapper_target) +MANGLE(wrapper_target): + .long MANGLE(null_call) + +.text +.globl MANGLE(null_call) + .type MANGLE(null_call), @function .balign 16,0x90 -null_call: +MANGLE(null_call): ret -.globl wrapper - .type wrapper, @function +.globl MANGLE(wrapper) + .type MANGLE(wrapper), @function .balign 16,0x90 -wrapper: +MANGLE(wrapper): pusha # store registers (EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI) pushf # store flags @@ -39,7 +45,7 @@ wrapper: push %eax push %edx - call *report_entry # report entry + call *MANGLE(report_entry) # report entry test %eax, %eax jnz .Ldone @@ -48,14 +54,14 @@ wrapper: popf # restore flags popa # restore registers - popl caller_return # switch return addresses + popl MANGLE(caller_return) # switch return addresses pushl $.Lwrapper_return - jmp *wrapper_target # wrapper_target should return at .Lwrapper_return + jmp *MANGLE(wrapper_target) # wrapper_target should return at .Lwrapper_return .balign 16, 0x90 .Lwrapper_return: - pushl caller_return # restore the original return address + pushl MANGLE(caller_return) # restore the original return address pusha # more for reference sake here pushf @@ -73,7 +79,7 @@ wrapper: push %eax push %edx - call *report_ret # report the return information (same args) + call *MANGLE(report_ret) # report the return information (same args) .Ldone: leave |