Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/2] ffplay: add -scaling_quality option for SDL
@ 2024-05-30 21:36 Ramiro Polla
  2024-05-30 21:36 ` [FFmpeg-devel] [PATCH 2/2] ffplay: set default scaling_quality to "best" instead of "linear" Ramiro Polla
  2024-06-04 13:00 ` [FFmpeg-devel] [PATCH 1/2] ffplay: add -scaling_quality option for SDL Ramiro Polla
  0 siblings, 2 replies; 5+ messages in thread
From: Ramiro Polla @ 2024-05-30 21:36 UTC (permalink / raw)
  To: ffmpeg-devel

---
 doc/ffplay.texi  | 2 ++
 fftools/ffplay.c | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/doc/ffplay.texi b/doc/ffplay.texi
index 93f77eeece..60f883e159 100644
--- a/doc/ffplay.texi
+++ b/doc/ffplay.texi
@@ -72,6 +72,8 @@ as 100.
 Force format.
 @item -window_title @var{title}
 Set window title (default is the input filename).
+@item -scaling_quality @var{value}
+Set SDL_HINT_RENDER_SCALE_QUALITY value (default is "linear").
 @item -left @var{title}
 Set the x position for the left of the window (default is a centered window).
 @item -top @var{title}
diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index b9d11eecee..75d2bec777 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -351,6 +351,7 @@ static int filter_nbthreads = 0;
 static int enable_vulkan = 0;
 static char *vulkan_params = NULL;
 static const char *hwaccel = NULL;
+static const char *scaling_quality = NULL;
 
 /* current context */
 static int is_full_screen;
@@ -3683,6 +3684,7 @@ static const OptionDef options[] = {
     { "framedrop",          OPT_TYPE_BOOL,   OPT_EXPERT, { &framedrop }, "drop frames when cpu is too slow", "" },
     { "infbuf",             OPT_TYPE_BOOL,   OPT_EXPERT, { &infinite_buffer }, "don't limit the input buffer size (useful with realtime streams)", "" },
     { "window_title",       OPT_TYPE_STRING,          0, { &window_title }, "set window title", "window title" },
+    { "scaling_quality",    OPT_TYPE_STRING, OPT_EXPERT, { &scaling_quality }, "set SDL_HINT_RENDER_SCALE_QUALITY value (default=linear)", "value" },
     { "left",               OPT_TYPE_INT,    OPT_EXPERT, { &screen_left }, "set the x position for the left of the window", "x pos" },
     { "top",                OPT_TYPE_INT,    OPT_EXPERT, { &screen_top }, "set the y position for the top of the window", "y pos" },
     { "vf",                 OPT_TYPE_FUNC, OPT_FUNC_ARG | OPT_EXPERT, { .func_arg = opt_add_vfilter }, "set video filters", "filter_graph" },
@@ -3831,7 +3833,9 @@ int main(int argc, char **argv)
             }
         }
         window = SDL_CreateWindow(program_name, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, default_width, default_height, flags);
-        SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
+        if (!scaling_quality)
+            scaling_quality = "linear";
+        SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, scaling_quality);
         if (!window) {
             av_log(NULL, AV_LOG_FATAL, "Failed to create window: %s", SDL_GetError());
             do_exit(NULL);
-- 
2.39.2

_______________________________________________
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] 5+ messages in thread

* [FFmpeg-devel] [PATCH 2/2] ffplay: set default scaling_quality to "best" instead of "linear"
  2024-05-30 21:36 [FFmpeg-devel] [PATCH 1/2] ffplay: add -scaling_quality option for SDL Ramiro Polla
@ 2024-05-30 21:36 ` Ramiro Polla
  2024-06-04 13:00 ` [FFmpeg-devel] [PATCH 1/2] ffplay: add -scaling_quality option for SDL Ramiro Polla
  1 sibling, 0 replies; 5+ messages in thread
From: Ramiro Polla @ 2024-05-30 21:36 UTC (permalink / raw)
  To: ffmpeg-devel

These values are aliases in SDL, but "best" is a more intuitive name.
---
 doc/ffplay.texi  | 2 +-
 fftools/ffplay.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/ffplay.texi b/doc/ffplay.texi
index 60f883e159..e7ff62ae16 100644
--- a/doc/ffplay.texi
+++ b/doc/ffplay.texi
@@ -73,7 +73,7 @@ Force format.
 @item -window_title @var{title}
 Set window title (default is the input filename).
 @item -scaling_quality @var{value}
-Set SDL_HINT_RENDER_SCALE_QUALITY value (default is "linear").
+Set SDL_HINT_RENDER_SCALE_QUALITY value (default is "best").
 @item -left @var{title}
 Set the x position for the left of the window (default is a centered window).
 @item -top @var{title}
diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index 75d2bec777..6575ad14a7 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -3684,7 +3684,7 @@ static const OptionDef options[] = {
     { "framedrop",          OPT_TYPE_BOOL,   OPT_EXPERT, { &framedrop }, "drop frames when cpu is too slow", "" },
     { "infbuf",             OPT_TYPE_BOOL,   OPT_EXPERT, { &infinite_buffer }, "don't limit the input buffer size (useful with realtime streams)", "" },
     { "window_title",       OPT_TYPE_STRING,          0, { &window_title }, "set window title", "window title" },
-    { "scaling_quality",    OPT_TYPE_STRING, OPT_EXPERT, { &scaling_quality }, "set SDL_HINT_RENDER_SCALE_QUALITY value (default=linear)", "value" },
+    { "scaling_quality",    OPT_TYPE_STRING, OPT_EXPERT, { &scaling_quality }, "set SDL_HINT_RENDER_SCALE_QUALITY value (default=best)", "value" },
     { "left",               OPT_TYPE_INT,    OPT_EXPERT, { &screen_left }, "set the x position for the left of the window", "x pos" },
     { "top",                OPT_TYPE_INT,    OPT_EXPERT, { &screen_top }, "set the y position for the top of the window", "y pos" },
     { "vf",                 OPT_TYPE_FUNC, OPT_FUNC_ARG | OPT_EXPERT, { .func_arg = opt_add_vfilter }, "set video filters", "filter_graph" },
@@ -3834,7 +3834,7 @@ int main(int argc, char **argv)
         }
         window = SDL_CreateWindow(program_name, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, default_width, default_height, flags);
         if (!scaling_quality)
-            scaling_quality = "linear";
+            scaling_quality = "best";
         SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, scaling_quality);
         if (!window) {
             av_log(NULL, AV_LOG_FATAL, "Failed to create window: %s", SDL_GetError());
-- 
2.39.2

_______________________________________________
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] 5+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/2] ffplay: add -scaling_quality option for SDL
  2024-05-30 21:36 [FFmpeg-devel] [PATCH 1/2] ffplay: add -scaling_quality option for SDL Ramiro Polla
  2024-05-30 21:36 ` [FFmpeg-devel] [PATCH 2/2] ffplay: set default scaling_quality to "best" instead of "linear" Ramiro Polla
@ 2024-06-04 13:00 ` Ramiro Polla
  2024-06-10 19:04   ` Marton Balint
  1 sibling, 1 reply; 5+ messages in thread
From: Ramiro Polla @ 2024-06-04 13:00 UTC (permalink / raw)
  To: ffmpeg-devel

On Thu, May 30, 2024 at 11:36 PM Ramiro Polla <ramiro.polla@gmail.com> wrote:
>
> ---
>  doc/ffplay.texi  | 2 ++
>  fftools/ffplay.c | 6 +++++-
>  2 files changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/doc/ffplay.texi b/doc/ffplay.texi
> index 93f77eeece..60f883e159 100644
> --- a/doc/ffplay.texi
> +++ b/doc/ffplay.texi
> @@ -72,6 +72,8 @@ as 100.
>  Force format.
>  @item -window_title @var{title}
>  Set window title (default is the input filename).
> +@item -scaling_quality @var{value}
> +Set SDL_HINT_RENDER_SCALE_QUALITY value (default is "linear").
>  @item -left @var{title}
>  Set the x position for the left of the window (default is a centered window).
>  @item -top @var{title}
> diff --git a/fftools/ffplay.c b/fftools/ffplay.c
> index b9d11eecee..75d2bec777 100644
> --- a/fftools/ffplay.c
> +++ b/fftools/ffplay.c
> @@ -351,6 +351,7 @@ static int filter_nbthreads = 0;
>  static int enable_vulkan = 0;
>  static char *vulkan_params = NULL;
>  static const char *hwaccel = NULL;
> +static const char *scaling_quality = NULL;
>
>  /* current context */
>  static int is_full_screen;
> @@ -3683,6 +3684,7 @@ static const OptionDef options[] = {
>      { "framedrop",          OPT_TYPE_BOOL,   OPT_EXPERT, { &framedrop }, "drop frames when cpu is too slow", "" },
>      { "infbuf",             OPT_TYPE_BOOL,   OPT_EXPERT, { &infinite_buffer }, "don't limit the input buffer size (useful with realtime streams)", "" },
>      { "window_title",       OPT_TYPE_STRING,          0, { &window_title }, "set window title", "window title" },
> +    { "scaling_quality",    OPT_TYPE_STRING, OPT_EXPERT, { &scaling_quality }, "set SDL_HINT_RENDER_SCALE_QUALITY value (default=linear)", "value" },
>      { "left",               OPT_TYPE_INT,    OPT_EXPERT, { &screen_left }, "set the x position for the left of the window", "x pos" },
>      { "top",                OPT_TYPE_INT,    OPT_EXPERT, { &screen_top }, "set the y position for the top of the window", "y pos" },
>      { "vf",                 OPT_TYPE_FUNC, OPT_FUNC_ARG | OPT_EXPERT, { .func_arg = opt_add_vfilter }, "set video filters", "filter_graph" },
> @@ -3831,7 +3833,9 @@ int main(int argc, char **argv)
>              }
>          }
>          window = SDL_CreateWindow(program_name, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, default_width, default_height, flags);
> -        SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
> +        if (!scaling_quality)
> +            scaling_quality = "linear";
> +        SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, scaling_quality);
>          if (!window) {
>              av_log(NULL, AV_LOG_FATAL, "Failed to create window: %s", SDL_GetError());
>              do_exit(NULL);
> --
> 2.39.2
>

Can anyone comment on this? I had a few doubts on this patch:
- does the option name properly convey its functionality?
- is the documentation too terse?
- should we include the accepted values in the documentation, even
though they are sdl-specific?
_______________________________________________
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] 5+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/2] ffplay: add -scaling_quality option for SDL
  2024-06-04 13:00 ` [FFmpeg-devel] [PATCH 1/2] ffplay: add -scaling_quality option for SDL Ramiro Polla
@ 2024-06-10 19:04   ` Marton Balint
  2024-06-11 11:08     ` Ramiro Polla
  0 siblings, 1 reply; 5+ messages in thread
From: Marton Balint @ 2024-06-10 19:04 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



On Tue, 4 Jun 2024, Ramiro Polla wrote:

> On Thu, May 30, 2024 at 11:36 PM Ramiro Polla <ramiro.polla@gmail.com> wrote:
>>
>> ---
>>  doc/ffplay.texi  | 2 ++
>>  fftools/ffplay.c | 6 +++++-
>>  2 files changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/doc/ffplay.texi b/doc/ffplay.texi
>> index 93f77eeece..60f883e159 100644
>> --- a/doc/ffplay.texi
>> +++ b/doc/ffplay.texi
>> @@ -72,6 +72,8 @@ as 100.
>>  Force format.
>>  @item -window_title @var{title}
>>  Set window title (default is the input filename).
>> +@item -scaling_quality @var{value}
>> +Set SDL_HINT_RENDER_SCALE_QUALITY value (default is "linear").
>>  @item -left @var{title}
>>  Set the x position for the left of the window (default is a centered window).
>>  @item -top @var{title}
>> diff --git a/fftools/ffplay.c b/fftools/ffplay.c
>> index b9d11eecee..75d2bec777 100644
>> --- a/fftools/ffplay.c
>> +++ b/fftools/ffplay.c
>> @@ -351,6 +351,7 @@ static int filter_nbthreads = 0;
>>  static int enable_vulkan = 0;
>>  static char *vulkan_params = NULL;
>>  static const char *hwaccel = NULL;
>> +static const char *scaling_quality = NULL;
>>
>>  /* current context */
>>  static int is_full_screen;
>> @@ -3683,6 +3684,7 @@ static const OptionDef options[] = {
>>      { "framedrop",          OPT_TYPE_BOOL,   OPT_EXPERT, { &framedrop }, "drop frames when cpu is too slow", "" },
>>      { "infbuf",             OPT_TYPE_BOOL,   OPT_EXPERT, { &infinite_buffer }, "don't limit the input buffer size (useful with realtime streams)", "" },
>>      { "window_title",       OPT_TYPE_STRING,          0, { &window_title }, "set window title", "window title" },
>> +    { "scaling_quality",    OPT_TYPE_STRING, OPT_EXPERT, { &scaling_quality }, "set SDL_HINT_RENDER_SCALE_QUALITY value (default=linear)", "value" },
>>      { "left",               OPT_TYPE_INT,    OPT_EXPERT, { &screen_left }, "set the x position for the left of the window", "x pos" },
>>      { "top",                OPT_TYPE_INT,    OPT_EXPERT, { &screen_top }, "set the y position for the top of the window", "y pos" },
>>      { "vf",                 OPT_TYPE_FUNC, OPT_FUNC_ARG | OPT_EXPERT, { .func_arg = opt_add_vfilter }, "set video filters", "filter_graph" },
>> @@ -3831,7 +3833,9 @@ int main(int argc, char **argv)
>>              }
>>          }
>>          window = SDL_CreateWindow(program_name, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, default_width, default_height, flags);
>> -        SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
>> +        if (!scaling_quality)
>> +            scaling_quality = "linear";
>> +        SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, scaling_quality);
>>          if (!window) {
>>              av_log(NULL, AV_LOG_FATAL, "Failed to create window: %s", SDL_GetError());
>>              do_exit(NULL);
>> --
>> 2.39.2
>>
>
> Can anyone comment on this? I had a few doubts on this patch:
> - does the option name properly convey its functionality?
> - is the documentation too terse?
> - should we include the accepted values in the documentation, even
> though they are sdl-specific?

What is the benefit of having such option? I don't really see a strong use 
case for it. Also you want to propagate the scaling quality to placebo 
backend as well? Does it acutally make sense to do that?

Thanks,
Marton
_______________________________________________
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] 5+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/2] ffplay: add -scaling_quality option for SDL
  2024-06-10 19:04   ` Marton Balint
@ 2024-06-11 11:08     ` Ramiro Polla
  0 siblings, 0 replies; 5+ messages in thread
From: Ramiro Polla @ 2024-06-11 11:08 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Hi,

On Mon, Jun 10, 2024 at 9:04 PM Marton Balint <cus@passwd.hu> wrote:
> On Tue, 4 Jun 2024, Ramiro Polla wrote:
> > On Thu, May 30, 2024 at 11:36 PM Ramiro Polla <ramiro.polla@gmail.com> wrote:
> >>
> >> ---
> >>  doc/ffplay.texi  | 2 ++
> >>  fftools/ffplay.c | 6 +++++-
> >>  2 files changed, 7 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/doc/ffplay.texi b/doc/ffplay.texi
> >> index 93f77eeece..60f883e159 100644
> >> --- a/doc/ffplay.texi
> >> +++ b/doc/ffplay.texi
> >> @@ -72,6 +72,8 @@ as 100.
> >>  Force format.
> >>  @item -window_title @var{title}
> >>  Set window title (default is the input filename).
> >> +@item -scaling_quality @var{value}
> >> +Set SDL_HINT_RENDER_SCALE_QUALITY value (default is "linear").
> >>  @item -left @var{title}
> >>  Set the x position for the left of the window (default is a centered window).
> >>  @item -top @var{title}
> >> diff --git a/fftools/ffplay.c b/fftools/ffplay.c
> >> index b9d11eecee..75d2bec777 100644
> >> --- a/fftools/ffplay.c
> >> +++ b/fftools/ffplay.c
> >> @@ -351,6 +351,7 @@ static int filter_nbthreads = 0;
> >>  static int enable_vulkan = 0;
> >>  static char *vulkan_params = NULL;
> >>  static const char *hwaccel = NULL;
> >> +static const char *scaling_quality = NULL;
> >>
> >>  /* current context */
> >>  static int is_full_screen;
> >> @@ -3683,6 +3684,7 @@ static const OptionDef options[] = {
> >>      { "framedrop",          OPT_TYPE_BOOL,   OPT_EXPERT, { &framedrop }, "drop frames when cpu is too slow", "" },
> >>      { "infbuf",             OPT_TYPE_BOOL,   OPT_EXPERT, { &infinite_buffer }, "don't limit the input buffer size (useful with realtime streams)", "" },
> >>      { "window_title",       OPT_TYPE_STRING,          0, { &window_title }, "set window title", "window title" },
> >> +    { "scaling_quality",    OPT_TYPE_STRING, OPT_EXPERT, { &scaling_quality }, "set SDL_HINT_RENDER_SCALE_QUALITY value (default=linear)", "value" },
> >>      { "left",               OPT_TYPE_INT,    OPT_EXPERT, { &screen_left }, "set the x position for the left of the window", "x pos" },
> >>      { "top",                OPT_TYPE_INT,    OPT_EXPERT, { &screen_top }, "set the y position for the top of the window", "y pos" },
> >>      { "vf",                 OPT_TYPE_FUNC, OPT_FUNC_ARG | OPT_EXPERT, { .func_arg = opt_add_vfilter }, "set video filters", "filter_graph" },
> >> @@ -3831,7 +3833,9 @@ int main(int argc, char **argv)
> >>              }
> >>          }
> >>          window = SDL_CreateWindow(program_name, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, default_width, default_height, flags);
> >> -        SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
> >> +        if (!scaling_quality)
> >> +            scaling_quality = "linear";
> >> +        SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, scaling_quality);
> >>          if (!window) {
> >>              av_log(NULL, AV_LOG_FATAL, "Failed to create window: %s", SDL_GetError());
> >>              do_exit(NULL);
> >> --
> >> 2.39.2
> >>
> >
> > Can anyone comment on this? I had a few doubts on this patch:
> > - does the option name properly convey its functionality?
> > - is the documentation too terse?
> > - should we include the accepted values in the documentation, even
> > though they are sdl-specific?
>
> What is the benefit of having such option? I don't really see a strong use
> case for it. Also you want to propagate the scaling quality to placebo
> backend as well? Does it acutally make sense to do that?

I use this option to set scaling quality to "nearest" when I want the
display to be pixelated in fullscreen.

I haven't thought about the placebo backend. I'll have a look when I
get the time.
_______________________________________________
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] 5+ messages in thread

end of thread, other threads:[~2024-06-11 11:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-30 21:36 [FFmpeg-devel] [PATCH 1/2] ffplay: add -scaling_quality option for SDL Ramiro Polla
2024-05-30 21:36 ` [FFmpeg-devel] [PATCH 2/2] ffplay: set default scaling_quality to "best" instead of "linear" Ramiro Polla
2024-06-04 13:00 ` [FFmpeg-devel] [PATCH 1/2] ffplay: add -scaling_quality option for SDL Ramiro Polla
2024-06-10 19:04   ` Marton Balint
2024-06-11 11:08     ` Ramiro Polla

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