Commit Graph

689 Commits

Author SHA1 Message Date
Stefano Pigozzi 37388ebb0e configure: uniform the defines to #define HAVE_xxx (0|1)
The configure followed 5 different convetions of defines because the next guy
always wanted to introduce a new better way to uniform it[1]. For an
hypothetic feature 'hurr' you could have had:

  * #define HAVE_HURR 1   / #undef HAVE_DURR
  * #define HAVE_HURR     / #undef HAVE_DURR
  * #define CONFIG_HURR 1 / #undef CONFIG_DURR
  * #define HAVE_HURR 1   / #define HAVE_DURR 0
  * #define CONFIG_HURR 1 / #define CONFIG_DURR 0

All is now uniform and uses:
  * #define HAVE_HURR 1
  * #define HAVE_DURR 0

We like definining to 0 as opposed to `undef` bcause it can help spot typos
and is very helpful when doing big reorganizations in the code.

[1]: http://xkcd.com/927/ related
2013-11-03 21:59:54 +01:00
wm4 891a2a1f47 w32: implement functionality required for window-scale
Same semantics with respect to fullscreen as x11.
2013-11-02 17:54:46 +01:00
wm4 9423a7e23e x11: make window-scale use windowed size in fullscreen mode
This is a bit more intuitive, since before, the window size was just set
to something random when setting the window-scale property during
fullscreen.
2013-11-02 17:32:03 +01:00
wm4 4d903127ad demux: rename Windows symbols
There are some Microsoft Windows symbols which are traditionally used by
the mplayer core, because it used to be convenient (avi was the big
format, using binary windows decoders made sense...). So these symbols
have the exact same definition as the Windows one, and if mplayer is
compiled on Windows, the symbols from windows.h are used.

This broke recently just because some files were shuffled around, and
the symbols defined in ms_hdr.h collided with windows.h ones. Since we
don't have windows binary decoders anymore, there's not the slightest
reason our symbols should have the same names. Rename them to reduce the
risk for collision, and to fix the recent regression.

Drop WAVEFORMATEXTENSIBLE, because it's mostly unused. ao_dsound defines
its own version if the windows headers don't define it, and ao_wasapi is
not available on systems where this symbol is missing.

Also reindent ms_hdr.h.
2013-11-02 15:14:12 +01:00
wm4 e0b6fdeb8d Fix some more -Wshadow warnings
These aren't printed with newer gcc or clang versions for some reason.

All of them seem to be about local variables shadowing global functions.
2013-11-01 17:35:38 +01:00
wm4 24897eb94c video: check profiles with hardware decoding
We had some code for checking profiles earlier, which was removed in
commits 2508f38 and adfb71b. These commits mentioned that (working) hw
decoding was sometimes prevented due to profile checking, but I can't
find the samples anymore that showed this behavior. Also, I changed my
opinion, and I think checking the profiles is something that should be
done for better fallback to software decoding behavior.

The checks roughly follow VLC's vdpau profile checks, although we do
not check codec levels. (VLC's profile checks aren't necessarily
completely correct, but they're a welcome help anyway.)

Add a --vd-lavc-check-hw-profile option, which skips the profile check.
2013-11-01 17:33:33 +01:00
wm4 dd344b43e8 Enable -Wshadow
This one really did bite me hard (see previous commit), so enable it by
default.

Fix some cases of shadowing throughout the codebase. None of these
change behavior, and all of these were correct code, and just tripped up
the warning.
2013-11-01 13:00:15 +01:00
wm4 94542abf2e command: add property to scale window size 2013-10-31 23:30:14 +01:00
wm4 b55d557822 x11: factor out normal window resize code
As preparation for resizing the window with input commands in the
following commit.

Since there are already so many functions which somehow resize the
window, add the word "highlevel" to the name of this new function.
2013-10-31 19:51:46 +01:00
wm4 7100a10127 vd_lavc: add more ifdeffery and ffmpeg cargo culting for correctness
We mixed the "old" AVFrame management functions (avcodec_alloc_frame,
avcodec_free_frame) with reference counting. This doesn't work
correctly; you must use av_frame_alloc and av_frame_free. Of course
ffmpeg doesn't warn us about the bad usage, but will just mess up
things silently. (Thanks a lot...)

While the alloc function seems to be 100% compatible, the free function
will do bad things, such as freeing memory that might still be
referenced by another frame. I didn't experience any actual bugs, but
maybe that was pure luck.
2013-10-31 18:17:14 +01:00
wm4 ee2ba635f2 dec_video: remove unused declaration of a former global variable 2013-10-31 18:17:13 +01:00
Stefano Pigozzi 55dca5b6a3 gl_common: osx: fix compilation with latest XQuartz RC
Looks the gl.h header in XQuartz is incompatible with the one in OS X 10.9.
2013-10-30 23:59:43 +01:00
wm4 50e57c346f x11: restore support for --wid=0
This stopped working when the code was changed to create a window even
if --wid is used.

It appears we can't create our own window in this case, because in X11
there is no difference between a window with the root window as parent,
and a window that is managed by the WM. So make this (kind of worthless)
special case use the root window itself.
2013-10-30 22:19:32 +01:00
wm4 7743ed2dc6 x11: remove ancient metacity hack
Tested with recent metacity; this code is not triggered anymore. The
code was added in 2003 and probably has been unused for years.
2013-10-30 22:19:31 +01:00
wm4 4b2d93f103 x11: minor cosmetics 2013-10-30 22:19:31 +01:00
wm4 884b4600a4 gl_x11: change error message when GL3 context creation fails
On systems that provide legacy OpenGL (up to 2.1), but not GL3 and
later, creating a GL3 context will fail. We then revert to legacy GL.

Apparently the error message printed when the GL3 context creation
fails is confusing. We could just silence it, but there's still a X
error ("X11 error: GLXBadFBConfig"), which would be quite hard to
filter out. For one, it would require messing with the X11 error
handler, which doesn't even carry a context pointer (for application
private data), so we don't even want to touch it. Instead, change
the error message to inform the user what's actually happening: a
fallback to an older version of OpenGL.
2013-10-28 23:54:02 +01:00
wm4 96a60e15ce x11_common: refactor of fstype code
This is completely pointless, but it still somehow bugged me.
2013-10-28 22:42:47 +01:00
Stefano Pigozzi e4d23dd01d cocoa: apply the more invasive constraining only with cmd+1/2/3
Regression from bc49957
Fixes #321
2013-10-28 09:08:08 +01:00
wm4 f2d438a1fd x11: fix border toggling
Trying to toggle the border during fullscreen (with "cycle border")
would leave the window stuck without border, and it couldn't be
restored. This was because vo_x11_decoration() always excepted to be
called when toggling the state, and thus confusing the contents of the
olddecor variable. Add got_motif_hints to hopefully prevent this.

Also, when changing the border, don't take fs in account. May break on
older/broken WMs, but all in all is in fact more robust and simpler,
because you do not need to update the border state manually when
returning from fullscreen.
2013-10-27 23:22:46 +01:00
wm4 6e1eb8add9 vo_xv: check whether image allocation succeeds 2013-10-27 17:58:06 +01:00
wm4 74e7043cc7 gl_common: suggest --vo=opengl-old if OpenGL 2.1 missing
If the caller requests at least OpenGL 2.1 (which --vo=opengl does),
but we get OpenGL 1.x, suggest using opengl-old.

Based on a patch by pfor on IRC.
2013-10-26 14:17:53 +02:00
wm4 de303d8ba4 x11_common: reduce screensaver heartbeat from 30 to 10 seconds
Apparently this fixes issues with Gnome, which has a smaller timeout.
See github issue #315.
2013-10-25 20:30:01 +02:00
Stefano Pigozzi bc49957458 cocoa: constraint the window position a little more
The intention of this is to not make the window go outside the screen when
changing dimensions from 2x to .5x.
2013-10-25 20:01:32 +02:00
Alexander Preisinger cb3327fe48 wayland: better name for mouse coordinates
I had to look up what the surf_x and surf_y members do.
That means the name is not very good. Also a comment.
2013-10-25 10:30:12 +02:00
Alexander Preisinger bef2135a44 wayland: fix fullscreen transparent border regions
The default behavior of weston changed some time ago to not fill the surface
black for fullscreen windows.

Now let mpv draw the whole screen in fullscreen mode.
2013-10-25 10:30:11 +02:00
wm4 60aea74f44 m_config: refactor option defaults handling
Keep track of the default values directly, instead of creating a new
instance of the option struct just to get the defaults.

Also get rid of the special handling of m_obj_desc.init_options.
Instead, handle it purely by the option parser. Originally, I wanted to
handle --vo=opengl-hq and --vo=direct3d_shaders with this (by making
them aliases to the real VOs with a different preset), but since --vo
=opengl-hq=help prints the wrong values (as consequence of the
simplification), I'm not doing that, and instead use something
different.
2013-10-24 22:50:13 +02:00
wm4 6d44a4dfd1 video/filter: remove useless vf_info fields
This time I didn't bother to move the contents of the author field to
the file headers. "git log" is your friend.
2013-10-23 19:30:01 +02:00
wm4 c8930e80a8 video/out: remove useless info struct and redundant fields
The author and comment fields were printed only in -v mode.
2013-10-23 19:30:01 +02:00
wm4 a37c810173 vo_opengl: don't enable PBOs with opengl-hq
The speed advantages are marginal (at least with the way it's currently
used), and it might actually be slower on some drivers, like Mesa.
2013-10-23 17:50:49 +02:00
wm4 68531e23a1 gl_video: add RGB10_A2 FBO format
Maybe this can be the default in the future, but I'm not sure yet.
2013-10-23 17:46:57 +02:00
Stefano Pigozzi 3b156caf78 cocoa: set and clear gl context inside of sync sections
The code did not set and unset the current context inside sync sections. I am
not sure if this was an actual problem but this is better since the context is
linked to a single thread. In my brief tests this seems to avoid garbage to
show up in fullscreen.
2013-10-20 21:25:55 +02:00
Alexander Preisinger 6a4e59677e wayland: use mp_input_test_dragging
Instead of removing dragging we now test if it we should drag the window or
not. Because if the OSC shows up we can not drag the window because that would
cause mouse events that makes the OSC disappear.
2013-10-20 09:25:28 +02:00
Alexander Preisinger bbb1057d06 Revert "wayland: remove moving window by grabbing"
This reverts commit 3308bc2bc9.
2013-10-20 09:24:37 +02:00
Alexander Preisinger 38ef925ab7 Revert "wayland: remove outdated comment"
This reverts commit d75cfef49c.
2013-10-20 09:24:37 +02:00
wm4 d7287d60dd vdpau_old: restore hardware decoding with old API
--hwdec=vdpau did nothing with older ffmpeg/libav versions. Oops.
2013-10-19 20:57:43 +02:00
wm4 e046fa584a mp_msg: remove gettext() support
Was disabled by default, was never used, internal support was
inconsistent and poor, and there has been virtually no interest in
creating translations.

And I don't even think that a terminal program should be translated.
This is something for (hypothetical) GUIs.
2013-10-18 22:38:10 +02:00
wm4 1eda9554d4 sws_utils: work around libswscale crash with --contrast=-100 2013-10-16 21:39:51 +02:00
wm4 20e1c5f7d9 vf_scale: fix get/set confusion
This caused the equalizer controls to appear stuck.
2013-10-16 21:35:27 +02:00
wm4 a0485221c7 x11_common: don't handle mouse enter events
This could cause the OSC to be displayed without mouse interaction: for
example, starting mpv with --fs, and putting the mouse to where the OSC
area is beforehand, would cause the OSC to appear and stay visible. We
don't want that. The simplest solution is not generating artificial
mouse move events from mouse enter events, because they make the OSC
think the mouse was actually moved.

Also see commit 0c7978c, where handling of mouse enter events was added.
This was supposed to fix certain corner cases, but they're not relevant
anymore due to changes in OSC behavior.

Commit 9777047 fixed this as well (by resetting the mouse state on
MOUSE_LEAVE), but all the behavior reverted with this commit as perhaps
a bad idea. It wasn't very robust, made it hard to distinguish real
events from artificial ones, and finally made the mouse cursor more
often visible than needed. (Now switching between workspaces doesn't
make the cursor visible again when switching to a fullscreened mpv.)
2013-10-15 21:53:33 +02:00
wm4 94e71b7cc0 mplayer, vo_image: simplify OSD redrawing, fix vo_image crash
vo_image didn't handle OSD redrawing correctly anymore after OSD
redrawing behavior was changed in commit ed9295c (or maybe it has been a
problem for a longer time, and only showed up now). Basically, flip_page
was called unexpectedly and when no image was stored, which made it
crash trying to access the image. This could happen when for example
provoking OSD redrawing by pausing while using --vo=image, or by using
this command line: mpv --vo=image '-vf=lavfi="select=not(mod(n\,3))"'

Fix by removing the code that pretends vo_image can redraw OSD, and by
removing the framestepping fallback, which could make bad things happen
if the VO didn't support OSD redrawing. By now, there aren't any real
VOs that can't redraw the OSD properly, so this code is not needed and
just complicates things like vo_image.

This change likely will also be useful for vo_lavc (encoding).
2013-10-13 23:40:23 +02:00
wm4 c613d802bc talloc: change talloc destructor signature
Change talloc destructor so that they can never signal failure, and
don't return a status code. This makes our talloc copy even more
incompatible to upstream talloc, but on the other hand this is
preparation for getting rid of talloc entirely.

(The talloc replacement in the next commit won't allow the talloc_free
equivalent to fail, and the destructor return value would be useless.
But I don't want to change any mpv code either; the idea is that the
talloc replacement commit can be reverted for some time in order to
test whether the talloc replacement introduced a regression.)
2013-10-13 01:16:30 +02:00
Stefano Pigozzi 8d5f800567 cocoa: make --ontop also cover dock+menubar
This only shows any differences when mpv isn't frontmost and is in fullscreen.
Cmd+Tab overlay is still at a higher level as to avoid complete usability fail.
2013-10-12 21:02:46 +02:00
Stefano Pigozzi 57c3fca7a8 cocoa: refactor precise scrolling to a separate method 2013-10-12 16:26:53 +02:00
Mad Fish 42189ada97 cocoa: fix mouse wheel scrolling 2013-10-12 16:26:24 +02:00
Stefano Pigozzi 177c89d948 cocoa_common: check if the screen has a menubar in a more generic way
Fixes #274
2013-10-09 09:27:41 +02:00
wm4 8304046180 vo_x11, vo_xv: fix OSD redrawing with --force-window
The window wasn't cleared in this mode before doing the redrawing.
2013-10-06 23:03:30 +02:00
Stefano Pigozzi 89fced63b8 cocoa_common: add OS X 10.7 compatibility hacks includes
I forgot these when I split the code. They will hopefully fix compilation on
10.7.
2013-10-05 14:40:48 +02:00
wm4 76f32e3881 gl_x11: fail gracefully if selected FBconfig has no X visual
glXGetVisualFromFBConfig() specifies specifies that it can return NULL
if there is no associated X visual. Instead of crashing, let
initialization fail. I'm not sure if this is actually supposed to work
with a fallback visual (passing a NULL visual to vo_x11_config_vo_window
would just do this), but let's play safe for now.

Apparently this can happen when trying to use vo_opengl over a remote
X display.
2013-10-03 23:50:48 +02:00
wm4 bdc56771eb vo_opengl_old: mp_msg conversion
This was the only thing in video/out/ left with major mp_msg() use.
2013-10-02 21:41:46 +02:00
wm4 ef9c5300ef cosmetics: replace "CTRL" defines by enums
Because why not.
2013-10-02 21:19:16 +02:00