mpv/options/options.h

319 lines
7.1 KiB
C
Raw Normal View History

#ifndef MPLAYER_OPTIONS_H
#define MPLAYER_OPTIONS_H
#include <stdbool.h>
#include <stdint.h>
#include "m_option.h"
typedef struct mp_vo_opts {
struct m_obj_settings *video_driver_list, *vo_defs;
int ontop;
int fullscreen;
int border;
int all_workspaces;
int screen_id;
int fsscreen_id;
int fs_black_out_screens;
char *winname;
int x11_netwm;
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;
int keepaspect;
int keepaspect_window;
int64_t WinID;
float force_monitor_aspect;
float monitor_pixel_aspect;
int force_window_position;
struct sws_opts *sws_opts;
} mp_vo_opts;
struct mp_cache_opts {
int size;
int def_size;
int initial;
int seek_min;
char *file;
int file_max;
};
typedef struct MPOpts {
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;
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, *ao_defs;
char *audio_device;
char *audio_client_name;
int force_vo;
int softvol;
float mixer_init_volume;
int mixer_init_mute;
char *mixer_restore_volume_data;
float softvol_max;
int gapless_audio;
double audio_buffer;
mp_vo_opts vo;
int allow_win_drag;
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 stop_screensaver;
int cursor_autohide_delay;
int cursor_autohide_fs;
video, options: implement better YUV->RGB conversion control Rewrite control of the colorspace and input/output level parameters used in YUV-RGB conversions, replacing VO-specific suboptions with new common options and adding configuration support to more cases. Add new option --colormatrix which selects the colorspace the original video is assumed to have in YUV->RGB conversions. The default behavior changes from assuming BT.601 to colorspace autoselection between BT.601 and BT.709 using a simple heuristic based on video size. Add new options --colormatrix-input-range and --colormatrix-output-range which select input YUV and output RGB range. Disable the previously existing VO-specific colorspace and level conversion suboptions in vo_gl and vo_vdpau. Remove the "yuv_colorspace" property and replace it with one named "colormatrix" and semantics matching the new option. Add new properties matching the options for level conversion. Colorspace selection is currently supported by vo_gl, vo_vdpau, vo_xv and vf_scale, and all can change it at runtime (previously only vo_vdpau and vo_xv could). vo_vdpau now uses the same conversion matrix generation as vo_gl instead of libvdpau functionality; the main functional difference is that the "contrast" equalizer control behaves somewhat differently (it scales the Y component around 1/2 instead of around 0, so that contrast 0 makes the image gray rather than black). vo_xv does not support level conversion. vf_scale supports range setting for input, but always outputs full-range RGB. The value of the slave properties is the policy setting used for conversions. This means they can be set to any value regardless of whether the current VO supports that value or whether there currently even is any video. Possibly separate properties could be added to query the conversion actually used at the moment, if any. Because the colorspace and level settings are now set with a single VF/VO control call, the return value of that is no longer used to signal whether all the settings are actually supported. Instead code should set all the details it can support, and ignore the rest. The core will use GET_YUV_COLORSPACE to check which colorspace details have been set and which not. In other words, the return value for SET_YUV_COLORSPACE only signals whether any kind of YUV colorspace conversion handling exists at all, and VOs have to take care to return the actual state with GET_YUV_COLORSPACE instead. To be changed in later commits: add missing option documentation.
2011-10-15 21:50:21 +00:00
int requested_colorspace;
int requested_input_range;
int requested_output_range;
int requested_primaries;
2008-04-25 04:12:05 +00:00
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;
int osd_level;
int osd_duration;
int osd_fractions;
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 network_rtsp_transport;
int hls_bitrate;
struct mp_cache_opts stream_cache;
int chapterrange[2];
int edition_id;
int correct_pts;
int user_pts_assoc_mode;
int initial_audio_sync;
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;
struct m_rel_time play_start;
struct m_rel_time play_end;
struct m_rel_time play_length;
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;
int pause;
int keep_open;
int audio_id;
int video_id;
int sub_id;
int sub2_id;
int audio_id_ff;
int video_id_ff;
int sub_id_ff;
char **audio_lang;
char **sub_lang;
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 sub_fix_timing;
2013-04-28 23:49:20 +00:00
char *sub_cp;
char **audio_files;
char *demuxer_name;
int demuxer_thread;
int demuxer_min_packs;
int demuxer_min_bytes;
double demuxer_min_secs;
char *audio_demuxer_name;
char *sub_demuxer_name;
int mkv_subtitle_preroll;
double mkv_subtitle_preroll_secs;
int mkv_probe_duration;
double demuxer_min_secs_cache;
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;
double force_fps;
int index_mode;
struct mp_chmap audio_output_channels;
int audio_output_format;
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 field_dominance;
char **sub_name;
2011-03-03 10:31:12 +00:00
char **sub_paths;
int sub_auto;
int audiofile_auto;
int use_text_osd;
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_text_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 hwdec_api;
char *hwdec_codecs;
int w32_priority;
int slave_mode;
int network_cookies_enabled;
char *network_cookies_file;
char *network_useragent;
char *network_referrer;
char **network_http_header_fields;
int network_tls_verify;
char *network_tls_ca_file;
double network_timeout;
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;
int dvd_title;
int dvd_angle;
int dvd_speed;
char *dvd_device;
int bluray_angle;
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 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;
} MPOpts;
extern const m_option_t mp_opts[];
extern const struct MPOpts mp_default_opts;
#endif