mirror of
https://github.com/mpv-player/mpv
synced 2025-03-24 12:22:25 +00:00
image_writer: improve format conversion logging
This commit is contained in:
parent
f41805081b
commit
8c751a0d78
@ -552,8 +552,10 @@ static int get_target_format(struct image_writer_ctx *ctx)
|
|||||||
int srcfmt = ctx->original_format.id;
|
int srcfmt = ctx->original_format.id;
|
||||||
|
|
||||||
int target = get_encoder_format(codec, srcfmt, ctx->opts->high_bit_depth);
|
int target = get_encoder_format(codec, srcfmt, ctx->opts->high_bit_depth);
|
||||||
if (!target)
|
if (!target) {
|
||||||
|
mp_dbg(ctx->log, "Falling back to high-depth format.\n");
|
||||||
target = get_encoder_format(codec, srcfmt, true);
|
target = get_encoder_format(codec, srcfmt, true);
|
||||||
|
}
|
||||||
|
|
||||||
if (!target)
|
if (!target)
|
||||||
goto unknown;
|
goto unknown;
|
||||||
@ -649,7 +651,7 @@ static struct mp_image *convert_image(struct mp_image *image, int destfmt,
|
|||||||
if (mp_image_params_equal(&p, &image->params))
|
if (mp_image_params_equal(&p, &image->params))
|
||||||
return mp_image_new_ref(image);
|
return mp_image_new_ref(image);
|
||||||
|
|
||||||
mp_dbg(log, "Will convert image to %s\n", mp_imgfmt_to_name(p.imgfmt));
|
mp_dbg(log, "will convert image to %s\n", mp_imgfmt_to_name(p.imgfmt));
|
||||||
|
|
||||||
struct mp_image *src = image;
|
struct mp_image *src = image;
|
||||||
if (mp_image_crop_valid(&src->params) &&
|
if (mp_image_crop_valid(&src->params) &&
|
||||||
@ -700,6 +702,8 @@ bool write_image(struct mp_image *image, const struct image_writer_opts *opts,
|
|||||||
if (!opts)
|
if (!opts)
|
||||||
opts = &defs;
|
opts = &defs;
|
||||||
|
|
||||||
|
mp_dbg(log, "input: %s\n", mp_image_params_to_str(&image->params));
|
||||||
|
|
||||||
struct image_writer_ctx ctx = { log, opts, image->fmt };
|
struct image_writer_ctx ctx = { log, opts, image->fmt };
|
||||||
bool (*write)(struct image_writer_ctx *, mp_image_t *, const char *) = write_lavc;
|
bool (*write)(struct image_writer_ctx *, mp_image_t *, const char *) = write_lavc;
|
||||||
int destfmt = 0;
|
int destfmt = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user