Commit Graph

511 Commits

Author SHA1 Message Date
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
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 0435ab7131 options: remove -lavdopts debug suboption
This can be set as avopt instead.
2013-06-28 14:42:06 +02:00
Stefano Pigozzi 6669366280 cocoa_common: schedule a redraw frame after a non live resize
A redraw forces recalculation of panscan and other stuff not accounted for in
the resize_redraw codepath. This is actually a hack but works really well in
my tests.

Thanks @wm4 and @Cpuroast for the idea.

Fixes #86
[ci skip]
2013-06-25 22:13:48 +02:00
wm4 403a266d46 Merge branch 'sub_mess2'
...the return.
2013-06-25 00:43:04 +02:00
wm4 4f5e12136d stream: remove padding parameter from stream_read_complete()
Seems like a completely unnecessary complication. Instead, always add a
1 byte padding (could be extended if a caller needs it), and clear it.

Also add some documentation. There was some, but it was outdated and
incomplete.
2013-06-23 22:33:59 +02:00
Stefano Pigozzi 0407869ae3 OSX: fix compilation with 10.7 SDK
Recent work in the OS X parts of the code started using clang's support for
Obj-C's support for Literals and Subscripting. These particular language
features remove a lot of boilerplate code and allow to interact with
collections as consicely as one would do in scripting languages like Ruby or
Python.

Even if these are compiler features, Subscripting needs some runtime support.
This is provided with libarclite (coming with the compiler), but we need to
add the proper method definitions since the 10.7 SDK headers do not include
them. That is because 10.7 shipped before this language features.

This will cause some warnings when compiling with the 10.7 SDK because the
commit also redefines BOOL to make autoboxing/unboxing of BOOL literals to
work.

If you need to test this for whatever reason on 10.8, just pass in the correct
SDK to configure's extra cflags:

  ./configure --extra-cflags='-mmacosx-version-min=10.7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk'

Fixes #117
2013-06-19 21:24:26 +02:00
wm4 656f9e1ba7 vo_lavc: remove unused variable 2013-06-18 12:22:25 +02:00
wm4 171d1ef7fe osdep: remove shmem wrapper
This is unused now that the cache is always threaded.
2013-06-18 02:19:15 +02:00
Rudolf Polzer 66f09d7384 vo_lavc: do NOT fill pict_type from the mp_image
Doing this makes the encoder force the same pict type as original, which
is often not even possible. Rather let the codec decide!

As there is no documented value to mean "decoder shall pick", I rather
save/restore the default value filled by libavcodec.
2013-06-17 17:33:50 +02:00
Rudolf Polzer 1d75d01392 vo_lavc: use mp_image_copy_fields_to_av_frame 2013-06-17 08:56:55 +02:00
Rudolf Polzer fee0b99047 fix compile, sorry 2013-06-16 17:26:28 +02:00
Rudolf Polzer dcd36c79c7 encode_lavc strings: use new option syntax 2013-06-16 17:14:47 +02:00
Rudolf Polzer 7ae4242820 vf_dlopen filters: add an "ildetect" filter that detects interlacing
The filter analyzes each frame for combing, and decides at the end
whether the content is likely interlaced, telecined or progressive.
2013-06-16 17:11:25 +02:00
Stefano Pigozzi de63e1d15e cocoa_common: implement VOCTRL_UPDATE_WINDOW_TITLE
Unfortunately this backend creates the window lazily and a call to
`cocoa_set_window_title` is needed inside config.
2013-06-16 11:00:20 +02:00
Alexander Preisinger 3866106be5 wayland: use VOCTRL_UPDATE_WINDOW_TTILE 2013-06-16 09:34:31 +02:00
wm4 a07b99540c vo: fix build on Libav 2013-06-15 19:23:53 +02:00
wm4 168a595bfe video/out: introduce VOCTRL_UPDATE_WINDOW_TITLE
Instead of implicitly changing the window title on config(), do it as
part of the new VOCTRL.

At first I wanted to make all VOs use the VOCTRL argument directly, but
on a second thought it appears vo_get_window_title() is much more useful
for some (namely, if the window is created lazily on first config()).

Not all VOs are changed. Wayland and OSX have to follow.
2013-06-15 19:07:21 +02:00
wm4 70f97efa72 vo: define VO_TRUE/FALSE to C99 constants
This make the intention more apparent, and some VOs are actually using
true instead of VO_TRUE in some places. Hopefully this changes makes it
less confusing (instead of more).

The C99 constants true/false are defined to 1/0 as well, so this commit
doesn't actually change anything.
2013-06-15 18:59:52 +02:00
wm4 73b9b0b830 w32_common: remove some unneeded code
vo_w32_init() can be called only once on a VO.
2013-06-15 18:57:38 +02:00
wm4 63ff79556f w32_common: fix non-sense
Seriously...
2013-06-15 18:54:01 +02:00
wm4 b04ce54711 vo_xv: always request redraw on resize
Fixes using panscan controls with OSD off and video paused.
2013-06-15 18:36:16 +02:00
wm4 0e2fb5d8e8 vo: redo video display rectangle calculations
This code calculates the source/display video rectangle for scaling with
most VOs. It's responsible for clipping the display rectangle against
the screen and adjusting the source rectangle accordingly.

Until now, it assumed that the video was centered on the screen. Change
this so that any rectangle is possible. Basically, the clipping is
extended to two sides (e.g. left and right), instead of handling both at
the same time.

The rounding behavior slightly changes. It seems to be slightly better
than before. On the other hand, the video is not strictly centered
anymore (due to different rounding on either side). When using panscan
controls, the video can "jitter" by 1 or 2 pixels around the center as
the panscan value is changed.
2013-06-15 18:35:09 +02:00
wm4 60631acd29 gl_video: rearrange some code
I think this is slightly nicer. Shouldn't change anything functionally.
2013-06-15 18:34:43 +02:00
wm4 18b6ff0d4e gl_video: fix scaling when image is cropped, or with no-npot
When the displayed image is cropped in Y direction (like using panscan
controls when playing 4:3 video on a 16:9 monitor), and separated
scaling is used, the texture size for the FBO holding the intermediate
result was calculated incorrectly. This could lead to artifacts, which
were quite apparent with extreme scale factors.

Actually, the size of that texture is OK, but the texture shouldn't be
used to hold the complete scaled image. Instead, it should be used for
the visible part of the image only. Because separate scaling works by
scaling in Y direction first, it's still fine to scale the image on the
full image width on the first pass. This helps avoiding artifacts on
the left/right border of the image when scaling in X direction, as the
scaler will try to fetch pixels from beyond the border. (The left border
is still kind of fine, but the right border will fetch garbage, unless
the texture is strictly sized, or explicit clamping is added to the
shader. Too much trouble, so using the full image width is simpler.)

Also fix some issues with no-npot mode, which enables use of power-of-2
textures. Maybe this mode isn't really useful anymore (modern hardware
is faster with smaller non-power-of-2 textures), but keep it for now.
2013-06-15 18:34:43 +02:00
wm4 abbb45ce13 gl_video: typo in comment 2013-06-15 18:34:43 +02:00
Martin Herkt 9b5a98676d image_writer: Add PNG filter option (default "mixed")
The use of filters prior to PNG compression can greatly improve
compression ratio, with "mixed" (ImageMagick calls it "adaptive")
typically achieving the best results.
2013-06-15 15:48:52 +02:00
Stefano Pigozzi 3c12148668 cocoa_common: remove play/pause VOCTRL functions
Make VOCTRL_RESTORE_SCREENSAVER / VOCTRL_KILL_SCREENSAVER use the power
management functions directly.
2013-06-14 07:34:47 +02:00
wm4 118a2a359f w32: enable screensaver when paused
This is quite similar to the previous commit.

Untested. I'm not sure if this is how it's supposed to work. At least
--no-stop-screensaver should work in any case.
2013-06-14 00:39:31 +02:00
wm4 f1d3ba0e33 x11: enable screensaver when paused, rename/change --stop-xscreensaver
Use the recently introduced screensaver VOCTRLs to control the
screensaver in the X11 backend. This means the behavior when paused
changes: the old code always kept the screensaver disabled, but now the
screensaver is reenabled on pausing.

Rename the --stop-xscreensaver option to --stop-screensaver and make it
more generic. Now it affects all backends that respond to the
screensaver VOCTRLs.
2013-06-14 00:37:39 +02:00
wm4 648c3d790a core: introduce separate VOCTRLs for screensaver stop/resume
This is slightly better because VOCTRL_RESUME/VOCTRL_PAUSE are usually
needed by VOs to know whether video is actually being played (for
whatever reason), and they wouldn't be passed to the backend's VOCTRL
handler, like vo_x11_control().

Also try to make sure that these flags (both pause state and screensaver
state) are set consistently in some corner cases. For example, it seems
enabling video in the middle of playing a file while the player is
paused would not set the paused flag.

If codec initialization fails, destroy the VO instead of keeping it
around to make sure the state is consistent.

Framestepping is implemented by unpausing the player for the duration of
a frame. Remove the special handling of VOCTRL_PAUSE/RESUME in these
cases. It was most likely needed because these VOCTRLs used to be
important for screen redrawing (blatant guess), which is now handled
completely differently. The only potentially bad side-effect is that the
screensaver will be disabled/reenabled for the duration of one frame.
2013-06-14 00:37:39 +02:00
wm4 aadf0abbf2 gl_video: remove redundant condition 2013-06-13 00:58:58 +02:00
wm4 d16516f553 vo_lavc: silence warning when writing y4m
Apparently a ffmpeg issue. Hide the warning because it's annoying.
Workaround suggested by divVerent.
2013-06-13 00:54:40 +02:00
Stefano Pigozzi 4ffaf4868e cocoa_common: fix ontop switching when fullscreen
`enterFullScreenMode:withOptions:` creates another window so set the level on
both the windowed window and current window.

Also remove NSFullScreenModeWindowLevel as it seems to be superfluous.
2013-06-11 21:20:46 +02:00
Stefano Pigozzi fbca1b179a cocoa_common: fix window level when going fullscreen
This is a regression introduced by 0057aa4769. Fix it so that the fullscreen
window uses the correct window level.

[ci skip]

Fixes #106
2013-06-10 20:42:39 +02:00
Rudolf Polzer fc438061e8 encoding: fix -oneverdrop logic when -omaxfps is used
Not that anyone should ever do this...
2013-06-09 16:37:13 +02:00
Rudolf Polzer 3600bf348f encoding -omaxfps: rewrite logic
Now it properly hits the "0 times displayed" case when frames get
skipped; this means the candidate frame for the case the next frame is
"long" is set properly.
2013-06-09 16:31:09 +02:00
Rudolf Polzer 19d80e28e1 encoding -omaxfps: do not shift pts when pts are repeated entirely
This is just to make sure. I have no test case for this, but the logic
seems saner that way.
2013-06-09 15:50:53 +02:00
Rudolf Polzer 0cbc75c083 Option -omaxfps: limit fps when encoding
Lower-fps content is left alone (NOT aligned to this fps); higher fps
content is decimated to this frame rate.
2013-06-09 15:37:28 +02:00
wm4 92ae48db0f Merge branch 'sub_mess'
This branch heavily refactors the subtitle code (both loading and
rendering), and adds support for a few new formats through FFmpeg.

We don't remove any of the old code yet. There are still some subtleties
related to subreader.c to be resolved: code page detection & conversion,
timing post-processing, UTF-16 subtitle support, support for the -subfps
option. Also, SRT reading and loading ASS via libass should be turned
into proper demuxers. (SRT is needed because Libav's is gravely broken,
and we want ASS loading via libass to cover full libass format support.
Both should be demuxers which are probed _before_ libavformat, so that
all subtitles can be loaded through the demuxer infrastructure, and
libavformat subtitles don't need to be treated in a special way.)
2013-06-04 00:29:44 +02:00
wm4 9f4261de65 core: add common function to initialize AVPacket
Audio and video had their own (very similar) functions to initialize an
AVPacket (ffmpeg's packet struct) from a demux_packet (mplayer's packet
struct). Add a common function for these.

Also use this function for sd_lavc_conv. This is actually a functional
change, as some libavfilter subtitle demuxers add weird out-of-band
stuff as side-data.
2013-06-03 22:40:07 +02:00
Stefano Pigozzi f0d2120347 osx: cocoa_common: use default wakeup period
Now that Cocoa's input handling is done on a separate thread from the playloop
it is ridicolously simple to have longer asynchronous sleeps when paused.
2013-06-03 22:31:13 +02:00
Stefano Pigozzi f13f0db33a osx: create macosx_events to deal with keyDown events
On OSX with Cocoa enabled keyDown events are now handled with
addLocalMonitorForEventsMatchingMask:handler:. This allows to respond to
events even when there is no VO initialized but the GUI is focused.
2013-06-03 22:31:13 +02:00
Stefano Pigozzi 63e2a21c64 osx_common: remove outdated ifdeffery
It was definining keycodes not defined in OS X < 10.5.
2013-06-03 22:31:13 +02:00
wm4 66be276f69 gl_video: reduce output with -v, skip useless header parts
Originally, the header wasn't supposed to contain random compatibility
stuff, but now all that is printed with -v. Add a hack to skip it and
to reduce the noise.
2013-06-03 00:05:07 +02:00
wm4 87c549ffae gl_video: explicitly clamp colormatrix output
This could lead to quite visible artifacts when using an appropriate ICC
and float FBOs. The float FBOs allow storing out of range values, and my
guess is that the rest of the precessing chain elevated these out of
range values, resulting in artifacts.
2013-06-03 00:00:14 +02:00
Stefano Pigozzi 57571b5da3 cocoa_common: autohide dock/menubar on fs only if on same screen
Autohide the menubar and/or dock only if they are present in the screen the
player is going to go fullscreen into. I thought the GUI would handle this for
me when I switched 0057aa476 but lack of hardware to test made me embarass
myself yet again.

I reimplemented this feature with nicer code and behaviour. The code checks
separately wether to hide menubar and dock separatly, while the old code used
a single check possibly hiding stuff without need.

Added the key checks as a some category additions to NSScreen for readability.
2013-06-01 22:52:21 +02:00
Stefano Pigozzi f4dcb93be1 cocoa_common: don't autohide mouse on mousedown
Previews code allowed to click the same spot for a long time and the cursor
would autohide. No more!
2013-06-01 17:58:08 +02:00
Stefano Pigozzi db7835f5d7 cocoa_common: avoid window creation with VOFLAG_HIDDEN
This takes an approach similar to the wayland OpenGL backend. VOFLAG_HIDDEN
flag semantics doesn't mean "hide the window" but is simply ever used only to
do detection of available OpenGL extensions. On OSX it's possibile to
accomplish this task just by creating the OpenGL context without attaching
it to a drawable.
2013-06-01 12:12:17 +02:00
Stefano Pigozzi 109158603d cocoa_common: dehack mouse autohide by clipping view bounds to visible screen
This prevents the mouse to autohide when hovering the dock/menubar without any
particular hack and seems to finally cover all edge cases.
2013-06-01 02:10:41 +02:00
Stefano Pigozzi 25ae58fbbe cocoa_common: fix mouse autohide on MenuBar/Dock interaction
This is needed after last commit. A bug within a bug (yo dawg)! Serious
explaination in the source code comment so that it's not forgotten.
2013-05-31 14:16:27 +02:00
Stefano Pigozzi 2c4f5b75c0 cocoa_common: fix empty window when going fs on different screen
Using `enterFullScreenMode:withOptions:` with a screen handle than the current
screen doesn't hide the current window in the current screen. This is a bug in
Cocoa (preparing an isolated test case and sending the rdar later).

To work around this, manually hide/show the window that the toolkit should
hide/show for us.
2013-05-31 12:58:54 +02:00
Stefano Pigozzi bf21ed0102 cocoa_common: fix mouse hiding outside of player view
This bug was the result of crappy position detection in the previous code
combined with the commits moving autohide delay out of the cocoa backend and
into the core.

The hit detection was improved and now takes also account of interactions with
the Dock and Menubar. Moreover VOCTRL_SET_CURSOR_VISIBILITY now has an effect
only if the mouse position matches with this improved hit detection. This means
that both interaction with the Dock and Menubar are considered as well as
moving the mouse inside another screen.
2013-05-30 23:03:21 +02:00
Stefano Pigozzi 68c3e2aabb cocoa_common: refactor fullscreen code for readability
Break up the code into several methods and reduce code duplication. Also add
comments to make the intention of all this clearer.
2013-05-30 23:03:20 +02:00
Stefano Pigozzi 0aac8bc5ad cocoa_common: fix native-fs state saving
`opts->fs = VO_FALSE` was forgotten
2013-05-30 23:03:20 +02:00
Stefano Pigozzi 3789e1bebf cocoa_common: fix a bug in window initialization error
We didn't bail out soon enough. Bug was introduced by 134f3e97.
2013-05-30 23:02:56 +02:00
Stefano Pigozzi 0057aa4769 cocoa_common: use cocoa APIs to go fullscreen
This removes a bit of ugly code and bookeeping which is never bad. `drawRect`
needs to guard against different window instances since in fullscreen the view
is wrapped in a fullscreen window provided by the toolkit (a instance of
NSFullScreenWindow to be precise).

The event handling was moved to the view so that it can still get all the
events when in the fullscreen window. Ideally these should be moved to
some NSResponder subclass within macosx_application and made available even
when no window is present. I refrained from this because "small steps".
2013-05-30 23:01:12 +02:00
Stefano Pigozzi 3396e0565b macosx_application: move escape_loadfile_name in this file
This allows to move back osx_common to raw C.
2013-05-30 23:01:12 +02:00
Stefano Pigozzi 14ff6bbf7c cocoa_common: use better power management activity description
Now one might actually undestand why this power management assertion is used
in the first place.
2013-05-30 23:01:12 +02:00
Stefano Pigozzi ae1fa639e0 osx: remove compatibility conditionals for 10.6
At this point 10.6 is pretty old and we don't want to supporting old platforms.
I'm killing all the 10.6 compatibility code before doing more refactorings.

Next commits will also use newer Objective-C syntax such as literals and
@autoreleasepool.
2013-05-30 22:57:35 +02:00
wm4 59892dd4cc gl_common: fix invalid alignment
0 is invalid. The intention of the code turning off any additional
alignment, so we need 1.

Change a comment: obviously we don't try to set alignment parameters
etc.to handle stride correctly, and instead do everything by row.
2013-05-30 15:56:51 +02:00
wm4 bbc865a4da gl_video: add some debug code for testing texture depth
This probes and prints the depth of some texture formats with the help
of a FBO. By default it tests the format used for scaling, as well as
the format used for dithering and the 3D LUT (if any of these are
enabled).

The output is visible only with -v. Some representative values are
probed, and the difference of input and output value is printed as hex-
float. Hex-floats are used because they make the implied precision more
obvious. Originally I wanted to do some more sophisticated guessing of
the implied depth/precision for more user-friendly reporting, but then
I decided that printing raw data is better for debugging, especially if
things go wrong.

This does not try to disable any functionality and does not print any
warnings if the depth is lower than what it should be.
2013-05-30 15:55:41 +02:00
wm4 5d0c4b6ac3 gl_video: change a GLSL statement
This might be better with dumb shader compilers, which won't vectorize
this to a single vector-division, assuming the hardware does have such
an instruction. Affects "bicubic_fast" scale mode only.
2013-05-30 15:40:55 +02:00
wm4 e08bf272ee gl_video: fix some dithering bugs
The internal texture format GL_RED is typically 8 bit, which is clearly
not good enough for the new dither matrix. The idea was to use a float
texture format, but this was somehow "forgotten". Use GL_R16, since
16 bit textures are more robust, and provide more precision for the
same memory usage.

Change how the offset for centering the dither matrix is applied. This
is needed for making it possible to round up values to the target depth.
Before this commit, this changed the output even if the input was exact
and input and output depth were the same, which is not really what you
want. Now it doesn't do that anymore.
2013-05-30 15:38:07 +02:00
wm4 a21cfddaab options: remove some questionable -lavdopts suboptions
Most of these are rather questionable, the rest you rarely need to set
manually. You still can set all of them with -lavdopts-o (because
libavcodec has AVOptions for them).
2013-05-29 14:57:05 +02:00
wm4 f3f77c6e31 vo_opengl: remove most of the "inline" documentation
There's no point duplicating all the text that is already in the man
pages, and synchronizing them is a pain. Place a link to the github
generated pages instead.

Unfortunately, the anchor '#vo-opengl' does not work. Maybe github's
rst converter just sucks, as the actually generated HTML contains
links using that anchor too, but does not generate the anchor itself.
Too bad.
2013-05-26 17:20:01 +02:00
wm4 3edb8fb71c vf_delogo: copy in non-direct case, fix double-free
If the image is not writeable, the image actually has to be copied
beforehand. This was overlooked when converting the video chain to
reference counted images.

Fix a double free issue. This was overlooked when vf.c was changed to
free filter priv data automatically.
2013-05-26 17:13:09 +02:00
wm4 58a7d81dc5 gl_video: improve dithering
Use a different algorithm to generate the dithering matrix. This
looks much better than the previous ordered dither matrix with its
cross-hatch artifacts.

The matrix generation algorithm as well as its implementation was
contributed by Wessel Dankers aka Fruit. The code in dither.c is
his implementation, reformatted and with static global variables
removed by me.

The new matrix is uploaded as float texture - before this commit, it
was a normal integer fixed point matrix. This means dithering will
be disabled on systems without float textures.

The size of the dithering matrix can be configured, as the matrix is
generated at runtime. The generation of the matrix can take rather
long, and is already unacceptable with size 8. The default is at 6,
which takes about 100 ms on a Core2 Duo system with dither.c compiled
at -O2, which I consider just about acceptable.

The old ordered dithering is still available and can be selected by
putting the dither=ordered sub-option. The ordered dither matrix
generation code was moved to dither.c. This function was originally
written by Uoti Urpala.
2013-05-26 16:44:20 +02:00
wm4 39225ed196 gl_video: add scaler-resizes-only sub-option
This option disables the scaler set with lscale if the video image is
not resized.
2013-05-26 16:44:20 +02:00
wm4 f44a242258 Replace calls to usec_sleep()
This is just dumb sed replacement to mp_sleep_us().

Also remove the now unused usec_sleep() wrapper.
2013-05-26 16:44:20 +02:00
wm4 e56d8a200d Replace all calls to GetTimer()/GetTimerMS()
GetTimer() is generally replaced with mp_time_us(). Both calls return
microseconds, but the latter uses int64_t, us defined to never wrap,
and never returns 0 or negative values.

GetTimerMS() has no direct replacement. Instead the other functions are
used.

For some code, switch to mp_time_sec(), which returns the time as double
float value in seconds. The returned time is offset to program start
time, so there is enough precision left to deliver microsecond
resolution for at least 100 years. Unless it's casted to a float
(or the CPU reduces precision), which is why we still use mp_time_us()
out of paranoia in places where precision is clearly needed.

Always switch to the correct time. The whole point of the new timer
calls is that they don't wrap, and storing microseconds in unsigned int
variables would negate this.

In some cases, remove wrap-around handling for time values.
2013-05-26 16:44:20 +02:00
wm4 51254a678c vo: rip out VO timer wakeup mechanism again
This was used by some VOs to do timing of cursor autohiding, but we
recently moved that out of the VOs. Even though this mechanism might
be a good idea and could be needed again in future (but for what?),
it's unused now. So better just get rid of it.
2013-05-26 16:44:20 +02:00
Stefano Pigozzi 25d66f526e cocoa_common: send mouse moved events to core when dragging
This change fixes mouse autohide when dragging mouse.
2013-05-26 16:44:20 +02:00
Alexander Preisinger 405182af46 wayland: use VOCTRL_SET_CURSOR_VISIBILITY 2013-05-26 16:44:19 +02:00
Alexander Preisinger bb9b6501fd wayland: introduce vo_wayland_config
This removes the need for exposing vo_wayland_fullscreen and other functions
also this will be usefull for other vos in the future.
2013-05-26 16:44:19 +02:00
Stefano Pigozzi e6a225d57a cocoa_common: implement VOCTRL_SET_CURSOR_VISIBILITY
Pass along cursor visibility hints to be more consistent with OSX's behaviour.
2013-05-26 16:44:19 +02:00
Stefano Pigozzi ea8a8af3ec cocoa_common: implement mouse movement notifications
Notify the core of mouse movement events. The coordinates are converted to a
coordinate system with the origin in upper left corner, since Cocoa has it in
the lower left corner.
2013-05-26 16:44:19 +02:00
wm4 8fe357380e w32: use VOCTRL_SET_CURSOR_VISIBILITY
This didn't even implement --cursor-autohide. Now it does, and the
behavior of the VOs under Windows change accordingly.
2013-05-26 16:44:19 +02:00
wm4 6ab719f698 vo_sdl: use VOCTRL_SET_CURSOR_VISIBILITY 2013-05-26 16:44:19 +02:00
wm4 c76c65441a x11: remove cursor hiding logic, use VOCTRL_SET_CURSOR_VISIBILITY 2013-05-26 16:44:19 +02:00
wm4 3c8f8b7714 core: do mouse cursor hiding business in frontend
Do this so that not every VO backend has to setup a timer for cursor
hiding and interpret the --cursor-autohide option.
2013-05-26 16:44:19 +02:00
wm4 8df780cb50 vo: remove vo.check_events callback
Use VOCTRL_CHECK_EVENTS instead. Change the remaining VOs to use it.
Only vo_sdl and vo_caca actually need this, and vo_null, vo_lavc, and
vo_image had stubs only.
2013-05-26 16:44:19 +02:00
wm4 526e969419 w32: use vo_w32_control() for all VOs 2013-05-26 16:44:19 +02:00
wm4 d5de75b340 x11: use vo_x11_control() for all VOs 2013-05-26 16:44:19 +02:00
wm4 bf10a4fdfa video/out: introduce vo_control for gl_common based VOs
Instead of having separate callbacks for each backend-handled feature
(like MPGLContext.fullscreen, MPGLContext.border, etc.), pass the
VOCTRL responsible for this directly to the backend. This allows
removing a bunch of callbacks, that currently must be set even for
optional/lesser features (like VOCTRL_BORDER).

This requires changes to all VOs using gl_common, as well as all
backends that support gl_common.

Also introduce VOCTRL_CHECK_EVENTS. vo.check_events is now optional.
VO backends can use VOCTRL_CHECK_EVENTS instead to implementing
check_events. This has the advantage that the event handling code in
VOs doesn't have to be duplicated if vo_control() is used.
2013-05-26 16:44:18 +02:00
wm4 c23bf5311f vf_lavfi: allow setting avopts 2013-05-26 16:44:18 +02:00
Stefano Pigozzi 8db90e18d3 cocoa_common: authohide menu/dock in fullscreen
This simple fix makes it possible to access the MainManu and Dock when in
fullscreen when not using `--native-fs`.
2013-05-26 11:34:35 +02:00
wm4 3d87ca6b5e m_option, vf: add label support
Can be used to refer to filters by name. Intended to be used when the
filter chain is changed at runtime.

A label can be assigned to a filter by prefixing it with '@name:', where
'name' is an user-chosen identifier. For example, a filter added with
'-vf-add @label1:gradfun=123' can be removed with '-vf-del @label1'.
If a filter with an already existing label is added, the existing filter
is replaced with the new filter (this happens for both -vf-add and
-vf-pre). If a filter is replaced, the new filter takes the position of
the old filter, instead of being appended/prepended to the filter chain
as usual. For -vf-toggle, labels are compared if at least one of the
filters has a label; otherwise they are compared by filter name and
arguments (like before). This means two filters are never considered
equal if one has a label and the other one does not.
2013-05-23 01:02:24 +02:00
wm4 3cae1b9fc9 vo: remove unused callback 2013-05-23 00:54:46 +02:00
wm4 1dff26730a dec_video: get rid of two global variables 2013-05-21 00:45:42 +02:00
wm4 644131fdb4 dec_video: remove emms usage
libavcodec generally shouldn't have this problem anymore (if libavcodec
ever had it). All other video decoders are gone. In any case, if this
commit actually causes regressions, these are libavcodec bugs and should
be fixed there instead.
2013-05-21 00:40:37 +02:00
wm4 4dc8c0756f vf_lavfi: remove redundant statements 2013-05-21 00:12:20 +02:00
wm4 266230ad64 Silence some compiler warnings
None of these were actual issues.
2013-05-21 00:04:27 +02:00
wm4 228c3d209c vo_image: start image file numbers at 1
Requested by a user.
2013-05-18 17:45:55 +02:00
wm4 b0a60b7321 video/filter: fix option parser memory leak
This happens only if an option actually allocates memory (like strings).

Change filter API such that vf->priv is free'd by vf.c instead by the
filters. vf.c will free the option values as well.
2013-05-18 17:45:55 +02:00
wm4 f569d245ba core: allow changing filter filters at runtime
Add the "vf" command, which allows changing the video filter chain at
runtime. For example, the 'y' key could be bound to toggle deinterlacing
by adding 'y vf toggle yadif' to the input.conf.

Reconfiguring the video filter chain normally resets the VO, so that it
will be "stuck" until a new video frame is rendered. To mitigate this, a
seek to the current position is issued when the filter chain is changed.
This is done only if playback is paused, because normal playback will
show an actual new frame quickly enough.

If vdpau hardware decoding is used, filter insertion (whether it fails
or not) will break the video for a while. This is because vo_vdpau
resets decoding related things on vo_config().
2013-05-18 17:45:54 +02:00
wm4 41d38b3a2b vd_lavc: change VDCTRL_REINIT_VO behavior
This tried to use ctx->pic (last decoded AVFrame) for the frame bounds.
However, if av_frame_unref() on the AVFrame is called, the function will
reset _all_ AVFrame fields, even those which are not involved with
memory management. As result, mpcodecs_config_vo() was called with 0
width/height, which made the function exit early, instead of
reconfiguring the filter chain.

Go back to using mpcodecs_config_vo() directly. (That's what it did
before this VDCTRL was originally introduced; the original reason for
it disappeared.)
2013-05-18 17:32:37 +02:00
wm4 c970f5c328 video: rename VDCTRL_RESET_ASPECT to VDCTRL_REINIT_VO
Same thing, and VDCTRL_REINIT_VO implies more generic use.
2013-05-18 17:32:37 +02:00
wm4 e40ae27a87 mp_image: align image allocation height
vo_vdpau actually reads past the image allocation when displaying a
non-mod 2 420p image. The vdpau API specifies that VdpVideoSurfacePutBitsYCbCr()
requires a height that is a multiple of 4, and surface allocations are
automatically rounded.

So allocate video images with rounded height. libavutil does the same,
so images coming directly from the decoder or from libavfilter are no
problem. (libavutil does this alginment explicitly, not just because the
decoded image size is aligned to macroblocks.)
2013-05-17 23:45:55 +02:00
Stefano Pigozzi f9ed43077f cocoa_common: vo_corevideo: fix window initialization
vo_corevideo doesn't create a hidden window to perform OpenGL extensions
detection. This caused the window to always stay close.
2013-05-16 23:46:31 +02:00
wm4 bc8815d69f vd_lavc: hack-fix vdpau decoding with non mod 16 video
This changes the code so that it does the same as MPlayer, mplayer2
and mpv before ref-counted AVFrame. The problem is that get_buffer2
is called with aligned frame dimensions, while get_buffer didn't. This
breaks the mpv video frame size change detection.
2013-05-14 01:10:05 +02:00
Stefano Pigozzi 647291bab2 cocoa_common: order front window only when invisible [2]
Followup to 8df7127. This refines the condition for front ordering the
condition to account for minimized or hidden state where the window should go
to the front only as a consequnce of user interaction.
2013-05-14 00:16:57 +02:00
Stefano Pigozzi 8df712781c cocoa_common: order front window only when invisible
Window creation code always made mpv the front window. Fix it to make it front
only if the window is currently invisible.

Fixes #84
2013-05-13 23:49:00 +02:00
Stefano Pigozzi d2960d2e96 cocoa_common: don't use recursive locking
This was in the original change set for the threadsafety changes but I forgot
to squash it in.
2013-05-13 23:41:03 +02:00
Stefano Pigozzi 4878be02ad cocoa_common: remove pointless locking when using -fs
When using --fs `vo_cocoa_fullscreen` was called from the primary thread. This
occurred inside `vo_cocoa_config_window` which is scheduled for excution on the
primary thread with libdispatch).

All of this caused spam from NSRecursiveLock in standard output.
2013-05-13 23:41:03 +02:00
Stefano Pigozzi 4ce808cc2c cocoa_common: fix a bug in window dragging state
When going in and going out of full screen the player lost information on the
movableByWindowBackground behaviour. There were some hacks in place to fix it
but they were broken with the recent native fullscreen changes in 74c15ec6.

This commit removes the problem at the root and removes the hacks. The delegate
method `isMovableByWindowBackground` seems to be called after setFrame and
setPresentationOptions so change fs state in opts before that.

Fixes #83
2013-05-13 23:41:03 +02:00
Stefano Pigozzi 35c8f7b608 cocoa_common: fix deadlock when calling resize_redraw
Fixes #82
2013-05-12 23:51:58 +02:00
Stefano Pigozzi 74c15ec696 cocoa_common: add native OSX fullscreen support
This adds Mission Control fullscreen functionality to mpv. Since this doesn't
play well with many of mpv's features disable it by default. Users can activate
this feature by using `--native-fs` when starting mpv.

Fixes #34
2013-05-12 15:27:54 +02:00
Stefano Pigozzi 134f3e97bf OSX: run native event loop in a separate thread
This commit is a followup on the previous one and uses a solution I like more
since it totally decouples the Cocoa code from mpv's core and tries to emulate
a generic Cocoa application's lifecycle as much as possible without fighting
the framework.

mpv's main is executed in a pthread while the main thread runs the native cocoa
event loop.

All of the thread safety is mainly accomplished with additional logic in
cocoa_common as to not increase complexity on the crossplatform parts of the
code.
2013-05-12 15:27:54 +02:00
Stefano Pigozzi afdc9c4ae2 OSX: use native Cocoa's event loop
Schedule mpv's playloop as a high frequency timer inside the main Cocoa event
loop. This has the benefit to allow accessing menus as well as resizing the
window without the playback being blocked and allows to remove countless hacks
from the code that involved manually pumping the event loop as well simulating
manually some of the Cocoa default behaviours.

A huge improvement consists in removing NSApplicationLoad. This is a C function
defined in the Cocoa header and implements a minimal OSX application under ther
hood so that you can use the Cocoa GUI toolkit from C/C++ without having to
respect the Cocoa standards in terms of application initialization. This was
bad because the behaviour implemented by NSApplicationLoad was hard to customize
and had several gotchas especially in the menu department.

mpv was changed to be just a nib-less application. All the Cocoa part is still
generated in code but the event handling is now not dissimilar to what is
present in a stock Mac application.

As a part of reviewing the initialization process, I also removed all of
`osdep/macosx_finder_args`. The useful parts of the code were moved to
`osdep/macosx_appication` which has the broaded responsibility of managing the
full lifecycle of the Cocoa application. By consequence the
`--enable-macosx-finder` configure switch was killed as well, as this feature
is always enabled.

Another change the users will notice is that when using a bundle the `--quiet`
option will be inserted much earlier in the initializaion process. This results
in mpv not spamming mpv.log anymore with all the initialization outputs.
2013-05-12 15:27:54 +02:00
wm4 6a2a8880e9 add a way to resize window contents without VO resize
gl_video_resize_redraw() simply resizes and redraws (but without
invoking swapGlBuffers()). The VO is not involved in any way, so this
can simply be called from inside the mpgl lock from any thread.

Requires a minor refactor of the GL OSD code in order to redraw without
an OSD object.
2013-05-12 15:27:54 +02:00
wm4 f6aedac7e9 vo_opengl: lock OpenGL context
To simplify things, we just assume that all OpenGL calls as well as
all calls into gl_video must be locked. Currently, also assume that
anything GUI related must be locked as well (stuff like VOCTRL_BORDER).

In its current state, this commit does nothing, but it will allow us to
move the Cocoa GUI out of the playloop, as well as possibly implementing
better framedropping.
2013-05-12 15:27:54 +02:00
wm4 d0924ae5a8 gl_common: add some sort of locking API
Some OpenGL implementations on some platforms require that a context
is current only on one thread. For this reason, mpgl_lock() and
mpgl_unlock() take care of this as well for convenience.

Each backend that needs thread safety should provide it's own locking strategy
inside of `set_current`.
2013-05-12 15:27:54 +02:00
Alexander Preisinger 2c6c842719 wayland: reworked resizing
This fixes 2 bugs:
 * Resizing very fast breaks the aspect of the window and the width and height
   don't match with the video anymore
 * Pressing 'f' for fullscreen very fast can overwrite the backup variables for
   the previous width and height.

Also includes a better aspect calculation with fluid resizing.
2013-05-07 21:21:37 +02:00
wm4 885c6a2610 Fix some cppcheck / scan-build warnings
These were found by the cppcheck and scan-build static analyzers. Most
of these aren't interesting (the 2 previous commits fix some interesting
cases found by these analyzers), and they don't nearly fix all warnings.
(Most of the unfixed warnings are spam, things MPlayer never cared
about, or false positives.)
2013-05-06 23:11:11 +02:00
wm4 ab776adece vf_yadif: actually set PTS for output frames
The original frame PTS was used instead. Oops...
2013-05-06 23:11:11 +02:00
wm4 b34338ac6f img_format: fix broken condition
This caused all formats with fewer than 8 bits per component marked as
little endian. (Normally, only some messed up packed RGB formats are
endian-specific in this case.)
2013-05-06 23:11:10 +02:00
wm4 977dc4c63d csputils: use AVCOL_SPC_YCOCG instead of AVCOL_SPC_YCGCO (fixes Libav build)
This one should probably be blamed on ffmpeg. Its headers contain:

     #define AVCOL_SPC_YCGCO AVCOL_SPC_YCOCG

Uh, ok...
2013-05-05 18:44:23 +02:00
wm4 012d297bb1 video: add --hwdec-codecs option to whitelist codecs for hw decoding 2013-05-04 01:38:27 +02:00
wm4 844249317b vd_lavc: allow explicitly selecting vdpau hw decoders
This allows using the vdpau decoders with -vd without having to use
the -hwdec switch (basically like in mplayer).

Note that this way of selecting the hardware decoder is still
deprecated. libavcodec went away from adding special decoder entries
for hardware decoding, and instead makes use of the "hwaccel"
architecture, where hardware decoders use the same decoder names as
the software decoders. The old vdpau special decoders will probably
be deprecated and removed in the future.
2013-05-04 01:36:15 +02:00
wm4 2cb147a2f4 video: support YCgCo colorspace
YCgCo can be manually selected, but will also be used if the decoder
reports YCgCo. To make things more fun, files are sometimes marked
incorrectly, which will display such broken files incorrectly starting
with this commit.
2013-05-04 01:34:29 +02:00
wm4 872aefaa15 vo_opengl: XYZ input support
Useful for the j2k decoder.

Matrix taken from http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
(XYZ to sRGB, whitepoint D65)

Gamma conversion follows what libswscale does (2.6 in, 2.2 out).

If linear RGB is used internally for scaling, the gamma conversion
will be undone by setting the exponent to 1. Unfortunately, the two
gamma values don't compensate each others exactly (2.2 vs. 1/0.45=2.22...),
so output is a little bit incorrect in sRGB or color-managed mode. But
for now try hard to match libswscale output, which may or may not be
correct.
2013-05-04 01:32:50 +02:00
wm4 16d40828ae video: fix setting XYZ flag
Commit 9e0b68a didn't really do this correctly, failure at basic logic.
2013-05-04 01:32:23 +02:00
wm4 767cbb77ed gl_video: use GL_SRGB only if it's really RGB
Use the proper RGB flag instead of !YUV. Currently, this doesn't change
anything, because only RGB and YUV formats are supported.
2013-05-04 01:31:46 +02:00
wm4 71cc8c1581 vf_rotate: fix for some obscure pixel formats
Repurpose the 3 byte case for any unhandled pixel width. Fixes rotation
with e.g. rgb48. Very inefficient, but works.
2013-05-03 21:08:26 +02:00
Alexander Preisinger f8c13d6b66 wayland: fix wrong poll comment, check for errors
We only print an error message when POLLERR or POLLHUP occurrs, as the
something did go horribly wrong and the server will either deal with it or
crash.

Also add POLLOUT to the events.
2013-05-02 23:24:14 +02:00
Alexander Preisinger 68d4cc4536 wayland: avoid iterating over all outputs
If we use the output itself as user data we don't have to iterate over all
outputs when the handle_mode event comes.
2013-05-02 21:01:19 +02:00
Alexander Preisinger 57e0a84715 wayland: remove unused stuff 2013-05-02 21:01:19 +02:00
Alexander Preisinger c0b8c35e3b wayland: use new function xkb_keymap_from_buffer
Bump xkbcommon version and use the new xkb_keymap_from_buffer. This is more
secure, because the from_string expects a 0 terminated string, but this cannot
be guaranteed with mmap.
2013-05-02 21:01:19 +02:00
wm4 0d1cd116d7 Fix compilation with Libav 2013-05-01 17:02:06 +02:00
wm4 9e0b68a385 video: add XYZ support
Needed for the ffmpeg j2k decoder.
2013-05-01 16:26:45 +02:00
Alexander Preisinger 3899e594ea wayland: remove input modifier variable
This variable was never used anywhere.
2013-05-01 15:46:01 +02:00
Alexander Preisinger db0c3d79f8 wayland: use GetTimerMS for hiding mouse cursor
This commit remove a lot of linux specific code, like epoll. It also reduces
the complexity of the code. Instead of epoll we use poll which makes the
wayland backend more portable to other platforms.
2013-05-01 15:41:33 +02:00
Alexander Preisinger 048c68e5c2 wayland: use mpv internal key auto-repeat handling
This removes a good chunk of code trying to recreate key repeat.
Because the wayland protocol and xkbcommon don't have an interface for
auto-repeating pressed keys.
2013-05-01 13:41:07 +02:00
wm4 ea7b920184 Merge branch 'master' into low_quality_intel_crap
Conflicts:
	video/out/gl_video_shaders.glsl
	video/out/vo_opengl.c
2013-04-30 00:52:32 +02:00
Stefano Pigozzi 7a42df8712 cocoa_common: fix window sizing
The code was attempting to get the ceiling of the double. Too bad NSSize has
floats inside of it and the int cast is nowhere to be seen. This caused
rounding errors by one pixel in the window size.
2013-04-28 09:55:06 +02:00
wm4 bf48f1ecce vd_lavc: fix decoder init failure path
libavcodec decoder initialization failure caused a segfault, because it
wasn't properly reported back in init().

Also remove the return value from init_avctx(), which actually makes
things simpler. Instead, ctx->avctx can be checked to see whether
initialization was ok.
2013-04-27 13:40:55 +02:00
wm4 ca08ce77a9 vf_lavfi: move compat crap to the start of the file 2013-04-26 20:40:27 +02:00
wm4 3ffeeee411 vf_lavfi: silence stupid deprecation warning
libavfilter changed the way a format list is passed to vf_format. Now
you have to separate formats with "|" instead of ":". If you use "|",
it prints an annoying message on every reinit:

    [format @ 0x8bbaaa0]This syntax is deprecated. Use '|' to separate the list items.

...and it will probably stop working without warning at some point in
the future.

We need some very annoying ifdeffery to detect this case, because
libavfilter version numbers are just plain incompatible between Libav
and ffmpeg. There is no other way to detect this.

(Sometimes I wonder whether ffmpeg and especially Libav actually like
causing unnecessary pain for their users, and intentionally break stuff
in the most annoying way possible. Sigh...)
2013-04-26 20:40:24 +02:00
wm4 848542a513 vf_lavfi: recreate filter graph on seek
Resetting the filter graph helps dealing with filters which save state
between frames. This is important especially if they modify frame timing
or emit additional frames.

Unfortunately the libavfilter API doesn't have a way to do this
directly, so we have to use a dirty trick: we recreate the whole graph,
including format negotiation down and filter string parsing. ffplay does
this too. If libavfilter somehow decides to change output format or size
from what the first run in config() returned, mpv will explode. The same
applies to vf_next_query_format() return values (although this could be
mitigated, should it really happen).
2013-04-25 20:38:53 +02:00
wm4 d853abafc3 x11: use mpv internal key auto-repeat handling if possible
Block X11's native key repeat, and use mpv's key repeat handling in
input.c instead.

No configure check for XKB. Even though it's an extension, it has been
part of most (all?) xlibs since 1996. If XKB appears to be missing,
just refuse enabling x11.

This is a potentially controversial change. mpv will use its own key
repeat rate, instead of X11's. This should be better, because seeking
will have a standardized "speed" (seek events per seconds when keeping
a seek key held down). It will also allow disabling key repears for
certain commands, though this is not done anywhere yet.

The new behavior can be disabled with the --native-keyrepeat option.
2013-04-24 18:07:01 +02:00
wm4 355b980a72 vo_opengl_old: remove nomanyfmts warning
The VO warns by default that the nomanyfmts option should be used if
video display fails. This is almost completely useless, but people
keep asking what it means.
2013-04-23 14:18:23 +02:00
wm4 7979718159 vf_lavfi: add libavfilter bridge
Requires recent FFmpeg/Libav git versions. Earlier versions will not
be supported, as the API is different. (A libavfilter version that
uses AVFrame instead of AVFilterBuffer is needed.)

Note that this is sort of useless, because the option parser prevents
you from making use of the full libavfilter graph syntax. This has to be
fixed later.

Most of the filter creation code (half of the config() function) has
been taken from avplay.c.

This code is not based on MPlayer's vf_lavfi. The MPlayer code doesn't
compile as it hasn't been updated through multiple libavfilter API
changes, making it completely useless as a starting point.
2013-04-21 04:39:58 +02:00
wm4 778e9c0633 mp_image: provide function to convert mp_image to AVFrame
Note that this does not pass through QP information (qscale field).
The only filter for which this matters is vf_pp, and we have this
natively.
2013-04-21 04:39:58 +02:00
wm4 465ccd2c93 x11_common: minor simplification 2013-04-21 00:39:54 +02:00