Commit Graph

33388 Commits

Author SHA1 Message Date
wm4 149d98d244 vo_gl: reject MS Windows native OpenGL as software rasterizer
If the graphics driver doesn't provide its own OpenGL implementation,
applications get Microsoft's OpenGL emulation. Even if it should be the
case that it's not strictly a software renderer, it provides OpenGL 1.1
only, no shaders in any form, and has other limitations that make it
almost completely useless for mplayer.
2012-04-24 01:27:00 +02:00
wm4 025caa9fb5 vo_gl: refuse to use software renderer, unless explicitly requested
vo_gl will now fail at initialization if a software renderer is
detected. This is the same behavior as vo_gl_nosw. Making this the
default behavior is preferable, because it will simplify positioning
vo_gl in the VO autoprobe list (video_out_drivers[]). Also, vo_gl_nosw
exists only if X11 support is configured.

Move gl in place of gl_nosw. Add the "sw" suboption to vo_gl to allow
using vo_gl even if a software renderer is detected.

vo_gl_nosw is now completely equivalent to vo_gl. It is kept in order
not to break too many user configurations, but should be considered
deprecated.
2012-04-24 01:25:33 +02:00
wm4 70fe8d12fa win32: don't crash if vo_w32_uninit() is called without vo_w32_init()
This is a recent regression. At least vo_direct3d uses vo_w32_uninit()
in this way, and crashed if initialization failed at an early point.
2012-04-24 01:25:10 +02:00
wm4 be10a06c84 subassconvert: handle unquoted attributes in subrip font tags
Previously, mplayer didn't convert tags like <font color=#00FF00>. But
such subtitles exist in the wild, and should be handled.
2012-04-16 23:00:19 +02:00
wm4 ad20cf4131 gl_common: do not call glXGetClientString() and glXGetServerString()
Only call glXGetClientString(), which contains all supported GLX
extensions. Extensions only returned by glXGetClientString() or
glXGetServerString() are not necessarily actually supported.

This essentially reverts svn commit 29721 (git fe3b9a88ce). It is
not known whether this commit actually fixed anything, such as working
around a broken OpenGL driver.
2012-04-16 21:49:02 +02:00
wm4 b6b09b23f6 win32: fix handling of AltGr
Windows implicitly enables Ctrl+Alt on AltGr. These modifiers are
unwanted for keys that have special mappings on AltGr.

Add warning about different behavior on wine.
2012-04-14 18:29:28 +02:00
wm4 3bb456b14d win32: simplify icon loading
I have no idea why the code used this roundabout method.
Also detab mplayer.rc.
2012-04-14 17:03:11 +02:00
wm4 923f353d2a win32: move global variables into a struct & some refactoring
This reflects the changes done to x11_common in mplayer2 some years
ago. It makes it possible to open multiple VOs at once.

The removed defines are probably for ancient versions of MinGW with
incomplete headers.

Remove some minor code duplication.
2012-04-14 17:03:11 +02:00
wm4 8c041127d1 win32: use GetKeyState() instead of maintaining the state manually 2012-04-14 17:02:03 +02:00
wm4 47371bdb94 Merge remote-tracking branch 'origin/master'
Conflicts:
	libvo/vo_kva.c
2012-04-13 17:45:27 +02:00
wm4 4dc0e54d4f win32: prevent modifier keys from getting stuck
Especially Alt would get stuck when using Alt+Tab to change focus.
Apparently Windows doesn't send an appropriate key up message. Solve
this by resetting the modifier state on focus change.
2012-04-13 17:27:18 +02:00
wm4 485f439cfe ao_alsa: use "Master" mixer channel instead of "PCM" by default
Do this, because the "Master" channel normally provides proper mute
control.

The old default can be forced with: --mixer-channel=PCM
2012-04-08 16:17:35 +03:00
wm4 1d527f0cf2 win32: make F10 key not enter the window menu
Normally, F10 enters the window menu (it's invisible at first, and the
blocking/recursive message handling by Windows makes it look like
mplayer was paused, without much visual indication). Stop this almost
completely useless behavior by signalling Windows that the F10 key was
handled. This makes the F10 key usable as normal mplayer shortcut.

This is probably still somewhat questionable.
2012-04-07 15:46:36 +02:00
wm4 440797ca71 win32: fix behavior of enter key
Windows sends the same character code on CTRL+Enter and CTRL+J. I'm not
sure what's the proper way to deal with this, but the hack added with
this commit seems to work fine.

Just to be sure, don't forward the modified wParam to DefWindowProc.
Add the missing "break;" in the switch statement, which sometimes
produced bogus mouse button events.
Fix the F12 key, which wasn't mapped correctly due to a typo.
2012-04-07 14:47:06 +02:00
reimar 1020ae516b vo_directx: do not do aspect scaling in windowed mode.
This matches behaviour of other vos.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34840 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-04-06 23:56:31 +02:00
wm4 a659429f86 win32: use more unicode functions
Use the *W variants instead of the implicit *A functions. (One could
define the UNICODE macro to switch the functions without suffix from
A to W, but I'm too lazy to figure out how portable that is, etc.)

Also make sure io.h defines a unicode aware printf().
2012-04-06 23:56:30 +02:00
wm4 ce7562705e win32: support key modifiers (shift, ctrl, alt)
Support for this is rather simple, and some combinations of modifiers
and keys don't work. For example, Ctrl+Alt+character is not supported,
because Windows doesn't emit a WM_CHAR in this case.

Also add support for the pause and print screen keys. Remove the
pointless KEY_CTRL translation. Remove KEY_CTRL altogether, because it
was not clear what it was actually supposed to mean.
2012-04-06 23:56:30 +02:00
Uoti Urpala e2fc1f640f build: remove OS/2 support 2012-04-06 17:45:56 +03:00
Uoti Urpala b93ed27836 input: stop trying to read terminal input on EOF
Stop trying to read terminal input if a read attempt returns EOF. The
most important case where this matters is when someone runs the player
with stdin redirected from /dev/null and without specifying
--no-consolecontrols. This used to cause 100% CPU load while paused,
as select() would continuously trigger on stdin (the need for
--no-consolecontrols was not apparent to people with older mplayer
versions, as input reading was less efficient and latencies like
hardcoded sleeps kept CPU use well below 100%). Now this will only
cause a "Dead key input" error message.
2012-04-06 14:34:56 +03:00
Uoti Urpala 87ae9d3e45 core: in VO flip timing, recheck time after OSD draw
Make the code read current real time again after drawing OSD. This
ensures time taken in OSD drawing is properly deducted from the
duration of the following sleep. The main practical effect is to avoid
the A-V field on the status line staying at a value a couple of
milliseconds above 0 (depending on VO).
2012-04-05 17:08:42 +03:00
Uoti Urpala f045c1552e core: fix problems in video EOF detection
Fix a missing check that could sometimes result in video frames being
shown after specified end pts (end of timeline segment or --endpos).

Fix mistaken video EOF detection after aspect change in video stream,
when there is no current valid visible frame but the next frame is
already buffered in VO.
2012-04-05 17:03:27 +03:00
wm4 fd4759c8e6 stream_cdda: print CDTEXT if available
The per-CD info will be printed on playback start, per-track info when
a track is played. (This is not a technical restriction, and just goes
along with the existing code.)

The following fields are not included in output, because these are
supposedly binary: CDTEXT_DISCID, CDTEXT_GENRE, CDTEXT_SIZE_INFO,
CDTEXT_TOC_INFO, CDTEXT_TOC_INFO2.
2012-04-01 22:59:00 +02:00
wm4 0a4beb49f6 configure, stream_cdda: remove libcdparanoia support
libcdparanoia is barely developed anymore, while libcdio is still quite
active.
2012-04-01 22:58:55 +02:00
wm4 18e7f64c69 stream_cdda: reformat 2012-04-01 22:58:52 +02:00
reimar 88cdec3122 stream_cdda: various fixes
Fix cdda speed default value, range and use more robust condition.

Based on patch by Ingo Brückl [ib wupperonline de].

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34458 b3059339-0415-0410-9bf9-f77b7e298cf2

Do not call paranoia_overlapset with 0, it actually causes cdparanoia to just hang.
Instead use it to set/unset PARANOIA_MODE_OVERLAP.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34459 b3059339-0415-0410-9bf9-f77b7e298cf2

Fail if trying to seek beyond the last chapter, not just if it is beyond the end of the disc.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34460 b3059339-0415-0410-9bf9-f77b7e298cf2

cdda: set position to an actual EOF position when we set EOF.

This avoids some inconsistency like the stream indicating EOF but
a read still returning more data.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34462 b3059339-0415-0410-9bf9-f77b7e298cf2

Allow PARANOIA_MODE_FULL with skipping.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34467 b3059339-0415-0410-9bf9-f77b7e298cf2

Don't call paranoia_modeset() for PARANOIA_MODE_DISABLE.

cdparanoia destroys start sector information after such a call.

Since it is pointless without setting a mode anyway, don't do it.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34468 b3059339-0415-0410-9bf9-f77b7e298cf2

Add comment to a condition that is just a hack around a cdparanoia bug.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34472 b3059339-0415-0410-9bf9-f77b7e298cf2

Add checks for errors in stream_cdda's get_track_by_sector().

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34495 b3059339-0415-0410-9bf9-f77b7e298cf2

Fix seeking beyond EOF in stream_cdda to work with cache.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34577 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-04-01 22:58:47 +02:00
wm4 1aa2e36122 Merge remote-tracking branch 'origin/master'
Conflicts:
	bstr.c
	bstr.h
	etc/input.conf
	input/input.c
	input/input.h
	libao2/ao_pulse.c
	libmpcodecs/vf_ass.c
	libmpcodecs/vf_vo.c
	libvo/gl_common.c
	libvo/x11_common.c
	mixer.c
	mixer.h
	mplayer.c
2012-04-01 22:52:33 +02:00
Uoti Urpala 8cd71527ad stream_vstream: fix vstream_error format string
Code printing a variable already-formatted string passed it to mp_msg
as the format string argument. Use "%s" instead.
2012-04-01 17:35:01 +03:00
wm4 fea8c85c85 gl_common: minor cleanup/refactor
Remove all platform/GUI specific includes from gl_common.h. Get rid of
the ugly union in MPGLContext. Use function pointers instead of an
ifdef ridden switch statement in uninit_mpglcontext(). Always include
glext.h, not only on Windows.

None of this should actually change any functionality.
2012-03-31 02:58:53 +02:00
wm4 4b883505f6 gl_common: remove unused glValName()
Using helper programs like apitrace is better for debugging.
2012-03-31 02:58:53 +02:00
wm4 8793a4c77b gl_common: move header hacks into gl_header_fixes.h
Keep this horrible (but unfortunately necessary) kludge out of the main
code.
2012-03-31 02:58:53 +02:00
wm4 98052873da libvo: add vo_gl3
This new vo is heavily based on vo_gl.c. It provides better scale
filters, dithering, and optional color management with LittleCMS2.
It requires OpenGL 3.

Many features are enabled by default, so it will be slower than vo_gl.
However, it can be tuned to behave almost as vo_gl.
2012-03-31 02:58:52 +02:00
Stefano Pigozzi b00c1335c8 gl_common: cocoa: add OpenGL 3.2 context creation code
Add a new option to the cocoa window creation code in order to decide
which OpenGL context to create.
2012-03-31 02:58:52 +02:00
wm4 35c29bdd52 gl_common: slightly change win32 GL 3 context creation
The code used OpenGL 3 specific functions for querying the extension
string when the actual GL 3 context wasn't created yet. This appears to
work fine on nVidia, but could break otherwise. Remove the offending
getFunctions call and retrieve the needed function pointer manually.
(This way the wglCreateContextAttribsARB function pointer can be removed
from struct GL too.)

(Amusingly exposes a wine bug; they made the same mistake.)

Explicitly check the extension string whether the function is available,
although this probably doesn't matter in practice.

Also retrieve bit depth information on win32.
2012-03-31 02:58:52 +02:00
Kovensky 59125ce71e gl_common: OpenGL 3.x context support on windows
Also include GL/glext.h on windows:

Mingw's (and cygwin's) GL/gl.h has GL/glext.h's inclusion commented
out for some reason. Their glext.h is also ancient, so do yourself
a favor and replace your GL/glext.h with the one from
http://www.opengl.org/registry/api/glext.h .

A workaround is needed for NVidia's broken wglCreateContextAtrribsARB:

It'll return an error if the requested OpenGL version is previous to
3.2 *and* you request a profile... which is exactly *not* what the
wgl_create_context spec says should happen.

Handle it by removing the profile request from attribs[] and retrying
the context creation once more if the first try fails.

And after my first foray into OpenGL I already find a driver quirk.
Oh well.
2012-03-31 02:58:52 +02:00
wm4 666915a6f0 gl_common: add OpenGL 3.x context creation
Also add a bunch of GL functions to the function loader, which will be
needed by vo_gl3. Remove some unused legacy GL functions from the
loader.

Use the proper name for glGetProgramivARB. glGetProgramiv is a different
and incompatible function. The ARB variant is used for ARB shaders,
while the proper one is for GLSL.
2012-03-31 02:58:52 +02:00
wm4 9564e07548 Add bin_to_header.py 2012-03-31 02:58:52 +02:00
wm4 67e7da2d70 mp_msg: double maximum message size 2012-03-31 02:58:48 +02:00
wm4 c161d31eed vo_direct3d: fix crash when using RGB formats
The function mp_get_yuv2rgb_coeffs() expects valid values for
input_bits.

When using RGB formats, input_bits is outside the range of what
mp_get_yuv2rgb_coeffs() expects. This doesn't matter since we don't
use the result of that function in the RGB case, but it triggered an
assertion.

This is a regression from commit a816810266,
"vo_gl: improve 10-bit YUV->RGB conversion accuracy slightly".
2012-03-26 04:12:26 +02:00
Uoti Urpala 81de9a52d0 ao_pulse: add hacks to work around seek problems
pa_stream_flush() seems to work pretty badly in general. The visible
symptoms included at least old audio continuing for a significant time
after the call, and bogus latency reporting causing temporary video
freezes after a seek. Add some hacks to work around these problems.
The result seems to work most of the time on my machine at least...
2012-03-26 03:55:31 +03:00
Uoti Urpala a0de4bc500 ao_pulse, core: make pulse thread wake up core for more data
For ao_pulse, the current latency is not a good indicator of how soon
the AO requires new data to avoid underflow. Add an internal pipe that
can be used to wake up the input loop from select(), and make the
pulseaudio main loop (which runs in a separate thread) use this
mechanism when pulse requests more data. The wakeup signal currently
contains no information about the reason for the wakup, but audio
buffers are always filled when the event loop wakes up.

Also, request a latency of 1 second from the Pulseaudio server. The
default is normally significantly higher. We don't need low latency,
while higher latency helps prevent underflows reduces need for
wakeups.
2012-03-26 03:55:31 +03:00
Uoti Urpala 4fed8ad197 ao_pulse: convert to new AO API 2012-03-26 03:55:31 +03:00
wm4 84b2c79c56 libmpcodecs: rename IMGFMT_GBR24P to IMGFMT_GBRP
This is more in line with the ffmpeg/libav names.
2012-03-25 23:12:57 +02:00
reimar bf3f28f0a8 vf_scale: prefer converting GBR24P to other 8 bit per component RGB formats
Compared to converting to Y444 this should be faster and lossless.

Based on patch by Hans-Kristian Arntzen [maister archlinux us]

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34317 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-03-25 23:09:58 +02:00
cehoyos b223805547 libmpcodecs: support planar GBR24 decoding
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34245 b3059339-0415-0410-9bf9-f77b7e298cf2

Note: ffmpeg first introduced PIX_FMT_GBR24P, which was used in this
commit. Later, it was renamed to PIX_FMT_GBRP in ffmpeg and libav. This
was updated in revision 34492 in mplayer, but the mplayer specific
names (such as IMGFMT_GBR24) were left unchanged.
2012-03-25 23:03:15 +02:00
Stefano Pigozzi 9badc1d786 cocoa_common: update screen info before entering fullscreen
If the user moved the window to another screen, fullscreen mode would
still use the original screen. Fix to use the screen the window is
currently on (unless overridden by --xineramascreen).
2012-03-25 22:30:38 +03:00
Uoti Urpala 215035b31a input.c: simplify command definitions
Change command definitions to allow writing the command definition
table in more readable format.
2012-03-25 22:30:38 +03:00
Stefano Pigozzi ae0a38ddf8 macosx_finder_args: use a custom logfile instead of system.log
Change the macosx_finder_args function so that when mplayer2 is
invoked from the Finder in a Mac application bundle, it redirects the
output to ~/Library/Logs/mplayer2.log instead of cluttering the global
system.log.

This doesn't affect terminal use which keeps writing to stdout and
stderr.
2012-03-25 22:30:37 +03:00
Stefano Pigozzi 19458020a6 VO: move gl+cocoa before corevideo in default VO order
The gl video output is faster and has more features than corevideo, so
it should be preferred on mac osx.

This doesn't affect GUI compatibility because they specify the
corevideo video output along with the suboptions for the shared buffer
name to mmap in.
2012-03-25 22:30:37 +03:00
Stefano Pigozzi e37d7b1452 configure: disable X11 opengl backend if Cocoa is enabled
The recommended way to get function pointers to the functions in the
OpenGL library is through dlopen/dlsym/dlclose. This causes problems
in the Cocoa OpenGL backend when -lGL (X11's OpenGL headers) is linked
to the binary together with -framework OpenGL.
The linked OpenGL symbols are always from -lGL, causing all the
function pointers to point to null when getFunctions is called against
a Cocoa OpenGL context.

For this reason change the configure autodetection code to disable
the vo_gl X11 backend when cocoa is active.
2012-03-25 22:30:37 +03:00
Stefano Pigozzi e89ea0c371 cocoa_common: add license information 2012-03-25 22:30:37 +03:00