diff options
author | wm4 <wm4@nowhere> | 2012-10-26 19:29:47 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-11-01 02:07:45 +0100 |
commit | 738aeb1c60c6ffe95e915e443598f8a51081bdfb (patch) | |
tree | c10472cd8e646344d0d5e2bf1644adcb002c424a /image_writer.c | |
parent | 9ba52ea6efd41db9dbd08311380f7fa633e22aa2 (diff) | |
download | mpv-738aeb1c60c6ffe95e915e443598f8a51081bdfb.tar.bz2 mpv-738aeb1c60c6ffe95e915e443598f8a51081bdfb.tar.xz |
screenshot: let VOs pass colorspace information via mp_image
This removes the hack that screenshot_save() got the colorspace
information from the decoder. Instead, require the VOs to set the
colorspace information on the mp_images used to pass around the
screenshot data. This is more correct, as the image may have been
converted/modified in the video filter chain, although there's
nothing yet in the video filter chain which does this correctly.
Diffstat (limited to 'image_writer.c')
-rw-r--r-- | image_writer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/image_writer.c b/image_writer.c index 82afeb0e48..f449b5c617 100644 --- a/image_writer.c +++ b/image_writer.c @@ -41,7 +41,6 @@ #include "libmpcodecs/sws_utils.h" #include "libmpcodecs/vf.h" -#include "libvo/csputils.h" #include "m_option.h" @@ -260,8 +259,8 @@ const char *image_writer_file_ext(const struct image_writer_opts *opts) return get_writer(opts)->file_ext; } -int write_image(struct mp_image *image, const struct mp_csp_details *csp, - const struct image_writer_opts *opts, const char *filename) +int write_image(struct mp_image *image, const struct image_writer_opts *opts, + const char *filename) { struct mp_image *allocated_image = NULL; struct image_writer_opts defs = image_writer_opts_defaults; @@ -286,6 +285,7 @@ int write_image(struct mp_image *image, const struct mp_csp_details *csp, // Caveat: - no colorspace/levels conversion done if pixel formats equal // - RGB->YUV assumes BT.601 + // - color levels broken in various ways thanks to libswscale if (image->imgfmt != destfmt || is_anamorphic) { struct mp_image hack = *image; hack.w = hack.width; |