Commit Graph

35608 Commits

Author SHA1 Message Date
wm4 2c732a46ba ao_jack: allow more control about channel layouts 2013-07-07 18:37:55 +02:00
wm4 886d982aa3 ao_jack: increase buffer size, always round up buffer size
This should help with github issue #128, which reported stuttering
distorted sound with 6 channel audio, but not with 2 channels.
2013-07-06 13:11:22 +02:00
wm4 b2b3778a48 configure: rename --enable/disable-libquvi to --enable/disable-libquvi4
--disable-libquvi creates the impression that it disables libquvi 0.9
as well. It doesn't, because it refers to libquvi 0.4, and 0.4 and 0.9
are practically completely different libraries. Make this more explicit
by renaming the switch to include the "4" version number.
2013-07-05 22:53:59 +02:00
wm4 1709b65a72 dither: don't use long double
This fixes compilation with broken libcs, like on Cygwin. C99
absolutely requires long double and associated functions like expl,
even if long double is double. But newlib (used by cygwin) omits
declaration for these if long double is equivalent to double.

The extra precision is not needed here, so remove it to make life
easier for the single person using mpv with cygwin.
2013-07-05 20:26:32 +02:00
wm4 0d6f5fbe54 playlist: don't add entries in reverse
The entries were always added after the insertion point - but that
means the entries are appended in reverse order. So update the
insertion point on each entry.

Regression introduced by commit 5f664d7.
2013-07-05 14:07:56 +02:00
wm4 50274ca3b0 stream: make eof flag more consistent
When reading something successfully, the eof flag should never be 1, so
clear it in these situations. The eof flag will be set properly on the
next read call.
2013-07-04 17:58:48 +02:00
wm4 d084f72a6c core: remove mp_fifo leftovers 2013-07-04 17:53:30 +02:00
Alexander Preisinger 1789449a0a wayland: remove mp_fifo header 2013-07-03 22:43:05 +02:00
Stefano Pigozzi 8af51bd3fe cocoa: remove usage of mp_fifo
Update Cocoa parts to remove usage of the mp_fifo internal API to send events
to the core and use the input context directly. This is to follow commits the
work in commits 70a8079c and d603e73c.
2013-07-03 22:25:45 +02:00
Alexander Preisinger 56b9dcaabb wayland: fix typo 2013-07-03 19:00:33 +02:00
Alexander Preisinger 17e5542574 wayland: remove unused members 2013-07-03 18:59:52 +02:00
Alexander Preisinger 8ea39d548b wayland: remove mp_fifo 2013-07-02 18:56:50 +02:00
Alexander Preisinger 37c5867703 wayland: implement MOUSE_LEAVE 2013-07-02 17:31:43 +02:00
wm4 d603e73c24 core: cleanup more mp_fifo leftovers
Now only the OSX and Wayland parts are using this.
2013-07-02 14:11:31 +02:00
wm4 70a8079c8e core: remove mp_fifo indirection
For some reason mp_fifo specifically handled double clicks, and other
than that was a pointless wrapper around input.c functionality.

Move the double click handling into input.c, and get rid of mp_fifo. Add
some compatibility wrappers, because so much VO code uses these
functions. Where struct mp_fifo is still used it's just a casted
struct input_ctx.
2013-07-02 14:00:24 +02:00
wm4 451f6788ce command: add some playlist manipulation commands
playlist_remove and playlist_move.
2013-07-02 13:23:26 +02:00
wm4 0b77649c0b stream_lavf: request and read streamcast/ICY metadata
Requires recent ffmpeg git, otherwise will do nothing.
2013-07-02 12:23:34 +02:00
wm4 3f3ffd0de4 core: update metadata during playback, allow streams to export metadata
STREAM_CTRL_GET_METADATA will be used to poll for streamcast metadata.
Also add DEMUXER_CTRL_UPDATE_INFO, which could in theory be used by
demux_lavf.c. (Unfortunately, libavformat is too crappy to read metadata
mid-stream for mp3 or ogg, so we don't implement it.)
2013-07-02 12:19:16 +02:00
wm4 e00621ac46 cache: fix per-block metadata memory leak 2013-07-02 12:19:16 +02:00
wm4 c4766dc3c6 input: require VOs to send key up events, redo input key lookup
Making key up events implicit was sort-of a nice idea, but it's too
tricky and unreliable and makes the key lookup code (interpret_keys())
hard to reason about. See e.g. previous commit for subtle bugs and
issues this caused.

Make key-up events explicit instead. Add key up events to all VOs.
Any time MP_KEY_STATE_DOWN is used, the matching key up event must
use MP_KEY_STATE_UP.

Rewrite the key lookup code. It should be simpler and more robust now.
(Even though the LOC increases, because the new code is less "compact".)
2013-07-02 12:19:16 +02:00
wm4 2f8dcac28b input: fix behavior if there are actually key up events
Wayland is the only backend that actually sends per-key key up events
(the X11 one just sends MP_INPUT_RELEASE_ALL for simplicity). Handling
was broken with Wayland, and each key event was interpreted twice, once
on key down and once on key up.

This commit should fix it.
2013-07-02 12:19:14 +02:00
wm4 931ee2dd21 demux_mkv: pass extradata for opus
Fixes playing 5.1 opus audio tracks.
2013-07-01 00:59:52 +02:00
wm4 2396e62c0b input: don't ignore press-only mouse button events
Before this commit, only mouse events with both down and up events
were processed. This caused a regression with ignoring mouse wheel
events in cocoa, because these don't distinguish between up and down.

Regression caused by 5b38a52.
2013-06-30 19:32:47 +02:00
Martin Herkt f3045eff1e Merge pull request #124 from rossy2401/w32-display-required
Prevent display power management in Windows
2013-06-30 06:58:49 -07:00
James Ross-Gowan d3b68a283f w32_common: prevent display power management
Handling SC_MONITORPOWER doesn't seem to prevent the screen from
dimming. The recommended way to do this in Windows XP and Vista is to
call SetThreadExecutionState with ES_DISPLAY_REQUIRED. Windows 7 also
has the PowerCreateRequest/PowerSetRequest/PowerClearRequest APIs but
they're probably too complicated for this task.
2013-06-30 23:41:06 +10:00
Stefano Pigozzi 0a1c497945 osxbundle: suggest some ways to correct missing dependencies
Hopefully this can give some more clues to users about what broke if they
find themselves in this situation.
2013-06-30 09:14:25 +02:00
wm4 588eef86c2 sd_lavc: respect forced subs only setting for DVD subs
Like the old spudec.c code did. Untested, I (probably) don't have a
sample with subtitles that have this flag set.
2013-06-29 22:58:14 +02:00
wm4 ada06703fb sd_ass: convert pts to integer for get_text()
Gives more consistent rounding, which makes sub_step behave better.
2013-06-29 22:58:14 +02:00
wm4 e5c0947541 dec_sub: introduce sub_control(), use it for sub_step
This means the direct libass usage can be removed from command.c, and no
weird hacks for retrieving the ASS_Track are needed.

Also fix a bug when using this feature with ordered chapters.
2013-06-29 22:58:14 +02:00
wm4 00b0f42c42 command: redraw subs if sub-delay is changed
Though in practice this probably happened anyway, because OSD was
redrawn.
2013-06-29 22:58:14 +02:00
wm4 f1fc60b32d sub: update subtitle time offset even if paused
This was changed as part of commit b44202b as an intended
simplification, but it's actually nicer to have the subtitles
update immediately even if paused.
2013-06-29 22:58:14 +02:00
wm4 302852c5e3 input: store number of binds, instead of using 0-termination 2013-06-29 22:58:14 +02:00
wm4 b24070ae5b input: store number of keys, instead of using 0-termination 2013-06-29 22:58:14 +02:00
wm4 12ac3356bf input: don't keep separate sections for builtin key bindings
Instead mark individual key bindings as builtin.

Not sure whether this is conceptually simpler or more complicated.
For one, it requires the annoying remove_binds() function to wipe
existing bindings instead of just killing the section, on the other
hand it gets rid of almost all special handling of builtin vs. normal
sections.
2013-06-29 22:58:14 +02:00
wm4 1099e0fc99 w32_common: prevent that window dragging and mouse input interfere 2013-06-29 22:58:14 +02:00
wm4 9ff6b472bd w32_common: refactor mouse button code, handle mouse up events
Instead of sending a single event on click, send both down and up
events.
2013-06-29 22:58:13 +02:00
wm4 e0d3dc3857 mplayer: don't hide mouse cursor if mouse is inside mouse area 2013-06-29 22:58:13 +02:00
wm4 831a7cf3ee input: trigger mouse_leave key bindings if mouse leaves mouse area
Also, implement mouse leave events for X11. But evne on other
platforms, these events will be generated if mouse crosses a section's
mouse area boundaries within the mpv window.
2013-06-29 22:58:13 +02:00
wm4 fc422f5aeb command: add commands to enable/disable input sections
For now, it's mostly for testing. It also might allow to create key
binding state machines, but this sounds questionable.
2013-06-29 22:58:13 +02:00
wm4 776e2893a2 manpage: document input sections 2013-06-29 22:58:13 +02:00
wm4 5b38a522f1 input: handle mouse movement differently
Before this commit, mouse movement events emitted a special command
("set_mouse_pos"), which was specially handled in command.c. This was
once special-cased to the dvdnav and menu code, and did nothing after
libmenu and dvdnav were removed.

Change it so that mouse movement triggers a pseudo-key ("MOUSE_MOVE"),
which then can be bound to an arbitrary command. The mouse position is
now managed in input.c. A command which actually needs the mouse
position can use either mp_input_get_mouse_pos() or mp_get_osd_mouse_pos()
to query it. The former returns raw window-space coordinates, while the
latter returns coordinates transformed to OSD- space. (Both are the same
for most VOs, except vo_xv and vo_x11, which can't render OSD in
window-space. These require extra code for mapping mouse position.)

As of this commit, there is still nothing that uses mouse movement, so
MOUSE_MOVE is mapped to "ignore" to silence warnings when moving the
mouse (much like MOUSE_BTN0).

Extend the concept of input sections. Allow multiple sections to be
active at once, and organize them as stack. Bindings from the top of
the stack are preferred to lower ones.

Each section has a mouse input section associated, inside which mouse
events are associated with the bindings. If the mouse pointer is
outside of a section's mouse area, mouse events will be dispatched to
an input section lower on the stack of active sections. This is intended
for scripting, which is to be added later. Two scripts could occupy
different areas of the screen without conflicting with each other. (If
it turns out that this mechanism is useless, we'll just remove it
again.)
2013-06-29 22:58:13 +02:00
wm4 d4680aaecd command: make raw percent-pos property return fractions
percent-pos was an integer (0-100). Sometimes higher precision is
wanted, but the property is this way because fractional parts would
look silly with normal OSD usage. As a compromise, make percent-pos
double (i.e. includes fractional parts), but print it as integer.

So ${percent-pos} is like an integer, but not ${=percent-pos}.
2013-06-29 22:58:13 +02:00
wm4 a6a1f4b833 command: add properties for playlist position
playlist-pos can set/get the current playlist index. playlist-count
returns the number of entries in the playlist.
2013-06-29 22:58:12 +02:00
Stefano Pigozzi fd7dd83e28 cocoa_common: uninit fs window properly
In fullscreen `s->window` is the windowed window. So freeing that didn't get
rid of the FS window and OpenGL view.

Fixes #122
[ci skip]
2013-06-29 22:55:15 +02:00
wm4 a5b90bde0c csputils.h: don't recursively include libavcodec header
Some functions (avcol_spc_to_mp_csp() etc.) used libavcodec enum types
as parameters. Remove these in order to get rid of the avcodec.h
include statement. This prevents that avcodec.h is recursively
included by dozens of files. Fix mp_image.c, which used the header
without explicitly including avcodec.h.
2013-06-28 21:20:42 +02:00
wm4 ac266da658 vo_opengl: handle chroma location
Use the video decoder chroma location flags and render chroma locations
other than centered. Until now, we've always used the intuitive and
obvious centered chroma location, but H.264 uses something else.

FFmpeg provides a small overview in libavcodec/avcodec.h:

-----------
/**
 *  X   X      3 4 X      X are luma samples,
 *             1 2        1-6 are possible chroma positions
 *  X   X      5 6 X      0 is undefined/unknown position
 */
enum AVChromaLocation{
    AVCHROMA_LOC_UNSPECIFIED = 0,
    AVCHROMA_LOC_LEFT        = 1, ///< mpeg2/4, h264 default
    AVCHROMA_LOC_CENTER      = 2, ///< mpeg1, jpeg, h263
    AVCHROMA_LOC_TOPLEFT     = 3, ///< DV
    AVCHROMA_LOC_TOP         = 4,
    AVCHROMA_LOC_BOTTOMLEFT  = 5,
    AVCHROMA_LOC_BOTTOM      = 6,
    AVCHROMA_LOC_NB             , ///< Not part of ABI
};
-----------

The visual difference is literally minimal, but since videophiles
apparently consider this detail as quality mark of a video renderer,
support it anyway. We don't bother with chroma locations other than
centered and left, though.

Not sure about correctness, but it's probably ok.
2013-06-28 21:20:41 +02:00
wm4 3382a6f6e4 video: add a new method to configure filters and VOs
The filter chain and the video ouputs have config() functions. They are
strictly limited to transfering the video size and format. Other
parameters (like color levels) have to be transferred separately.

Improve upon this by introducing a separate set of reconfig() functions,
which use mp_image_params to carry format parameters. This struct
contains all image format related parameters from config(), plus
additional parameters such as colorspace.

Change vf_rotate to use it, as well as vo_opengl. vf_rotate is just
an example/test case, but vo_opengl will need it later.

The intention is also to get rid of VOCTRL_SET_YUV_COLORSPACE. This
information is now handed to the VOs via reconfig(). The getter,
VOCTRL_GET_YUV_COLORSPACE, will still be needed though.
2013-06-28 20:34:46 +02:00
wm4 823e0c511b mp_image: copy palette only if allocated
Normally, we assume that IMGFMT_PAL8 always has a palette allocated
in plane 1. But there may be corner cases in ffmpeg where it doesn't
(namely pseudo-pal stuff).
2013-06-28 20:30:37 +02:00
wm4 9e80fe1c15 vf_rotate: fix params >= 4 2013-06-28 20:29:42 +02:00
wm4 49fb242edb configure: prefer libquvi 0.4.x over libquvi 0.9.x
Because 0.4.x is the current series of stable releases.
2013-06-28 15:51:20 +02:00