2008-03-31 03:19:29 +00:00
|
|
|
#ifndef MPLAYER_OPTIONS_H
|
|
|
|
#define MPLAYER_OPTIONS_H
|
|
|
|
|
2013-03-04 16:40:21 +00:00
|
|
|
#include <stdbool.h>
|
2013-03-08 01:08:02 +00:00
|
|
|
#include <stdint.h>
|
2013-12-17 01:02:25 +00:00
|
|
|
#include "m_option.h"
|
2015-05-22 19:00:24 +00:00
|
|
|
#include "common/common.h"
|
2012-11-15 17:49:17 +00:00
|
|
|
|
2013-03-04 21:41:27 +00:00
|
|
|
typedef struct mp_vo_opts {
|
2016-11-25 20:00:39 +00:00
|
|
|
struct m_obj_settings *video_driver_list;
|
2013-03-04 21:41:27 +00:00
|
|
|
|
2016-05-05 05:56:21 +00:00
|
|
|
int taskbar_progress;
|
2016-12-09 18:22:33 +00:00
|
|
|
int snap_window;
|
2013-03-04 21:41:27 +00:00
|
|
|
int ontop;
|
2017-02-13 19:08:43 +00:00
|
|
|
int ontop_level;
|
2013-07-18 12:05:39 +00:00
|
|
|
int fullscreen;
|
2015-01-16 22:38:47 +00:00
|
|
|
int border;
|
2016-04-26 01:46:49 +00:00
|
|
|
int fit_border;
|
2015-01-16 22:38:47 +00:00
|
|
|
int all_workspaces;
|
|
|
|
|
2013-03-04 21:41:27 +00:00
|
|
|
int screen_id;
|
|
|
|
int fsscreen_id;
|
|
|
|
char *winname;
|
2014-05-15 22:47:13 +00:00
|
|
|
int x11_netwm;
|
2015-11-18 20:37:38 +00:00
|
|
|
int x11_bypass_compositor;
|
2013-04-03 23:13:56 +00:00
|
|
|
int native_keyrepeat;
|
2013-03-04 21:41:27 +00:00
|
|
|
|
|
|
|
float panscan;
|
2013-06-14 22:15:32 +00:00
|
|
|
float zoom;
|
|
|
|
float pan_x, pan_y;
|
|
|
|
float align_x, align_y;
|
2013-09-01 01:27:03 +00:00
|
|
|
int unscaled;
|
2013-03-04 21:41:27 +00:00
|
|
|
|
|
|
|
struct m_geometry geometry;
|
|
|
|
struct m_geometry autofit;
|
|
|
|
struct m_geometry autofit_larger;
|
2015-01-16 21:30:32 +00:00
|
|
|
struct m_geometry autofit_smaller;
|
2016-09-19 23:20:22 +00:00
|
|
|
double window_scale;
|
2013-03-04 21:41:27 +00:00
|
|
|
|
|
|
|
int keepaspect;
|
2014-10-04 20:17:36 +00:00
|
|
|
int keepaspect_window;
|
2016-10-25 13:59:13 +00:00
|
|
|
int hidpi_window_scale;
|
2017-07-27 19:28:33 +00:00
|
|
|
int native_fs;
|
2013-03-04 21:41:27 +00:00
|
|
|
|
|
|
|
int64_t WinID;
|
|
|
|
|
|
|
|
float force_monitor_aspect;
|
|
|
|
float monitor_pixel_aspect;
|
|
|
|
int force_window_position;
|
2013-05-10 22:22:23 +00:00
|
|
|
|
2015-12-06 18:20:23 +00:00
|
|
|
char *mmcss_profile;
|
|
|
|
|
vo_gpu: make it possible to load multiple hwdec interop drivers
Make the VO<->decoder interface capable of supporting multiple hwdec
APIs at once. The main gain is that this simplifies autoprobing a lot.
Before this change, it could happen that the VO loaded the "wrong" hwdec
API, and the decoder was stuck with the choice (breaking hw decoding).
With the change applied, the VO simply loads all available APIs, so
autoprobing trickery is left entirely to the decoder.
In the past, we were quite careful about not accidentally loading the
wrong interop drivers. This was in part to make sure autoprobing works,
but also because libva had this obnoxious bug of dumping garbage to
stderr when using the API. libva was fixed, so this is not a problem
anymore.
The --opengl-hwdec-interop option is changed in various ways (again...),
and renamed to --gpu-hwdec-interop. It does not have much use anymore,
other than debugging. It's notable that the order in the hwdec interop
array ra_hwdec_drivers[] still matters if multiple drivers support the
same image formats, so the option can explicitly force one, if that
should ever be necessary, or more likely, for debugging. One example are
the ra_hwdec_d3d11egl and ra_hwdec_d3d11eglrgb drivers, which both
support d3d11 input.
vo_gpu now always loads the interop lazily by default, but when it does,
it loads them all. vo_opengl_cb now always loads them when the GL
context handle is initialized. I don't expect that this causes any
problems.
It's now possible to do things like changing between vdpau and nvdec
decoding at runtime.
This is also preparation for cleaning up vd_lavc.c hwdec autoprobing.
It's another reason why hwdec_devices_request_all() does not take a
hwdec type anymore.
2017-12-01 04:05:00 +00:00
|
|
|
// vo_drm
|
2014-06-10 20:41:14 +00:00
|
|
|
struct sws_opts *sws_opts;
|
2016-10-04 20:07:19 +00:00
|
|
|
// vo_drm
|
2017-10-23 06:59:58 +00:00
|
|
|
struct drm_opts *drm_opts;
|
2013-03-04 21:41:27 +00:00
|
|
|
} mp_vo_opts;
|
|
|
|
|
2014-05-19 21:27:09 +00:00
|
|
|
struct mp_cache_opts {
|
|
|
|
int size;
|
|
|
|
int def_size;
|
|
|
|
int initial;
|
|
|
|
int seek_min;
|
2015-07-22 21:38:45 +00:00
|
|
|
int back_buffer;
|
2014-06-22 00:50:52 +00:00
|
|
|
char *file;
|
|
|
|
int file_max;
|
2014-05-19 21:27:09 +00:00
|
|
|
};
|
|
|
|
|
2017-12-29 16:19:25 +00:00
|
|
|
// Subtitle options needed by the subtitle decoders/renderers.
|
|
|
|
struct mp_subtitle_opts {
|
|
|
|
int sub_visibility;
|
|
|
|
int sub_pos;
|
|
|
|
float sub_delay;
|
|
|
|
float sub_fps;
|
|
|
|
float sub_speed;
|
|
|
|
int forced_subs_only;
|
|
|
|
int stretch_dvd_subs;
|
|
|
|
int stretch_image_subs;
|
|
|
|
int image_subs_video_res;
|
|
|
|
int sub_fix_timing;
|
|
|
|
int sub_scale_by_window;
|
|
|
|
int sub_scale_with_window;
|
|
|
|
int ass_scale_with_window;
|
|
|
|
struct osd_style_opts *sub_style;
|
|
|
|
float sub_scale;
|
|
|
|
float sub_gauss;
|
|
|
|
int sub_gray;
|
|
|
|
int sub_filter_SDH;
|
|
|
|
int sub_filter_SDH_harder;
|
|
|
|
int ass_enabled;
|
|
|
|
float ass_line_spacing;
|
|
|
|
int ass_use_margins;
|
|
|
|
int sub_use_margins;
|
|
|
|
int ass_vsfilter_aspect_compat;
|
|
|
|
int ass_vsfilter_color_compat;
|
|
|
|
int ass_vsfilter_blur_compat;
|
|
|
|
int use_embedded_fonts;
|
|
|
|
char **ass_force_style_list;
|
|
|
|
char *ass_styles_file;
|
|
|
|
int ass_style_override;
|
|
|
|
int ass_hinting;
|
|
|
|
int ass_shaper;
|
|
|
|
int ass_justify;
|
|
|
|
int sub_clear_on_seek;
|
|
|
|
int teletext_page;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct mp_osd_render_opts {
|
|
|
|
float osd_bar_align_x;
|
|
|
|
float osd_bar_align_y;
|
|
|
|
float osd_bar_w;
|
|
|
|
float osd_bar_h;
|
|
|
|
float osd_scale;
|
|
|
|
int osd_scale_by_window;
|
|
|
|
struct osd_style_opts *osd_style;
|
|
|
|
int force_rgba_osd;
|
|
|
|
};
|
|
|
|
|
2013-03-04 21:41:27 +00:00
|
|
|
typedef struct MPOpts {
|
2016-09-01 18:00:43 +00:00
|
|
|
int property_print_help;
|
2014-02-06 15:49:50 +00:00
|
|
|
int use_terminal;
|
2014-04-17 19:47:00 +00:00
|
|
|
char *dump_stats;
|
2013-12-21 22:11:12 +00:00
|
|
|
int verbose;
|
2017-06-23 18:42:20 +00:00
|
|
|
int msg_really_quiet;
|
2015-02-06 15:48:52 +00:00
|
|
|
char **msg_levels;
|
2013-12-21 22:11:12 +00:00
|
|
|
int msg_color;
|
|
|
|
int msg_module;
|
2014-02-28 21:45:34 +00:00
|
|
|
int msg_time;
|
2015-01-26 10:31:02 +00:00
|
|
|
char *log_file;
|
2013-12-18 18:04:30 +00:00
|
|
|
|
2016-09-23 19:24:50 +00:00
|
|
|
int operation_mode;
|
|
|
|
|
2013-04-10 19:06:00 +00:00
|
|
|
char **reset_options;
|
2014-12-14 23:31:30 +00:00
|
|
|
char **script_files;
|
|
|
|
char **script_opts;
|
2013-09-25 22:56:41 +00:00
|
|
|
int lua_load_osc;
|
2014-11-19 17:51:53 +00:00
|
|
|
int lua_load_ytdl;
|
2014-11-19 22:33:28 +00:00
|
|
|
char *lua_ytdl_format;
|
2015-02-22 20:32:42 +00:00
|
|
|
char **lua_ytdl_raw_options;
|
2017-09-26 23:17:47 +00:00
|
|
|
int lua_load_stats;
|
2014-11-19 22:33:28 +00:00
|
|
|
|
2014-02-28 21:25:48 +00:00
|
|
|
int auto_load_scripts;
|
2013-04-10 19:06:00 +00:00
|
|
|
|
2016-11-25 20:00:39 +00:00
|
|
|
struct m_obj_settings *audio_driver_list;
|
2014-10-09 19:21:31 +00:00
|
|
|
char *audio_device;
|
2016-09-05 19:07:34 +00:00
|
|
|
int audio_exclusive;
|
2014-11-07 14:54:35 +00:00
|
|
|
char *audio_client_name;
|
2015-10-05 16:53:02 +00:00
|
|
|
int ao_null_fallback;
|
2016-08-09 14:22:06 +00:00
|
|
|
int audio_stream_silence;
|
2016-08-09 14:26:44 +00:00
|
|
|
float audio_wait_open;
|
2013-10-01 23:15:59 +00:00
|
|
|
int force_vo;
|
2016-07-09 16:31:18 +00:00
|
|
|
float softvol_volume;
|
2017-04-26 22:21:17 +00:00
|
|
|
int rgain_mode;
|
2017-04-26 19:45:50 +00:00
|
|
|
float rgain_preamp; // Set replaygain pre-amplification
|
|
|
|
int rgain_clip; // Enable/disable clipping prevention
|
|
|
|
float rgain_fallback;
|
2016-07-09 16:31:18 +00:00
|
|
|
int softvol_mute;
|
2012-01-21 07:28:07 +00:00
|
|
|
float softvol_max;
|
2010-11-12 12:06:37 +00:00
|
|
|
int gapless_audio;
|
2014-09-04 21:48:27 +00:00
|
|
|
double audio_buffer;
|
2013-03-04 16:40:21 +00:00
|
|
|
|
2016-08-30 21:50:57 +00:00
|
|
|
mp_vo_opts *vo;
|
2013-03-04 16:40:21 +00:00
|
|
|
|
|
|
|
char *wintitle;
|
2014-09-02 20:28:11 +00:00
|
|
|
char *media_title;
|
2013-03-04 16:40:21 +00:00
|
|
|
|
video: redo video equalizer option handling
I really wouldn't care much about this, but some parts of the core code
are under HAVE_GPL, so there's some need to get rid of it. Simply turn
the video equalizer from its current fine-grained handling with vf/vo
fallbacks into global options. This makes updating them much simpler.
This removes any possibility of applying video equalizers in filters,
which affects vf_scale, and the previously removed vf_eq. Not a big
loss, since the preferred VOs have this builtin.
Remove video equalizer handling from vo_direct3d, vo_sdl, vo_vaapi, and
vo_xv. I'm not going to waste my time on these legacy VOs.
vo.eq_opts_cache exists _only_ to send a VOCTRL_SET_EQUALIZER, which
exists _only_ to trigger a redraw. This seems silly, but for now I feel
like this is less of a pain. The rest of the equalizer using code is
self-updating.
See commit 96b906a51d5 for how some video equalizer code was GPL only.
Some command line option names and ranges can probably be traced back to
a GPL only committer, but we don't consider these copyrightable.
2017-08-22 15:01:35 +00:00
|
|
|
struct mp_csp_equalizer_opts *video_equalizer;
|
2013-03-04 16:40:21 +00:00
|
|
|
|
2013-06-13 22:24:41 +00:00
|
|
|
int stop_screensaver;
|
2013-09-08 00:07:20 +00:00
|
|
|
int cursor_autohide_delay;
|
2013-09-08 00:46:19 +00:00
|
|
|
int cursor_autohide_fs;
|
2013-09-08 00:07:20 +00:00
|
|
|
|
2014-05-24 12:08:39 +00:00
|
|
|
int video_rotate;
|
2014-08-30 21:24:46 +00:00
|
|
|
int video_stereo_mode;
|
2014-05-24 12:08:39 +00:00
|
|
|
|
core: redo how codecs are mapped, remove codecs.conf
Use codec names instead of FourCCs to identify codecs. Rewrite how
codecs are selected and initialized. Now each decoder exports a list
of decoders (and the codec it supports) via add_decoders(). The order
matters, and the first decoder for a given decoder is preferred over
the other decoders. E.g. all ad_mpg123 decoders are preferred over
ad_lavc, because it comes first in the mpcodecs_ad_drivers array.
Likewise, decoders within ad_lavc that are enumerated first by
libavcodec (using av_codec_next()) are preferred. (This is actually
critical to select h264 software decoding by default instead of vdpau.
libavcodec and ffmpeg/avconv use the same method to select decoders by
default, so we hope this is sane.)
The codec names follow libavcodec's codec names as defined by
AVCodecDescriptor.name (see libavcodec/codec_desc.c). Some decoders
have names different from the canonical codec name. The AVCodecDescriptor
API is relatively new, so we need a compatibility layer for older
libavcodec versions for codec names that are referenced internally,
and which are different from the decoder name. (Add a configure check
for that, because checking versions is getting way too messy.)
demux/codec_tags.c is generated from the former codecs.conf (minus
"special" decoders like vdpau, and excluding the mappings that are the
same as the mappings libavformat's exported RIFF tables). It contains
all the mappings from FourCCs to codec name. This is needed for
demux_mkv, demux_mpg, demux_avi and demux_asf. demux_lavf will set the
codec as determined by libavformat, while the other demuxers have to do
this on their own, using the mp_set_audio/video_codec_from_tag()
functions. Note that the sh_audio/video->format members don't uniquely
identify the codec anymore, and sh->codec takes over this role.
Replace the --ac/--vc/--afm/--vfm with new --vd/--ad options, which
provide cover the functionality of the removed switched.
Note: there's no CODECS_FLAG_FLIP flag anymore. This means some obscure
container/video combinations (e.g. the sample Film_200_zygo_pro.mov)
are played flipped. ffplay/avplay doesn't handle this properly either,
so we don't care and blame ffmeg/libav instead.
2013-02-09 14:15:19 +00:00
|
|
|
char *audio_decoders;
|
|
|
|
char *video_decoders;
|
2015-06-05 20:35:43 +00:00
|
|
|
char *audio_spdif;
|
core: redo how codecs are mapped, remove codecs.conf
Use codec names instead of FourCCs to identify codecs. Rewrite how
codecs are selected and initialized. Now each decoder exports a list
of decoders (and the codec it supports) via add_decoders(). The order
matters, and the first decoder for a given decoder is preferred over
the other decoders. E.g. all ad_mpg123 decoders are preferred over
ad_lavc, because it comes first in the mpcodecs_ad_drivers array.
Likewise, decoders within ad_lavc that are enumerated first by
libavcodec (using av_codec_next()) are preferred. (This is actually
critical to select h264 software decoding by default instead of vdpau.
libavcodec and ffmpeg/avconv use the same method to select decoders by
default, so we hope this is sane.)
The codec names follow libavcodec's codec names as defined by
AVCodecDescriptor.name (see libavcodec/codec_desc.c). Some decoders
have names different from the canonical codec name. The AVCodecDescriptor
API is relatively new, so we need a compatibility layer for older
libavcodec versions for codec names that are referenced internally,
and which are different from the decoder name. (Add a configure check
for that, because checking versions is getting way too messy.)
demux/codec_tags.c is generated from the former codecs.conf (minus
"special" decoders like vdpau, and excluding the mappings that are the
same as the mappings libavformat's exported RIFF tables). It contains
all the mappings from FourCCs to codec name. This is needed for
demux_mkv, demux_mpg, demux_avi and demux_asf. demux_lavf will set the
codec as determined by libavformat, while the other demuxers have to do
this on their own, using the mp_set_audio/video_codec_from_tag()
functions. Note that the sh_audio/video->format members don't uniquely
identify the codec anymore, and sh->codec takes over this role.
Replace the --ac/--vc/--afm/--vfm with new --vd/--ad options, which
provide cover the functionality of the removed switched.
Note: there's no CODECS_FLAG_FLIP flag anymore. This means some obscure
container/video combinations (e.g. the sample Film_200_zygo_pro.mov)
are played flipped. ffplay/avplay doesn't handle this properly either,
so we don't care and blame ffmeg/libav instead.
2013-02-09 14:15:19 +00:00
|
|
|
|
2017-12-29 16:19:25 +00:00
|
|
|
struct mp_subtitle_opts *subs_rend;
|
|
|
|
struct mp_osd_render_opts *osd_rend;
|
|
|
|
|
2009-03-29 23:06:58 +00:00
|
|
|
int osd_level;
|
|
|
|
int osd_duration;
|
2011-04-12 15:11:12 +00:00
|
|
|
int osd_fractions;
|
2018-01-21 23:36:08 +00:00
|
|
|
int osd_on_seek;
|
2016-08-28 16:15:37 +00:00
|
|
|
int video_osd;
|
|
|
|
|
2012-07-29 22:27:50 +00:00
|
|
|
int untimed;
|
2013-05-11 20:40:46 +00:00
|
|
|
char *stream_dump;
|
2017-02-07 16:05:17 +00:00
|
|
|
char *record_file;
|
2014-10-28 18:51:44 +00:00
|
|
|
int stop_playback_on_init_failure;
|
2008-04-21 02:18:40 +00:00
|
|
|
int loop_times;
|
2014-04-17 21:55:04 +00:00
|
|
|
int loop_file;
|
2013-08-18 22:50:39 +00:00
|
|
|
int shuffle;
|
2009-04-07 23:37:27 +00:00
|
|
|
int ordered_chapters;
|
2013-12-14 20:52:37 +00:00
|
|
|
char *ordered_chapters_files;
|
2010-11-26 14:56:05 +00:00
|
|
|
int chapter_merge_threshold;
|
2013-08-14 01:25:50 +00:00
|
|
|
double chapter_seek_threshold;
|
2014-11-02 15:47:23 +00:00
|
|
|
char *chapter_file;
|
2013-08-25 18:40:21 +00:00
|
|
|
int load_unsafe_playlists;
|
2013-11-19 21:36:33 +00:00
|
|
|
int merge_files;
|
2010-11-12 20:04:16 +00:00
|
|
|
int quiet;
|
2013-02-08 22:52:06 +00:00
|
|
|
int load_config;
|
2014-02-25 20:04:04 +00:00
|
|
|
char *force_configdir;
|
2013-03-08 01:08:02 +00:00
|
|
|
int use_filedir_conf;
|
2014-09-01 21:47:27 +00:00
|
|
|
int hls_bitrate;
|
2016-09-06 18:09:56 +00:00
|
|
|
struct mp_cache_opts *stream_cache;
|
2010-04-24 17:09:31 +00:00
|
|
|
int chapterrange[2];
|
2009-12-01 12:28:34 +00:00
|
|
|
int edition_id;
|
2008-04-25 10:30:44 +00:00
|
|
|
int correct_pts;
|
2010-11-13 17:27:01 +00:00
|
|
|
int initial_audio_sync;
|
2015-08-10 16:43:25 +00:00
|
|
|
int video_sync;
|
|
|
|
double sync_max_video_change;
|
|
|
|
double sync_max_audio_change;
|
2015-10-27 19:56:46 +00:00
|
|
|
double sync_audio_drop_size;
|
2010-12-14 23:09:47 +00:00
|
|
|
int hr_seek;
|
2011-11-06 14:54:57 +00:00
|
|
|
float hr_seek_demuxer_offset;
|
2014-05-07 20:01:17 +00:00
|
|
|
int hr_seek_framedrop;
|
2013-03-08 01:08:02 +00:00
|
|
|
float audio_delay;
|
|
|
|
float default_max_pts_correction;
|
2010-11-12 20:04:16 +00:00
|
|
|
int autosync;
|
2012-09-17 06:38:19 +00:00
|
|
|
int frame_dropping;
|
2014-08-15 22:05:02 +00:00
|
|
|
double frame_drop_fps;
|
2010-11-13 21:10:58 +00:00
|
|
|
int term_osd;
|
2014-01-15 15:14:37 +00:00
|
|
|
int term_osd_bar;
|
|
|
|
char *term_osd_bar_chars;
|
2010-11-13 21:10:58 +00:00
|
|
|
char *playing_msg;
|
2014-09-01 22:09:03 +00:00
|
|
|
char *osd_playing_msg;
|
2012-10-02 01:12:09 +00:00
|
|
|
char *status_msg;
|
2013-02-16 21:14:33 +00:00
|
|
|
char *osd_status_msg;
|
2014-09-17 23:19:27 +00:00
|
|
|
char *osd_msg[3];
|
2010-11-13 21:10:58 +00:00
|
|
|
int player_idle_mode;
|
|
|
|
int consolecontrols;
|
2015-08-22 20:08:17 +00:00
|
|
|
int playlist_pos;
|
2012-11-15 17:49:17 +00:00
|
|
|
struct m_rel_time play_start;
|
|
|
|
struct m_rel_time play_end;
|
|
|
|
struct m_rel_time play_length;
|
2015-11-16 21:47:17 +00:00
|
|
|
int rebase_start_time;
|
2013-03-08 01:08:02 +00:00
|
|
|
int play_frames;
|
2014-11-17 23:09:42 +00:00
|
|
|
double ab_loop[2];
|
2013-03-08 01:08:02 +00:00
|
|
|
double step_sec;
|
core: add playback resume feature (manual/opt-in)
A "watch later" command is now mapped to Shift+Q. This quits the player
and stores the playback state in a config file in ~/.mpv/watch_later/.
When calling the player with the same file again, playback is resumed
at that time position.
It's also possible to make mpv save playback state always on quit with
the --save-position-on-quit option. Likewise, resuming can be disabled
with the --no-resume-playback option.
This also attempts to save some playback parameters, like fullscreen
state or track selection. This will unconditionally override config
settings and command line options (which is probably not what you would
expect, but in general nobody will really care about this). Some things
are not backed up, because that would cause various problems. Additional
subtitle files, video filters, etc. are not stored because that would be
too hard and fragile. Volume/mute state are not stored because it would
mess up if the system mixer is used, or if the system mixer was
readjusted in the meantime.
Basically, the tradeoff between perfect state restoration and
complexity/fragility makes it not worth to attempt to implement
it perfectly, even if the result is a little bit inconsistent.
2013-05-05 17:37:29 +00:00
|
|
|
int position_resume;
|
|
|
|
int position_save_on_quit;
|
2014-06-01 16:25:21 +00:00
|
|
|
int write_filename_in_watch_later_config;
|
2014-12-12 22:57:49 +00:00
|
|
|
int ignore_path_in_watch_later_config;
|
2016-09-08 14:50:39 +00:00
|
|
|
char *watch_later_directory;
|
2013-04-25 18:38:22 +00:00
|
|
|
int pause;
|
core: add --keep-open, which doesn't close the file on EOF
The --keep-open option causes mpv not to close the current file.
Instead, it will pause, and allow the user to seek around. When
seeking beyond the end of the file, mpv does a precise seek back to
the previous last known position that produced video output.
In some corner cases, mpv might not be able to produce video output at
all, despite having created a VO. (Possibly when only 1 frame could be
decoded, but the video filter chain queues frames. Then a VO would be
created, without sending an actual video frame to the VO.) In these
cases, the VO window will not redraw, not even OSD.
Based on a patch by coax [1].
[1] http://devel.mplayer2.org/ticket/210#comment:4
2012-11-12 23:56:20 +00:00
|
|
|
int keep_open;
|
2017-03-27 09:34:02 +00:00
|
|
|
int keep_open_pause;
|
2016-08-17 20:45:44 +00:00
|
|
|
double image_display_duration;
|
2016-02-05 22:19:56 +00:00
|
|
|
char *lavfi_complex;
|
2015-05-22 19:00:24 +00:00
|
|
|
int stream_id[2][STREAM_TYPE_COUNT];
|
|
|
|
char **stream_lang[STREAM_TYPE_COUNT];
|
2017-08-12 21:43:05 +00:00
|
|
|
int stream_auto_sel;
|
2012-12-10 17:52:06 +00:00
|
|
|
int audio_display;
|
2014-12-29 21:51:18 +00:00
|
|
|
char **display_tags;
|
2013-04-28 23:49:20 +00:00
|
|
|
|
2014-06-17 23:40:20 +00:00
|
|
|
char **audio_files;
|
2010-11-11 14:24:17 +00:00
|
|
|
char *demuxer_name;
|
2014-07-16 20:40:21 +00:00
|
|
|
int demuxer_thread;
|
2017-01-18 18:02:50 +00:00
|
|
|
int prefetch_open;
|
2010-11-11 14:24:17 +00:00
|
|
|
char *audio_demuxer_name;
|
|
|
|
char *sub_demuxer_name;
|
|
|
|
|
2018-01-03 20:50:04 +00:00
|
|
|
int cache_pause;
|
2018-01-03 20:48:42 +00:00
|
|
|
int cache_pause_initial;
|
2018-01-03 20:28:28 +00:00
|
|
|
float cache_pause_wait;
|
player: redo how stream caching and pausing on low cache works
Add the --cache-secs option, which literally overrides the value of
--demuxer-readahead-secs if the stream cache is active. The default
value is very high (10 seconds), which means it can act as network
cache.
Remove the old behavior of trying to pause once the byte cache runs
low. Instead, do something similar wit the demuxer cache. The nice
thing is that we can guess how many seconds of video it has cached,
and we can make better decisions. But for now, apply a relatively
naive heuristic: if the cache is below 0.5 secs, pause, and wait
until at least 2 secs are available.
Note that due to timestamp reordering, the estimated cached duration
of video might be inaccurate, depending on the file format. If the
file format has DTS, it's easy, otherwise the duration will seemingly
jump back and forth.
2014-08-26 23:13:20 +00:00
|
|
|
|
2012-08-06 15:48:30 +00:00
|
|
|
struct image_writer_opts *screenshot_image_opts;
|
screenshot: make screenshot filenames configurable
This adds the --screenshot-template option, which specifies a template
for the filename used for a screenshot. The '%' character is parsed as
format specifier. These format specifiers insert metadata into the
filename. For example, '%f' is replaced with the filename of the
currently played file.
The following format specifiers are available:
%n Insert sequence number (padded with 4 zeros), e.g. "0002".
%0Nn Like %n, but pad to N zeros (N = 0 to 9).
%n behaves like %04n.
%#n Like %n, but reset the sequence counter on every screenshot.
(Useful if other parts in the template make the resulting
filename already mostly unique.)
%#0Nn Use %0Nn and %#n at the same time.
%f Insert filename of the currently played video.
%F Like %f, but with stripped file extension ("." and rest).
%p Insert current playback time, in HH:MM:SS format.
%P Like %p, but adds milliseconds: HH:MM:SS.mmmm
%tX Insert the current local date/time, using the date format X.
X is a single letter and is passed to strftime() as "%X".
E.g. "%td" inserts the number of the current day.
%{prop} Insert the value of the slave property 'prop'.
E.g. %{filename} is the same as %f. If the property doesn't
exist or is not available, nothing is inserted, unless a
fallback is specified as in %{prop:fallback text}.
%% Insert the character '%'.
The strings inserted by format specifiers will be checked for
characters not allowed in filenames (including '/' and '\'), and
replaced with the placeholder '_'. (This doesn't happen for text that
was passed with the --screenshot-template option, and allows specifying
a screenshot target directory by prefixing the template with a relative
or absolute path.)
2012-02-29 02:46:25 +00:00
|
|
|
char *screenshot_template;
|
2015-05-03 12:44:42 +00:00
|
|
|
char *screenshot_directory;
|
2011-10-06 18:46:02 +00:00
|
|
|
|
2013-03-08 01:08:02 +00:00
|
|
|
double force_fps;
|
2014-06-13 00:05:37 +00:00
|
|
|
int index_mode;
|
2013-03-08 01:08:02 +00:00
|
|
|
|
2016-08-04 18:49:20 +00:00
|
|
|
struct m_channels audio_output_channels;
|
2010-10-31 05:26:40 +00:00
|
|
|
int audio_output_format;
|
2013-03-08 01:08:02 +00:00
|
|
|
int force_srate;
|
2013-08-04 21:56:20 +00:00
|
|
|
double playback_speed;
|
2014-10-02 00:58:52 +00:00
|
|
|
int pitch_correction;
|
2013-11-30 23:12:10 +00:00
|
|
|
struct m_obj_settings *vf_settings, *vf_defs;
|
|
|
|
struct m_obj_settings *af_settings, *af_defs;
|
video: rewrite filtering glue code
Get rid of the old vf.c code. Replace it with a generic filtering
framework, which can potentially handle more than just --vf. At least
reimplementing --af with this code is planned.
This changes some --vf semantics (including runtime behavior and the
"vf" command). The most important ones are listed in interface-changes.
vf_convert.c is renamed to f_swscale.c. It is now an internal filter
that can not be inserted by the user manually.
f_lavfi.c is a refactor of player/lavfi.c. The latter will be removed
once --lavfi-complex is reimplemented on top of f_lavfi.c. (which is
conceptually easy, but a big mess due to the data flow changes).
The existing filters are all changed heavily. The data flow of the new
filter framework is different. Especially EOF handling changes - EOF is
now a "frame" rather than a state, and must be passed through exactly
once.
Another major thing is that all filters must support dynamic format
changes. The filter reconfig() function goes away. (This sounds complex,
but since all filters need to handle EOF draining anyway, they can use
the same code, and it removes the mess with reconfig() having to predict
the output format, which completely breaks with libavfilter anyway.)
In addition, there is no automatic format negotiation or conversion.
libavfilter's primitive and insufficient API simply doesn't allow us to
do this in a reasonable way. Instead, filters can use f_autoconvert as
sub-filter, and tell it which formats they support. This filter will in
turn add actual conversion filters, such as f_swscale, to perform
necessary format changes.
vf_vapoursynth.c uses the same basic principle of operation as before,
but with worryingly different details in data flow. Still appears to
work.
The hardware deint filters (vf_vavpp.c, vf_d3d11vpp.c, vf_vdpaupp.c) are
heavily changed. Fortunately, they all used refqueue.c, which is for
sharing the data flow logic (especially for managing future/past
surfaces and such). It turns out it can be used to factor out most of
the data flow. Some of these filters accepted software input. Instead of
having ad-hoc upload code in each filter, surface upload is now
delegated to f_autoconvert, which can use f_hwupload to perform this.
Exporting VO capabilities is still a big mess (mp_stream_info stuff).
The D3D11 code drops the redundant image formats, and all code uses the
hw_subfmt (sw_format in FFmpeg) instead. Although that too seems to be a
big mess for now.
f_async_queue is unused.
2018-01-16 10:53:44 +00:00
|
|
|
struct filter_opts *filter_opts;
|
2008-04-24 04:36:43 +00:00
|
|
|
float movie_aspect;
|
2015-08-30 21:01:46 +00:00
|
|
|
int aspect_method;
|
2011-02-07 23:35:51 +00:00
|
|
|
char **sub_name;
|
2011-03-03 10:31:12 +00:00
|
|
|
char **sub_paths;
|
2015-12-25 12:17:11 +00:00
|
|
|
char **audiofile_paths;
|
2016-02-08 20:18:35 +00:00
|
|
|
char **external_files;
|
2016-08-10 20:22:50 +00:00
|
|
|
int autoload_files;
|
2011-02-07 23:35:51 +00:00
|
|
|
int sub_auto;
|
2015-02-02 20:23:12 +00:00
|
|
|
int audiofile_auto;
|
2013-02-16 20:17:59 +00:00
|
|
|
int osd_bar_visible;
|
2012-12-11 17:16:42 +00:00
|
|
|
|
2017-12-01 20:05:54 +00:00
|
|
|
char *hwdec_api;
|
2013-05-03 19:00:05 +00:00
|
|
|
char *hwdec_codecs;
|
2017-10-16 12:37:28 +00:00
|
|
|
int hwdec_image_format;
|
2012-12-11 17:16:42 +00:00
|
|
|
|
2014-06-11 22:34:20 +00:00
|
|
|
int w32_priority;
|
|
|
|
|
2014-06-09 21:54:45 +00:00
|
|
|
struct tv_params *tv_params;
|
2014-06-10 18:12:19 +00:00
|
|
|
struct pvr_params *stream_pvr_opts;
|
2014-06-10 18:46:15 +00:00
|
|
|
struct cdda_params *stream_cdda_opts;
|
2014-06-10 19:44:50 +00:00
|
|
|
struct dvb_params *stream_dvb_opts;
|
2014-07-29 23:15:42 +00:00
|
|
|
struct stream_lavf_params *stream_lavf_opts;
|
2014-06-10 18:46:15 +00:00
|
|
|
|
|
|
|
char *cdrom_device;
|
2014-07-14 23:49:02 +00:00
|
|
|
char *bluray_device;
|
2014-06-09 21:54:45 +00:00
|
|
|
|
2014-06-10 20:48:11 +00:00
|
|
|
double mf_fps;
|
|
|
|
char *mf_type;
|
|
|
|
|
2014-06-10 21:06:42 +00:00
|
|
|
struct demux_rawaudio_opts *demux_rawaudio;
|
|
|
|
struct demux_rawvideo_opts *demux_rawvideo;
|
2014-06-10 23:46:20 +00:00
|
|
|
struct demux_lavf_opts *demux_lavf;
|
2015-04-23 17:21:17 +00:00
|
|
|
struct demux_mkv_opts *demux_mkv;
|
2014-06-10 21:06:42 +00:00
|
|
|
|
2016-09-06 18:09:56 +00:00
|
|
|
struct demux_opts *demux_opts;
|
|
|
|
|
2014-06-10 23:35:39 +00:00
|
|
|
struct vd_lavc_params *vd_lavc_params;
|
2014-06-10 23:39:51 +00:00
|
|
|
struct ad_lavc_params *ad_lavc_params;
|
2013-03-31 02:24:53 +00:00
|
|
|
|
2014-06-10 23:54:03 +00:00
|
|
|
struct input_opts *input_opts;
|
2012-09-14 15:51:26 +00:00
|
|
|
|
2014-06-11 00:04:02 +00:00
|
|
|
// may be NULL if encoding is not compiled-in
|
|
|
|
struct encode_opts *encode_opts;
|
2014-10-16 09:48:18 +00:00
|
|
|
|
|
|
|
char *ipc_path;
|
2014-10-15 15:48:47 +00:00
|
|
|
char *input_file;
|
2016-09-02 13:59:40 +00:00
|
|
|
|
2017-01-20 13:02:17 +00:00
|
|
|
int wingl_dwm_flush;
|
|
|
|
|
2018-01-12 03:02:55 +00:00
|
|
|
struct mp_resample_opts *resample_opts;
|
|
|
|
|
2016-09-02 13:59:40 +00:00
|
|
|
struct gl_video_opts *gl_video_opts;
|
2017-01-20 12:38:28 +00:00
|
|
|
struct angle_opts *angle_opts;
|
vo_opengl: refactor into vo_gpu
This is done in several steps:
1. refactor MPGLContext -> struct ra_ctx
2. move GL-specific stuff in vo_opengl into opengl/context.c
3. generalize context creation to support other APIs, and add --gpu-api
4. rename all of the --opengl- options that are no longer opengl-specific
5. move all of the stuff from opengl/* that isn't GL-specific into gpu/
(note: opengl/gl_utils.h became opengl/utils.h)
6. rename vo_opengl to vo_gpu
7. to handle window screenshots, the short-term approach was to just add
it to ra_swchain_fns. Long term (and for vulkan) this has to be moved to
ra itself (and vo_gpu altered to compensate), but this was a stop-gap
measure to prevent this commit from getting too big
8. move ra->fns->flush to ra_gl_ctx instead
9. some other minor changes that I've probably already forgotten
Note: This is one half of a major refactor, the other half of which is
provided by rossy's following commit. This commit enables support for
all linux platforms, while his version enables support for all non-linux
platforms.
Note 2: vo_opengl_cb.c also re-uses ra_gl_ctx so it benefits from the
--opengl- options like --opengl-early-flush, --opengl-finish etc. Should
be a strict superset of the old functionality.
Disclaimer: Since I have no way of compiling mpv on all platforms, some
of these ports were done blindly. Specifically, the blind ports included
context_mali_fbdev.c and context_rpi.c. Since they're both based on
egl_helpers, the port should have gone smoothly without any major
changes required. But if somebody complains about a compile error on
those platforms (assuming anybody actually uses them), you know where to
complain.
2017-09-14 06:04:55 +00:00
|
|
|
struct opengl_opts *opengl_opts;
|
vo_gpu: vulkan: initial implementation
This time based on ra/vo_gpu. 2017 is the year of the vulkan desktop!
Current problems / limitations / improvement opportunities:
1. The swapchain/flipping code violates the vulkan spec, by assuming
that the presentation queue will be bounded (in cases where rendering
is significantly faster than vsync). But apparently, there's simply
no better way to do this right now, to the point where even the
stupid cube.c examples from LunarG etc. do it wrong.
(cf. https://github.com/KhronosGroup/Vulkan-Docs/issues/370)
2. The memory allocator could be improved. (This is a universal
constant)
3. Could explore using push descriptors instead of descriptor sets,
especially since we expect to switch descriptors semi-often for some
passes (like interpolation). Probably won't make a difference, but
the synchronization overhead might be a factor. Who knows.
4. Parallelism across frames / async transfer is not well-defined, we
either need to use a better semaphore / command buffer strategy or a
resource pooling layer to safely handle cross-frame parallelism.
(That said, I gave resource pooling a try and was not happy with the
result at all - so I'm still exploring the semaphore strategy)
5. We aggressively use pipeline barriers where events would offer a much
more fine-grained synchronization mechanism. As a result of this, we
might be suffering from GPU bubbles due to too-short dependencies on
objects. (That said, I'm also exploring the use of semaphores as a an
ordering tactic which would allow cross-frame time slicing in theory)
Some minor changes to the vo_gpu and infrastructure, but nothing
consequential.
NOTE: For safety, all use of asynchronous commands / multiple command
pools is currently disabled completely. There are some left-over relics
of this in the code (e.g. the distinction between dev_poll and
pool_poll), but that is kept in place mostly because this will be
re-extended in the future (vulkan rev 2).
The queue count is also currently capped to 1, because of the lack of
cross-frame semaphores means we need the implicit synchronization from
the same-queue semantics to guarantee a correct result.
2016-09-14 18:54:18 +00:00
|
|
|
struct vulkan_opts *vulkan_opts;
|
2017-09-13 01:09:48 +00:00
|
|
|
struct spirv_opts *spirv_opts;
|
vo_gpu: d3d11: initial implementation
This is a new RA/vo_gpu backend that uses Direct3D 11. The GLSL
generated by vo_gpu is cross-compiled to HLSL with SPIRV-Cross.
What works:
- All of mpv's internal shaders should work, including compute shaders.
- Some external shaders have been tested and work, including RAVU and
adaptive-sharpen.
- Non-dumb mode works, even on very old hardware. Most features work at
feature level 9_3 and all features work at feature level 10_0. Some
features also work at feature level 9_1 and 9_2, but without high-bit-
depth FBOs, it's not very useful. (Hardware this old is probably not
fast enough for advanced features anyway.)
Note: This is more compatible than ANGLE, which requires 9_3 to work
at all (GLES 2.0,) and 10_1 for non-dumb-mode (GLES 3.0.)
- Hardware decoding with D3D11VA, including decoding of 10-bit formats
without truncation to 8-bit.
What doesn't work / can be improved:
- PBO upload and direct rendering does not work yet. Direct rendering
requires persistent-mapped PBOs because the decoder needs to be able
to read data from images that have already been decoded and uploaded.
Unfortunately, it seems like persistent-mapped PBOs are fundamentally
incompatible with D3D11, which requires all resources to use driver-
managed memory and requires memory to be unmapped (and hence pointers
to be invalidated) when a resource is used in a draw or copy
operation.
However it might be possible to use D3D11's limited multithreading
capabilities to emulate some features of PBOs, like asynchronous
texture uploading.
- The blit() and clear() operations don't have equivalents in the D3D11
API that handle all cases, so in most cases, they have to be emulated
with a shader. This is currently done inside ra_d3d11, but ideally it
would be done in generic code, so it can take advantage of mpv's
shader generation utilities.
- SPIRV-Cross is used through a NIH C-compatible wrapper library, since
it does not expose a C interface itself.
The library is available here: https://github.com/rossy/crossc
- The D3D11 context could be made to support more modern DXGI features
in future. For example, it should be possible to add support for
high-bit-depth and HDR output with DXGI 1.5/1.6.
2017-09-07 10:18:06 +00:00
|
|
|
struct d3d11_opts *d3d11_opts;
|
2017-11-01 11:38:41 +00:00
|
|
|
struct d3d11va_opts *d3d11va_opts;
|
2017-02-20 19:34:57 +00:00
|
|
|
struct cocoa_opts *cocoa_opts;
|
2018-02-16 12:07:15 +00:00
|
|
|
struct macos_opts *macos_opts;
|
2017-12-25 15:04:09 +00:00
|
|
|
struct android_opts *android_opts;
|
2016-09-08 19:46:48 +00:00
|
|
|
struct dvd_opts *dvd_opts;
|
2017-05-29 16:48:10 +00:00
|
|
|
|
|
|
|
int cuda_device;
|
2008-03-31 03:19:29 +00:00
|
|
|
} MPOpts;
|
|
|
|
|
2016-09-08 19:46:48 +00:00
|
|
|
struct dvd_opts {
|
|
|
|
int angle;
|
|
|
|
int speed;
|
|
|
|
char *device;
|
|
|
|
};
|
|
|
|
|
video: rewrite filtering glue code
Get rid of the old vf.c code. Replace it with a generic filtering
framework, which can potentially handle more than just --vf. At least
reimplementing --af with this code is planned.
This changes some --vf semantics (including runtime behavior and the
"vf" command). The most important ones are listed in interface-changes.
vf_convert.c is renamed to f_swscale.c. It is now an internal filter
that can not be inserted by the user manually.
f_lavfi.c is a refactor of player/lavfi.c. The latter will be removed
once --lavfi-complex is reimplemented on top of f_lavfi.c. (which is
conceptually easy, but a big mess due to the data flow changes).
The existing filters are all changed heavily. The data flow of the new
filter framework is different. Especially EOF handling changes - EOF is
now a "frame" rather than a state, and must be passed through exactly
once.
Another major thing is that all filters must support dynamic format
changes. The filter reconfig() function goes away. (This sounds complex,
but since all filters need to handle EOF draining anyway, they can use
the same code, and it removes the mess with reconfig() having to predict
the output format, which completely breaks with libavfilter anyway.)
In addition, there is no automatic format negotiation or conversion.
libavfilter's primitive and insufficient API simply doesn't allow us to
do this in a reasonable way. Instead, filters can use f_autoconvert as
sub-filter, and tell it which formats they support. This filter will in
turn add actual conversion filters, such as f_swscale, to perform
necessary format changes.
vf_vapoursynth.c uses the same basic principle of operation as before,
but with worryingly different details in data flow. Still appears to
work.
The hardware deint filters (vf_vavpp.c, vf_d3d11vpp.c, vf_vdpaupp.c) are
heavily changed. Fortunately, they all used refqueue.c, which is for
sharing the data flow logic (especially for managing future/past
surfaces and such). It turns out it can be used to factor out most of
the data flow. Some of these filters accepted software input. Instead of
having ad-hoc upload code in each filter, surface upload is now
delegated to f_autoconvert, which can use f_hwupload to perform this.
Exporting VO capabilities is still a big mess (mp_stream_info stuff).
The D3D11 code drops the redundant image formats, and all code uses the
hw_subfmt (sw_format in FFmpeg) instead. Although that too seems to be a
big mess for now.
f_async_queue is unused.
2018-01-16 10:53:44 +00:00
|
|
|
struct filter_opts {
|
|
|
|
int deinterlace;
|
|
|
|
};
|
|
|
|
|
2013-06-07 20:57:00 +00:00
|
|
|
extern const m_option_t mp_opts[];
|
|
|
|
extern const struct MPOpts mp_default_opts;
|
2016-09-02 13:50:54 +00:00
|
|
|
extern const struct m_sub_options vo_sub_opts;
|
2016-09-06 18:09:56 +00:00
|
|
|
extern const struct m_sub_options stream_cache_conf;
|
2016-09-08 19:46:48 +00:00
|
|
|
extern const struct m_sub_options dvd_conf;
|
2017-12-29 16:19:25 +00:00
|
|
|
extern const struct m_sub_options mp_subtitle_sub_opts;
|
|
|
|
extern const struct m_sub_options mp_osd_render_sub_opts;
|
video: rewrite filtering glue code
Get rid of the old vf.c code. Replace it with a generic filtering
framework, which can potentially handle more than just --vf. At least
reimplementing --af with this code is planned.
This changes some --vf semantics (including runtime behavior and the
"vf" command). The most important ones are listed in interface-changes.
vf_convert.c is renamed to f_swscale.c. It is now an internal filter
that can not be inserted by the user manually.
f_lavfi.c is a refactor of player/lavfi.c. The latter will be removed
once --lavfi-complex is reimplemented on top of f_lavfi.c. (which is
conceptually easy, but a big mess due to the data flow changes).
The existing filters are all changed heavily. The data flow of the new
filter framework is different. Especially EOF handling changes - EOF is
now a "frame" rather than a state, and must be passed through exactly
once.
Another major thing is that all filters must support dynamic format
changes. The filter reconfig() function goes away. (This sounds complex,
but since all filters need to handle EOF draining anyway, they can use
the same code, and it removes the mess with reconfig() having to predict
the output format, which completely breaks with libavfilter anyway.)
In addition, there is no automatic format negotiation or conversion.
libavfilter's primitive and insufficient API simply doesn't allow us to
do this in a reasonable way. Instead, filters can use f_autoconvert as
sub-filter, and tell it which formats they support. This filter will in
turn add actual conversion filters, such as f_swscale, to perform
necessary format changes.
vf_vapoursynth.c uses the same basic principle of operation as before,
but with worryingly different details in data flow. Still appears to
work.
The hardware deint filters (vf_vavpp.c, vf_d3d11vpp.c, vf_vdpaupp.c) are
heavily changed. Fortunately, they all used refqueue.c, which is for
sharing the data flow logic (especially for managing future/past
surfaces and such). It turns out it can be used to factor out most of
the data flow. Some of these filters accepted software input. Instead of
having ad-hoc upload code in each filter, surface upload is now
delegated to f_autoconvert, which can use f_hwupload to perform this.
Exporting VO capabilities is still a big mess (mp_stream_info stuff).
The D3D11 code drops the redundant image formats, and all code uses the
hw_subfmt (sw_format in FFmpeg) instead. Although that too seems to be a
big mess for now.
f_async_queue is unused.
2018-01-16 10:53:44 +00:00
|
|
|
extern const struct m_sub_options filter_conf;
|
2018-01-18 13:44:20 +00:00
|
|
|
extern const struct m_sub_options resample_conf;
|
2013-06-07 20:57:00 +00:00
|
|
|
|
2017-12-01 20:05:54 +00:00
|
|
|
int hwdec_validate_opt(struct mp_log *log, const m_option_t *opt,
|
|
|
|
struct bstr name, struct bstr param);
|
|
|
|
|
2008-03-31 03:19:29 +00:00
|
|
|
#endif
|