summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* vo_opengl: allow texture uploads to failNiklas Haas2017-08-183-9/+8
| | | | Surprisingly makes the code shorter, not longer
* options: correct two remaining instances of singular `file-path` optionsFrédéric Brière2017-08-181-2/+2
| | | | These were left behind by e4bc563fd2dc.
* vo_opengl: clarify the ra_fns.debug_markerNiklas Haas2017-08-181-1/+2
|
* vo_opengl: refactor RA texture and buffer updatesNiklas Haas2017-08-1811-189/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - tex_uploads args are moved to a struct - the ability to directly upload texture data without going through a buffer is made explicit - the concept of buffer updates and buffer polling is made more explicit and generalized to buf_update as well (not just mapped buffers) - the ability to call tex_upload/buf_update on a tex/buf is made explicit during tex/buf creation - uploading from buffers now uses an explicit offset instead of implicitly comparing *src against buf->data, because not all buffers may actually be persistently mapped - the initial_data = immutable requirement is dropped. (May be re-added later for D3D11 if that ever becomes a thing) This change helps the vulkan abstraction immensely and also helps move common code (like the PBO pooling) out of ra_gl and into the opengl/utils.c This also technically has the side-benefit / side-constraint of using PBOs for OSD texture uploads as well, which actually seems to help performance on machines where --opengl-pbo is faster than the naive code path. Because of this, I decided to hook up the OSD code to the opengl-pbo option as well. One drawback of this refactor is that the GL_STREAM_COPY hack for texture uploads "got lost", but I think I'm happy with that going away anyway since DR almost fully deprecates it, and it's not the "right thing" anyway - but instead an nvidia-only hack to make this stuff work somewhat better on NUMA systems with discrete GPUs. Another change is that due to the way fencing works with ra_buf (we get one fence per ra_buf per upload) we have to use multiple ra_bufs instead of offsets into a shared buffer. But for OpenGL this is probably better anyway. It's possible that in future, we could support having independent “buffer slices” (each with their own fence/sync object), but this would be an optimization more than anything. I also think that we could address the underlying problem (memory closeness) differently by making the ra_vk memory allocator smart enough to chunk together allocations under the hood.
* vo_opengl: make blitting an explicit capabilityNiklas Haas2017-08-183-6/+10
| | | | | | | | | Instead of merging it into render_dst. This is better for vulkan, because blitting in vulkan both does not require a FBO *and* requires a different image layout. Also less "hacky" for OpenGL, since now the weird blit=FBO requirement is an implementation detail of ra_gl
* vo_opengl: make ra_fns.timer_create optionalNiklas Haas2017-08-182-1/+4
|
* TOOLS/autocrop.lua: fix cropdetect black limit for 10-bit videosRicardo Constantino2017-08-171-3/+4
| | | | | Also update to use newer lavfi-bridges for the relevant filters to shut up warnings about deprecated crop filter.
* stream: add an assert() to an obscure seek casewm42017-08-171-0/+1
| | | | | | | | This affects small seeks backwards while within the buffer. Demuxers usually avoid this, so it's probably not triggered very often. (Although demux_mkv.c potentially triggers it often, and it uses stream_peek() to explicitly guarantee that it can use this code to seek back.) The condition is complex enough to warrant an assertion.
* demux_lavf: use partial read for AVIOContext.read_packetwm42017-08-171-1/+1
| | | | More betterer.
* manpage: update --lavfi-complex descriptionwm42017-08-171-4/+7
|
* vo_opengl: remove redundant #defines in unsharp_hookNiklas Haas2017-08-171-3/+0
| | | | These are no longer valid anyway, and the code doesn't use them.
* audio: fix build on Libavwm42017-08-161-0/+1
| | | | Sigh...
* audio: introduce a new type to hold audio frameswm42017-08-1620-140/+706
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is pretty pointless, but I believe it allows us to claim that the new code is not affected by the copyright of the old code. This is needed, because the original mp_audio struct was written by someone who has disagreed with LGPL relicensing (it was called af_data at the time, and was defined in af.h). The "GPL'ed" struct contents that surive are pretty trivial: just the data pointer, and some metadata like the format, samplerate, etc. - but at least in this case, any new code would be extremely similar anyway, and I'm not really sure whether it's OK to claim different copyright. So what we do is we just use AVFrame (which of course is LGPL with 100% certainty), and add some accessors around it to adapt it to mpv conventions. Also, this gets rid of some annoying conventions of mp_audio, like the struct fields that require using an accessor to write to them anyway. For the most part, this change is only dumb replacements of mp_audio related functions and fields. One minor actual change is that you can't allocate the new type on the stack anymore. Some code still uses mp_audio. All audio filter code will be deleted, so it makes no sense to convert this code. (Audio filters which are LGPL and which we keep will have to be ported to a new filter infrastructure anyway.) player/audio.c uses it because it interacts with the old filter code. push.c has some complex use of mp_audio and mp_audio_buffer, but this and pull.c will most likely be rewritten to do something else.
* vo_opengl: extract non-ANGLE specific D3D11 codeJames Ross-Gowan2017-08-174-232/+490
| | | | | | | | | | | | This extracts non-ANGLE specific code to d3d11_helpers.c, which is modeled after egl_helpers.c. Currently the only consumer is context_angle.c, but in future this may allow the D3D11 device and swapchain creation logic to be reused in other backends. Also includes small improvements to D3D11 device creation. It is now possible to create feature level 11_1 devices (though ANGLE does not support these,) and BGRA swapchains, which might be slightly more efficient than ARGB, since its the same format used by the compositor.
* img_format: #if -> #ifdefwm42017-08-161-1/+1
| | | | Oops.
* TOOLS/autoload.lua: implement natural sortingRicardo Constantino2017-08-161-9/+32
|
* x11: use xdg-screensaver suspend/resumewm42017-08-152-40/+65
| | | | | | If it doesn't work this time, I'll remove all X11 screensaver code. Fixes #4763.
* vo_rpi: fix operationwm42017-08-154-5/+17
| | | | Commit 697c4389a9e6 worked "almost". I couldn't test it at the time.
* vo_opengl: fix incorrect glBindFramebuffer() callwm42017-08-151-1/+1
| | | | Used the wrong binding.
* vo_opengl: fix dangling pointers when VAOs are not availablewm42017-08-152-4/+4
| | | | | | | | | | This is for legacy GL: if VAOs are not available, the helper has to specify vertex attributes again on every rendering. gl_vao_init() keeps the vertex array for this purpose. Unfortunately, a temporary argument was passed to the function, instead of the permanent copy. Also, it didn't use num_entries (instead expected the array being terminated by a {0} entry). Fix that source code indentation too.
* Revert "build: rpi: rely on pkgconfig for compiler flags"wm42017-08-152-23/+22
| | | | | | | | | This reverts commit ea40fa36eef15384b4c0218fb102f92f5cd1cdff. This caused strange runtime failure on Raspbian (when running mpv, vc_dispmanx_display_open() returned 0, while other dispmanx using programs were fine). The problem must have been something about the compiler flags, maybe linking order or set of include paths.
* img_format: better exclusion of bayer formatswm42017-08-151-0/+5
| | | | | | | These are useless and shouldn't be confused with normal RGB formats. Replace the earlier hack checking the format name with a proper check. (Not sure when this flag was added. Libav won't have it anyway, but also no bayer formats.)
* vo_opengl: support float pixel formatswm42017-08-153-7/+67
| | | | Like AV_PIX_FMT_GBRPF32LE.
* options: change --loop semanticswm42017-08-143-7/+7
| | | | As announced by the previous deprecation.
* vo_opengl: remove DR image layouting code to rendererwm42017-08-143-26/+31
| | | | No reason to have it in a higher level.
* player: make refresh seeks slightly more robustwm42017-08-146-33/+40
| | | | | | | | | | | | | | | | | | | | | | Refresh seeks are automatically issued when changing filters, which improves user experience if these filters change buffering or such. The refresh seek could actually overwrite a previously ongoing seek: set pause yes set time-pos 10 set vf "" Here, the video code issued a refresh seek to the previous video position, which could be different from the previously triggered (and still ongoing) seek, this overwriting the seek. Factor all refresh seek handling into a new function, and make it handle ongoing seeks correctly. Remove the weird new canonical_pts field, which actually had no use. Fixes #4757.
* player: do not destroy VO immediately if there is no video trackwm42017-08-141-1/+0
| | | | | | | | | | | Commit f1d161d55f45 accidentally added the handle_force_window() call if no track is selected. This was OK, but breaks something like "mpv *", where some files are not playable (like subtitle files) - the unplayable files would remove and recreate the VO window, which is annoying. Just drop the call again.
* vo_opengl: hwdec_vdpau: use correct source texture sizewm42017-08-141-42/+45
| | | | | | | | | | | | | | | | In commit c6fafbffaca1 we accidentally set the logical texture size to the cropped video size, which is not correct. This caused rendering artifacts in some cases. Use the video surfaces size instead. Since the current mp_image_params contains the cropped size only, wrapper texture creation has to be moved to the _map function. Move the same code for the mixer case (strictly speaking this is not needed, but seems more symmetric). (Also there is no need to clear gl_textures on uninit - leftover from the old hwdec mapper API. So we just drop that part.) Fixes #4760.
* player: add --track-auto-selection optionwm42017-08-125-2/+19
| | | | I imagine this is useful. Or maybe it isn't.
* player: fix another audio resync issuewm42017-08-121-1/+1
| | | | | | | | | | | This oddly triggers bogus EOF when switching filter graphs between two audio files (in this case, "[vid1]f[vo];[aid2]f[ao]"->"[aid1]f[ao]", with aid2 being an external audio source). This commit also fixes desync when seeking with an external file connected via --lavfi-complex. (Yes, the audio resync code is cursed.)
* player: make --lavfi-complex changeable at runtimewm42017-08-1211-99/+188
| | | | | | | | Tends to be somewhat glitchy if subtitles are enabled, and you enable and disable tracks. On error, this will disable --lavfi-complex, which will result in whatever behavior.
* af_lavrresample: don't call swr_set_compensation() unless necessarywm42017-08-121-5/+9
| | | | | | | | | | | | | | This was _always_ called, even if the resampling was static, or the filter was inserted for format conversion only. This should have been fine, as I expected the function not to enable resampling when the compensation is unset, and the source/target rates are the same. But this is not the case, and it always enables resampling. So explicitly avoid the call. If we have already called it successfully, it's better not do avoid it (to overwrite the previous compensation value), but it will also be cheap/no-op then. Probably fixes #4716.
* vo_opengl: hwdec_ios: fix buildwm42017-08-111-1/+1
|
* player: fix --lavfi-complex freezewm42017-08-114-9/+13
| | | | | | | | | | | | | | | | | | | Commit 0e0b87b6f3297 fixed that dropped packets did not trigger further work correctly. But it also made trivial --lavfi-complex freeze. The reason is that the meaning if DATA_AGAIN was overloaded: the decoders meant that they should be called again, while lavfi.c meant that other outputs needed to be checked again. Rename the latter meaning to DATA_STARVE, which means that the current input will deliver no more data, until "other" work has been done (like reading other outputs, or feeding input). The decoders never return DATA_STARVE, because they don't get input from the player core (instead, they get it from the demuxer directly, which is why they still can return DATA_WAIT). Also document the DATA_* semantics in the enum. Fixes #4746.
* vo_opengl: remove some dead codewm42017-08-112-187/+0
| | | | | These were replaced by ra equivalents, and with the recent changes, all of them became fully unused.
* vo_opengl: handle probing GL texture formats betterwm42017-08-114-36/+46
| | | | | | | | | | | | | | | | | | Retrieve the depth for each component and internal texture format separately. Only for 8 bit per component textures we assume that all bits are used (or else we would in my opinion create too many probe textures). Assuming 8 bit components are always correct also fixes operation in GLES3, where we assumed that each component had -1 bits depth, and this all UNORM formats were considered unusable. On GLES, the function to check the real bit depth is not available. Since GLES has no 16 bit UNORM textures at all, except with the MPGL_CAP_EXT16 extension, just drop the special condition for it. (Of course GLES still manages to introduce a funny special case by allowing GL_LUMINANCE , but not defining GL_TEXTURE_LUMINANCE_SIZE.) Should fix #4749.
* vo_opengl: remove another unneeded GL includewm42017-08-112-1/+7
| | | | Getting mp_pass_perf seriously requires including vo.h???
* rpi: fix buildwm42017-08-116-59/+63
| | | | | | | | | | | Runtime untested, because I get this: [vo/rpi] Could not get DISPMANX objects. This happened even when building older git versions, and on a RPI image that hasn't changed in the recent years. I don't know how to make this POS work again, so I guess if there's a bug in the new code, it will remain broken.
* vo_opengl: move strictly private ra_gl structs to .c filewm42017-08-112-35/+35
| | | | So that nothing accidentally accesses these.
* man/mpv: document bd:// expected titles and title listRicardo Constantino2017-08-111-0/+5
|
* vo_opengl: remove some indirect GL header inclusions from core rendererwm42017-08-106-7/+4
|
* vo_opengl: separate hwdec context and mapping, port it to use rawm42017-08-1021-1139/+1429
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This does two separate rather intrusive things: 1. Make the hwdec context (which does initialization, provides the device to the decoder, and other basic state) and frame mapping (getting textures from a mp_image) separate. This is more flexible, and you could map multiple images at once. It will help removing some hwdec special-casing from video.c. 2. Switch all hwdec API use to ra. Of course all code is still GL specific, but in theory it would be possible to support other backends. The most important change is that the hwdec interop returns ra objects, instead of anything GL specific. This removes the last dependency on GL-specific header files from video.c. I'm mixing these separate changes because both requires essentially rewriting all the glue code, so better do them at once. For the same reason, this change isn't done incrementally. hwdec_ios.m is untested, since I can't test it. Apart from superficial mistakes, this also requires dealing with Apple's texture format fuckups: they force you to use GL_LUMINANCE[_ALPHA] instead of GL_RED and GL_RG. We also need to report the correct format via ra_tex to the renderer, which is done by find_la_variant(). It's unknown whether this works correctly. hwdec_rpi.c as well as vo_rpi.c are still broken. (I need to pull my RPI out of a dusty pile of devices and cables, so, later.)
* vo_opengl: hwdec_cuda: fix filtering modewm42017-08-091-1/+1
| | | | Probably explains quality issues in some cases.
* vo_opengl: shrink the hwdec overlay APIwm42017-08-093-25/+20
| | | | | Just remove one callback, and fold the functionality into the other one. RPI will still not compile, so the hwdec_rpi.c changes are untested.
* vd_lavc: fix device leak with copy-mode hwaccelswm42017-08-092-2/+4
| | | | | | | | | | | | Apparently this was broken by the "ctx->hwdec" check in the if condition guarding the destroy call, and "ctx->hwdec = NULL;" was moved up earlier, making this always dead code. This should probably be refcounted or so, although that could make it worse as well. For now, add a flag whether the device should be destroyed. Fixes #4735.
* vo_opengl: add a hack for Apple's broken iOS hwdec stuffwm42017-08-082-1/+11
| | | | | As seen in hwdec_ios.m, it insists on using the legacy luminance alpha formats for mapped textures.
* vo_opengl: go back to using GL_TIME_ELAPSEDNiklas Haas2017-08-082-16/+26
| | | | | | | | Less flexible than GL_TIMESTAMP but supported by more platforms. This will mean that nested queries have to be detected and silently omitted, but oh well. Not much use for them anyway. Fixes #4721.
* Revert "mp_image_pool: disallow adding read only frames"wm42017-08-081-6/+2
| | | | | | | | | | This reverts commit 0ce3dce03aaea3e777ebf68504d5afb3f5e3f9e1. We actually explicitly add read-only frames in some of the hwaccel code via mp_image_new_custom_ref(), which sets AV_BUFFER_FLAG_READONLY. It's probably better to keep it this way. Fixes #4652 (and some related issues with D3D).
* options: fix --includewm42017-08-081-0/+2
| | | | | | | | This is really obnoxious. --include parses into the default profile, but when used on the command line, it did never get applied. So we have to apply it when the exact conditions for this are met. Fixes #4673.
* demux_mkv: avoid an error message in a corner casewm42017-08-081-0/+1
| | | | | | | | If --demuxer-mkv-probe-start-time=no is used, and a seek is triggered on start, then cluster_start will be 0, and the packet reading code will print an error message about not finding valid data. This fixes itself since it invokes the resync code, but it's still pretty ugly. Avoid this by always initializing cluster_start.
* build: use main-fn-cocoa.c on OSXwm42017-08-081-1/+1
| | | | Broken by a434892208.
* player: fix confusion in audio resync codewm42017-08-081-2/+6
| | | | | | | | | | Just the audio resync code in its normal state: buggy. This time, AD_NO_PROGRESS was handled about the same as AD_WAIT. But it means the decoder didn't output data, even though input is still readily available. This happened in particular when the timeline code was used (potentially skipping many packets), and thus should fix #4688.
* player: fix --end with large valueswm42017-08-081-2/+5
| | | | | | Causea a simple integer overflow. Fixes #4650.
* vo_opengl: don't call glGetProgramBinary if GL_PROGRAM_BINARY_LENGTH==0wm42017-08-081-2/+4
| | | | Noticed in #4717, although the issue might be about something else.
* x11: drop xscrnsaver usewm42017-08-083-18/+1
| | | | | | | | | | | It's an ancient X11 protocol extension that apparently nobody uses anymore (desktop environments in particular have replaced it with equally bad protocols that require tons of dependencies). Users keep complaining about it being a required dependency. The impact is likely minimal to none. Fixes #4706 and other annoying people.
* build: fix dependencies for Cygwin environmentfeixm12017-08-082-3/+3
| | | | | This replaces previous commit with same intentions. This time, with proper formating (no tabs in code).
* vo_opengl: cosmetics to commentswm42017-08-081-5/+3
|
* player: readd smi subtitle extensionwm42017-08-081-1/+1
| | | | | | | Fixes #4626. Previously removed because the original smi entry was added by someone who did not agree to LGPL relicensing. I'm not sure if the original change was copyrightable, but this commit for sure does not fall under that author's copyright.
* ao_wasapi: remove old commentKevin Mitchell2017-08-071-1/+1
|
* ao_wasapi: reorganize wasapi.hKevin Mitchell2017-08-072-12/+8
| | | | | Remove dead declarations. Move macro only used in wasapi_utils.c closer to use. Rearrange declaration order.
* ao_wasapi: deduplicate wasapi sample format selectionKevin Mitchell2017-08-071-49/+40
|
* ao_wasapi: clean up find_formats logicKevin Mitchell2017-08-071-75/+45
| | | | | There were too many functions within functions, too much going on in if clauses and duplicated code. Fix it.
* ao_wasapi: return bool instead of HRESULT from thread_initKevin Mitchell2017-08-073-38/+48
| | | | |