mirror of
https://github.com/mpv-player/mpv
synced 2024-12-18 12:55:16 +00:00
Merge svn changes up to r30514
This commit is contained in:
commit
173beb5608
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -1,27 +1,33 @@
|
||||
.section .data
|
||||
.globl caller_return
|
||||
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
|
||||
#include "config.h"
|
||||
|
||||
.section .text
|
||||
.globl null_call
|
||||
.type null_call, @function
|
||||
#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 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
|
||||
|
Loading…
Reference in New Issue
Block a user