aboutsummaryrefslogtreecommitdiffhomepage
path: root/video
Commit message (Collapse)AuthorAge
* vo_opengl: pass the correct target to deband functionsGravatar wm42016-02-18
| | | | | | | | 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.
* wscript: remove dxva2-dxinterop configure testGravatar Kevin Mitchell2016-02-17
| | | | Wasn't really necessary as it was equivalent to gl-dxinterop.
* vo_opengl: dxinterop: add dxva2 passthroughGravatar Kevin Mitchell2016-02-17
| | | | | Use dxva2 surface to fill RGB IDirect3DSurface9 shared with opengl via DXRegisterObjectNV.
* dxva2: add interop (non-copyback) hwdec_typeGravatar Kevin Mitchell2016-02-17
| | | | | This always falls back to software decoding right now. VO support will be added in future commits.
* vo_opengl: dxinterop: improve error messagesGravatar Kevin Mitchell2016-02-17
| | | | | | | * 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
* dxva2: avoid using AV_PIX_FMT_P010 directlyGravatar wm42016-02-17
| | | | | | | The new code is essentially equivalent, but compiles against older ffmpeg. Fixes #2832.
* dxva2: use mp_HESULT_to_str on FAILED(hr)Gravatar Kevin Mitchell2016-02-16
|
* dxva2: use mp_image_pool_get_no_alloc for decoder imagesGravatar Kevin Mitchell2016-02-16
| | | | | This makes it more explicit that the pool doesn't ever actually do any allocating itself.
* dxva2: check for failure of mp_image_new_custom_refGravatar Kevin Mitchell2016-02-16
| | | | previously, this may have caused a leak
* dxva2: another attempt at using mp_image poolGravatar Kevin Mitchell2016-02-16
| | | | | | | | | | 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
* mp_image_pool: add mp_image_pool_addGravatar Kevin Mitchell2016-02-16
| | | | | | 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.
* dxva2: fix license on some newly added files to lgpl v2.1+Gravatar Kevin Mitchell2016-02-16
| | | | | | 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.
* Rewrite ordered chapters and timeline stuffGravatar wm42016-02-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* audio/video: expose codec info as separate fieldGravatar wm42016-02-15
| | | | | Preparation for the timeline rewrite. The codec will be able to change, the stream header not.
* video: remove pointless parameter indirectionGravatar wm42016-02-15
| | | | This is always the same value.
* vo_opengl_cb: unbreak destroying+recreating GL contextGravatar wm42016-02-15
| | | | | | 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.
* dxva2: support HEVC Main 10Gravatar wm42016-02-15
|
* dxva2: use mp_image pool for d3d surfacesGravatar Kevin Mitchell2016-02-14
| | | | | | | | | | | | | 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.
* dxva2: remove unused structure membersGravatar Kevin Mitchell2016-02-14
|
* dxva2: streamline number of surface calculationGravatar Kevin Mitchell2016-02-14
| | | | | use hwdec_get_max_refs and put the "4 base work surfaces" into ADDITIONAL_SURFACES macro.
* mp_image: force display size to at least 1x1Gravatar wm42016-02-12
| | | | | | | | 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.
* vo_opengl: unconfuse CoverityGravatar wm42016-02-12
| | | | | | | | | 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.
* video: approximate AVI timestamps via DTS handlingGravatar wm42016-02-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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".
* Enable building the opengl-cb video renderer on AndroidGravatar Jan Ekström2016-02-10
| | | | | | * Add Android-specific OpenGL ES feature and checks * Add missing GL_* symbols for Android (list gathered by Ilya Zhuravlev <whatever@xyz.is>)
* player: fix crash if no video decoder can be initializedGravatar wm42016-02-10
| | | | Caused by the recent refactoring for complex filters.
* vo_opengl_cb: do also not block when drawing nothingGravatar wm42016-02-09
| | | | | | | The ctx->redrawing field signals whether flip_page() should block. Do not block if a black frame (i.e. nothing) is to be rendered. Also, frame==NULL can never happen.
* image_writer: take care of prediction_method deprecationGravatar wm42016-02-09
| | | | | | | The field was recently deprecated, and you're supposed to set the private codec option instead. Not sure if this really works as intended.
* vo_opengl: vdpau: call glVDPAUFiniNV only if initializedGravatar wm42016-02-08
| | | | This is "more correct". See #2798.
* wayland: set fs mode on every configureGravatar Alexander Preisinger2016-02-07
| | | | | Check and set the fullscreen mode on every surface configure event. This prevents gnome from resizing mpvs fullscreen window to a smaller size.
* video/decode/dxva2.c: GUID_NULL conflictsGravatar kwkam2016-02-06
| | | | | | | GUID_NULL is defined in <ks.h> gcc 6.0 refuses to link the executable because of that Signed-off-by: wm4 <wm4@nowhere>
* vd_lavc: fix use after free in some hwdecsGravatar Kevin Mitchell2016-02-06
| | | | | | | | | | | | | | fd339e3f53996efd2dae9525990da433d1e1bf89 introduced a regression that caused segfault while uniniting dxva2 decoder (and possibly vdpau too). The problem was that it freed the avctx earlier, before calling the backend-specific uninit which referenced it. Revert some of the changes of that commit, and avoid calling flush by checking whether the codec is open instead. (Based on a PR by Kevin Mitchell.) Signed-off-by: wm4 <wm4@nowhere>
* build: make libavfilter mandatoryGravatar wm42016-02-05
| | | | | | The complex filter support that will be added makes much more complex use of libavfilter, and I'm not going to bother with adding hacks to keep libavfilter optional.
* vo_rpi: add geometry handlingGravatar Uros Vampl2016-02-05
| | | | | | This makes it possible to set video size and position using the --geometry and/or --autofit options. It's also possible to switch between fullscreen/non-fullscreen playback during runtime.
* vd_lavc: avoid calling flush on an unopened AVCodecContextGravatar wm42016-02-05
| | | | | | | It can be "dangerous". In particular, the decoder might have failed to initialize, and is now in a broken state. avcodec_flush_buffers() is not expected to be called in this state, and could trigger undefined behavior.
* video: remove AVI timestamps for dropped framesGravatar wm42016-02-04
| | | | | Might possible improve A/V sync, although this is at best approximate. (AVI is just fucked.)
* vd_lavc: remove redundant best_csp fieldGravatar wm42016-02-03
| | | | And some other simplifications.
* vd_lavc: force microsecond timestamps on RPIGravatar wm42016-02-03
| | | | | | | | | | Avoids "problems". In particular, it makes MMAL output a NOPTS timestamp if the input timestamp was NOPTS. Don't do it for other decoders. Ideally, we will at some point in the future switch to integer fractions for timestamps at least up until the filter layer. But this would be a larger change, and for now I'd prefer keeping the not-rounded demuxer timestamps (if we have them).
* w32_common: switch to UniformResourceLocatorWGravatar wm42016-02-02
| | | | | | | | This is the "unicode" version of it. It appears Firefox uses it now? I'm not sure if we still need to support the old variant, but hopefully not. Fixes #2782.
* audio/video: merge decoder return valuesGravatar wm42016-02-01
| | | | | | Will be helpful for the coming filter support. I planned on merging audio/video decoding, but this will have to wait a bit longer, so only remove the duplicate status codes.
* vo_opengl: hwdec: use IDs for API, and log which backend is usedGravatar wm42016-02-01
| | | | | | | Since there can be multiple backends for a single API (vaapi can use GLX or EGL), not logging the exact backend name is annoying. So add it. At the same time, there is no need to duplicate the name as used by the --hwdec options, so replace it with using the numeric hwdec API ID.
* x11: stop waiting for MapNotify when WM_STATE changesGravatar Tracerneo2016-01-31
| | | | Signed-off-by: wm4 <wm4@nowhere>
* vd_lavc: release surfaces before destroying decoderGravatar wm42016-01-30
| | | | | | | | | | Commit b53cb8de added a delay queue for decoded frames. This is supposed to be used with copy-back decoders like dxva2-copy and vaapi-copy. Surfaces returned by them can't be referenced after uninitializing the decoders, so they have to be released before destroying the decoder. Move the flush_all() call above decoder uninit accordingly. Also move the destruction of the AVFrame used for decoding (just for being defensive - normally it doesn't hold any reference).
* vd_lavc: allow switching between hw/sw decoding any timeGravatar wm42016-01-29
| | | | | | | We just need to provide an entrypoint for it, and move the main init code to a separate function. This gets rid of the messy video chain full reinit in command.c, which completely destroyed and recreated the video state for the purpose of mid-stream hw/sw switching.
* vd_lavc: simplify an aspect of hwdec fallbackGravatar wm42016-01-29
| | | | | | Don't give the "software_fallback_decoder" field special meaning. Alwass set it, and rename it to "decoder". Whether hw decoding is used is determined by the "hwdec" field already.
* video: fix broken-PTS fallback determinationGravatar wm42016-01-29
| | | | | | | | | | This codes tries to deal with broken PTS timestamps, but since commit 271cabe6 it didn't always overwrite the previous timestamp as it should have. This mattered only if there were broken timestamps in the video stream. Also remove the pointless prev_codec_pts variables, since the decoder doesn't overwrite these fields anymore.
* rpi: add VC-1 supportGravatar wm42016-01-28
| | | | | Oops, this was forgotten earlier. Enables automatic use of the VC-1 hardware decoder on RPI.
* mp_image: copy dts as part of mp_image attributes tooGravatar wm42016-01-28
| | | | | Fixes DTS handling with certain container formats broken in commit b53cb8de (when using vaapi-copy or dxva2-copy).
* rpi: add mpeg-4 decoding supportGravatar wm42016-01-27
|
* vo_opengl: do chroma merging in integer conversion stageGravatar wm42016-01-27
| | | | | | This is a huge win when playing yuv420p10 on ANGLE - the 2 conversion stages for planes 1 and 2 and the chroma merging stage are all merged into one.
* vo_opengl: add precision qualifier to usampler2D on ANGLEGravatar wm42016-01-27
| | | | | | | | GLES requires this. Some more common sampler types have default precisions, but not usampler2D. Newer ANGLE builds verify this more strictly than older builds, so this wasn't caught before. Fixes #2761.