Commit Graph

42854 Commits

Author SHA1 Message Date
wm4 c01aaabb3e vo_opengl: use correct gl_target variable
p->gl_target and plane->gl_target are always the same value here, but
semantically plane->gl_target is the correct one.
2016-02-18 10:46:03 +01:00
wm4 57c31f4130 vo_opengl: don't use normalized coords for debanding rectangle textures
Fixes #2831.
2016-02-18 10:42:26 +01:00
wm4 d6af58c699 vo_opengl: pass the correct target to deband functions
Apple crap (namely hardware decoding interop) forces us to use rectangle
textures for input. But after that we continue with normal textures.
This was not considered for debanding, and the sampler type used for it
can be different depending on the exact render chain. Simply use the
target type of the input texture.
2016-02-18 10:41:13 +01:00
Kevin Mitchell 0d40140668 wscript: remove dxva2-dxinterop configure test
Wasn't really necessary as it was equivalent to gl-dxinterop.
2016-02-17 10:17:52 -08:00
Kevin Mitchell 2d1f42089c vo_opengl: dxinterop: add dxva2 passthrough
Use dxva2 surface to fill RGB IDirect3DSurface9 shared with opengl via
DXRegisterObjectNV.
2016-02-17 09:07:12 -08:00
Kevin Mitchell 084162d6fe dxva2: add interop (non-copyback) hwdec_type
This always falls back to software decoding right now. VO support will be added
in future commits.
2016-02-17 06:59:02 -08:00
Kevin Mitchell 941885b62c vo_opengl: dxinterop: improve error messages
* use mp_HRESULT_to_str/mp_LastError_to_str
* make some messages non-identical
* replace "GL" -> "OpenGL"
* change some MP_FATAL to MP_ERR that don't actually kill the vo
2016-02-17 06:59:02 -08:00
Kevin Mitchell 50d9a2609a windows_utils: try and use FormatMessage for errors.
This is useful in particular for GetLastError, unfortunately, it's stil pretty
dumb with regards to WASAPI or D3D specific errors, so keep the
hresult_to_string switch.
2016-02-17 06:58:56 -08:00
wm4 f371367aac dxva2: avoid using AV_PIX_FMT_P010 directly
The new code is essentially equivalent, but compiles against older
ffmpeg.

Fixes #2832.
2016-02-17 13:54:55 +01:00
Kevin Mitchell 3dfb07854b dxva2: use mp_HESULT_to_str on FAILED(hr) 2016-02-16 12:36:57 -08:00
Kevin Mitchell 88c83f450a dxva2: use mp_image_pool_get_no_alloc for decoder images
This makes it more explicit that the pool doesn't ever actually do any
allocating itself.
2016-02-16 12:36:57 -08:00
Kevin Mitchell 5d761dd342 dxva2: check for failure of mp_image_new_custom_ref
previously, this may have caused a leak
2016-02-16 12:36:56 -08:00
Kevin Mitchell d5348a66dc dxva2: another attempt at using mp_image pool
Apparently, some drivers require you to allocate all of the decoder d3d surfaces
at once. This commit changes the strategy from allocating surfaces as needed via
mp_image_pool_set_allocator, to allocating all the surfaces in one call to
IDirectXVideoDecoderService_CreateSurface and adding them to the pool with
mp_image_pool_add.

fixes #2822
2016-02-16 12:36:56 -08:00
Kevin Mitchell 01743f4ecd mp_image_pool: add mp_image_pool_add
Provide a way for the user to add mp_images to the pool. This is required for
dxva2, for which using set_allocator is extremely awkward since all the d3d9
surfaces must be allocated in advance and all together.
2016-02-16 12:36:50 -08:00
Kevin Mitchell cd0a34feb3 dxva2: fix license on some newly added files to lgpl v2.1+
I mistakenly copied the wrong license text into these files when
I created them. Since I'm the only one to have touched these files,
it should be OK to change them.
2016-02-16 12:07:31 -08:00
wm4 ce0b99314b demux_timeline: cosmetics: move a function
Gets rid of a forward declaration.
2016-02-16 21:06:02 +01:00
wm4 3c3cd0c540 demux_timeline: disable cache for inactive segments
This is achieved indirectly by deslecting all streams for the non-
current segment (and if the segment doesn't share the demuxer with the
currently active one).

Restores functionality added with commit 46bcdb70.
2016-02-16 21:05:18 +01:00
wm4 0af5335383 Rewrite ordered chapters and timeline stuff
This uses a different method to piece segments together. The old
approach basically changes to a new file (with a new start offset) any
time a segment ends. This meant waiting for audio/video end on segment
end, and then changing to the new segment all at once. It had a very
weird impact on the playback core, and some things (like truly gapless
segment transitions, or frame backstepping) just didn't work.

The new approach adds the demux_timeline pseudo-demuxer, which presents
an uniform packet stream from the many segments. This is pretty similar
to how ordered chapters are implemented everywhere else. It also reminds
of the FFmpeg concat pseudo-demuxer.

The "pure" version of this approach doesn't work though. Segments can
actually have different codec configurations (different extradata), and
subtitles are most likely broken too. (Subtitles have multiple corner
cases which break the pure stream-concatenation approach completely.)

To counter this, we do two things:
- Reinit the decoder with each segment. We go as far as allowing
  concatenating files with completely different codecs for the sake
  of EDL (which also uses the timeline infrastructure). A "lighter"
  approach would try to make use of decoder mechanism to update e.g.
  the extradata, but that seems fragile.
- Clip decoded data to segment boundaries. This is equivalent to
  normal playback core mechanisms like hr-seek, but now the playback
  core doesn't need to care about these things.

These two mechanisms are equivalent to what happened in the old
implementation, except they don't happen in the playback core anymore.
In other words, the playback core is completely relieved from timeline
implementation details. (Which honestly is exactly what I'm trying to
do here. I don't think ordered chapter behavior deserves improvement,
even if it's bad - but I want to get it out from the playback core.)

There is code duplication between audio and video decoder common code.
This is awful and could be shareable - but this will happen later.

Note that the audio path has some code to clip audio frames for the
purpose of codec preroll/gapless handling, but it's not shared as
sharing it would cause more pain than it would help.
2016-02-15 21:04:07 +01:00
wm4 ae55896f42 player: remove old timeline/ordered chapters support 2016-02-15 21:03:51 +01:00
wm4 65f9af1d40 packet: cosmetics: reorder fields 2016-02-15 20:39:17 +01:00
wm4 f2b039da77 audio/video: expose codec info as separate field
Preparation for the timeline rewrite. The codec will be able to change,
the stream header not.
2016-02-15 20:34:45 +01:00
wm4 f219a48dca video: remove pointless parameter indirection
This is always the same value.
2016-02-15 20:28:36 +01:00
wm4 8aeaa34a5c sub: move sub decoder init to a function
Preparation for timeline rewrite.
2016-02-15 20:26:22 +01:00
Alexis Nootens 733e0b23c8 cocoa: fix charcode retrieving for accented characters
The handler was retrieving an invalid charcode for
accented characters, thus ignoring them.
2016-02-15 18:21:50 +01:00
wm4 39ab426f05 player: add on_preloaded hook
(Limited usefulness.)
2016-02-15 16:19:19 +01:00
wm4 b7034db4af player: restore old/correct --force-window behavior
When playback of a video ends, and the next file has no video at all (no
cover art or anything), then the window must be cleared.

This also resizes the window forcibly, which is by design.

Fixes #2825.
2016-02-15 15:14:11 +01:00
wm4 012a8ef2cc vo_opengl_cb: unbreak destroying+recreating GL context
A client API user is allowed to call mpv_opengl_cb_uninit_gl() followed
by mpv_opengl_cb_init_gl(). This crashed; fix it by fixing the lifetime
of ctx->gl.
2016-02-15 14:50:03 +01:00
wm4 acf239a45c dxva2: support HEVC Main 10 2016-02-15 12:52:16 +01:00
Kevin Mitchell 06f1e934db dxva2: use mp_image pool for d3d surfaces
This is required so that the individual surfaces can pass beyond the dxva2
decoder and be passed to the vo.

This also adds additional data to mp_image->planes[0] for IMGFMT_DXVA2, which is
required for maintaining and releasing the surface even if the decoder code is
uninited.

The IDirectXVideoDecoder itself is encapsulated together with its surface pool
and configuration in a dxva2_decoder structure whose creation and destruction is
managed by talloc.
2016-02-14 11:01:12 -08:00
Kevin Mitchell 543f6df2a6 dxva2: remove unused structure members 2016-02-14 11:01:12 -08:00
Kevin Mitchell 74a8fd3702 dxva2: streamline number of surface calculation
use hwdec_get_max_refs and put the "4 base work surfaces" into
ADDITIONAL_SURFACES macro.
2016-02-14 11:01:12 -08:00
wm4 e1e052a58e client API: explain when mpv_create() can return NULL 2016-02-14 12:44:53 +01:00
wm4 fa821de8b2 demux_mkv: support channel layout in VfW muxed PCM
Fixes #2820.
2016-02-14 12:42:24 +01:00
wm4 d3ed550792 mpv.conf: add some more options
Seems like questions related to functionality covered by them are quite
often asked.
2016-02-13 13:13:15 +01:00
wm4 0970763f69 client API: handle double->int64 conversion correctly
It signalled failure instead.
2016-02-13 13:07:53 +01:00
wm4 90089b860c manpage: normal filters are still active with complex filters
It's not exactly obvious how they interact.
2016-02-12 20:28:39 +01:00
wm4 cf323d0cc1 lavfi: dump the filter graph
Especially useful to see what video formats are involved on the various
filter links.

I suspect this function is not available on Libav, so add necessary
ifdeffery preemptively.
2016-02-12 20:28:07 +01:00
wm4 f9f3175487 ipc: fix uninitialized field
The sockaddr_un.sun_len field was not initialized. It seems our API use
is correct by simply making sure it's 0.

Fixes CID 1350075.
2016-02-12 16:11:05 +01:00
wm4 0868546f9d player: remove dead code
Fixes CID 1350055 and CID 1350054.
2016-02-12 16:06:20 +01:00
wm4 1cfcc1e1d5 mp_image: force display size to at least 1x1
Don't allow rounding to let it underflow to 0. 0 width or height is
simply not allowed and could cause problems otherwhere.

Indirectly fixes CID 1350057, which complains about not checking the
resulting output size values before using it in divisions.
2016-02-12 16:04:26 +01:00
wm4 0b427c54ad player: remove double assignment in declaration
Fixes CID 1350058.

(Still looks like this might be valid C, in some fucked up way.)
2016-02-12 16:00:20 +01:00
wm4 0287736119 sub: remove always-true check
Confuses Coverity with FORWARD_NULL on the mp_err() at the end of the
function. These pointers are never NULL.

Fixes CID 1350059.
2016-02-12 15:58:48 +01:00
wm4 fd80fcd3f3 vo_opengl: unconfuse Coverity
It thinks that integer_conv_fbo[index] is implied to be accessed with up
to index=5. Although that is theoretical only, it has a point that this
makes no sense. Use the same constant for the array allocation, to make
it more uniform and robust.

Fixes CID 1350060.
2016-02-12 15:56:58 +01:00
wm4 337ad4fef4 stream_dvb: fix minor resource leaks
Fixes CID 1350062 and 1350061.

Just for the sake of shutting up Coverity.
2016-02-12 15:51:49 +01:00
wm4 8e4eee9a9a stream_dvb: remove dead code
Fixes CID 1350063.
2016-02-12 15:47:25 +01:00
wm4 6eae6a785c ad_lavc: fix --ad-lavc-threads range
The code is shared with the --vd-lavc-threads option, so using 0 for
auto-detection just works.

But no, this is not useful. Just change it for orthogonality.
2016-02-11 22:06:58 +01:00
wm4 166fa30f4b build: enable vaapi under drm-only
Fixes #2808.
2016-02-11 22:03:24 +01:00
wm4 dccda5189d demux: reduce verbosity
Tired of seeing all these useless pseudo-demuxers in the log.
2016-02-11 20:54:44 +01:00
wm4 d3f32cba32 video: approximate AVI timestamps via DTS handling
Until now (and in mplayer traditionally), avi timestamps were handled
with a timestamp FIFO. AVI timestamps are essentially just strictly
increasing frame numbers and are not reordered like normal timestamps.

Limiting the FIFO is required because frames can be dropped. To make
it worse, frame dropping can't be distinguished from the decoder not
returning output due to increasing the buffering required for B-frames.
("Measuring" the buffering at playback start seems like an interesting
idea, but won't work as the buffering could be increased mid-playback.)
Another problem are skipped frames (packets with data, but which do
not contain a video frame).

Besides dropped and skipped frames, there is the problem that we can't
always know the delay. External decoders like MMAL are not going to
tell us. (And later perhaps others, like direct VideoToolbox usage.)

In general, this works not-well enough that I prefer the solution of
passing through AVI timestamps as DTS. This is slightly incorrect,
because most decoders treat DTS as mpeg-style timestamps, which
already include a b-frame delay, and thus will be shifted by a few
frames. This means there will be a problem with A/V sync in some
situations.

Note that the FFmpeg AVI demuxer shifts timestamps by an additional
amount (which increases after the first seek!?!?), which makes the
situation worse. It works well with VfW-muxed Matroska files, though.

On RPI, the first X timestamps are broken until the MMAL decoder "locks
on".
2016-02-11 16:14:30 +01:00
Niklas Haas eff2e575f1 manpage: fix indenting issue in vf_format 2016-02-11 00:14:12 +01:00