mpv/core/options.h

257 lines
5.4 KiB
C
Raw Normal View History

#ifndef MPLAYER_OPTIONS_H
#define MPLAYER_OPTIONS_H
#include <stdbool.h>
#include <stdint.h>
#include "core/m_option.h"
typedef struct mp_vo_opts {
char **video_driver_list;
int screenwidth;
int screenheight;
int ontop;
bool fs;
int screen_id;
int fsscreen_id;
int stop_screensaver;
char *winname;
char** fstype_list;
float panscan;
float panscanrange;
struct m_geometry geometry;
struct m_geometry autofit;
struct m_geometry autofit_larger;
int fsmode;
int keepaspect;
int border;
int colorkey;
int nomouse_input;
int enable_mouse_movements;
int cursor_autohide_delay;
int64_t WinID;
float force_monitor_aspect;
float monitor_pixel_aspect;
int force_window_position;
} mp_vo_opts;
typedef struct MPOpts {
char **reset_options;
char **audio_driver_list;
int fixed_vo;
char *mixer_device;
char *mixer_channel;
int softvol;
float mixer_init_volume;
int mixer_init_mute;
2013-04-09 00:41:46 +00:00
int volstep;
float softvol_max;
int gapless_audio;
int ao_buffersize;
mp_vo_opts vo;
char *wintitle;
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;
2008-04-24 03:58:16 +00:00
int fullscreen;
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;
2008-04-25 04:12:05 +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;
int osd_level;
int osd_duration;
int osd_fractions;
char *vobsub_name;
int untimed;
2008-04-21 02:18:40 +00:00
int loop_times;
2009-04-07 23:37:27 +00:00
int ordered_chapters;
int chapter_merge_threshold;
int quiet;
int load_config;
int use_filedir_conf;
int stream_cache_size;
float stream_cache_min_percent;
float stream_cache_seek_min_percent;
int stream_cache_pause;
int chapterrange[2];
int edition_id;
int correct_pts;
2008-04-16 04:11:12 +00:00
int user_correct_pts;
int user_pts_assoc_mode;
int initial_audio_sync;
int hr_seek;
float hr_seek_demuxer_offset;
float audio_delay;
float default_max_pts_correction;
int ignore_start;
int autosync;
int softsleep;
int frame_dropping;
int term_osd;
char *term_osd_esc;
char *playing_msg;
char *status_msg;
char *osd_status_msg;
char *heartbeat_cmd;
float heartbeat_interval;
int player_idle_mode;
int slave_mode;
int consolecontrols;
int doubleclick_time;
int list_properties;
struct m_rel_time play_start;
struct m_rel_time play_end;
struct m_rel_time play_length;
int play_frames;
double step_sec;
int64_t seek_to_byte;
int start_paused;
int keep_open;
int audio_id;
int video_id;
int sub_id;
char **audio_lang;
char **sub_lang;
int audio_display;
int sub_visibility;
int forced_subs_only;
char *quvi_format;
char *audio_stream;
int audio_stream_cache;
char *sub_stream;
char *demuxer_name;
char *audio_demuxer_name;
char *sub_demuxer_name;
int extension_parsing;
int mkv_subtitle_preroll;
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;
struct mp_chmap audio_output_channels;
int audio_output_format;
int force_srate;
int dtshd;
2008-04-21 03:55:23 +00:00
float playback_speed;
2008-04-25 10:58:12 +00:00
struct m_obj_settings *vf_settings;
2008-04-24 04:36:43 +00:00
float movie_aspect;
int flip;
int vd_use_dr1;
char **sub_name;
2011-03-03 10:31:12 +00:00
char **sub_paths;
int sub_auto;
int osd_bar_visible;
float osd_bar_align_x;
float osd_bar_align_y;
float osd_bar_w;
float osd_bar_h;
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 ass_vsfilter_aspect_compat;
int use_embedded_fonts;
char **ass_force_style_list;
char *ass_styles_file;
int ass_style_override;
int ass_hinting;
int hwdec_api;
2008-04-24 00:59:21 +00:00
struct lavc_param {
int workaround_bugs;
int error_resilience;
int error_concealment;
int gray;
int idct_algo;
int debug;
int vismv;
int skip_top;
int skip_bottom;
int fast;
char *skip_loop_filter_str;
char *skip_idct_str;
char *skip_frame_str;
int threads;
int bitexact;
char *avopt;
2008-04-24 00:59:21 +00:00
} lavc_param;
struct ad_lavc_param {
float ac3drc;
int downmix;
char *avopt;
} ad_lavc_param;
struct lavfdopts {
int probesize;
int probescore;
int analyzeduration;
char *format;
char *cryptokey;
char *avopt;
} lavfdopts;
2008-04-30 15:57:02 +00:00
struct input_conf {
char *config_file;
input: rework event reading and command queuing Rework much of the logic related to reading from event sources and queuing commands. The two biggest architecture changes are: - The code buffering keycodes in mp_fifo.c is gone. Instead key input is now immediately fed to input.c and interpreted as commands, and then the commands are buffered instead. - mp_input_get_cmd() now always tries to read every available event from every event source and convert them to (buffered) commands. Before it would only process new events until one new command became available. Some relevant behavior changes: - Before commands could be lost when stream code called mp_input_check_interrupt() which read commands (to see if they were of types that triggered aborts during slow IO tasks) and then threw them away. This was especially an issue if cache was enabled and slow to read. Fixed - now it's possible to check whether there are queued commands which will abort playback of the current file without throwing other commands away. - mp_input_check_interrupt() now prints a message if it returns true. This is especially useful because the failures caused by aborted stream reads can trigger error messages from other code that was doing the read; the new message makes it more obvious what the cause of the subsequent error messages is. - It's now possible to again avoid making stdin non-blocking (which caused some issues) without reintroducing extra latency. The change will be done in a subsequent commit. - Event sources that do not support select() should now have somewhat lower latency in certain situations as they will be checked both before and after select()/sleep in input reading; before the sleep always happened first even if such sources already had queued input. Before the key fifo was also handled in this manner (first key triggered select, but if multiple were read then rest could be delayed; however in most cases this didn't add latency in practice as after central code started doing command handling it queried for further commands with a max sleep time of 0). - Key fifo limiting is more accurate now: it now counts actual commands intead of keycodes, and all queued keys are read immediately from input devices so they can be counted correctly. - Since keypresses are now interpreted immediately, commands which change keybindings will no longer affect following keypresses that have already been read before the command is executed. This should not be an issue in practice with current keybinding behavior.
2011-07-17 01:47:50 +00:00
int key_fifo_size;
int ar_delay;
int ar_rate;
2008-04-30 15:57:02 +00:00
char *js_dev;
char *in_file;
int use_joystick;
int use_lirc;
int use_lircc;
2009-03-31 23:26:34 +00:00
int default_bindings;
int test;
2008-04-30 15:57:02 +00:00
} input;
struct encode_output_conf {
char *file;
char *format;
char **fopts;
float fps;
char *vcodec;
char **vopts;
char *acodec;
char **aopts;
int harddup;
float voffset;
float aoffset;
int copyts;
int rawts;
int autofps;
int neverdrop;
int video_first;
int audio_first;
} encode_output;
} MPOpts;
#endif