From ee9b73f20cb824feb440e51b2ec814e7ce4bb76a Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 4 Feb 2010 21:20:47 +0000 Subject: [PATCH 1/9] Mention rtmp and rtsp specifically as formats supported via ffmpeg. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30506 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 956af59f2b..fa6f29fed3 100644 --- a/Changelog +++ b/Changelog @@ -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) * experimental support for external libass, configure with --disable-ass-internal From f34454b6b5acba9c21dcc98d9b7d877731aa98cf Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 4 Feb 2010 22:08:23 +0000 Subject: [PATCH 2/9] Create the OpenGL probe window as a hidden Window on X11. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30507 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/video_out.h | 1 + libvo/vo_gl.c | 2 +- libvo/x11_common.c | 10 ++++++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/libvo/video_out.h b/libvo/video_out.h index b9380fadf1..1fce2c2877 100644 --- a/libvo/video_out.h +++ b/libvo/video_out.h @@ -108,6 +108,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 5219b06cab..066ad5b71b 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -1167,7 +1167,7 @@ static int preinit(const char *arg) 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; diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 871ab62940..bb46588ea4 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -104,6 +104,7 @@ int mLocalDisplay; int vo_mouse_autohide = 0; int vo_wm_type = 0; int vo_fs_type = 0; // needs to be accessible for GUI X11 code +static int window_state; static int vo_fs_flip = 0; char **vo_fstype_list; @@ -1102,13 +1103,18 @@ void vo_x11_create_vo_window(XVisualInfo *vis, int x, int y, goto final; } if (vo_window == None) { - XSizeHints hint; - XEvent xev; vo_fs = 0; vo_dwidth = width; vo_dheight = height; vo_window = vo_x11_create_smooth_window(mDisplay, mRootWin, vis->visual, x, y, width, height, vis->depth, col_map); + window_state = VOFLAG_HIDDEN; + } + if (flags & VOFLAG_HIDDEN) + goto final; + if (window_state & VOFLAG_HIDDEN) { + XSizeHints hint; + XEvent xev; vo_x11_classhint(mDisplay, vo_window, classname); XStoreName(mDisplay, vo_window, title); vo_hidecursor(mDisplay, vo_window); From bf6dc310dc523deee16b9193b31f77eb884c7c1c Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 4 Feb 2010 22:46:01 +0000 Subject: [PATCH 3/9] Set the PixelFormat right after creating the window and set it only once. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30508 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/w32_common.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/libvo/w32_common.c b/libvo/w32_common.c index da8ed74695..7c60f2d301 100644 --- a/libvo/w32_common.c +++ b/libvo/w32_common.c @@ -329,10 +329,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; @@ -378,26 +375,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, vo_depthonscreen); - - vo_w32_release_dc(vo_window, vo_hdc); return 1; } @@ -461,6 +438,9 @@ static char *get_display_name(void) { * \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; @@ -517,6 +497,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, vo_depthonscreen); + return 1; } From 1cd3b3c5ddde1c9d93de1b8bd4f26916e41b9381 Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 4 Feb 2010 22:46:45 +0000 Subject: [PATCH 4/9] Add support for VOFLAG_HIDDEN to the w32 backend. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30509 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/w32_common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libvo/w32_common.c b/libvo/w32_common.c index 7c60f2d301..a0ffd9fb98 100644 --- a/libvo/w32_common.c +++ b/libvo/w32_common.c @@ -391,6 +391,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; From 21208015e0e55c54c19168402b8fc11940831d61 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 5 Feb 2010 07:12:05 +0000 Subject: [PATCH 5/9] Print messages only after we are sure preinit will not fail anymore. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30510 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 066ad5b71b..acf7e96891 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -1159,11 +1159,6 @@ 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) { @@ -1173,6 +1168,11 @@ static int preinit(const char *arg) 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; From 788b356377a15435cc0e04c511572025ad474459 Mon Sep 17 00:00:00 2001 From: komh Date: Fri, 5 Feb 2010 10:54:28 +0000 Subject: [PATCH 6/9] Remove '.section' causing the following assembler error on OS/2. Error: unknown pseudo-op: `.section' git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30511 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/wrapper.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/loader/wrapper.S b/loader/wrapper.S index 7656a00f92..14d1296bf7 100644 --- a/loader/wrapper.S +++ b/loader/wrapper.S @@ -1,4 +1,4 @@ -.section .data +.data .globl caller_return caller_return: .long 0 @@ -12,7 +12,7 @@ report_ret: wrapper_target: .long null_call -.section .text +.text .globl null_call .type null_call, @function .balign 16,0x90 From 2762207eed48f962b4ac4fd303850109c7ff285f Mon Sep 17 00:00:00 2001 From: komh Date: Fri, 5 Feb 2010 11:00:59 +0000 Subject: [PATCH 7/9] Prefix EXTERN_ASM to global variables to match them to an extern prefix of C. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30512 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/wrapper.S | 50 +++++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/loader/wrapper.S b/loader/wrapper.S index 14d1296bf7..219ed736b0 100644 --- a/loader/wrapper.S +++ b/loader/wrapper.S @@ -1,27 +1,33 @@ +#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 caller_return -caller_return: +.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 +.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 null_call - .type null_call, @function +.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 From 2e9988220cc68fc5d342efecc980ff4c0e850fd5 Mon Sep 17 00:00:00 2001 From: conrad Date: Fri, 5 Feb 2010 16:09:03 +0000 Subject: [PATCH 8/9] Add function to translate SWS_CS_* to coefficient array git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30513 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.h | 8 +++++++- libswscale/yuv2rgb.c | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/libswscale/swscale.h b/libswscale/swscale.h index 9e14262d30..ba198aaf2f 100644 --- a/libswscale/swscale.h +++ b/libswscale/swscale.h @@ -30,7 +30,7 @@ #include "libavutil/avutil.h" #define LIBSWSCALE_VERSION_MAJOR 0 -#define LIBSWSCALE_VERSION_MINOR 9 +#define LIBSWSCALE_VERSION_MINOR 10 #define LIBSWSCALE_VERSION_MICRO 0 #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ @@ -103,6 +103,12 @@ const char *swscale_license(void); #define SWS_CS_SMPTE240M 7 #define SWS_CS_DEFAULT 5 +/** + * Returns a pointer to yuv<->rgb coefficients for the given colorspace + * suitable for sws_setColorspaceDetails() + * @colorspace one of SWS_CS_* If invalid, SWS_CS_DEFAULT is used. + */ +const int * sws_getCoefficients(int colorspace); // when used for filters they must have an odd number of elements diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index 3c7bb3fd9f..a019bf76fd 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -49,6 +49,13 @@ const int32_t ff_yuv2rgb_coeffs[8][4] = { {117579, 136230, 16907, 35559} /* SMPTE 240M (1987) */ }; +const int * sws_getCoefficients(int colorspace) +{ + if (colorspace > 7 || colorspace < 0) + colorspace = SWS_CS_DEFAULT; + return ff_yuv2rgb_coeffs[colorspace]; +} + #define LOADCHROMA(i) \ U = pu[i]; \ V = pv[i]; \ From c5b0ff1cfacfa502eb0647f329756ddf7c79fcb6 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 5 Feb 2010 16:42:13 +0000 Subject: [PATCH 9/9] Fix hang with -fixed-vo due to VOFLAG_HIDDEN never being removed from window_state. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30514 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/x11_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libvo/x11_common.c b/libvo/x11_common.c index bb46588ea4..bb334f13f5 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -1115,6 +1115,7 @@ void vo_x11_create_vo_window(XVisualInfo *vis, int x, int y, if (window_state & VOFLAG_HIDDEN) { XSizeHints hint; XEvent xev; + window_state &= ~VOFLAG_HIDDEN; vo_x11_classhint(mDisplay, vo_window, classname); XStoreName(mDisplay, vo_window, title); vo_hidecursor(mDisplay, vo_window);