aboutsummaryrefslogtreecommitdiffhomepage
path: root/video
Commit message (Collapse)AuthorAge
* vo_opengl: don't discard buffered video on redundant resize callsGravatar wm42017-08-29
| | | | | | | | | | If a VO-area option changes, gl_video_resize() is called unconditionally. This function does something even if the size does not change (at least it discards buffered frames for interpolation), which can lead to stutter when you keep firing option change events during playback. Check for an actual resize, and if nothing changes, exit early.
* vo_opengl: don't assume imgfmt=0 is validGravatar wm42017-08-29
| | | | | | Could cause a crash if anything called ra_get_imgfmt_desc(imgfmt=0). Let it fail correctly. This can happen if a hwdec backend does not set hw_subfmt correctly.
* vo_opengl: fix the renderpass target format at creation timeGravatar Niklas Haas2017-08-27
| | | | Required for vulkan.
* vo_opengl: fix misleading comment in ra.hGravatar Niklas Haas2017-08-27
| | | | tex_upload is not just for buffers
* vo_opengl: use UBOs where supported/requiredGravatar Niklas Haas2017-08-27
| | | | | | | | | | | | This also introduces RA_CAP_GLOBAL_UNIFORM. If this is not set, UBOs *must* be used for non-bindings. Currently the cap is ignored though, and the shader_cache *always* generates UBO-using code where it can. Could be made an option in principle. Only enabled for drivers new enough to support explicit UBO offsets, just in case... No change to performance, which is probably what we expect.
* vo_opengl: add support for UBOsGravatar Niklas Haas2017-08-27
| | | | | Not actually used by anything yet, but straightforward enough to add to the RA API for starters.
* vo_opengl: clarify RA_CAP_DIRECT_UPLOADGravatar Niklas Haas2017-08-27
| | | | | | This no longer concerns the API user except in as much as the API user probably wants to know whether or not PBOs are active, so keep around the CAP field even though it's mostly useless now.
* vo_opengl: refactor shader_cache bindingGravatar Niklas Haas2017-08-27
| | | | | There's no reason to be needlessly wasteful with our binding points here. Just add a CAP for it.
* vo_opengl: be explicit about IMG_RWGravatar Niklas Haas2017-08-27
| | | | | | | | | | | | Both vulkan and opengl distinguish between rendering to an image and using an image as a storage attachment. So make this an explicit capability instead of lumping it in with render_dst. (That way we could support, for example, using an image as a storage attachment without requiring a framebuffer) The real reason for this change is that you can directly use the output FBO as a storage attachment on vulkan but you can't on opengl, which makes this param structly separate from render_dst.
* vo_opengl: use size_t offset for vertex offsetsGravatar Niklas Haas2017-08-27
| | | | | | | | I don't like the feeling of "reusing" the int binding for this. It feels... wrong, somehow. I'd prefer to use an explicit "offset" field. (Plus, I might re-use this for uniform buffers or something) YMMV
* mp_image: include config.h directlyGravatar James Ross-Gowan2017-08-26
| | | | | | | | | This is needed for HAVE_SSE4_INTRINSICS. config.h used to be included as a transitive dependency of vf.h, but the include statement was removed from vf.h in 8f2ccba71bb4. Also silence an unused variable warning that was introduced in the same commit.
* vo_opengl: allow selection of true 32 bit float if float16 unavailableGravatar wm42017-08-24
| | | | | Shouldn't make a difference for OpenGL (even with the weird duplication of these functions removed). Might be useful for the WIP vulkan backend.
* vd_lavc: work around some more idiotic FFmpeg nonsenseGravatar wm42017-08-24
| | | | | | Like in commit bd356333c713, but for the other hwaccels as well. Fixes #4794.
* vd_lavc: fix mid-stream hwdec fallbackGravatar wm42017-08-23
| | | | | | Not resetting hwdec_request_reinit caused it to flush on every packet, which not only caused it to fail triggering the actual fallback, and let it never decode a new frame, but also to get stuck on EOF.
* video: change --deinterlace behaviorGravatar wm42017-08-22
| | | | | | | | | | | | This removes all GPL only code from it, and that's the whole purpose. Also happens to be much simpler. The "deinterlace" option still sort of exists, but only as runtime changeable option. The main change in behavior is that the property will not report back the actual deint state. Or in other words, if inserting or initializing the filter fails, the deinterlace property will still return "yes". This is in line with most recent behavior changes to properties and options.
* vo_direct3d: fix buildGravatar wm42017-08-22
| | | | Broken by previous commit. Fix completely untested.
* video: redo video equalizer option handlingGravatar wm42017-08-22
| | | | | | | | | | | | | | | | | | | | | | | I really wouldn't care much about this, but some parts of the core code are under HAVE_GPL, so there's some need to get rid of it. Simply turn the video equalizer from its current fine-grained handling with vf/vo fallbacks into global options. This makes updating them much simpler. This removes any possibility of applying video equalizers in filters, which affects vf_scale, and the previously removed vf_eq. Not a big loss, since the preferred VOs have this builtin. Remove video equalizer handling from vo_direct3d, vo_sdl, vo_vaapi, and vo_xv. I'm not going to waste my time on these legacy VOs. vo.eq_opts_cache exists _only_ to send a VOCTRL_SET_EQUALIZER, which exists _only_ to trigger a redraw. This seems silly, but for now I feel like this is less of a pain. The rest of the equalizer using code is self-updating. See commit 96b906a51d5 for how some video equalizer code was GPL only. Some command line option names and ranges can probably be traced back to a GPL only committer, but we don't consider these copyrightable.
* vf_eq: remove this filterGravatar wm42017-08-22
| | | | | | | | | Both the video equalizer command/option glue, which drives this filter, as well as the filter itself are slightly GPL contaminated. So it goes. After this commit, "--vf=eq" will actually use libavfilter's vf_eq (if FFmpeg was compiled in GPL mode), but it has different options and will not listen to the equalizer VOCTRLs.
* options: add a thread-safe way to notify option updatesGravatar wm42017-08-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, we had a thread-safe way to read options, but no option update notification mechanism. Everything was funneled though the main thread's central mp_option_change_callback() function. For example, if the panscan options were changed, the function called vo_control() with VOCTRL_SET_PANSCAN to manually notify the VO thread of updates. This worked, but's pretty inconvenient. Most of these problems come from the fact that MPlayer was written as a single-threaded program. This commit works towards a more flexible mechanism. It adds an update callback to m_config_cache (the thing that is already used for thread-safe access of global options). This alone would still be rather inconvenient, at least in context of VOs. Add another mechanism on top of it that uses mp_dispatch_queue, and takes care of some annoying synchronization issues. We extend mp_dispatch_queue itself to make this easier and slightly more efficient. As a first application, use this to reimplement certain VO scaling and renderer options. The update_opts() function translates these to the "old" VOCTRLs, though. An annoyingly subtle issue is that m_config_cache's destructor now releases pending notifications, and must be released before the associated dispatch queue. Otherwise, it could happen that option updates during e.g. VO destruction queue or run stale entries, which is not expected. Rather untested. The singly-linked list code in dispatch.c is probably buggy, and I bet some aspects about synchronization are not entirely sane.
* vo_opengl: refactor tex_upload to ra_buf_poolGravatar Niklas Haas2017-08-22
| | | | | | | | | | Also refactors the usage of tex_upload to make ra_tex_upload_pbo a RA-internal thing again. ra_buf_pool has the main advantage of being dynamically sized depending on buf_poll, so for OpenGL we'll end up only using one buffer (when not persistently mapping) - while for vulkan we'll use as many as necessary, which depends on the swapchain depth anyway.
* x11: fix that window could be resized when using embeddingGravatar wm42017-08-21
| | | | | | | Somewhat lazy fix. The code isn't particularly robust or correct wrt. window embedding. Fixes #4784.
* video: add metadata handling for spherical videoGravatar wm42017-08-21
| | | | | | | | | | | | | | This adds handling of spherical video metadata: retrieving it from demux_lavf and demux_mkv, passing it through filters, and adjusting it with vf_format. This does not include support for rendering this type of video. We don't expect we need/want to support the other projection types like cube maps, so we don't include that for now. They can be added later as needed. Also raise the maximum sizes of stringified image params, since they can get really long.
* Revert "x11: drop xscrnsaver use"Gravatar Martin Herkt2017-08-20
| | | | | | | | | | | | | | This broke screensaver/powersave inhibition with at least KDE and LXDE. This is a release blocker. Since fdo, KDE and GNOME idiots seem to be unable to reach a consensus on a simple protocol, this seems unlikely to get fixed upstream this year, so revert this change. Fixes #4752. Breaks #4706 but I don’t give a damn. This reverts commit 3f75b3c3439241c209349908fa190c0382e44f05.
* Revert "x11: use xdg-screensaver suspend/resume"Gravatar Martin Herkt2017-08-20
| | | | This reverts commit 6694048272619b7f91d161c040b818ff63e65279.
* context_angle: remove unused variableGravatar James Ross-Gowan2017-08-20
| | | | Unused since 16e0a3948288.
* context_angle: replace hard-coded array sizeGravatar James Ross-Gowan2017-08-19
|
* osx: code cleanups and cosmetic fixesGravatar Akemi2017-08-18
| | | | silence build warnings, clean up code style and remove unused code.
* vo_opengl: allow texture uploads to failGravatar Niklas Haas2017-08-18
| | | | Surprisingly makes the code shorter, not longer
* vo_opengl: clarify the ra_fns.debug_markerGravatar Niklas Haas2017-08-18
|
* vo_opengl: refactor RA texture and buffer updatesGravatar Niklas Haas2017-08-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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 capabilityGravatar Niklas Haas2017-08-18
| | | | | | | | | 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 optionalGravatar Niklas Haas2017-08-18
|
* vo_opengl: remove redundant #defines in unsharp_hookGravatar Niklas Haas2017-08-17
| | | | These are no longer valid anyway, and the code doesn't use them.
* vo_opengl: extract non-ANGLE specific D3D11 codeGravatar James Ross-Gowan2017-08-17
| | | | | | | | | | | | 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 -> #ifdefGravatar wm42017-08-16
| | | | Oops.
* x11: use xdg-screensaver suspend/resumeGravatar wm42017-08-15
| | | | | | If it doesn't work this time, I'll remove all X11 screensaver code. Fixes #4763.
* vo_rpi: fix operationGravatar wm42017-08-15
| | | | Commit 697c4389a9e6 worked "almost". I couldn't test it at the time.
* vo_opengl: fix incorrect glBindFramebuffer() callGravatar wm42017-08-15
| | | | Used the wrong binding.
* vo_opengl: fix dangling pointers when VAOs are not availableGravatar wm42017-08-15
| | | | | | | | | | 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.
* img_format: better exclusion of bayer formatsGravatar wm42017-08-15
| | | | | | | 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 formatsGravatar wm42017-08-15
| | | | Like AV_PIX_FMT_GBRPF32LE.
* vo_opengl: remove DR image layouting code to rendererGravatar wm42017-08-14
| | | | No reason to have it in a higher level.
* vo_opengl: hwdec_vdpau: use correct source texture sizeGravatar wm42017-08-14
| | | | | | | | | | | | | | | | 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.
* vo_opengl: hwdec_ios: fix buildGravatar wm42017-08-11
|
* vo_opengl: remove some dead codeGravatar wm42017-08-11
| | | | | These were replaced by ra equivalents, and with the recent changes, all of them became fully unused.
* vo_opengl: handle probing GL texture formats betterGravatar wm42017-08-11
| | | | | | | | | | | | | | | | | | 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 includeGravatar wm42017-08-11
| | | | Getting mp_pass_perf seriously requires including vo.h???
* rpi: fix buildGravatar wm42017-08-11
| | | | | | | | | | | 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 fileGravatar wm42017-08-11
| | | | So that nothing accidentally accesses these.
* vo_opengl: remove some indirect GL header inclusions from core rendererGravatar wm42017-08-10
|