summaryrefslogtreecommitdiff
path: root/fftools/ffplay.c
diff options
context:
space:
mode:
authorDave Rice <dave@dericed.com>2018-10-01 17:07:44 -0400
committerMarton Balint <cus@passwd.hu>2018-10-07 20:44:22 +0200
commit1431ff2d379e25890309569dd99ca613b4fbb564 (patch)
treef8ca6f674e87232180314a1e1220a5aad7aaf22b /fftools/ffplay.c
parent416804fe412063887c1c9cd94d8ca4787d036f51 (diff)
downloadffmpeg-1431ff2d379e25890309569dd99ca613b4fbb564.tar.gz
ffplay: add options to specify window position
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'fftools/ffplay.c')
-rw-r--r--fftools/ffplay.c6
1 files changed, 5 insertions, 1 deletions
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" },