Commit Graph

34160 Commits

Author SHA1 Message Date
reimar 2e663a3181 mp_image: update description of MP_IMGFLAG_READABLE
Update description of MP_IMGFLAG_READABLE.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35150 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:19 +01:00
reimar 1cb11c53b6 vf: fix usage count for passthrough-only filters
Fix usage count for passthrough-only filters.

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

Conflicts:
	libmpcodecs/vf.c
2012-10-30 19:50:18 +01:00
reimar 1b57e80cb8 vd_ffmpeg: detect broken mpi usage count
Detect broken mpi usage count also in decoder.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35134 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:18 +01:00
cehoyos 354b118b28 demuxer: add missing newline in error message
Add missing newline in error message.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35120 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:18 +01:00
reimar 5aab9eafb0 cache: fix long hangs
Avoid sleeping 0 ms, this can cause sleep to be not called at all.

This will then cause long hangs e.g. when sleeping on single-CPU/core computers.
Should fix bug #2084.
Patch suggested by Visenri [visenri yahoo es]

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35119 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:18 +01:00
reimar 9b8967a7de demux_lavf: support SRT subtitles
Support subrip format subtitles.

Patch by Philip Langdale [philipl overt org].

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

Conflicts:
	libmpdemux/demux_lavf.c
2012-10-30 19:50:18 +01:00
reimar 570c907609 demux_lavf: do not special case ID_TEXT subs on program switching
When switching programs select subtitle stream regardless of
whether the format is text, ASS, bitmap or whatever.

There probably was some good reason for the condition but
it got lost in time and special-casing CODEC_ID_TEXT over other
test-based subtitles doesn't seem to make much sense.

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

Conflicts:
	libmpdemux/demux_lavf.c
2012-10-30 19:50:18 +01:00
reimar ff08d0c34a stream_file: explicitly signal EOF
Explicitly signal EOF when reaching the end of a file/pipe.

Fixes a 4 second delay due to stream_reconnect for e.g.
echo | mplayer -

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35112 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:18 +01:00
reimar 5104699646 demux_ts: add support for PCM variant found on BluRay
TS demuxer: Add support for PCM variant found on BluRay.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35106 b3059339-0415-0410-9bf9-f77b7e298cf2
2012-10-30 19:50:17 +01:00
reimar 7bc7d9955a vf_stereo3d: add another anaglyph color variant
Make compiler give the ana_coeff array automatically the right size.
Makes adding more colour schemes easier.

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

Convert comments into designated initializers.

That is a simple way to ensure they always correspond
to what the compiler actually does.

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

Add another anaglyph color variant.

Patch by Bob [mpbob ezpi net].

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35080 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar
2012-10-30 19:50:17 +01:00
reimar ceca8f6757 vf_expand: remove outdated code causing crashes
Remove outdated code that instead of preventing now causes crashes.

The problem it was trying to catch (next filter not supporting slices)
was fixed already in r10141 (by implementing a fallback version
of vf_next_draw_slice).
This should fix Debian Bug#683907.
Example command-line:
mencoder big_buck_bunny_480p_stereo.avi -o a.mpg -vf crop=346:240:2:24 -oac copy -ovc lavc

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

Conflicts:
	libmpcodecs/vf_expand.c
2012-10-30 19:50:17 +01:00
Uoti Urpala 7470b02ef4 options: fix URL user/password parsing
Code parsing the optional user/password part for some URL types given
as files to play, such as "ftp://user:password@host/filename", was
broken. Fix. I guess this isn't used much as nobody reported it
earlier.
2012-10-30 19:50:17 +01:00
Uoti Urpala 85dbd9b8f6 stream_ftp: fix double free in one error case 2012-10-30 19:50:17 +01:00
Uoti Urpala 616047c618 af_scaletempo: reset latency info when reconfiguring
af_scaletempo kept outdated values in the af->delay field after
reconfiguration until some audio was fed through the filter. This
could affect audio sync code after a playback speed change.
Additionally, in the special case speed=1 the code did not set the
af->mul field at all. Initialize both fields after reconfiguration.
2012-10-28 17:36:28 +01:00
Uoti Urpala 6903319c66 stream_ffmpeg: handle rtsp:// URLs by default, add lavf://
Make stream_ffmpeg handle rtsp:// URLs by default, without requiring
ffmpeg://rtsp://. Previously (after removal of other rtsp
implementations) rtsp:// fell back to using HTTP, which was unlikely
to work.

Also add lavf:// as an alternative to ffmpeg:// to force the stream
implementation. Since libavformat can come from Libav rather than
FFmpeg, using the ffmpeg name in the prefix is misleading.
2012-10-28 17:35:56 +01:00
wm4 d9839fe862 mp_image: add fields to pass colorspace down the filter chain
Note that this also adds a RGB colorspace for general symmetry. The
frontend (colormatrix property and options) and
mp_get_yuv2rgb_coeffs() don't support this.
2012-10-28 15:31:32 +01:00
wm4 1ba8090df7 mp_image: use uint8_t instead of unsigned char for plane pointers
Purely cosmetic.
2012-10-28 15:31:32 +01:00
wm4 d072e857d7 csputils: better support for integer color values 2012-10-28 15:31:32 +01:00
wm4 65b313a8b0 draw_bmp, csputils: use function instead of macro 2012-10-28 15:31:32 +01:00
wm4 18d4eebedb draw_bmp: cosmetics, refactor
Mostly pedantic bikeshedding issues.

Move some code around, so that the sub_bitmap_to_mp_images() function
can be split into two parts. This is better than having a big function
with many input and outputs, of which only half are used in each code
path.

Also, try to make code simpler by using a mp_rect type.
2012-10-28 15:31:31 +01:00
wm4 06a4526519 mpcommon: add mp_rect type 2012-10-27 21:17:58 +02:00
wm4 f50d0b16e0 draw_bmp: remove CONDITIONAL2 code
This was sometimes slower, sometimes slightly faster. Remove it.
2012-10-24 23:12:26 +02:00
wm4 0e81d62c53 Merge branch 'master' into osd_changes
Conflicts:
	libvo/vo_xv.c
2012-10-24 22:38:45 +02:00
wm4 bcf447d7e8 vo_lavc: never draw OSD
This guarantees that only subtitles are drawn. (Before this change, we
relied on the fact that OSD is only visible on user interaction, or if
explicitly request with --osd-level.)
2012-10-24 21:56:35 +02:00
wm4 10295b080d manpage: cleanup
Removing text about things that have been removed from the code long
ago, other fixes.
2012-10-24 21:56:35 +02:00
wm4 3d98e8c674 options: remove --ffactor switch
This controlled the generation of the palette for DVD subs if no palette
was found. The option name and description is confusing, and it was
probably barely useful. Remove the option, and hardcode the behavior to
the option's default value.
2012-10-24 21:56:35 +02:00
wm4 a8824f12dd options: remove --subfont-autoscale (changes default font scale)
The code for this option attempted to emulate the old as-documented
behavior. It wasn't very good at it, and now that the old OSD code has
been removed, it's entirely pointless.

This removes the factor 1.7 with which --subfont-text-scale was
multiplied.
2012-10-24 21:56:35 +02:00
wm4 2afd7ebb4e options: remove subtitle related options that did nothing
Most of these cased working when the OSD was switched to libass, or
didn't do anything even before that.

Also don't recursively include subreader.h in sub.h.
2012-10-24 21:56:35 +02:00
Rudolf Polzer e1e056fe5d draw_bmp: fix IMGFMT_BGR32 use 2012-10-24 21:56:35 +02:00
wm4 77016efd27 sub: add clarifying comments 2012-10-24 21:56:35 +02:00
wm4 93b384a799 core: disable vf_sub auto-insertion
Since most VOs support rendering subs directly, this doesn't change
much. Changes include: vo_null is faster, vo_image doesn't add subtitles
by default (while vo_lavc does), vo_caca doesn't render subs (but you
couldn't read them anyway).
2012-10-24 21:56:34 +02:00
wm4 773668b6e8 VF: rename vf_ass to vf_sub
This reflects the fact that this filter now renders all types of
subtitles, not just ASS subtitles.

Always compile this filter, not just on CONFIG_ASS.

Note that --no-ass still disables auto-inserting this filter. It's the
only way to disable auto-insertion, so keep it even though it's not
really ASS specific anymore. --no-ass also disables using libass for
rendering text subs directly.
2012-10-24 21:56:34 +02:00
Stefano Pigozzi 281989d384 vo_corevideo: add screenshot capability
Added screenshot capability to the corevideo VO by sending back the raw data
from the CVPixelBuffer.

Also added "screenshot window" functionality from the other OpenGL based VOs,
which uses glReadPixels to read image data back. This was moved to gl_common to
avoid duplication.
2012-10-24 21:56:34 +02:00
wm4 6bea013e27 screenshot: hack against w/width confusion
struct mp_image has two sets of size members: width/height and w/h. It's
not even sure which one of these is the ACTUAL dimension, and which is
the "stored" or "visible" dimension. vf_get_image() (a core function for
video filters) does something confusing with the sizes, and often sets
up cropped versions of other filter's image buffers. The screenshot code
uses w/h to store the display size for anamorphic video, while
width/height is the size of the pixel data. The draw_bmp.c code, as well
as sws_utils.c, always use w/h for the size of the pixel data.

It's an unholy mess, and the screenshot code potentially breaks it even
more. Work that around with a hack, until we hopefully clean up
mp_image and the video filter code.
2012-10-24 21:56:34 +02:00
wm4 4b4e4b5690 draw_bmp: fix for yuy2 format
mp_get_chroma_shift() modifies its argument even if it fails, so we have
to restore that.

mp_image didn't set chroma shifts for yuy2.
2012-10-24 21:56:34 +02:00
wm4 f80a32a8eb core: do not try to redraw OSD if VO doesn't support OSD
This fixes awkward framestepping when seeking with -vo null while paused
(caused because seeking by default draws an OSD bar, and mplayer trying
to redraw the OSD in that case; this logic is actually needed with
vo_xv).

It would have been simpler to just check vo->driver->draw_osd (and leave
that callback to NULL for VOs which don't support OSD), but for now try
to retain the capability to let VOs decide based on the image format
whether to support OSD or not.
2012-10-24 21:56:34 +02:00
wm4 0c49ddc818 sub: simplify OSD redrawing logic
Normally, we can redraw the OSD any time. But some drivers don't support
OSD redrawing (vo_null etc.), or only "sometimes" (vo_xv). For that,
some additional logic is needed. Simplify that logic. This might also
fix subtle bugs with the OSD not updating or endless frame stepping in
unforseen corner cases.

Do this by adding a new flag, which tells whether the OSD should be
redrawn.

Remove some minor code duplication.
2012-10-24 21:56:34 +02:00
wm4 796e5638ac manpage: optional input command args can't just be omitted
Fix the "grammar" of such commands to be hopefully less confusing. Also,
add the "-" for such arguments, which skips optional arguments without
changing their default value.

Also change some mentions of "mplayer" to "mpv".
2012-10-24 21:56:34 +02:00
Stefano Pigozzi 16d4e09b99 vo_corevideo: fix EOSD artifacts
The new EOSD code suffered from artifacts due to missing setup of a projection
matrix. This commit fixes the problem and uniforms the resize code to the one
driving vo_opengl_old.
2012-10-24 21:56:34 +02:00
wm4 48ce4ab7f9 screenshot: change "screenshot" input command
"screenshot" now maps to "screenshot subtitles" by default, instead of
"screenshot video". Swap the argument order: the more useful argument
should come first. Remove the compatibility aliases for numeric choices
(e.g. "screenshot 1 0" won't work anymore).
2012-10-24 21:56:34 +02:00
wm4 11ed093182 screenshot: allow taking screenshots with subtitles
This adds a new screenshot mode "subtitles", which basically takes the
video frame as decoded, and renders subtitles into it.

This may fail for some pixel formats, because libswscale sucks. If this
becomes ever a real problem, the code could be changed to convert the
image to RGBA first (or whatever the image writer wants), and then
render the subtitles into it. This would avoid the additional image
copy needed with vo_xv too. But for now, it seems better to go with the
current method in the common case: vo_opengl creates an image copy
anyway, and drawing bitmaps to yv12 is better, as no color space
conversion is involved in draw_bmp.c's up/downsampling conversion.
2012-10-24 21:56:34 +02:00
wm4 821c01a5f5 vo_corevideo: uninitialize CoreVideo objects before OpenGL 2012-10-24 21:56:34 +02:00
wm4 4d11f32162 VO, sub: refactor
Remove VFCTRL_DRAW_OSD, VFCAP_EOSD_FILTER, VFCAP_EOSD_RGBA, VFCAP_EOSD,
VOCTRL_DRAW_EOSD, VOCTRL_GET_EOSD_RES, VOCTRL_QUERY_EOSD_FORMAT.

Remove draw_osd_with_eosd(), which rendered the OSD by calling
VOCTRL_DRAW_EOSD. Change VOs to call osd_draw() directly, which takes
a callback as argument. (This basically works like the old OSD API,
except multiple OSD bitmap formats are supported and caching is
possible.)

Remove all mentions of "eosd". It's simply "osd" now.

Make OSD size per-OSD-object, as they can be different when using
vf_sub. Include display_par/video_par in resolution change detection.

Fix the issue with margin borders in vo_corevideo.
2012-10-24 21:56:34 +02:00
wm4 a4f9077f6c draw_bmp: don't try to call swscale if image format not supported
If that happens, we silently fail.
2012-10-24 21:56:34 +02:00
wm4 bf68634d15 sub: add cache to mp_draw_sub_bitmaps()
This caches scaled RGBA sub-bitmaps.
2012-10-24 21:56:34 +02:00
wm4 97c6425140 sub, vf_ass: allow rendering RGBA subs, replace old vf_ass rendering
Do this by replacing all the old vf_ass drawing code by draw_bmp.c.

Change sub.c to always use osd_draw() for the other OSD drawing
routines, and simplify the code a bit.

spudec.c subtitles (i.e. DVD subs) are now considered subtitles, and
are rendered by vf_ass, if that filter is inserted.
2012-10-24 21:56:33 +02:00
wm4 98f74335d5 sub: fix text subtitle aspect ratio with vo_xv and vo_lavc, refactor
This fixes that vo_xv didn't display text subtitles correctly when
using anamorphic video. It didn't pass the aspect information to the
subtitle renderer. Also, try to render OSD correctly with respect to
aspect ratio settings: on vo_xv, the OSD is rendered into the video,
and needs to be "stretched" too when playing anamorphic video. When
the -monitorpixelaspect option is used, even with VOs such as vo_opengl
the OSD has to be rendered with that aspect ratio.

As preparation for future commits, replace the weird vsfilter_scale
value with a somewhat more sensible video_par member.

Also, struct mp_eosd_res is a better place for the aspect ratio
parameters, as OSD needs this too.

Use osd_draw_on_image() directly in vo_lavc, which fixes aspect ratio
issues as well.
2012-10-24 21:56:33 +02:00
wm4 d5def80afb core: fix -subfile
When demux_demuxers was removed, and -subfile was moved to the frontend,
setting the non_interleaved for -subfile was forgotten.
2012-10-24 21:56:33 +02:00
wm4 73f18ace91 mp_image: hack to fix alignment for certain image formats
This is to get rid of swscale alignment warnings with the new OSD code.
Only image formats used by it are fixed.

Solving this generally would require some more effort. (Possibly by
using libav's allocation functions plus lots of testing.)
2012-10-24 21:56:33 +02:00
wm4 f6197249a7 spudec: use csputils for color conversion
Just to get rid of that conversion copy&pasted from the internet.

R and G are swapped for unknown reasons. Testing various subtitles
seem to yield the same results as VLC. The sub-bitmap renderers output
the correct colors. The colorspace conversion is used without problems
for vo_gl, vo_gl3 and vo_vdpau. The problem is most likely that
apparently, the DVD palette read from the subtitle track extradata is
converted to YUV using vobsub_palette_to_yuv(), and swapped in the
process. Or in other words, the YUV colors spu->global_palette are
encoded with R and G swapped.

Add some utility definition to csputils.c/h to make converting single
color values easier.
2012-10-24 21:56:33 +02:00