From patchwork Mon May 13 09:00:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Kucera X-Patchwork-Id: 13091 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 650F2447BD8 for ; Mon, 13 May 2019 12:00:30 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3B35868055A; Mon, 13 May 2019 12:00:30 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AA971680403 for ; Mon, 13 May 2019 12:00:23 +0300 (EEST) Received: by mail-wr1-f68.google.com with SMTP id b18so4301462wrq.12 for ; Mon, 13 May 2019 02:00:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ROR6jKDZSRXoj9bRupCpUItzrM0dMGcvgUKGrPbfv2U=; b=QlqD4edfsActm5Wd34hqoRpLopiWYKs0aLagLVLMMI+P3Qjqp2CNw+k1xV9OTlUNgz UN4M64oHjTxUojz3vmBdWke73PEl9D4zjUaJOMzYMY/qlPCX7Erun/jFotQibJ65E8D3 QTNSm6zGpQ9HPSR2WsGdn+Z/TEcmZua3mGUMh+bFRxoZWOeC4MOjMNDPUUhl3bz6L/fS iPyLTQpjRbL8suaf2VLNDI9iECW9MyKIjPW7NhdrscZ4idOWcPHxDxhuUki0Muqk48UM ogB0rD7F6PaYaUcbvNkXQz754QrjwEzJFYkrjApMrMSDES2ojw907VsApc0g33rCTY/l 9/Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ROR6jKDZSRXoj9bRupCpUItzrM0dMGcvgUKGrPbfv2U=; b=UtkrgVUScyj/hWxNMrCj1FTWk6REdeCmbdySHVdkepPvLc3JVgXMnznrCPlYttIU/l /modZTP/X1oGsxeuBwHnRPrS6LgxLxM43Rkrtboj4AxztkiGFO3Xf+z2rf+DuSC+X5X2 tiaSEl3to+ftqEZg4eh377BrraVCDl5+IynPNg0j/eptuQnj13sRTm5KYG6h9qFT1kx5 XedizCC7yPnrVAtL7j0e91pRlvTpPxEIeVkUq9IpSesKs9TQBk38Vt7mtHuWoDjVt0z3 GjCVKQYujjgsan7/4I1l77Lh3MIcFMMu4eYmnwVzu6Wz8SuUmp9Dd62m3iPg9kXC8YxD OjcQ== X-Gm-Message-State: APjAAAXxzSuOohA71LTuBnVV24uR3kaZjoIjrLe7HcJA2LtpeYZfJBVt EPnRsN1zz2StkEp7Z1Nw2c8LkI2KPUM= X-Google-Smtp-Source: APXvYqz6bBpmExauAydJn7M2Mt0CM3Ubdc/leRdHWSDqDJ3dO+XeoQmnOWzaKeDnt0MQrMg2V2WMlg== X-Received: by 2002:adf:db82:: with SMTP id u2mr15818748wri.316.1557738022699; Mon, 13 May 2019 02:00:22 -0700 (PDT) Received: from speedy.danman.eu ([2a06:cc0::5054:ff:febb:3523]) by smtp.gmail.com with ESMTPSA id y130sm17385334wmc.44.2019.05.13.02.00.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 May 2019 02:00:21 -0700 (PDT) From: Daniel Kucera To: ffmpeg-devel@ffmpeg.org Date: Mon, 13 May 2019 11:00:15 +0200 Message-Id: <20190513090015.27775-1-daniel.kucera@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH] ffplay: added option always on top for video window X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Daniel Kucera MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Daniel Kucera Signed-off-by: Daniel Kucera --- doc/ffplay.texi | 2 ++ fftools/ffplay.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/doc/ffplay.texi b/doc/ffplay.texi index c305465078..a487c0de8d 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. +@item -alwaysontop +Window always on top. Available on: X11 with SDL >= 2.0.5, Windows SDL >= 2.0.6. @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..2af5f0386a 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,9 @@ 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" }, +#ifdef SDL_WINDOW_ALWAYS_ON_TOP + { "alwaysontop", OPT_BOOL, { &alwaysontop }, "window always on top" }, +#endif { "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 +3726,10 @@ int main(int argc, char **argv) if (!display_disable) { int flags = SDL_WINDOW_HIDDEN; +#ifdef SDL_WINDOW_ALWAYS_ON_TOP + if (alwaysontop) + flags |= SDL_WINDOW_ALWAYS_ON_TOP; +#endif if (borderless) flags |= SDL_WINDOW_BORDERLESS; else