Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* Re: [FFmpeg-devel] [FFmpeg-cvslog] avfilter/vsrc_ddagrab: add options for more control over output format fallback
       [not found] <20220813133523.0699C410513@natalya.videolan.org>
@ 2022-08-13 13:51 ` Gyan Doshi
  2022-08-13 14:16   ` Timo Rothenpieler
  0 siblings, 1 reply; 2+ messages in thread
From: Gyan Doshi @ 2022-08-13 13:51 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



On 2022-08-13 07:05 pm, Timo Rothenpieler wrote:
> ffmpeg | branch: master | Timo Rothenpieler <timo@rothenpieler.org> | Sun Aug  7 23:14:09 2022 +0200| [c469c3c3b18fbacd6ee0165573034d2a0408b83f] | committer: Timo Rothenpieler
>
> avfilter/vsrc_ddagrab: add options for more control over output format fallback
>
>> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c469c3c3b18fbacd6ee0165573034d2a0408b83f
> ---
>
>   libavfilter/version.h      |  2 +-
>   libavfilter/vsrc_ddagrab.c | 12 +++++++++---

doc/filters.texi update needed.

Regards,
Gyan

>   2 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/libavfilter/version.h b/libavfilter/version.h
> index fa67606495..f3c1964cac 100644
> --- a/libavfilter/version.h
> +++ b/libavfilter/version.h
> @@ -32,7 +32,7 @@
>   #include "version_major.h"
>   
>   #define LIBAVFILTER_VERSION_MINOR  46
> -#define LIBAVFILTER_VERSION_MICRO 102
> +#define LIBAVFILTER_VERSION_MICRO 103
>   
>   
>   #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
> diff --git a/libavfilter/vsrc_ddagrab.c b/libavfilter/vsrc_ddagrab.c
> index 252505b96d..00c72187ea 100644
> --- a/libavfilter/vsrc_ddagrab.c
> +++ b/libavfilter/vsrc_ddagrab.c
> @@ -98,6 +98,8 @@ typedef struct DdagrabContext {
>       int        offset_x;
>       int        offset_y;
>       int        out_fmt;
> +    int        allow_fallback;
> +    int        force_fmt;
>   } DdagrabContext;
>   
>   #define OFFSET(x) offsetof(DdagrabContext, x)
> @@ -117,6 +119,10 @@ static const AVOption ddagrab_options[] = {
>       { "x2bgr10",    "only output 10 Bit X2BGR10",        0,            AV_OPT_TYPE_CONST,      { .i64 = DXGI_FORMAT_R10G10B10A2_UNORM }, 0, INT_MAX, FLAGS, "output_fmt" },
>       { "16bit",      "only output default 16 Bit format", 0,            AV_OPT_TYPE_CONST,      { .i64 = DXGI_FORMAT_R16G16B16A16_FLOAT },0, INT_MAX, FLAGS, "output_fmt" },
>       { "rgbaf16",    "only output 16 Bit RGBAF16",        0,            AV_OPT_TYPE_CONST,      { .i64 = DXGI_FORMAT_R16G16B16A16_FLOAT },0, INT_MAX, FLAGS, "output_fmt" },
> +    { "allow_fallback", "don't error on fallback to default 8 Bit format",
> +                                                   OFFSET(allow_fallback), AV_OPT_TYPE_BOOL,   { .i64 = 0    },       0,       1, FLAGS },
> +    { "force_fmt",  "exclude BGRA from format list (experimental, discouraged by Microsoft)",
> +                                                   OFFSET(force_fmt),  AV_OPT_TYPE_BOOL,       { .i64 = 0    },       0,       1, FLAGS },
>       { NULL }
>   };
>   
> @@ -226,7 +232,7 @@ static av_cold int init_dxgi_dda(AVFilterContext *avctx)
>           } else if (dda->out_fmt) {
>               formats[0] = dda->out_fmt;
>               formats[1] = DXGI_FORMAT_B8G8R8A8_UNORM;
> -            nb_formats = 2;
> +            nb_formats = dda->force_fmt ? 1 : 2;
>           }
>   
>           IDXGIOutput_Release(dxgi_output);
> @@ -262,7 +268,7 @@ static av_cold int init_dxgi_dda(AVFilterContext *avctx)
>   #else
>       {
>   #endif
> -        if (dda->out_fmt && dda->out_fmt != DXGI_FORMAT_B8G8R8A8_UNORM) {
> +        if (dda->out_fmt && dda->out_fmt != DXGI_FORMAT_B8G8R8A8_UNORM && (!dda->allow_fallback || dda->force_fmt)) {
>               av_log(avctx, AV_LOG_ERROR, "Only 8 bit output supported with legacy API\n");
>               return AVERROR(ENOTSUP);
>           }
> @@ -733,7 +739,7 @@ static int ddagrab_config_props(AVFilterLink *outlink)
>       if (ret < 0)
>           return ret;
>   
> -    if (dda->out_fmt && dda->raw_format != dda->out_fmt) {
> +    if (dda->out_fmt && dda->raw_format != dda->out_fmt && (!dda->allow_fallback || dda->force_fmt)) {
>           av_log(avctx, AV_LOG_ERROR, "Requested output format unavailable.\n");
>           return AVERROR(ENOTSUP);
>       }
>
> _______________________________________________
> ffmpeg-cvslog mailing list
> ffmpeg-cvslog@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
>
> To unsubscribe, visit link above, or email
> ffmpeg-cvslog-request@ffmpeg.org with subject "unsubscribe".

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [FFmpeg-devel] [FFmpeg-cvslog] avfilter/vsrc_ddagrab: add options for more control over output format fallback
  2022-08-13 13:51 ` [FFmpeg-devel] [FFmpeg-cvslog] avfilter/vsrc_ddagrab: add options for more control over output format fallback Gyan Doshi
@ 2022-08-13 14:16   ` Timo Rothenpieler
  0 siblings, 0 replies; 2+ messages in thread
From: Timo Rothenpieler @ 2022-08-13 14:16 UTC (permalink / raw)
  To: ffmpeg-devel

On 13.08.2022 15:51, Gyan Doshi wrote:
> 
> 
> On 2022-08-13 07:05 pm, Timo Rothenpieler wrote:
>> ffmpeg | branch: master | Timo Rothenpieler <timo@rothenpieler.org> | 
>> Sun Aug  7 23:14:09 2022 +0200| 
>> [c469c3c3b18fbacd6ee0165573034d2a0408b83f] | committer: Timo Rothenpieler
>>
>> avfilter/vsrc_ddagrab: add options for more control over output format 
>> fallback
>>
>>> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c469c3c3b18fbacd6ee0165573034d2a0408b83f
>> ---
>>
>>   libavfilter/version.h      |  2 +-
>>   libavfilter/vsrc_ddagrab.c | 12 +++++++++---
> 
> doc/filters.texi update needed.

It's intentionally omitted for now, until the format is actually useful.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-13 14:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20220813133523.0699C410513@natalya.videolan.org>
2022-08-13 13:51 ` [FFmpeg-devel] [FFmpeg-cvslog] avfilter/vsrc_ddagrab: add options for more control over output format fallback Gyan Doshi
2022-08-13 14:16   ` Timo Rothenpieler

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