1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-27 09:32:40 +00:00
mpv/options/options.h

339 lines
7.6 KiB
C
Raw Normal View History

#ifndef MPLAYER_OPTIONS_H
#define MPLAYER_OPTIONS_H
#include <stdbool.h>
#include <stdint.h>
#include "m_option.h"
#include "common/common.h"
typedef struct mp_vo_opts {
struct m_obj_settings *video_driver_list;
int taskbar_progress;
int ontop;
int fullscreen;
int border;
int fit_border;
int all_workspaces;
int screen_id;
int fsscreen_id;
int fs_black_out_screens;
char *winname;
int x11_netwm;
int x11_bypass_compositor;
int native_keyrepeat;
float panscan;
float zoom;
float pan_x, pan_y;
float align_x, align_y;
int unscaled;
struct m_geometry geometry;
struct m_geometry autofit;
struct m_geometry autofit_larger;
struct m_geometry autofit_smaller;
double window_scale;
int keepaspect;
int keepaspect_window;
int hidpi_window_scale;
int64_t WinID;
float force_monitor_aspect;
float monitor_pixel_aspect;
int force_window_position;
char *mmcss_profile;
// vo_wayland, vo_drm
struct sws_opts *sws_opts;
// vo_opengl, vo_opengl_cb
int hwdec_preload_api;
// vo_drm
char *drm_connector_spec;
int drm_mode_id;
} mp_vo_opts;
struct mp_cache_opts {
int size;
int def_size;
int initial;
int seek_min;
int back_buffer;
char *file;
int file_max;
};
typedef struct MPOpts {
int property_print_help;
int use_terminal;
char *dump_stats;
2013-12-21 22:11:12 +00:00
int verbose;
char **msg_levels;
2013-12-21 22:11:12 +00:00
int msg_color;
int msg_module;
int msg_time;
char *log_file;
int operation_mode;
char **reset_options;
char **script_files;
char **script_opts;
int lua_load_osc;
2014-11-19 17:51:53 +00:00
int lua_load_ytdl;
char *lua_ytdl_format;
char **lua_ytdl_raw_options;
int auto_load_scripts;
struct m_obj_settings *audio_driver_list;
char *audio_device;
int audio_exclusive;
char *audio_client_name;
int ao_null_fallback;
int audio_stream_silence;
float audio_wait_open;
int force_vo;
int softvol;
float softvol_volume;
float balance;
int softvol_mute;
float softvol_max;
int gapless_audio;
double audio_buffer;
mp_vo_opts *vo;
char *wintitle;
char *media_title;
int force_rgba_osd;
// ranges -100 - 100, 1000 if the vo default should be used
int gamma_gamma;
int gamma_brightness;
int gamma_contrast;
int gamma_saturation;
int gamma_hue;
int video_output_levels;
int stop_screensaver;
int cursor_autohide_delay;
int cursor_autohide_fs;
int video_rotate;
int video_stereo_mode;
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;
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
int osd_level;
int osd_duration;
int osd_fractions;
int video_osd;
int untimed;
char *stream_capture;
char *stream_dump;
int stop_playback_on_init_failure;
2008-04-21 02:18:40 +00:00
int loop_times;
int loop_file;
int shuffle;
2009-04-07 23:37:27 +00:00
int ordered_chapters;
char *ordered_chapters_files;
int chapter_merge_threshold;
double chapter_seek_threshold;
char *chapter_file;
int load_unsafe_playlists;
2013-11-19 21:36:33 +00:00
int merge_files;
int quiet;
int load_config;
char *force_configdir;
int use_filedir_conf;
int hls_bitrate;
struct mp_cache_opts *stream_cache;
int chapterrange[2];
int edition_id;
int correct_pts;
int initial_audio_sync;
int video_sync;
double sync_max_video_change;
double sync_max_audio_change;
double sync_audio_drop_size;
int hr_seek;
float hr_seek_demuxer_offset;
int hr_seek_framedrop;
float audio_delay;
float default_max_pts_correction;
int autosync;
int frame_dropping;
double frame_drop_fps;
int term_osd;
int term_osd_bar;
char *term_osd_bar_chars;
char *playing_msg;
2014-09-01 22:09:03 +00:00
char *osd_playing_msg;
char *status_msg;
char *osd_status_msg;
char *osd_msg[3];
char *heartbeat_cmd;
float heartbeat_interval;
int player_idle_mode;
int consolecontrols;
int playlist_pos;
struct m_rel_time play_start;
struct m_rel_time play_end;
struct m_rel_time play_length;
int rebase_start_time;
int play_frames;
double ab_loop[2];
double step_sec;
int position_resume;
int position_save_on_quit;
int write_filename_in_watch_later_config;
int ignore_path_in_watch_later_config;
char *watch_later_directory;
int pause;
int keep_open;
double image_display_duration;
char *lavfi_complex;
int stream_id[2][STREAM_TYPE_COUNT];
int stream_id_ff[STREAM_TYPE_COUNT];
char **stream_lang[STREAM_TYPE_COUNT];
int audio_display;
char **display_tags;
int sub_visibility;
2013-04-28 23:49:20 +00:00
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 sub_fix_timing;
2013-04-28 23:49:20 +00:00
char **audio_files;
char *demuxer_name;
int demuxer_thread;
char *audio_demuxer_name;
char *sub_demuxer_name;
int cache_pausing;
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;
double force_fps;
int index_mode;
struct m_channels audio_output_channels;
int audio_output_format;
int audio_normalize;
int force_srate;
int dtshd;
double playback_speed;
int pitch_correction;
struct m_obj_settings *vf_settings, *vf_defs;
struct m_obj_settings *af_settings, *af_defs;
core: add --deinterlace option, restore it with resume functionality The --deinterlace option does on playback start what the "deinterlace" property normally does at runtime. You could do this before by using the --vf option or by messing with the vo_vdpau default options, but this new option is supposed to be a "foolproof" way. The main motivation for adding this is so that the deinterlace property can be restored when using the video resume functionality (quit_watch_later command). Implementation-wise, this is a bit messy. The video chain is rebuilt in mpcodecs_reconfig_vo(), where we don't have access to MPContext, so the usual mechanism for enabling deinterlacing can't be used. Further, mpcodecs_reconfig_vo() is called by the video decoder, which doesn't have access to MPContext either. Moving this call to mplayer.c isn't currently possible either (see below). So we just do this before frames are filtered, which potentially means setting the deinterlacing every frame. Fortunately, setting deinterlacing is stable and idempotent, so this is hopefully not a problem. We also add a counter that is incremented on each reconfig to reduce the amount of additional work per frame to nearly zero. The reason we can't move mpcodecs_reconfig_vo() to mplayer.c is because of hardware decoding: we need to check whether the video chain works before we decide that we can use hardware decoding. Changing it so that this can be decided in advance without building a filter chain sounds like a good idea and should be done, but we aren't there yet.
2013-09-13 16:06:08 +00:00
int deinterlace;
2008-04-24 04:36:43 +00:00
float movie_aspect;
int aspect_method;
int field_dominance;
char **sub_name;
2011-03-03 10:31:12 +00:00
char **sub_paths;
char **audiofile_paths;
char **external_files;
int autoload_files;
int sub_auto;
int audiofile_auto;
int osd_bar_visible;
float osd_bar_align_x;
float osd_bar_align_y;
float osd_bar_w;
float osd_bar_h;
float osd_scale;
2013-12-10 18:58:57 +00:00
int osd_scale_by_window;
int sub_scale_by_window;
int sub_scale_with_window;
int ass_scale_with_window;
osd: make the OSD and sub font more customizable Make more aspects of the OSD font customizable. This also affects the font used for unstyled subtitles (such as SRT), or when using the --no-ass option. This adds back some customizability that was lost with commit 74e7a1 (osd: use libass for OSD rendering). Removed options: --ass-border-color --ass-color --font --subfont --subfont-text-scale Added options: --osd-color --osd-border --osd-back-color --osd-shadow-color --osd-font --osd-font-size --osd-border-size --osd-margin-x --osd-margin-y --osd-shadow-offset --osd-spacing --sub-scale The font size is now specified in pixels as it would be rendered on a window with a height of 720 pixels. OSD and subtitles are always scaled with the window height, so specifying or expecting an absolute font size doesn't make sense. Such scaled pixel units are used to specify font border etc. as well. (Note: the font size is directly passed to libass. How the fonts are actually rasterized is outside of our control, but in theory ASS font sizes map to "script" pixels and then are scaled to screen size.) The default settings should be about the same, with slight difference due to rounding to the new scales. The OSD and subtitle fonts are not separately configurable. It has limited use and would double the number of newly added options, which would be more confusing than helpful. It could be easily added later, should the need arise. Other small details that change: - ASS_Style.Encoding is not set to -1 for subs anymore (assuming subs use VSFilter direction in -no-ass mode too) - use a different WrapStyle for OSD - ASS forced styles are not applied to OSD
2012-11-17 19:56:45 +00:00
struct osd_style_opts *osd_style;
struct osd_style_opts *sub_style;
osd: make the OSD and sub font more customizable Make more aspects of the OSD font customizable. This also affects the font used for unstyled subtitles (such as SRT), or when using the --no-ass option. This adds back some customizability that was lost with commit 74e7a1 (osd: use libass for OSD rendering). Removed options: --ass-border-color --ass-color --font --subfont --subfont-text-scale Added options: --osd-color --osd-border --osd-back-color --osd-shadow-color --osd-font --osd-font-size --osd-border-size --osd-margin-x --osd-margin-y --osd-shadow-offset --osd-spacing --sub-scale The font size is now specified in pixels as it would be rendered on a window with a height of 720 pixels. OSD and subtitles are always scaled with the window height, so specifying or expecting an absolute font size doesn't make sense. Such scaled pixel units are used to specify font border etc. as well. (Note: the font size is directly passed to libass. How the fonts are actually rasterized is outside of our control, but in theory ASS font sizes map to "script" pixels and then are scaled to screen size.) The default settings should be about the same, with slight difference due to rounding to the new scales. The OSD and subtitle fonts are not separately configurable. It has limited use and would double the number of newly added options, which would be more confusing than helpful. It could be easily added later, should the need arise. Other small details that change: - ASS_Style.Encoding is not set to -1 for subs anymore (assuming subs use VSFilter direction in -no-ass mode too) - use a different WrapStyle for OSD - ASS forced styles are not applied to OSD
2012-11-17 19:56:45 +00:00
float sub_scale;
float sub_gauss;
int sub_gray;
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 sub_clear_on_seek;
int teletext_page;
int hwdec_api;
char *hwdec_codecs;
int videotoolbox_format;
int w32_priority;
struct tv_params *tv_params;
struct pvr_params *stream_pvr_opts;
struct cdda_params *stream_cdda_opts;
struct dvb_params *stream_dvb_opts;
struct stream_lavf_params *stream_lavf_opts;
char *cdrom_device;
char *bluray_device;
double mf_fps;
char *mf_type;
struct demux_rawaudio_opts *demux_rawaudio;
struct demux_rawvideo_opts *demux_rawvideo;
struct demux_lavf_opts *demux_lavf;
struct demux_mkv_opts *demux_mkv;
struct demux_opts *demux_opts;
struct vd_lavc_params *vd_lavc_params;
struct ad_lavc_params *ad_lavc_params;
struct input_opts *input_opts;
// may be NULL if encoding is not compiled-in
struct encode_opts *encode_opts;
char *ipc_path;
char *input_file;
struct gl_video_opts *gl_video_opts;
struct dvd_opts *dvd_opts;
} MPOpts;
struct dvd_opts {
int angle;
int speed;
char *device;
};
extern const m_option_t mp_opts[];
extern const struct MPOpts mp_default_opts;
extern const struct m_sub_options vo_sub_opts;
extern const struct m_sub_options stream_cache_conf;
extern const struct m_sub_options dvd_conf;
#endif