ffplay: allow borderless playback windows

For a pure video tile effect, and enabling better integration of playback windows
into other programs. It would improve the looks in many situations and avoid ugly
hacks like this: http://stackoverflow.com/q/31465630/315024

Signed-off-by: Lucas Sandery <lucas-sandery@users.noreply.github.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
pull/250/head
Lucas Sandery 8 years ago committed by Marton Balint
parent 0126cd95cc
commit 15d7e31dcb
  1. 2
      doc/ffplay.texi
  2. 4
      ffplay.c

@ -62,6 +62,8 @@ see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1)
Seek by bytes. Seek by bytes.
@item -nodisp @item -nodisp
Disable graphical display. Disable graphical display.
@item -noborder
Borderless window.
@item -volume @item -volume
Set the startup volume. 0 means silence, 100 means no volume reduction or 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 amplification. Negative values are treated as 0, values above 100 are treated

@ -321,6 +321,7 @@ static int subtitle_disable;
static const char* wanted_stream_spec[AVMEDIA_TYPE_NB] = {0}; static const char* wanted_stream_spec[AVMEDIA_TYPE_NB] = {0};
static int seek_by_bytes = -1; static int seek_by_bytes = -1;
static int display_disable; static int display_disable;
static int borderless;
static int startup_volume = 100; static int startup_volume = 100;
static int show_status = 1; static int show_status = 1;
static int av_sync_type = AV_SYNC_AUDIO_MASTER; static int av_sync_type = AV_SYNC_AUDIO_MASTER;
@ -1265,6 +1266,8 @@ static int video_open(VideoState *is)
window_title = input_filename; window_title = input_filename;
if (is_full_screen) if (is_full_screen)
flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
if (borderless)
flags |= SDL_WINDOW_BORDERLESS;
window = SDL_CreateWindow(window_title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, w, h, flags); window = SDL_CreateWindow(window_title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, w, h, flags);
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
if (window) { if (window) {
@ -3513,6 +3516,7 @@ static const OptionDef options[] = {
{ "t", HAS_ARG, { .func_arg = opt_duration }, "play \"duration\" seconds of audio/video", "duration" }, { "t", HAS_ARG, { .func_arg = opt_duration }, "play \"duration\" seconds of audio/video", "duration" },
{ "bytes", OPT_INT | HAS_ARG, { &seek_by_bytes }, "seek by bytes 0=off 1=on -1=auto", "val" }, { "bytes", OPT_INT | HAS_ARG, { &seek_by_bytes }, "seek by bytes 0=off 1=on -1=auto", "val" },
{ "nodisp", OPT_BOOL, { &display_disable }, "disable graphical display" }, { "nodisp", OPT_BOOL, { &display_disable }, "disable graphical display" },
{ "noborder", OPT_BOOL, { &borderless }, "borderless window" },
{ "volume", OPT_INT | HAS_ARG, { &startup_volume}, "set startup volume 0=min 100=max", "volume" }, { "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" }, { "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" }, { "pix_fmt", HAS_ARG | OPT_EXPERT | OPT_VIDEO, { .func_arg = opt_frame_pix_fmt }, "set pixel format", "format" },

Loading…
Cancel
Save