[FFmpeg-devel] [PATCH] ffplay: added option always on top for video window

Michael Niedermayer michael at niedermayer.cc
Sat May 11 18:33:07 EEST 2019


On Fri, May 10, 2019 at 12:12:17PM +0200, Daniel Kucera wrote:
> From: Daniel Kucera <github at danman.eu>
> 
> Signed-off-by: Daniel Kucera <github at danman.eu>
> ---
>  doc/ffplay.texi  | 2 ++
>  fftools/ffplay.c | 4 ++++
>  2 files changed, 6 insertions(+)
> 
> diff --git a/doc/ffplay.texi b/doc/ffplay.texi
> index c305465078..a37c02dc0d 100644
> --- a/doc/ffplay.texi
> +++ b/doc/ffplay.texi
> @@ -66,6 +66,8 @@ Set custom interval, in seconds, for seeking using left/right keys. Default is 1
>  Disable graphical display.
>  @item -noborder
>  Borderless window.
> + at item -alwaysontop
> +Window always on top.
>  @item -volume
>  Set the startup volume. 0 means silence, 100 means no volume reduction or
>  amplification. Negative values are treated as 0, values above 100 are treated
> diff --git a/fftools/ffplay.c b/fftools/ffplay.c
> index 8f050e16e6..931dc08e2d 100644
> --- a/fftools/ffplay.c
> +++ b/fftools/ffplay.c
> @@ -324,6 +324,7 @@ static int seek_by_bytes = -1;
>  static float seek_interval = 10;
>  static int display_disable;
>  static int borderless;
> +static int alwaysontop;
>  static int startup_volume = 100;
>  static int show_status = 1;
>  static int av_sync_type = AV_SYNC_AUDIO_MASTER;
> @@ -3581,6 +3582,7 @@ static const OptionDef options[] = {
>      { "seek_interval", OPT_FLOAT | HAS_ARG, { &seek_interval }, "set seek interval for left/right keys, in seconds", "seconds" },
>      { "nodisp", OPT_BOOL, { &display_disable }, "disable graphical display" },
>      { "noborder", OPT_BOOL, { &borderless }, "borderless window" },
> +    { "alwaysontop", OPT_BOOL, { &alwaysontop }, "window always on top" },
>      { "volume", OPT_INT | HAS_ARG, { &startup_volume}, "set startup volume 0=min 100=max", "volume" },
>      { "f", HAS_ARG, { .func_arg = opt_format }, "force format", "fmt" },
>      { "pix_fmt", HAS_ARG | OPT_EXPERT | OPT_VIDEO, { .func_arg = opt_frame_pix_fmt }, "set pixel format", "format" },
> @@ -3722,6 +3724,8 @@ int main(int argc, char **argv)
>  
>      if (!display_disable) {
>          int flags = SDL_WINDOW_HIDDEN;
> +        if (alwaysontop)
> +            flags |= SDL_WINDOW_ALWAYS_ON_TOP;

fails to build

fftools/ffplay.c: In function ‘main’:
fftools/ffplay.c:3728:22: error: ‘SDL_WINDOW_ALWAYS_ON_TOP’ undeclared (first use in this function)
             flags |= SDL_WINDOW_ALWAYS_ON_TOP;


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190511/1030d2f4/attachment.sig>


More information about the ffmpeg-devel mailing list