TOOLS: add script for osx bundle generation

Add a make task and python script to create a Mac OS X Application Bundle
to be used when compiling with the --enable-macosx-finder and
--enable-macosx-bundle configure flags.

The main svg icon was created by me and heavily inspired by Apple's iTunes
and AppStore icon designs. We are still looking for something better.
For the audio, movie and subtitles icons I added the main logo to MPlayer OSX
Extended icons.

Use with `make osxbundle` after running configure and make.
codecs: add Video Decode Acceleration Framework codec

Video Decode Acceleration Framework is a framework by Apple to provide
GPU assisted H.264 decoding. It is available on Mac OS X v10.6.3 and
later with Mac models equipped with the NVIDIA GeForce 9400M, GeForce 320M,
GeForce GT 330M, ATI HD Radeon GFX, Intel HD Graphics and others.

This commit uses the new video decoder added in FFmpeg based upon this
framework.
cocoa_common: save state in the vo struct

Save the cocoa state in an instance variable for the Objective-C part of the
code and use a field in the vo struct for the raw C part of the code.
cocoa_common: use IOKit to perform power management

This allows to remove the call to the deprecated `UpdateSystemActivity`. The
additional benefit is power management is disabled only if the video is really
playing. A paused video will not stop the system from idling.
cocoa_common: replace TickCount() with NSProcessInfo#systemUptime

TickCount is depracted in OS X 10.8. Substitute it with a public Cocoa API
call available since OS X 10.6.
cocoa_common: remove useless import

QuartzCore was probably forgot after extracting the code from `vo_corevideo`.
The OpenGL.h include can be avoided with no warnings/errors.
gl_common: remove useless cocoa wrapper functions
cocoa_common: cosmetics / reformat

Use 80columns almost exclusively and reformat Objective-C messages declarations
to follow Apple's style (i.e.: - (int)name; instead of - (int) name;).
cocoa_common: split window creation in helper functions

This commit hopefully makes it easier to follow the flow of the program.
cocoa_common: use the same window level when windowed and fullscreen

This greatly simplifies the code and makes alt tab behave like it is supposed
to: it doesn't put the mplayer window behind the other ones when losing focus.

If you have other programs that are displaying themselves above the normal
window level, avoid them or use --ontop.
cocoa_common: avoid situational nil dereferencing
gl_common: hack to support compilation on FreeBSD

It seems FreeBSD 10.0-CURRENT as of this time doesn't include the GLX
extension and header file definitions for creating OpenGL 3.x core
contexts. Dump some more hacks into gl_header_fixes.h.
VO: fix screenshot size with -geometry

The -geometry switch works by modifying the d_width/d_height values
passed to VOs. Moreover, d_width/d_height seem to be subject to the
-monitorpixelaspect option. Screenshots should not be influenced by
this. Change screenshot supporting VOs to use the original
d_width/d_height values stored in vo->aspdat.prew/h.

(Not all uses of -geometry did this. E.g. --geometry=900x560+0+20 did.)
build: fix compilation on Windows (manifest files)
mplayer: make terminal status playback time consistent with OSD

Always use the same function as the OSD does (get_current_time()). This
loses the logic to display "???" if the time is unknown, as
get_current_time() returns 0 in this case. (The function has far too
many uses to change that now, and it seems to happen rarely in
practice.)
vo_vdpau: fix screenshots

Attempting to take screenshots printed vdpau errors on the terminal,
and the resulting screenshots were filled with black.

The problem was that that the screenshot code tried to use an
unallocated output surface (the one at vc->output_surfaces[vc->num_output_surfaces]).
This used to refer to the last allocated surface, until this was
changed by a recently merged commit. That commit also added a separate
screenshot surface. The merge somehow went wrong, and that part was not
integrated.

<uau> wm4: you used an earlier buggy version of a commit

OK...
mp_image: add IMGFMT_BGR0/PIX_FMT_BGR0

Needed by ffv1.
osd_libass: fix stupid dangling pointer crash

append_utf8_buffer() reallocates the buffer passed to it, and returns
the new pointer.

This bug was originally introduced in mplayer2 when that project merged
mpv's osd_libass.c. That merge changed some minor things, including ASS
escape handling. When mpv used this better method of escape handling too
(commit 0ff7dd992fb0), the bug was duplicated.
osd_libass: increase robustness when handling internal OSD escapes

The \xFF escape is used internally to insert special OSD symbols (which
need a font change to the internal OSD font). There was potential for
breakage when \xFF was followed by \0, because then "in" would be
advanced past the string's end.

Normally this can't happen, as it would require invalid UTF-8 input
data. But we don't check input for UTF-8 validness, so there's a
potential issue here. Garbled output is ok on invalid UTF-8 input,
but crashing is not.

Make it more robust by checking for this.
vd_ffmpeg, vf: fix crashes with some game formats

Fixes for palette allocation handling.

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

This caused a crash with http://samples.ffmpeg.org/cdxl/fruit.cdxl if
direct rendering was used. (Which is rarely these days.)

With small changes: avoid av_freep() use, as this function is not sane.