From patchwork Thu Oct 4 19:02:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Rice X-Patchwork-Id: 10592 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:ab0:73d2:0:0:0:0:0 with SMTP id m18csp1255444uaq; Thu, 4 Oct 2018 12:03:03 -0700 (PDT) X-Google-Smtp-Source: ACcGV606O9u0slxfxL4Hcixn/wCYwNKKkoMjxku3J0/WvvHzv0Tx3TjWS2CJgQZdORzH7qLRs+Zg X-Received: by 2002:a1c:974f:: with SMTP id z76-v6mr5417620wmd.84.1538679783626; Thu, 04 Oct 2018 12:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538679783; cv=none; d=google.com; s=arc-20160816; b=LIWn9WD0TvfRxchenKERncyckBeW04ZhHuN0SFNfhsokgj23Y8WyCGY2GkLmKeFQ23 kTLF6mD74DCBlSyflJXiZi2qlEJfW6Y+zC/Wxcks/w7x6UCTZblEj02Z8z/JjJ+XT5ns 2ZmPx3+gqwRKde2NbjEVkxMTwBKXD99qOXYQe1DlN1aXTw1HBWF4nWS3hGaM6OF4yLzW ZM05DJMSbthgc9WyPL7qwStr03I0GRo/qbpyMcW3N/Pp0sATAdDb0Dmkz1JWQ1m7CcDu EaWTON3nxlovUrsq8h8LuoWuiydbxiq8SxEIYTwDFZBJJi+hl4Pyy32JieqS4xQlVD9a qeDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:message-id:in-reply-to:to:references:date :mime-version:from:delivered-to; bh=dOz3VgN/Yw1oQv4jfXfGA/gnX5apQY0o/1qdi1exki4=; b=rmixhjUwzc0/ut81qJCekwQhZULuheKlF5zpDgVwKqGHzkJ8rVjLa28qyyYw5nm584 JF3987qUOoz85ONChYd+8BZ1ppCwKD9UG76LYnxN3w59CjVl+DFprhjPLBWN2o3tjpih YOSIBqLnQkUD+DmMNW4Ydv+WgEsZfzHLXGuuMdvcdOMnsF15V6kHcBdQcHF8On/JK4r3 sQVCTn2eYEwN3fg7wndqtvFa6vkF3yiHVBM2pghpakyZLIrOOjxvjgqKoCljTPf3YyZL Gio5bZDBN4Gzqoniqz5J+Ob0Qs7LbC1U4Vv9pRFnbuZeqOT++QMvt4P2PLU9dbn5ULsG o8fw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id q16-v6si4373664wrn.268.2018.10.04.12.03.02; Thu, 04 Oct 2018 12:03:03 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 266CB689F85; Thu, 4 Oct 2018 22:02:40 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from server172-3.web-hosting.com (server172-3.web-hosting.com [68.65.122.111]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BEFE0689A69 for ; Thu, 4 Oct 2018 22:02:33 +0300 (EEST) Received: from [146.96.19.240] (port=48619 helo=[10.10.201.39]) by server172.web-hosting.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1g88td-000iBM-UP for ffmpeg-devel@ffmpeg.org; Thu, 04 Oct 2018 15:02:50 -0400 From: Dave Rice Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Date: Thu, 4 Oct 2018 15:02:48 -0400 References: <1C10744D-B083-455C-9236-EFC6ABFA1676@dericed.com> To: FFmpeg development discussions and patches In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3273) X-OutGoing-Spam-Status: No, score=-2.9 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server172.web-hosting.com X-AntiAbuse: Original Domain - ffmpeg.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - dericed.com X-Get-Message-Sender-Via: server172.web-hosting.com: authenticated_id: dave@dericed.com X-Authenticated-Sender: server172.web-hosting.com: dave@dericed.com X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched Subject: Re: [FFmpeg-devel] [PATCHv3 1/2] ffplay: options to specify window position 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From caa816d70e69f85d49556ff341addab24ebcd942 Mon Sep 17 00:00:00 2001 From: Dave Rice Date: Mon, 1 Oct 2018 17:07:44 -0400 Subject: [PATCH 1/2] ffplay: options to specify window position --- doc/ffplay.texi | 4 ++++ fftools/ffplay.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/ffplay.texi b/doc/ffplay.texi index dcb86ce13c..99e1d7468a 100644 --- a/doc/ffplay.texi +++ b/doc/ffplay.texi @@ -74,6 +74,10 @@ as 100. Force format. @item -window_title @var{title} Set window title (default is the input filename). +@item -left @var{title} +Set the x position for the left of the window (default is a centered window). +@item -top @var{title} +Set the y position for the top of the window (default is a centered window). @item -loop @var{number} Loops movie playback times. 0 means forever. @item -showmode @var{mode} diff --git a/fftools/ffplay.c b/fftools/ffplay.c index e375a32ec2..ab1f9faccf 100644 --- a/fftools/ffplay.c +++ b/fftools/ffplay.c @@ -314,6 +314,8 @@ static int default_width = 640; static int default_height = 480; static int screen_width = 0; static int screen_height = 0; +static int screen_left = SDL_WINDOWPOS_CENTERED; +static int screen_top = SDL_WINDOWPOS_CENTERED; static int audio_disable; static int video_disable; static int subtitle_disable; @@ -1346,7 +1348,7 @@ static int video_open(VideoState *is) SDL_SetWindowTitle(window, window_title); SDL_SetWindowSize(window, w, h); - SDL_SetWindowPosition(window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED); + SDL_SetWindowPosition(window, screen_left, screen_top); if (is_full_screen) SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); SDL_ShowWindow(window); @@ -3602,6 +3604,8 @@ static const OptionDef options[] = { { "framedrop", OPT_BOOL | OPT_EXPERT, { &framedrop }, "drop frames when cpu is too slow", "" }, { "infbuf", OPT_BOOL | OPT_EXPERT, { &infinite_buffer }, "don't limit the input buffer size (useful with realtime streams)", "" }, { "window_title", OPT_STRING | HAS_ARG, { &window_title }, "set window title", "window title" }, + { "left", OPT_INT | HAS_ARG | OPT_EXPERT, { &screen_left }, "set the x position for the left of the window", "x pos" }, + { "top", OPT_INT | HAS_ARG | OPT_EXPERT, { &screen_top }, "set the y position for the top of the window", "y pos" }, #if CONFIG_AVFILTER { "vf", OPT_EXPERT | HAS_ARG, { .func_arg = opt_add_vfilter }, "set video filters", "filter_graph" }, { "af", OPT_STRING | HAS_ARG, { &afilters }, "set audio filters", "filter_graph" },