Commit Graph

3844 Commits

Author SHA1 Message Date
Stefano Pigozzi da374c40de cocoa_common: improve conditional dock hiding from 3259e4a7a
Make the conditional hiding logic introduced in commit 3259e4a7a2a938
("cocoa_common: make fullscreen menubar/dock hiding conditional") work
when mplayer is started with the `fs` and `xineramascreen` options.
2012-08-28 23:21:07 +02:00
Uoti Urpala 009d9d8706 Adjust ffmpeg/libav #includes to work with recent upstream changes
The <libavutil/avutil.h> stopped including <libavutil/common.h>
recursively in recent ffmpeg/libav git revisions. As a result, some
files no longer got needed definitions, causing a build failure.
Modify #include lines in various files to fix build with the latest
versions of ffmpeg/libav headers.
2012-08-21 18:22:00 +02:00
cantabile a1380f3945 video: honor the video's colormatrix and color range flags
If either of them is not defined, the old behavior is used:
- the colormatrix is guessed based on resolution.
- the color range is assumed to be tv aka limited range.
2012-08-21 18:17:41 +02:00
wm4 988dad5fc7 osd: get rid of useless initialization function
The function merely printed redundant messages that were not visible by
default.
2012-08-20 15:36:05 +02:00
Stefano Pigozzi e70b5ee2fd cocoa_common: add HiDPI/retina support
With a HiDPI screen, for performance and backwards compatibility
reasons, AppKit requests an OpenGL surface with a pixel number that
equals the user points number. After the image is rendered to this
smaller surface, it is upscaled so that its dimensions are comparable
across screens of different DPIs. The applied scaling is not that good
and makes the video/subtitles blurry; this is not acceptable for a
video player.

Request AppKit to use a high resolution OpenGL surface to back the
mplayer2 OpenGL view. Also set the window pixel size information
correctly in the VO object by converting user points to actual pixels.

All the system version checks are done at runtime so that the feature
is available on OSX 10.7 even with a binary compiled with older SDKs.

Also replace is_lion_or_better() with is_osx_version_at_least(10, 7, 0)
which is defined in osx_common.
2012-08-16 22:41:09 +02:00
Stefano Pigozzi 87c375e6f2 cocoa_common.m: add missing config.h include
This is needed for the check on CONFIG_SDL in this file.
2012-08-16 22:30:06 +02:00
Stefano Pigozzi 13675fc7dc cleanup: osx_common: remove unused functions
Remove functions that aren't called anymore:

 *  `osx_foreground_hack` was replaced by the NSApplication's
    activateIgnoringOtherApps: in cocoa_common.
 *  Aspect ratio functions were not called by the "new" cocoa backend,
    since the corresponding menu item was deleted.
2012-08-16 22:29:42 +02:00
Stefano Pigozzi dcb90fde25 cocoa_common: refactor menu generation
This commit is supposed to make the menu generation a little more
readable. It also fixes menu generation for the `cmd+q` entry.
2012-08-16 22:28:27 +02:00
Stefano Pigozzi 31d0eb86f3 gl_common: fix compilation on OS X 10.8
As of OS X 10.8 Apple completely removed X11 from the system.
gl_common.h was including gl.h using the path <GL/gl.h>. This path
comes from the X11 headers, which are missing in 10.8.

Change gl_common.h to include gl.h from Apple's OpenGL implementation
as <OpenGL/gl.h> if X11/XQuartz is not detected.
2012-08-16 22:25:13 +02:00
wm4 0e2c48a3ce VO: remove vo_directfb2 and vo_directx
While being able to play videos on a framebuffer device would be nice,
I didn't need it, and couldn't even test it (buggy nvidia binary
drivers that disable framebuffers, buggy DirectFB that crashes when
using the X11 backend). It's just dead weight, get rid of it.

vo_directx was very horrible, and by today it's mostly useless. I didn't
remove it, because there was that-guy who told me in amazement how
awesome mplayer was, because it was the only video player fast enough
for fast playback on his system when using vo_directx. Sorry, that-guy.
2012-08-16 17:17:50 +02:00
wm4 4672ff39dd vo_vdpau: fix crash when vo_vdpau initialization fails
This happened on system without a vdpau driver installed. It's
especially bad because vdpau is the default VO.

I'm not sure when this bug was introduced, and it seems to exist in
upstream mplayer2 too.
2012-08-16 17:16:32 +02:00
wm4 1b7b0c93a8 video_out: fix crash when VO autoselection fails
init_best_video_out() did not manage the memory for vo->window_title
correctly, and free'd it twice when initialization failed (that's due
to talloc_free_children() being called). When the next VO was tried,
it reused the dangling pointer. Initialize this member somewhere else
lazily instead.
2012-08-16 17:16:08 +02:00
Stefano Pigozzi 6879d1162c vo_sharedbuffer: remove this VO
Since slave mode is not planned to be kept, this VO is useless and I'm
removing it.

This VO was useful for OSX GUIs. Since in cocoa you can't embed views in
windows from other processes, this VO was writing to a sharedbuffer with
mmap. The OSX GUIs would then read from the buffer and render the image
with an external renderer.

If in the future we will want to support GUIs we will need to reasearch the
IOSurface framework. This allows to share kernel managed image data
across processes and integrates well with OpenGL.
2012-08-15 22:01:39 +02:00
Stefano Pigozzi 7fd43b0bcd osx: fix build
adapt the osx VOs to build against the latest changes.
2012-08-08 21:23:28 +02:00
wm4 477af1c777 osd: remove FAST_OSD code
This code has never been active by default, ever since it was added
back in 2001. You had to edit config.h or configure manually to enable
it.
2012-08-07 02:21:19 +02:00
wm4 2287245136 VO: remove old VO glue
This transition to a new VO API started over 4 years ago. It's time to
finally end it, and get rid of the horrible hacks.

Also removes some previously undetected dead code from spudec.c.
2012-08-07 01:29:56 +02:00
wm4 f3bb6692c7 osx_common: remove old VO include, modify change_movie_aspect()
The only reason the old VO related header old_vo_defines.h was included
was probably to gain access to the current VO struct in the function
change_movie_aspect(). Make that function take a parameter instead.

This function seems to be unused.
2012-08-07 01:13:25 +02:00
wm4 1602bb5a46 vo_directx: convert to new VO API 2012-08-07 01:09:50 +02:00
wm4 89b7cb0331 win32: fix compilation on MinGW
The commit 74df1d8e05 (and f752212c62) replaced the configure
endian check with byte order macros defined by standard headers. It
turns out that MinGW-w64 actually doesn't define these macros in the
sys/types.h system header. (I assumed it does, because a quick test
seemed to work. But that was because gcc -W -Wall doesn't warn against
undefined macros. You need -Wundef for that.) MinGW-w64 has a
sys/params.h header defining these macros, but sys/types.h doesn't
include it, so it's useless without special casing the mplayer code.
Add a hack top configure instead. Define the macros directly, and
assume MinGW-w64 only works on little endian machines.

The other changes are basically random typos and superficial oversights.
2012-08-07 01:09:42 +02:00
wm4 76b98e4c32 vo_null: reformat and use new VO API 2012-08-07 01:09:30 +02:00
wm4 c113e6ed7d Remove V4L2 decoder support (vo_v4l2 and ao_v4l2)
The removed VO and AO took MPEG data and decoded it with V4L2. I'm not
exactly sure what's the use of this today, but get rid of it.

As far as feeding video data to V4L2 is concerned, there are other
ways. For example, there is this script, that feeds yuv4mpeg formatted
raw video data to V4L2:

    https://raw.github.com/umlaeute/v4l2loopback/master/examples/yuv4mpeg_to_v4l2.c
2012-08-07 01:09:30 +02:00
wm4 229380d9bd vo_v4l2: reformat, use new VO API
Actually, this is probably completely broken, and there are better
ways to get mplayer output into a V4L2 device.
2012-08-07 01:09:30 +02:00
wm4 3699d5433b vo_caca: use new VO API 2012-08-07 01:09:30 +02:00
wm4 c291f321bb vo_directfb2: reformat and convert to new VO API
No effort was put into moving static variables into a priv struct. The
VO wasn't tested, because DirectFB's X11 backend didn't work for me (it
crashed, not just with mplayer, but also SDL applications).
2012-08-07 01:09:30 +02:00
wm4 ca6d8d431a vo_x11: reformat, use new VO API
This also involves moving the static variables into a priv struct.
2012-08-07 01:09:22 +02:00
wm4 0a20d13dfc libvo: remove videodev_mjpeg.h
This was used by stream/tvi_v4l.c, which was removed a while ago.
2012-08-06 19:02:35 +02:00
wm4 6ecfa42a46 VO: remove vo_gif89a, vo_md5sum, vo_yuv4mpeg
The encoding branch by divverent can handle of these via libavformat.

Note: for some reason, libav/ffmpeg have a GIF muxer only, and no
demuxer. The gif configure checks needef for the mplayer internal gif
demuxer can't be removed yet.
2012-08-06 18:58:17 +02:00
wm4 44f23e36e8 VO: remove vo_jpeg, vo_png, vo_pnm, vo_tga
All of these have been replaced by vo_image.
2012-08-06 18:49:35 +02:00
wm4 eb1182eb50 vo_image: add outdir option
The function checked_mkdir is taken from vo_jpeg, with the error
handling stripped down to a reasonable level.
2012-08-06 17:52:47 +02:00
wm4 c7b66d99d1 vo_image: add new video output for writing images
This is supposed to replace vo_png and others.
2012-08-06 17:52:17 +02:00
wm4 b43adea6c8 video_out: rename privsize member to priv_size 2012-08-06 17:51:53 +02:00
wm4 1ce5ca5f26 options: get rid of some compatibility stuff
Doesn't make sense because we broke/are going to break compatibility
with everything anyway.

Remove mechanism for warning the user against disabled options.

Remove colorspace alternative option values.
2012-08-06 00:10:13 +02:00
wm4 6031b8e22c m_config: implement m_config_new in terms of m_config_simple
Also change m_config_simple() such that you need to register options
using m_config_register_options().
2012-08-04 19:59:56 +02:00
wm4 37c03f2c81 options: revert passing around talloc contexts
This reverts commit 48f0692ab9 "options: make option struct the talloc parent of options".

This made things actually more complicated. It introduced a new
parameter to the option parse and copy functions, which was used
inconsistently. Some code passed a parent, some not. Morever, you have
to call m_option_free() anyway, because not all options actually
respect the talloc parent. There is also the question whether passing
NULL as parent is supposed to work, or if you still have to implement
m_config_free().

On the other hand, this simplifies nothing. I assume the intention was
being able to free all option values with a single talloc_free() call,
but the same goal can be reached by simply freeing the m_config struct.
(The m_config talloc destructor will free each option values.)

Get rid of the talloc parent context parameter. This essentially
reverts commit 48f0692ab9 ("options: make option struct the talloc parent of options").

In video_out.c, make the VO priv struct the talloc parent for the
m_config object, so that destroying the VO will free the options.

The ability to free the m_config struct and all its managed options was
introduced in commit 89a17bcda6.
2012-08-04 19:59:56 +02:00
wm4 9a2f4e10e7 mplayer: never exit mplayer from within the play loop
The only place exit_player() should be called is the main() function.
exit_player() should be the only function allowed to call exit(). This
makes it easier to guarantee proper deinitialization, and allows using
the --leak-report flag without showing false positives.

The quit slave command now sets a flag only. It uses the same mechanism
that's normally used to advance to the next file on the playlist, so the
rest of the playback path should be able to react to the quit command
quickly enough. That is, the player should react just as fast to quit
requests in practice as before this commit.

In reinit_audio_chain(), the player was actually exited if
init_audio_filters() failed. Reuse the normal error handling path to
handle this condition.
2012-08-04 19:59:56 +02:00
wm4 adde96a814 x11_common: remove some code duplication
This sin was committed in 2002.
2012-08-03 06:30:47 +02:00
wm4 b4d9647d18 mplayer: do not create X11 state in player frontend
This is about the vo_x11_init_state() call. It basically opens a X11
connection. It's called in the main() function once. It's not really
clear why this isn't done on VO creation instead. Maybe one reason was
that --no-fixed-vo used to be the default: when playing a new file, the
full VO state would be free'd and recreated. Keeping the X11 connection
possibly improved things, although the question is how. In summary,
there is no good reason to do this, and it only adds platform specific
details to the player frontend.

Do the X11 initialization in the respective VOs instead.
2012-08-03 05:55:02 +02:00
mplayer-svn 2d513fac33 vo_yuv4mpeg: support writing to stdout
yuv4mpeg: support writing to stdout instead of file.

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

Allow using -vo yuv4mpeg for files with resolution changes.

Not all programs can read such files.

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

vo_yuv4mpeg: flush userspace FILE buffers after each frame.

Potentially reduces delay when piping to stdout/fifo.

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

Author: reimar
2012-08-03 02:53:21 +02:00
mplayer-svn cb2f0e7c38 libmpcodecs: use 128 instead of 64 to define non-native RGB image formats
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34659 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: cehoyos
2012-08-03 01:46:25 +02:00
mplayer-svn 47a0e4fadd vo_x11: X11 non-native RGB/BGR "emulation" only works for 32bit
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34658 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: cehoyos
2012-08-03 01:44:11 +02:00
mplayer-svn 094acd6884 vo_caca: reformat and various fixes
Squashed commits by various authors.

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

vo_caca: Port to libcaca 1.x API, which is widespread enough nowadays.

patch by Paul B. Mahol, onemda gmail com

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

caca: support mouse events and more keys.

Patch by Paul B. Mahol [onemda gmail com].

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

caca: for ordinary keys, send key events on press instead of release.

This is consistent with how other vos behave.

Patch by Paul B. Mahol [onemda gmail com].

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

caca: process all pending events instead of exactly one per check_events.

Patch by Paul B. Mahol [onemda gmail com].

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

Reindent.

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

Use lookup_keymap_table instead of a large number of switch cases.

Patch by Paul B. Mahol [onemda gmail com].

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

Author: diego
2012-08-03 01:35:18 +02:00
mplayer-svn 595928542a vo_md5sum: support printing to stdout
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34313 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
2012-08-03 01:33:12 +02:00
mplayer-svn c0c47c3474 x11: change stop_xscreensaver default to 1 to be more user-friendly
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34076 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
2012-08-03 01:26:33 +02:00
mplayer-svn 9c76680dfb x11: make the stop-xscreensaver option behave as described in the man page
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@34074 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
2012-08-03 01:26:32 +02:00
mplayer-svn 4f04019338 vo_null: do not accept hwaccel formats
Do not accept hwaccel formats since they need special vo
support and thus will actually not work with it.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33953 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
2012-08-03 01:13:02 +02:00
wm4 e48b21dd87 VO: remove VO direct rendering
This was disabled by default, and could be enabled with -dr. It was
disabled by default because it was buggy: there were issues with OSD
corruption.

It wasn't entirely sane for OpenGL based VOs either. OpenGL can chose
to drop mapped pixel buffer objects, requiring the application to map
and fill the buffer again. But there was no mechanism in mplayer to
fill the lost buffer again. (It seems this rarely happened in practice,
though.)

On the other side, users liked the --dr flag, because it promised them
more speed. I'm not sure if it actually helped with speed, but it's
unlikely it had any real advantages on modern systems.

In order to evade the --dr cargo culting in mplayer config files, it's
best to get rid of it.
2012-08-02 22:07:38 +02:00
wm4 d5315a678e mplayer: expand --title as property, remove --use-filename-title
The --title option, which sets the GUI window caption, is now expanded
as slave mode property string (like osd_show_property_text). Make the
default value for --title include the filename. This makes a behavior
similar to --use-filename-title the default.

Remove the --use-filename-title option, as it's redundant now.
2012-08-02 02:37:00 +02:00
wm4 168293e0ae osd: minor simplification of vo_osd_changed()
vo_osd_changed() was a weird function: it was used both to query and
mutate state, which is a bad combination. The VOs used it to query
and reset the state, and the mplayer frontend mostly used it to set
the state. In some cases, the frontend did both (that code used a
variable "int hack" to backup the state and set it again).

Simplify it and make the VOs use a vo_osd_has_changed() function to
query whether the OSD bitmaps have to be recreated. vo_osd_changed()
on the other hand is now used to update state only. The OSD change
state is reset when osd_draw_text() is called.

Update vo_corevideo.m to use vo_osd_resized() as well (forgotten change
from libass-OSD merge).

Simplify osd_set_text() and its usages.
2012-08-01 18:23:28 +02:00
wm4 c92538dfaa Remove dead code
This was done with the help of callcatcher [1]. Only functions which
are statically known to be unused are removed.

Some unused functions are not removed yet, because they might be needed
in the near future (such as open_output_stream for the encode branch).

There is one user visible change: the --subcc option did nothing, and is
removed with this commit.

[1] http://www.skynet.ie/~caolan/Packages/callcatcher.html
2012-08-01 17:07:35 +02:00
Stefano Pigozzi 38e705b3e4 vo_corevideo: remove font_load code
This was probably forgotten in the commit that removed the dependency on
freetype.
2012-08-01 08:44:58 +02:00