diff options
author | wm4 <wm4@nowhere> | 2018-02-07 20:18:36 +0100 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-02-11 17:45:51 -0800 |
commit | 9f595f3a80eeaa0bfbda5702031f054f684f6123 (patch) | |
tree | 0667e6e7ab4c64dcfd28aa23e10690e1776a6f03 /video/image_writer.h | |
parent | 7b1e73139f73f446a472782e1465040c0e6b16dd (diff) |
vo_gpu: make screenshots use the GL renderer
Using the GL renderer for color conversion will make sure screenshots
will use the same conversion as normal video rendering. It can do this
for all types of screenshots.
The logic when to write 16 bit PNGs changes. To approximate the old
behavior, we decide by looking whether the source video format has more
than 8 bits per component. We apply this logic even for window
screenshots. Also, 16 bit PNGs now always include an unused alpha
channel. The reason is that FFmpeg has RGB48 and RGBA64 formats, but no
RGB064. RGB48 is 3 bytes and usually not supported by GPUs for
rendering, so we have to use RGBA64, which forces an alpha channel.
Will break for users who use --target-trc and similar options.
I considered creating a new gl_video context, but it could double GPU
memory use, so I didn't.
This uses FBOs instead of glGetTexImage(), because that increases the
chance it could work on GLES (e.g. ANGLE). Untested. No support for the
Vulkan and D3D11 backends yet.
Fixes #5498. Also fixes #5240, because the code for reading back is not
used with the new code path.
Diffstat (limited to 'video/image_writer.h')
-rw-r--r-- | video/image_writer.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/video/image_writer.h b/video/image_writer.h index 7f7f123499..98cb95a898 100644 --- a/video/image_writer.h +++ b/video/image_writer.h @@ -42,6 +42,9 @@ extern const struct m_option image_writer_opts[]; // Return the file extension that will be used, e.g. "png". const char *image_writer_file_ext(const struct image_writer_opts *opts); +// Return whether the selected format likely supports >8 bit per component. +bool image_writer_high_depth(const struct image_writer_opts *opts); + // Map file extension to format ID - return 0 (which is invalid) if unknown. int image_writer_format_from_ext(const char *ext); |