* RE: [PATCH v2 2/3] avcodec/dvbsub: don't dump images to disk based on DEBUG define
[not found] ` <514006579dd00b11767a8b3ec70a3448cff26f78.1639943578.git.ffmpegagent@gmail.com>
@ 2021-12-19 19:54 ` Soft Works
0 siblings, 0 replies; 3+ messages in thread
From: Soft Works @ 2021-12-19 19:54 UTC (permalink / raw)
To: ffmpegdev
> -----Original Message-----
> From: ffmpegagent <ffmpegagent@gmail.com>
> Sent: Sunday, December 19, 2021 8:53 PM
> To: softworkz@hotmail.com
> Cc: softworkz <softworkz@hotmail.com>; softworkz <softworkz@hotmail.com>
> Subject: [PATCH v2 2/3] avcodec/dvbsub: don't dump images to disk based on
> DEBUG define
>
> From: softworkz <softworkz@hotmail.com>
>
> It's been a regular annoyance.
> Introduce a debug-only parameter for this.
>
> Signed-off-by: softworkz <softworkz@hotmail.com>
> ---
> libavcodec/dvbsubdec.c | 16 +++++++++++-----
> 1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
> index bc741a1de6..8db9963fda 100644
> --- a/libavcodec/dvbsubdec.c
> +++ b/libavcodec/dvbsubdec.c
> @@ -137,6 +137,9 @@ typedef struct DVBSubContext {
>
> DVBSubRegionDisplay *display_list;
> DVBSubDisplayDefinition *display_definition;
> +#ifdef DEBUG
> + int dump_imgs;
> +#endif
> } DVBSubContext;
>
>
> @@ -1534,11 +1537,11 @@ static int save_display_set(DVBSubContext *ctx)
>
> }
>
> - snprintf(filename, sizeof(filename), "dvbs.%d", fileno_index);
> -
> - png_save(ctx, filename, pbuf, width, height);
> -
> - av_freep(&pbuf);
> + if (ctx->dump_imgs) {
> + snprintf(filename, sizeof(filename), "dvbs.%d", fileno_index);
> + png_save(ctx, filename, pbuf, width, height);
> + av_freep(&pbuf);
> + }
> }
This is disgusting. Totally unacceptable.
>
> fileno_index++;
> @@ -1730,6 +1733,9 @@ static const AVOption options[] = {
> {"compute_edt", "compute end of time using pts or timeout",
> OFFSET(compute_edt), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DS},
> {"compute_clut", "compute clut when not available(-1) or only once (-2)
> or always(1) or never(0)", OFFSET(compute_clut), AV_OPT_TYPE_BOOL, {.i64 = -
> 1}, -2, 1, DS},
> {"dvb_substream", "", OFFSET(substream), AV_OPT_TYPE_INT, {.i64 = -1}, -
> 1, 63, DS},
> +#ifdef DEBUG
> + { "dump_imgs", "Dump subtitle images to disk", OFFSET(dump_imgs),
> AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, DS},
> +#endif
> {NULL}
> };
> static const AVClass dvbsubdec_class = {
> --
> gitgitgadget
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH v2 1/3] avcodec/dvdsub: don't dump images to disk based on DEBUG define
[not found] ` <21c1b20d25b1331b8c3fc39cb48038968d9c162f.1639943578.git.ffmpegagent@gmail.com>
@ 2021-12-20 0:02 ` Soft Works
0 siblings, 0 replies; 3+ messages in thread
From: Soft Works @ 2021-12-20 0:02 UTC (permalink / raw)
To: ffmpegdev
> -----Original Message-----
> From: ffmpegagent <ffmpegagent@gmail.com>
> Sent: Sunday, December 19, 2021 8:53 PM
> To: softworkz@hotmail.com
> Cc: softworkz <softworkz@hotmail.com>; softworkz <softworkz@hotmail.com>
> Subject: [PATCH v2 1/3] avcodec/dvdsub: don't dump images to disk based on
> DEBUG define
>
> From: softworkz <softworkz@hotmail.com>
>
> It's been a regular annoyance.
> Introduce a debug-only parameter for this.
>
> Signed-off-by: softworkz <softworkz@hotmail.com>
> ---
> libavcodec/dvdsubdec.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
> index 52259f0730..c0f796068e 100644
> --- a/libavcodec/dvdsubdec.c
> +++ b/libavcodec/dvdsubdec.c
> @@ -44,6 +44,7 @@ typedef struct DVDSubContext
> uint8_t used_color[256];
> #ifdef DEBUG
> int sub_id;
> + int dump_imgs;
> #endif
> } DVDSubContext;
>
> @@ -597,8 +598,9 @@ static int dvdsub_decode(AVCodecContext *avctx,
> ff_dlog(NULL, "start=%d ms end =%d ms\n",
> sub->start_display_time,
> sub->end_display_time);
> - ppm_save(ppm_name, sub->rects[0]->data[0],
> - sub->rects[0]->w, sub->rects[0]->h, (uint32_t*) sub->rects[0]-
> >data[1]);
> + if (ctx->dump_imgs)
> + ppm_save(ppm_name, sub->rects[0]->data[0],
> + sub->rects[0]->w, sub->rects[0]->h, (uint32_t*) sub-
> >rects[0]->data[1]);
> }
> #endif
>
> @@ -745,6 +747,9 @@ static const AVOption options[] = {
> { "palette", "set the global palette", OFFSET(palette_str),
> AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, SD },
No way, that's totally unacceptable. NACK NACK, Veto.
> { "ifo_palette", "obtain the global palette from .IFO file",
> OFFSET(ifo_str), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, SD },
> { "forced_subs_only", "Only show forced subtitles",
> OFFSET(forced_subs_only), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, SD},
> +#ifdef DEBUG
> + { "dump_imgs", "Dump subtitle images to disk", OFFSET(dump_imgs),
> AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, SD},
> +#endif
> { NULL }
> };
> static const AVClass dvdsub_class = {
> --
> gitgitgadget
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH v2 0/3] Don't dump images to disk based on DEBUG define
[not found] ` <pull.9.v2.ffstaging.FFmpeg.1639943578.ffmpegagent@gmail.com>
[not found] ` <514006579dd00b11767a8b3ec70a3448cff26f78.1639943578.git.ffmpegagent@gmail.com>
[not found] ` <21c1b20d25b1331b8c3fc39cb48038968d9c162f.1639943578.git.ffmpegagent@gmail.com>
@ 2021-12-20 0:10 ` Soft Works
2 siblings, 0 replies; 3+ messages in thread
From: Soft Works @ 2021-12-20 0:10 UTC (permalink / raw)
To: ffmpegdev
> -----Original Message-----
> From: ffmpegagent <ffmpegagent@gmail.com>
> Sent: Sunday, December 19, 2021 8:53 PM
> To: softworkz@hotmail.com
> Cc: softworkz <softworkz@hotmail.com>
> Subject: [PATCH v2 0/3] Don't dump images to disk based on DEBUG define
>
> It's been a regular annoyance. Introduce a debug-only parameter for this.
>
> softworkz (3):
> avcodec/dvdsub: don't dump images to disk based on DEBUG define
> avcodec/dvbsub: don't dump images to disk based on DEBUG define
> avcodec/dvbsub: creating a new commit to test patchset versioning
>
> libavcodec/dvbsubdec.c | 19 ++++++++++++++-----
> libavcodec/dvdsubdec.c | 9 +++++++--
> 2 files changed, 21 insertions(+), 7 deletions(-)
>
This is a reply to a cover letter message.
Thanks
> base-commit: 11aa9ca153d4446887ff3ebd26e5a3c243a19d80
> Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-
> 9%2Fsoftworkz%2Fdont_dump_subs-v2
> Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-
> 9/softworkz/dont_dump_subs-v2
> Pull-Request: https://github.com/ffstaging/FFmpeg/pull/9
>
> Range-diff vs v1:
>
> 1: 21c1b20d25 = 1: 21c1b20d25 avcodec/dvdsub: don't dump images to disk
> based on DEBUG define
> 2: 514006579d = 2: 514006579d avcodec/dvbsub: don't dump images to disk
> based on DEBUG define
> -: ---------- > 3: e82eb1ee58 avcodec/dvbsub: creating a new commit to
> test patchset versioning
>
> --
> gitgitgadget
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-20 0:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <pull.9.ffstaging.FFmpeg.1639943023.ffmpegagent@gmail.com>
[not found] ` <pull.9.v2.ffstaging.FFmpeg.1639943578.ffmpegagent@gmail.com>
[not found] ` <514006579dd00b11767a8b3ec70a3448cff26f78.1639943578.git.ffmpegagent@gmail.com>
2021-12-19 19:54 ` [PATCH v2 2/3] avcodec/dvbsub: don't dump images to disk based on DEBUG define Soft Works
[not found] ` <21c1b20d25b1331b8c3fc39cb48038968d9c162f.1639943578.git.ffmpegagent@gmail.com>
2021-12-20 0:02 ` [PATCH v2 1/3] avcodec/dvdsub: " Soft Works
2021-12-20 0:10 ` [PATCH v2 0/3] Don't " Soft Works
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git