mpv/core/defaultopts.c

107 lines
3.0 KiB
C
Raw Normal View History

#include <stddef.h>
#include "config.h"
#include "defaultopts.h"
#include "core/options.h"
#include "audio/mixer.h"
void set_default_mplayer_options(struct MPOpts *opts)
{
*opts = (const struct MPOpts){
.audio_driver_list = NULL,
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
.audio_decoders = "-spdif:*", // never select spdif by default
.video_decoders = NULL,
.fixed_vo = 1,
.softvol = SOFTVOL_AUTO,
.softvol_max = 200,
.mixer_init_volume = -1,
.mixer_init_mute = -1,
2013-04-09 00:41:46 +00:00
.volstep = 3,
.ao_buffersize = -1,
.vo = {
.video_driver_list = NULL,
.cursor_autohide_delay = 1000,
.monitor_pixel_aspect = 1.0,
.panscanrange = 1.0,
.fs = false,
.screen_id = -1,
.fsscreen_id = -1,
.stop_screensaver = 1,
.nomouse_input = 0,
.fsmode = 0,
.panscan = 0.0f,
.keepaspect = 1,
.border = 1,
.colorkey = 0x0000ff00, // default colorkey is green
// (0xff000000 means that colorkey has been disabled)
.WinID = -1,
},
.wintitle = "mpv - ${media-title}",
.heartbeat_interval = 30.0,
.gamma_gamma = 1000,
.gamma_brightness = 1000,
.gamma_contrast = 1000,
.gamma_saturation = 1000,
.gamma_hue = 1000,
.osd_level = 1,
.osd_duration = 1000,
.osd_bar_align_y = 0.5,
.osd_bar_w = 75.0,
.osd_bar_h = 3.125,
2008-04-21 02:18:40 +00:00
.loop_times = -1,
2009-04-07 23:37:27 +00:00
.ordered_chapters = 1,
.chapter_merge_threshold = 100,
.load_config = 1,
.stream_cache_min_percent = 20.0,
.stream_cache_seek_min_percent = 50.0,
.stream_cache_pause = 10.0,
.chapterrange = {-1, -1},
.edition_id = -1,
.default_max_pts_correction = -1,
2008-04-16 04:11:12 +00:00
.user_correct_pts = -1,
.initial_audio_sync = 1,
.term_osd = 2,
.consolecontrols = 1,
.doubleclick_time = 300,
.play_frames = -1,
.keep_open = 0,
.audio_id = -1,
.video_id = -1,
.sub_id = -1,
.audio_display = 1,
.sub_visibility = 1,
.extension_parsing = 1,
.audio_output_channels = 2,
.audio_output_format = -1, // AF_FORMAT_UNKNOWN
2008-04-21 03:55:23 +00:00
.playback_speed = 1.,
2008-04-24 04:36:43 +00:00
.movie_aspect = -1.,
.sub_auto = 1,
.osd_bar_visible = 1,
#ifdef CONFIG_ASS
.ass_enabled = 1,
#endif
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
.sub_scale = 1,
.ass_vsfilter_aspect_compat = 1,
.ass_style_override = 1,
.use_embedded_fonts = 1,
.lavc_param = {
2008-04-24 00:59:21 +00:00
.workaround_bugs = 1, // autodetect
.error_concealment = 3,
},
.ad_lavc_param = {
.ac3drc = 1.,
.downmix = 1,
},
.input = {
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
.key_fifo_size = 7,
2008-04-30 15:57:02 +00:00
.ar_delay = 100,
.ar_rate = 8,
.use_joystick = 1,
.use_lirc = 1,
.use_lircc = 1,
2009-03-31 23:26:34 +00:00
.default_bindings = 1,
2008-04-30 15:57:02 +00:00
}
};
}