2010-01-30 23:24:23 +00:00
|
|
|
/*
|
2015-04-13 07:36:54 +00:00
|
|
|
* This file is part of mpv.
|
2010-01-30 23:24:23 +00:00
|
|
|
*
|
player: change license of most core files to LGPL
These files have all in common that they were fully or mostly taken from
mplayer.c. (mplayer.c was a huge file that contains almost all of the
playback core, until it was split into multiple parts.) This was
probably the hardest part to relicense, because so much code was moved
around all the time.
player/audio.c still does not compile. We'll have to redo audio
filtering. Once that is done, we can probably actually provide an
actual LGPL configure switch.
Here is a relatively detailed list of potential issues:
8d190244: author did not reply, parts were made GPL-only in a previous
commit.
7882ea9b: author could not be reached, but the code is gone. wscript
still has --datadir switch, but I don't think this is relevant to
copyright.
f197efd5: unclear origin, but I consider the code gone anyway (replaced
with generic OSD mechanisms).
8337d9c2: author did not reply, but only the option still exists (under
a different name), other code was removed.
d8fd7131: did not reply. Disabled in a previous commit.
05258251: same author as above. Both fields actually seem to have
vanished (even when tracking renames), so no action taken.
d459e644, 268b2c1a: author did not reply, but we reuse only the options
(with different names and slightly or fully different semantics, and
completely different implementations), so I don't think this is relevant
for copyright.
09e742fe, 17c39c4e: same as above.
e8a173de, bff4b3ee: author could not be reached. The commands were
reworked to properties, and the code outside of the TV code were moved
back to the TV code. So I don't think copyright applies to the current
command.c parts (mp_property_tv_color, mp_property_tv_freq,
mp_property_tv_scan). The TV parts remain GPL.
0810e427: could not be reached. Disabled in a previous commit.
43744a2d: unknown author, but this was replaced by dynamic alloc (if the
change is even copyrightable).
116ca0c7: unknown author; reasoning see input.c relicensing commit.
e7e4d1d8: these semantics still exist, but as generic code, and this
code was fully removed.
f1175cd9: the author of the cited patch is unknown, and upon inspection
it turns out that I was only using the idea to pause the player on EOF,
so I claim it's not copyright relevant.
25affdcc: author could not be reached (yet) - but it's only a function
rename, not copyrightable.
5728504c was committed by Arpi (who agreed), but hints that it might be
by a different author. In fact it seems to be mostly this patch:
http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2001-November/002041.html
The author did not respond, but it all seems to have been removed later.
It's a terrible mess though. Arpi reverted the A-V sync code at first,
but left the RTC code for a while. The following commits remove these
changes 100%: 14b35442, 7181a091, 31482783, 614f8475, df58e822.
cehoyos did explicitly not agree to LGPL, but was involved in the
following changes:
c99d8fc8: applied a patch and didn't modify it, the original author
agreed.
40ac0d31: author could not be reached, but all code is gone anyway. The
"af" command has a similar function, but works completely different and
actually reuses a mechanism older than this patch.
54350436: applied a patch, but didn't modify it, except for adding a
German translation, which was removed later.
a2dda036: same situation as above
240b743e: this was made GPL-only in a previous commit
7b25afd7: same as above (for now)
kirijua could not be reached, but was a regular patch contributor:
c2c997fd: video equalizer code move; probably not copyrightable. Is GPL
due to Nick anyway.
be54f481: technically, this became the audio track property later. But
all what is left is the fact that you pass a track ID to it, so consider
the original coypright non-relevant.
2f376d1b: this was rewritten in b7052b43, but for now we can afford to
be careful, so this was marked as GPL only in a previous commit.
43844d09: remaining parts in main.c were reverted in a previous commit.
anders has mostly disagreed with the LGPL relicensing. Does not want
libaf to become LGPL, but made some concessions. In particular, he
granted us permission to relicense 4943e9c52c and 242aa6ebd4. We also
consider some of his changes remaining in mpv not relevant for copyright
(such as 735de602 - we won't remove the this option completely). We will
completely remove his other contributions, including the entire audio
filter chain. For now, this stuff is marked as GPL only. The remaining
question is how much code in player/audio.c (based on the former
mplayer.c and dec_audio.c) is under his copyright. I made claims about
this in a previous commit.
Nick(ols) Kurshev, svn username "nick" and "nickols_k", could not be
reached. He had a lot of changes in early MPlayer. It seems all of that
was removed, at least in mpv. His main work, like VIDIX or libswscale
work, does not exist in mpv anymore, but the changes to mplayer.c and
other core parts still deserve attention:
a4119f6b, fb927549, ad3529b8, e11b23dc, 5f2178be, 93c371d5: removed in
b43d67e0, d1628d12, 24ed01fe, df58e822.
0a83c6ec, 104c125e, 4e067f62, aec5dcc8, b587a3d6, f3de6e6b: DR, VAA, and
"tune" stuff was fully removed later on or replaced with other
mechanisms.
340183b0: screenshots were redone later (the VOCTRL was even removed,
with an independent implementation using the same VOCTRL a few years
later), so not relevant anymore. Basically only the 's' shortcut remains
(but not its implementation).
92c5c274, bffd4007, 555c6766: for now marked as GPL only in a previous
commit.
Might contain some trace amounts of "michael"'s copyright, who agreed to
LGPL only once the core is relicensed. This will still be respected, but
I don't think it matters at this in this case. (Some code touched by him
was merged into mplayer.c, and then disappeared after heavy
refactoring.)
I tried to be as careful and as complete as possible. It can't be
excluded that amends to this will be made later.
This does not make the player LGPL yet.
2017-06-23 13:53:41 +00:00
|
|
|
* mpv is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2010-01-30 23:24:23 +00:00
|
|
|
*
|
2015-04-13 07:36:54 +00:00
|
|
|
* mpv is distributed in the hope that it will be useful,
|
2010-01-30 23:24:23 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
player: change license of most core files to LGPL
These files have all in common that they were fully or mostly taken from
mplayer.c. (mplayer.c was a huge file that contains almost all of the
playback core, until it was split into multiple parts.) This was
probably the hardest part to relicense, because so much code was moved
around all the time.
player/audio.c still does not compile. We'll have to redo audio
filtering. Once that is done, we can probably actually provide an
actual LGPL configure switch.
Here is a relatively detailed list of potential issues:
8d190244: author did not reply, parts were made GPL-only in a previous
commit.
7882ea9b: author could not be reached, but the code is gone. wscript
still has --datadir switch, but I don't think this is relevant to
copyright.
f197efd5: unclear origin, but I consider the code gone anyway (replaced
with generic OSD mechanisms).
8337d9c2: author did not reply, but only the option still exists (under
a different name), other code was removed.
d8fd7131: did not reply. Disabled in a previous commit.
05258251: same author as above. Both fields actually seem to have
vanished (even when tracking renames), so no action taken.
d459e644, 268b2c1a: author did not reply, but we reuse only the options
(with different names and slightly or fully different semantics, and
completely different implementations), so I don't think this is relevant
for copyright.
09e742fe, 17c39c4e: same as above.
e8a173de, bff4b3ee: author could not be reached. The commands were
reworked to properties, and the code outside of the TV code were moved
back to the TV code. So I don't think copyright applies to the current
command.c parts (mp_property_tv_color, mp_property_tv_freq,
mp_property_tv_scan). The TV parts remain GPL.
0810e427: could not be reached. Disabled in a previous commit.
43744a2d: unknown author, but this was replaced by dynamic alloc (if the
change is even copyrightable).
116ca0c7: unknown author; reasoning see input.c relicensing commit.
e7e4d1d8: these semantics still exist, but as generic code, and this
code was fully removed.
f1175cd9: the author of the cited patch is unknown, and upon inspection
it turns out that I was only using the idea to pause the player on EOF,
so I claim it's not copyright relevant.
25affdcc: author could not be reached (yet) - but it's only a function
rename, not copyrightable.
5728504c was committed by Arpi (who agreed), but hints that it might be
by a different author. In fact it seems to be mostly this patch:
http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2001-November/002041.html
The author did not respond, but it all seems to have been removed later.
It's a terrible mess though. Arpi reverted the A-V sync code at first,
but left the RTC code for a while. The following commits remove these
changes 100%: 14b35442, 7181a091, 31482783, 614f8475, df58e822.
cehoyos did explicitly not agree to LGPL, but was involved in the
following changes:
c99d8fc8: applied a patch and didn't modify it, the original author
agreed.
40ac0d31: author could not be reached, but all code is gone anyway. The
"af" command has a similar function, but works completely different and
actually reuses a mechanism older than this patch.
54350436: applied a patch, but didn't modify it, except for adding a
German translation, which was removed later.
a2dda036: same situation as above
240b743e: this was made GPL-only in a previous commit
7b25afd7: same as above (for now)
kirijua could not be reached, but was a regular patch contributor:
c2c997fd: video equalizer code move; probably not copyrightable. Is GPL
due to Nick anyway.
be54f481: technically, this became the audio track property later. But
all what is left is the fact that you pass a track ID to it, so consider
the original coypright non-relevant.
2f376d1b: this was rewritten in b7052b43, but for now we can afford to
be careful, so this was marked as GPL only in a previous commit.
43844d09: remaining parts in main.c were reverted in a previous commit.
anders has mostly disagreed with the LGPL relicensing. Does not want
libaf to become LGPL, but made some concessions. In particular, he
granted us permission to relicense 4943e9c52c and 242aa6ebd4. We also
consider some of his changes remaining in mpv not relevant for copyright
(such as 735de602 - we won't remove the this option completely). We will
completely remove his other contributions, including the entire audio
filter chain. For now, this stuff is marked as GPL only. The remaining
question is how much code in player/audio.c (based on the former
mplayer.c and dec_audio.c) is under his copyright. I made claims about
this in a previous commit.
Nick(ols) Kurshev, svn username "nick" and "nickols_k", could not be
reached. He had a lot of changes in early MPlayer. It seems all of that
was removed, at least in mpv. His main work, like VIDIX or libswscale
work, does not exist in mpv anymore, but the changes to mplayer.c and
other core parts still deserve attention:
a4119f6b, fb927549, ad3529b8, e11b23dc, 5f2178be, 93c371d5: removed in
b43d67e0, d1628d12, 24ed01fe, df58e822.
0a83c6ec, 104c125e, 4e067f62, aec5dcc8, b587a3d6, f3de6e6b: DR, VAA, and
"tune" stuff was fully removed later on or replaced with other
mechanisms.
340183b0: screenshots were redone later (the VOCTRL was even removed,
with an independent implementation using the same VOCTRL a few years
later), so not relevant anymore. Basically only the 's' shortcut remains
(but not its implementation).
92c5c274, bffd4007, 555c6766: for now marked as GPL only in a previous
commit.
Might contain some trace amounts of "michael"'s copyright, who agreed to
LGPL only once the core is relicensed. This will still be respected, but
I don't think it matters at this in this case. (Some code touched by him
was merged into mplayer.c, and then disappeared after heavy
refactoring.)
I tried to be as careful and as complete as possible. It can't be
excluded that amends to this will be made later.
This does not make the player LGPL yet.
2017-06-23 13:53:41 +00:00
|
|
|
* GNU Lesser General Public License for more details.
|
2010-01-30 23:24:23 +00:00
|
|
|
*
|
player: change license of most core files to LGPL
These files have all in common that they were fully or mostly taken from
mplayer.c. (mplayer.c was a huge file that contains almost all of the
playback core, until it was split into multiple parts.) This was
probably the hardest part to relicense, because so much code was moved
around all the time.
player/audio.c still does not compile. We'll have to redo audio
filtering. Once that is done, we can probably actually provide an
actual LGPL configure switch.
Here is a relatively detailed list of potential issues:
8d190244: author did not reply, parts were made GPL-only in a previous
commit.
7882ea9b: author could not be reached, but the code is gone. wscript
still has --datadir switch, but I don't think this is relevant to
copyright.
f197efd5: unclear origin, but I consider the code gone anyway (replaced
with generic OSD mechanisms).
8337d9c2: author did not reply, but only the option still exists (under
a different name), other code was removed.
d8fd7131: did not reply. Disabled in a previous commit.
05258251: same author as above. Both fields actually seem to have
vanished (even when tracking renames), so no action taken.
d459e644, 268b2c1a: author did not reply, but we reuse only the options
(with different names and slightly or fully different semantics, and
completely different implementations), so I don't think this is relevant
for copyright.
09e742fe, 17c39c4e: same as above.
e8a173de, bff4b3ee: author could not be reached. The commands were
reworked to properties, and the code outside of the TV code were moved
back to the TV code. So I don't think copyright applies to the current
command.c parts (mp_property_tv_color, mp_property_tv_freq,
mp_property_tv_scan). The TV parts remain GPL.
0810e427: could not be reached. Disabled in a previous commit.
43744a2d: unknown author, but this was replaced by dynamic alloc (if the
change is even copyrightable).
116ca0c7: unknown author; reasoning see input.c relicensing commit.
e7e4d1d8: these semantics still exist, but as generic code, and this
code was fully removed.
f1175cd9: the author of the cited patch is unknown, and upon inspection
it turns out that I was only using the idea to pause the player on EOF,
so I claim it's not copyright relevant.
25affdcc: author could not be reached (yet) - but it's only a function
rename, not copyrightable.
5728504c was committed by Arpi (who agreed), but hints that it might be
by a different author. In fact it seems to be mostly this patch:
http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2001-November/002041.html
The author did not respond, but it all seems to have been removed later.
It's a terrible mess though. Arpi reverted the A-V sync code at first,
but left the RTC code for a while. The following commits remove these
changes 100%: 14b35442, 7181a091, 31482783, 614f8475, df58e822.
cehoyos did explicitly not agree to LGPL, but was involved in the
following changes:
c99d8fc8: applied a patch and didn't modify it, the original author
agreed.
40ac0d31: author could not be reached, but all code is gone anyway. The
"af" command has a similar function, but works completely different and
actually reuses a mechanism older than this patch.
54350436: applied a patch, but didn't modify it, except for adding a
German translation, which was removed later.
a2dda036: same situation as above
240b743e: this was made GPL-only in a previous commit
7b25afd7: same as above (for now)
kirijua could not be reached, but was a regular patch contributor:
c2c997fd: video equalizer code move; probably not copyrightable. Is GPL
due to Nick anyway.
be54f481: technically, this became the audio track property later. But
all what is left is the fact that you pass a track ID to it, so consider
the original coypright non-relevant.
2f376d1b: this was rewritten in b7052b43, but for now we can afford to
be careful, so this was marked as GPL only in a previous commit.
43844d09: remaining parts in main.c were reverted in a previous commit.
anders has mostly disagreed with the LGPL relicensing. Does not want
libaf to become LGPL, but made some concessions. In particular, he
granted us permission to relicense 4943e9c52c and 242aa6ebd4. We also
consider some of his changes remaining in mpv not relevant for copyright
(such as 735de602 - we won't remove the this option completely). We will
completely remove his other contributions, including the entire audio
filter chain. For now, this stuff is marked as GPL only. The remaining
question is how much code in player/audio.c (based on the former
mplayer.c and dec_audio.c) is under his copyright. I made claims about
this in a previous commit.
Nick(ols) Kurshev, svn username "nick" and "nickols_k", could not be
reached. He had a lot of changes in early MPlayer. It seems all of that
was removed, at least in mpv. His main work, like VIDIX or libswscale
work, does not exist in mpv anymore, but the changes to mplayer.c and
other core parts still deserve attention:
a4119f6b, fb927549, ad3529b8, e11b23dc, 5f2178be, 93c371d5: removed in
b43d67e0, d1628d12, 24ed01fe, df58e822.
0a83c6ec, 104c125e, 4e067f62, aec5dcc8, b587a3d6, f3de6e6b: DR, VAA, and
"tune" stuff was fully removed later on or replaced with other
mechanisms.
340183b0: screenshots were redone later (the VOCTRL was even removed,
with an independent implementation using the same VOCTRL a few years
later), so not relevant anymore. Basically only the 's' shortcut remains
(but not its implementation).
92c5c274, bffd4007, 555c6766: for now marked as GPL only in a previous
commit.
Might contain some trace amounts of "michael"'s copyright, who agreed to
LGPL only once the core is relicensed. This will still be respected, but
I don't think it matters at this in this case. (Some code touched by him
was merged into mplayer.c, and then disappeared after heavy
refactoring.)
I tried to be as careful and as complete as possible. It can't be
excluded that amends to this will be made later.
This does not make the player LGPL yet.
2017-06-23 13:53:41 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with mpv. If not, see <http://www.gnu.org/licenses/>.
|
2010-01-30 23:24:23 +00:00
|
|
|
*/
|
|
|
|
|
2008-02-22 09:09:46 +00:00
|
|
|
#ifndef MPLAYER_CFG_MPLAYER_H
|
|
|
|
#define MPLAYER_CFG_MPLAYER_H
|
2008-01-01 21:35:58 +00:00
|
|
|
|
2001-03-18 23:32:31 +00:00
|
|
|
/*
|
|
|
|
* config for cfgparser
|
|
|
|
*/
|
|
|
|
|
2008-03-31 03:19:29 +00:00
|
|
|
#include <stddef.h>
|
2011-03-10 21:08:21 +00:00
|
|
|
#include <sys/types.h>
|
2013-07-07 21:54:11 +00:00
|
|
|
#include <limits.h>
|
2016-08-17 20:45:44 +00:00
|
|
|
#include <math.h>
|
2008-03-31 03:19:29 +00:00
|
|
|
|
2011-03-10 21:08:21 +00:00
|
|
|
#include "config.h"
|
2014-06-11 22:34:20 +00:00
|
|
|
|
2015-01-20 14:18:51 +00:00
|
|
|
#ifdef _WIN32
|
2014-06-11 22:34:20 +00:00
|
|
|
#include <windows.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "options.h"
|
2013-12-17 01:02:25 +00:00
|
|
|
#include "m_config.h"
|
|
|
|
#include "m_option.h"
|
2013-12-22 13:33:15 +00:00
|
|
|
#include "common/common.h"
|
2014-04-13 16:51:43 +00:00
|
|
|
#include "stream/stream.h"
|
2012-11-09 00:06:43 +00:00
|
|
|
#include "video/csputils.h"
|
2015-07-07 12:25:37 +00:00
|
|
|
#include "video/hwdec.h"
|
2016-09-05 19:04:55 +00:00
|
|
|
#include "video/image_writer.h"
|
2013-11-24 11:58:06 +00:00
|
|
|
#include "sub/osd.h"
|
2013-12-17 00:08:53 +00:00
|
|
|
#include "player/core.h"
|
2013-12-26 18:22:40 +00:00
|
|
|
#include "player/command.h"
|
2014-06-30 10:49:01 +00:00
|
|
|
#include "stream/stream.h"
|
2001-11-09 23:46:06 +00:00
|
|
|
|
2016-10-04 20:07:19 +00:00
|
|
|
#if HAVE_DRM
|
|
|
|
#include "video/out/drm_common.h"
|
|
|
|
#endif
|
|
|
|
|
2013-12-26 18:22:40 +00:00
|
|
|
static void print_version(struct mp_log *log)
|
2013-06-07 20:57:00 +00:00
|
|
|
{
|
2013-12-21 18:45:42 +00:00
|
|
|
mp_print_version(log, true);
|
2013-12-26 18:22:40 +00:00
|
|
|
}
|
|
|
|
|
2014-06-09 21:54:45 +00:00
|
|
|
extern const struct m_sub_options tv_params_conf;
|
2014-06-10 18:46:15 +00:00
|
|
|
extern const struct m_sub_options stream_cdda_conf;
|
2014-06-10 19:44:50 +00:00
|
|
|
extern const struct m_sub_options stream_dvb_conf;
|
2014-07-29 23:15:42 +00:00
|
|
|
extern const struct m_sub_options stream_lavf_conf;
|
2014-06-10 20:41:14 +00:00
|
|
|
extern const struct m_sub_options sws_conf;
|
2019-10-19 23:54:45 +00:00
|
|
|
extern const struct m_sub_options zimg_conf;
|
2017-10-23 06:59:58 +00:00
|
|
|
extern const struct m_sub_options drm_conf;
|
2014-06-10 21:06:42 +00:00
|
|
|
extern const struct m_sub_options demux_rawaudio_conf;
|
|
|
|
extern const struct m_sub_options demux_rawvideo_conf;
|
2014-06-10 23:46:20 +00:00
|
|
|
extern const struct m_sub_options demux_lavf_conf;
|
2015-04-23 17:21:17 +00:00
|
|
|
extern const struct m_sub_options demux_mkv_conf;
|
2019-04-07 13:10:52 +00:00
|
|
|
extern const struct m_sub_options demux_cue_conf;
|
2014-06-10 23:35:39 +00:00
|
|
|
extern const struct m_sub_options vd_lavc_conf;
|
2014-06-10 23:39:51 +00:00
|
|
|
extern const struct m_sub_options ad_lavc_conf;
|
2014-06-10 23:54:03 +00:00
|
|
|
extern const struct m_sub_options input_config;
|
2014-06-11 00:04:02 +00:00
|
|
|
extern const struct m_sub_options encode_config;
|
2016-09-02 13:59:40 +00:00
|
|
|
extern const struct m_sub_options gl_video_conf;
|
2016-09-02 18:07:25 +00:00
|
|
|
extern const struct m_sub_options ao_alsa_conf;
|
2011-03-10 21:08:21 +00:00
|
|
|
|
2016-09-06 18:09:56 +00:00
|
|
|
extern const struct m_sub_options demux_conf;
|
demux: add a on-disk cache
Somewhat similar to the old --cache-file, except for the demuxer cache.
Instead of keeping packet data in memory, it's written to disk and read
back when needed.
The idea is to reduce main memory usage, while allowing fast seeking in
large cached network streams (especially live streams). Keeping the
packet metadata on disk would be rather hard (would use mmap or so, or
rewrite the entire demux.c packet queue handling), and since it's
relatively small, just keep it in memory.
Also for simplicity, the disk cache is append-only. If you're watching
really long livestreams, and need pruning, you're probably out of luck.
This still could be improved by trying to free unused blocks with
fallocate(), but since we're writing multiple streams in an interleaved
manner, this is slightly hard.
Some rather gross ugliness in packet.h: we want to store the file
position of the cached data somewhere, but on 32 bit architectures, we
don't have any usable 64 bit members for this, just the buf/len fields,
which add up to 64 bit - so the shitty union aliases this memory.
Error paths untested. Side data (the complicated part of trying to
serialize ffmpeg packets) untested.
Stream recording had to be adjusted. Some minor details change due to
this, but probably nothing important.
The change in attempt_range_joining() is because packets in cache
have no valid len field. It was a useful check (heuristically
finding broken cases), but not a necessary one.
Various other approaches were tried. It would be interesting to list
them and to mention the pros and cons, but I don't feel like it.
2019-06-13 17:10:32 +00:00
|
|
|
extern const struct m_sub_options demux_cache_conf;
|
2016-09-06 18:09:56 +00:00
|
|
|
|
options: use m_config for options instead of m_struct
For some reason, both m_config and m_struct are somewhat similar, except
that m_config is much more powerful. m_config is used for VOs and some
other things, so to unify them. We plan to kick out m_struct and use
m_config for everything. (Unfortunately, m_config is also a bit more
bloated, so this commit isn't all that great, but it will allow to
reduce the option parser mess somewhat.)
This commit also switches all video filters to use the option macros.
One reason is that m_struct and m_config, even though they both use
m_option, store the offsets of the option fields differently (sigh...),
meaning the options defined for either are incompatible. It's easier to
switch everything in one go.
This commit will allow using the -vf option parser for other things,
like VOs and AOs.
2013-07-21 17:33:08 +00:00
|
|
|
extern const struct m_obj_list vf_obj_list;
|
2013-07-22 12:43:58 +00:00
|
|
|
extern const struct m_obj_list af_obj_list;
|
2013-07-21 19:17:48 +00:00
|
|
|
extern const struct m_obj_list vo_obj_list;
|
2018-05-21 13:11:19 +00:00
|
|
|
|
|
|
|
extern const struct m_sub_options ao_conf;
|
2011-03-10 21:08:21 +00:00
|
|
|
|
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
|
|
|
extern const struct m_sub_options opengl_conf;
|
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
|
|
|
extern const struct m_sub_options vulkan_conf;
|
2017-09-13 01:09:48 +00:00
|
|
|
extern const struct m_sub_options spirv_conf;
|
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
|
|
|
extern const struct m_sub_options d3d11_conf;
|
2017-11-01 11:38:41 +00:00
|
|
|
extern const struct m_sub_options d3d11va_conf;
|
2017-01-20 12:38:28 +00:00
|
|
|
extern const struct m_sub_options angle_conf;
|
2017-02-20 19:34:57 +00:00
|
|
|
extern const struct m_sub_options cocoa_conf;
|
2018-02-16 12:07:15 +00:00
|
|
|
extern const struct m_sub_options macos_conf;
|
2017-12-25 15:04:09 +00:00
|
|
|
extern const struct m_sub_options android_conf;
|
2019-10-14 17:16:42 +00:00
|
|
|
extern const struct m_sub_options wayland_conf;
|
2018-03-29 21:23:27 +00:00
|
|
|
extern const struct m_sub_options vaapi_conf;
|
2017-01-20 12:38:28 +00:00
|
|
|
|
2016-09-05 19:04:55 +00:00
|
|
|
static const struct m_sub_options screenshot_conf = {
|
|
|
|
.opts = image_writer_opts,
|
|
|
|
.size = sizeof(struct image_writer_opts),
|
|
|
|
.defaults = &image_writer_opts_defaults,
|
|
|
|
};
|
|
|
|
|
2016-09-06 18:09:56 +00:00
|
|
|
#undef OPT_BASE_STRUCT
|
2016-08-30 21:50:57 +00:00
|
|
|
#define OPT_BASE_STRUCT struct mp_vo_opts
|
|
|
|
|
|
|
|
static const m_option_t mp_vo_opt_list[] = {
|
2016-09-02 14:10:55 +00:00
|
|
|
OPT_SETTINGSLIST("vo", video_driver_list, 0, &vo_obj_list, ),
|
2016-08-30 21:50:57 +00:00
|
|
|
OPT_FLAG("taskbar-progress", taskbar_progress, 0),
|
2016-12-09 18:22:33 +00:00
|
|
|
OPT_FLAG("snap-window", snap_window, 0),
|
2016-09-19 17:50:41 +00:00
|
|
|
OPT_FLAG("ontop", ontop, 0),
|
2017-02-13 19:08:43 +00:00
|
|
|
OPT_CHOICE_OR_INT("ontop-level", ontop_level, 0, 0, INT_MAX,
|
|
|
|
({"window", -1}, {"system", -2})),
|
2016-09-19 17:50:41 +00:00
|
|
|
OPT_FLAG("border", border, 0),
|
|
|
|
OPT_FLAG("fit-border", fit_border, 0),
|
|
|
|
OPT_FLAG("on-all-workspaces", all_workspaces, 0),
|
2016-08-30 21:50:57 +00:00
|
|
|
OPT_GEOMETRY("geometry", geometry, 0),
|
|
|
|
OPT_SIZE_BOX("autofit", autofit, 0),
|
|
|
|
OPT_SIZE_BOX("autofit-larger", autofit_larger, 0),
|
|
|
|
OPT_SIZE_BOX("autofit-smaller", autofit_smaller, 0),
|
2016-09-19 23:20:22 +00:00
|
|
|
OPT_DOUBLE("window-scale", window_scale, CONF_RANGE, .min = 0.001, .max = 100),
|
2019-11-29 12:49:33 +00:00
|
|
|
OPT_FLAG("window-minimized", window_minimized, 0),
|
|
|
|
OPT_FLAG("window-maximized", window_maximized, 0),
|
2016-08-30 21:50:57 +00:00
|
|
|
OPT_FLAG("force-window-position", force_window_position, 0),
|
|
|
|
OPT_STRING("x11-name", winname, 0),
|
|
|
|
OPT_FLOATRANGE("monitoraspect", force_monitor_aspect, 0, 0.0, 9.0),
|
2017-08-25 14:14:32 +00:00
|
|
|
OPT_FLOATRANGE("monitorpixelaspect", monitor_pixel_aspect, 0, 1.0/32.0, 32.0),
|
2016-09-19 17:50:41 +00:00
|
|
|
OPT_FLAG("fullscreen", fullscreen, 0),
|
2016-08-31 15:09:10 +00:00
|
|
|
OPT_ALIAS("fs", "fullscreen"),
|
2016-09-19 17:50:41 +00:00
|
|
|
OPT_FLAG("native-keyrepeat", native_keyrepeat, 0),
|
options: add a thread-safe way to notify option updates
So far, we had a thread-safe way to read options, but no option update
notification mechanism. Everything was funneled though the main thread's
central mp_option_change_callback() function. For example, if the
panscan options were changed, the function called vo_control() with
VOCTRL_SET_PANSCAN to manually notify the VO thread of updates. This
worked, but's pretty inconvenient. Most of these problems come from the
fact that MPlayer was written as a single-threaded program.
This commit works towards a more flexible mechanism. It adds an update
callback to m_config_cache (the thing that is already used for
thread-safe access of global options).
This alone would still be rather inconvenient, at least in context of
VOs. Add another mechanism on top of it that uses mp_dispatch_queue, and
takes care of some annoying synchronization issues. We extend
mp_dispatch_queue itself to make this easier and slightly more
efficient.
As a first application, use this to reimplement certain VO scaling and
renderer options. The update_opts() function translates these to the
"old" VOCTRLs, though.
An annoyingly subtle issue is that m_config_cache's destructor now
releases pending notifications, and must be released before the
associated dispatch queue. Otherwise, it could happen that option
updates during e.g. VO destruction queue or run stale entries, which is
not expected.
Rather untested. The singly-linked list code in dispatch.c is probably
buggy, and I bet some aspects about synchronization are not entirely
sane.
2017-08-22 13:50:33 +00:00
|
|
|
OPT_FLOATRANGE("panscan", panscan, 0, 0.0, 1.0),
|
|
|
|
OPT_FLOATRANGE("video-zoom", zoom, 0, -20.0, 20.0),
|
|
|
|
OPT_FLOATRANGE("video-pan-x", pan_x, 0, -3.0, 3.0),
|
|
|
|
OPT_FLOATRANGE("video-pan-y", pan_y, 0, -3.0, 3.0),
|
|
|
|
OPT_FLOATRANGE("video-align-x", align_x, 0, -1.0, 1.0),
|
|
|
|
OPT_FLOATRANGE("video-align-y", align_y, 0, -1.0, 1.0),
|
2019-06-15 15:53:59 +00:00
|
|
|
OPT_FLOATRANGE("video-margin-ratio-left", margin_x[0], 0, 0.0, 1.0),
|
|
|
|
OPT_FLOATRANGE("video-margin-ratio-right", margin_x[1], 0, 0.0, 1.0),
|
|
|
|
OPT_FLOATRANGE("video-margin-ratio-top", margin_y[0], 0, 0.0, 1.0),
|
|
|
|
OPT_FLOATRANGE("video-margin-ratio-bottom", margin_y[1], 0, 0.0, 1.0),
|
options: add a thread-safe way to notify option updates
So far, we had a thread-safe way to read options, but no option update
notification mechanism. Everything was funneled though the main thread's
central mp_option_change_callback() function. For example, if the
panscan options were changed, the function called vo_control() with
VOCTRL_SET_PANSCAN to manually notify the VO thread of updates. This
worked, but's pretty inconvenient. Most of these problems come from the
fact that MPlayer was written as a single-threaded program.
This commit works towards a more flexible mechanism. It adds an update
callback to m_config_cache (the thing that is already used for
thread-safe access of global options).
This alone would still be rather inconvenient, at least in context of
VOs. Add another mechanism on top of it that uses mp_dispatch_queue, and
takes care of some annoying synchronization issues. We extend
mp_dispatch_queue itself to make this easier and slightly more
efficient.
As a first application, use this to reimplement certain VO scaling and
renderer options. The update_opts() function translates these to the
"old" VOCTRLs, though.
An annoyingly subtle issue is that m_config_cache's destructor now
releases pending notifications, and must be released before the
associated dispatch queue. Otherwise, it could happen that option
updates during e.g. VO destruction queue or run stale entries, which is
not expected.
Rather untested. The singly-linked list code in dispatch.c is probably
buggy, and I bet some aspects about synchronization are not entirely
sane.
2017-08-22 13:50:33 +00:00
|
|
|
OPT_CHOICE("video-unscaled", unscaled, 0,
|
2016-08-30 21:50:57 +00:00
|
|
|
({"no", 0}, {"yes", 1}, {"downscale-big", 2})),
|
|
|
|
OPT_INT64("wid", WinID, 0),
|
|
|
|
OPT_CHOICE_OR_INT("screen", screen_id, 0, 0, 32,
|
|
|
|
({"default", -1})),
|
|
|
|
OPT_CHOICE_OR_INT("fs-screen", fsscreen_id, 0, 0, 32,
|
|
|
|
({"all", -2}, {"current", -1})),
|
2019-12-02 15:11:06 +00:00
|
|
|
OPT_CHOICE_OR_INT("cursor-autohide", cursor_autohide_delay, 0,
|
|
|
|
0, 30000, ({"no", -1}, {"always", -2})),
|
|
|
|
OPT_FLAG("cursor-autohide-fs-only", cursor_autohide_fs, 0),
|
options: add a thread-safe way to notify option updates
So far, we had a thread-safe way to read options, but no option update
notification mechanism. Everything was funneled though the main thread's
central mp_option_change_callback() function. For example, if the
panscan options were changed, the function called vo_control() with
VOCTRL_SET_PANSCAN to manually notify the VO thread of updates. This
worked, but's pretty inconvenient. Most of these problems come from the
fact that MPlayer was written as a single-threaded program.
This commit works towards a more flexible mechanism. It adds an update
callback to m_config_cache (the thing that is already used for
thread-safe access of global options).
This alone would still be rather inconvenient, at least in context of
VOs. Add another mechanism on top of it that uses mp_dispatch_queue, and
takes care of some annoying synchronization issues. We extend
mp_dispatch_queue itself to make this easier and slightly more
efficient.
As a first application, use this to reimplement certain VO scaling and
renderer options. The update_opts() function translates these to the
"old" VOCTRLs, though.
An annoyingly subtle issue is that m_config_cache's destructor now
releases pending notifications, and must be released before the
associated dispatch queue. Otherwise, it could happen that option
updates during e.g. VO destruction queue or run stale entries, which is
not expected.
Rather untested. The singly-linked list code in dispatch.c is probably
buggy, and I bet some aspects about synchronization are not entirely
sane.
2017-08-22 13:50:33 +00:00
|
|
|
OPT_FLAG("keepaspect", keepaspect, 0),
|
2016-08-30 21:50:57 +00:00
|
|
|
OPT_FLAG("keepaspect-window", keepaspect_window, 0),
|
2016-10-25 13:59:13 +00:00
|
|
|
OPT_FLAG("hidpi-window-scale", hidpi_window_scale, 0),
|
2017-07-27 19:28:33 +00:00
|
|
|
OPT_FLAG("native-fs", native_fs, 0),
|
2019-11-24 23:47:53 +00:00
|
|
|
OPT_DOUBLE("override-display-fps", override_display_fps, M_OPT_MIN, .min = 0),
|
2018-03-13 10:23:23 +00:00
|
|
|
OPT_DOUBLERANGE("video-timing-offset", timing_offset, 0, 0.0, 1.0),
|
2016-08-30 21:50:57 +00:00
|
|
|
#if HAVE_X11
|
|
|
|
OPT_CHOICE("x11-netwm", x11_netwm, 0,
|
|
|
|
({"auto", 0}, {"no", -1}, {"yes", 1})),
|
|
|
|
OPT_CHOICE("x11-bypass-compositor", x11_bypass_compositor, 0,
|
|
|
|
({"no", 0}, {"yes", 1}, {"fs-only", 2}, {"never", 3})),
|
|
|
|
#endif
|
2017-06-27 11:47:46 +00:00
|
|
|
#if HAVE_WIN32_DESKTOP
|
2016-09-21 14:19:56 +00:00
|
|
|
OPT_STRING("vo-mmcss-profile", mmcss_profile, 0),
|
2016-08-30 21:50:57 +00:00
|
|
|
#endif
|
2016-10-04 20:07:19 +00:00
|
|
|
#if HAVE_DRM
|
2017-10-23 06:59:58 +00:00
|
|
|
OPT_SUBSTRUCT("", drm_opts, drm_conf, 0),
|
2016-10-04 20:07:19 +00:00
|
|
|
#endif
|
2019-09-28 08:26:23 +00:00
|
|
|
OPT_INTRANGE("swapchain-depth", swapchain_depth, 0, 1, 8),
|
2016-08-30 21:50:57 +00:00
|
|
|
{0}
|
|
|
|
};
|
|
|
|
|
2016-09-02 13:50:54 +00:00
|
|
|
const struct m_sub_options vo_sub_opts = {
|
2016-08-30 21:50:57 +00:00
|
|
|
.opts = mp_vo_opt_list,
|
|
|
|
.size = sizeof(struct mp_vo_opts),
|
|
|
|
.defaults = &(const struct mp_vo_opts){
|
|
|
|
.video_driver_list = NULL,
|
|
|
|
.monitor_pixel_aspect = 1.0,
|
|
|
|
.screen_id = -1,
|
|
|
|
.fsscreen_id = -1,
|
|
|
|
.panscan = 0.0f,
|
2019-12-02 15:11:06 +00:00
|
|
|
.cursor_autohide_delay = 1000,
|
2016-08-30 21:50:57 +00:00
|
|
|
.keepaspect = 1,
|
|
|
|
.keepaspect_window = 1,
|
2016-10-25 13:59:13 +00:00
|
|
|
.hidpi_window_scale = 1,
|
2017-07-27 19:28:33 +00:00
|
|
|
.native_fs = 1,
|
2016-08-30 21:50:57 +00:00
|
|
|
.taskbar_progress = 1,
|
2016-12-09 18:22:33 +00:00
|
|
|
.snap_window = 0,
|
2016-08-30 21:50:57 +00:00
|
|
|
.border = 1,
|
|
|
|
.fit_border = 1,
|
|
|
|
.WinID = -1,
|
|
|
|
.window_scale = 1.0,
|
|
|
|
.x11_bypass_compositor = 2,
|
|
|
|
.mmcss_profile = "Playback",
|
2017-02-13 19:08:43 +00:00
|
|
|
.ontop_level = -1,
|
2018-03-13 10:23:23 +00:00
|
|
|
.timing_offset = 0.050,
|
2019-09-28 08:26:23 +00:00
|
|
|
.swapchain_depth = 3,
|
2016-08-30 21:50:57 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2017-12-29 16:19:25 +00:00
|
|
|
#undef OPT_BASE_STRUCT
|
|
|
|
#define OPT_BASE_STRUCT struct mp_subtitle_opts
|
|
|
|
|
|
|
|
const struct m_sub_options mp_subtitle_sub_opts = {
|
|
|
|
.opts = (const struct m_option[]){
|
|
|
|
OPT_FLOAT("sub-delay", sub_delay, 0),
|
|
|
|
OPT_FLOAT("sub-fps", sub_fps, 0),
|
|
|
|
OPT_FLOAT("sub-speed", sub_speed, 0),
|
|
|
|
OPT_FLAG("sub-visibility", sub_visibility, 0),
|
|
|
|
OPT_FLAG("sub-forced-only", forced_subs_only, 0),
|
|
|
|
OPT_FLAG("stretch-dvd-subs", stretch_dvd_subs, 0),
|
|
|
|
OPT_FLAG("stretch-image-subs-to-screen", stretch_image_subs, 0),
|
|
|
|
OPT_FLAG("image-subs-video-resolution", image_subs_video_res, 0),
|
|
|
|
OPT_FLAG("sub-fix-timing", sub_fix_timing, 0),
|
|
|
|
OPT_INTRANGE("sub-pos", sub_pos, 0, 0, 100),
|
|
|
|
OPT_FLOATRANGE("sub-gauss", sub_gauss, 0, 0.0, 3.0),
|
|
|
|
OPT_FLAG("sub-gray", sub_gray, 0),
|
|
|
|
OPT_FLAG("sub-ass", ass_enabled, 0),
|
|
|
|
OPT_FLAG("sub-filter-sdh", sub_filter_SDH, 0),
|
|
|
|
OPT_FLAG("sub-filter-sdh-harder", sub_filter_SDH_harder, 0),
|
|
|
|
OPT_FLOATRANGE("sub-scale", sub_scale, 0, 0, 100),
|
|
|
|
OPT_FLOATRANGE("sub-ass-line-spacing", ass_line_spacing, 0, -1000, 1000),
|
|
|
|
OPT_FLAG("sub-use-margins", sub_use_margins, 0),
|
|
|
|
OPT_FLAG("sub-ass-force-margins", ass_use_margins, 0),
|
|
|
|
OPT_FLAG("sub-ass-vsfilter-aspect-compat", ass_vsfilter_aspect_compat, 0),
|
|
|
|
OPT_CHOICE("sub-ass-vsfilter-color-compat", ass_vsfilter_color_compat, 0,
|
|
|
|
({"no", 0}, {"basic", 1}, {"full", 2}, {"force-601", 3})),
|
|
|
|
OPT_FLAG("sub-ass-vsfilter-blur-compat", ass_vsfilter_blur_compat, 0),
|
|
|
|
OPT_FLAG("embeddedfonts", use_embedded_fonts, 0),
|
|
|
|
OPT_STRINGLIST("sub-ass-force-style", ass_force_style_list, 0),
|
|
|
|
OPT_STRING("sub-ass-styles", ass_styles_file, M_OPT_FILE),
|
|
|
|
OPT_CHOICE("sub-ass-hinting", ass_hinting, 0,
|
|
|
|
({"none", 0}, {"light", 1}, {"normal", 2}, {"native", 3})),
|
|
|
|
OPT_CHOICE("sub-ass-shaper", ass_shaper, 0,
|
|
|
|
({"simple", 0}, {"complex", 1})),
|
|
|
|
OPT_FLAG("sub-ass-justify", ass_justify, 0),
|
|
|
|
OPT_CHOICE("sub-ass-override", ass_style_override, 0,
|
|
|
|
({"no", 0}, {"yes", 1}, {"force", 3}, {"scale", 4}, {"strip", 5})),
|
|
|
|
OPT_FLAG("sub-scale-by-window", sub_scale_by_window, 0),
|
|
|
|
OPT_FLAG("sub-scale-with-window", sub_scale_with_window, 0),
|
|
|
|
OPT_FLAG("sub-ass-scale-with-window", ass_scale_with_window, 0),
|
|
|
|
OPT_SUBSTRUCT("sub", sub_style, sub_style_conf, 0),
|
|
|
|
OPT_FLAG("sub-clear-on-seek", sub_clear_on_seek, 0),
|
|
|
|
OPT_INTRANGE("teletext-page", teletext_page, 0, 1, 999),
|
|
|
|
{0}
|
|
|
|
},
|
|
|
|
.size = sizeof(OPT_BASE_STRUCT),
|
|
|
|
.defaults = &(OPT_BASE_STRUCT){
|
|
|
|
.sub_visibility = 1,
|
|
|
|
.sub_pos = 100,
|
|
|
|
.sub_speed = 1.0,
|
|
|
|
.ass_enabled = 1,
|
|
|
|
.sub_scale_by_window = 1,
|
|
|
|
.ass_use_margins = 0,
|
|
|
|
.sub_use_margins = 1,
|
|
|
|
.ass_scale_with_window = 0,
|
|
|
|
.sub_scale_with_window = 1,
|
|
|
|
.teletext_page = 100,
|
|
|
|
.sub_scale = 1,
|
|
|
|
.ass_vsfilter_aspect_compat = 1,
|
|
|
|
.ass_vsfilter_color_compat = 1,
|
|
|
|
.ass_vsfilter_blur_compat = 1,
|
|
|
|
.ass_style_override = 1,
|
|
|
|
.ass_shaper = 1,
|
|
|
|
.use_embedded_fonts = 1,
|
|
|
|
},
|
|
|
|
.change_flags = UPDATE_OSD,
|
|
|
|
};
|
|
|
|
|
|
|
|
#undef OPT_BASE_STRUCT
|
|
|
|
#define OPT_BASE_STRUCT struct mp_osd_render_opts
|
|
|
|
|
|
|
|
const struct m_sub_options mp_osd_render_sub_opts = {
|
|
|
|
.opts = (const struct m_option[]){
|
|
|
|
OPT_FLOATRANGE("osd-bar-align-x", osd_bar_align_x, 0, -1.0, +1.0),
|
|
|
|
OPT_FLOATRANGE("osd-bar-align-y", osd_bar_align_y, 0, -1.0, +1.0),
|
|
|
|
OPT_FLOATRANGE("osd-bar-w", osd_bar_w, 0, 1, 100),
|
|
|
|
OPT_FLOATRANGE("osd-bar-h", osd_bar_h, 0, 0.1, 50),
|
|
|
|
OPT_SUBSTRUCT("osd", osd_style, osd_style_conf, 0),
|
|
|
|
OPT_FLOATRANGE("osd-scale", osd_scale, 0, 0, 100),
|
|
|
|
OPT_FLAG("osd-scale-by-window", osd_scale_by_window, 0),
|
|
|
|
OPT_FLAG("force-rgba-osd-rendering", force_rgba_osd, 0),
|
|
|
|
{0}
|
|
|
|
},
|
|
|
|
.size = sizeof(OPT_BASE_STRUCT),
|
|
|
|
.defaults = &(OPT_BASE_STRUCT){
|
|
|
|
.osd_bar_align_y = 0.5,
|
|
|
|
.osd_bar_w = 75.0,
|
|
|
|
.osd_bar_h = 3.125,
|
|
|
|
.osd_scale = 1,
|
|
|
|
.osd_scale_by_window = 1,
|
|
|
|
},
|
|
|
|
.change_flags = UPDATE_OSD,
|
|
|
|
};
|
|
|
|
|
2016-09-08 19:46:48 +00:00
|
|
|
#undef OPT_BASE_STRUCT
|
|
|
|
#define OPT_BASE_STRUCT struct dvd_opts
|
|
|
|
|
|
|
|
const struct m_sub_options dvd_conf = {
|
|
|
|
.opts = (const struct m_option[]){
|
|
|
|
OPT_STRING("dvd-device", device, M_OPT_FILE),
|
|
|
|
OPT_INT("dvd-speed", speed, 0),
|
|
|
|
OPT_INTRANGE("dvd-angle", angle, 0, 1, 99),
|
|
|
|
{0}
|
|
|
|
},
|
|
|
|
.size = sizeof(struct dvd_opts),
|
|
|
|
.defaults = &(const struct dvd_opts){
|
|
|
|
.angle = 1,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
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
|
|
|
#undef OPT_BASE_STRUCT
|
|
|
|
#define OPT_BASE_STRUCT struct filter_opts
|
|
|
|
|
|
|
|
const struct m_sub_options filter_conf = {
|
|
|
|
.opts = (const struct m_option[]){
|
|
|
|
OPT_FLAG("deinterlace", deinterlace, 0),
|
|
|
|
{0}
|
|
|
|
},
|
|
|
|
.size = sizeof(OPT_BASE_STRUCT),
|
|
|
|
.change_flags = UPDATE_IMGPAR,
|
|
|
|
};
|
|
|
|
|
2016-08-30 21:50:57 +00:00
|
|
|
#undef OPT_BASE_STRUCT
|
2013-03-01 10:27:59 +00:00
|
|
|
#define OPT_BASE_STRUCT struct MPOpts
|
|
|
|
|
2019-11-28 23:16:52 +00:00
|
|
|
static const m_option_t mp_opts[] = {
|
2013-12-21 22:11:12 +00:00
|
|
|
// handled in command line pre-parser (parse_commandline.c)
|
options: remove M_OPT_FIXED
Options marked with this flag were changed to strictly read-only after
initialization (mpv_initialize() in the client API, after option parsing
and config file loading with the CLI player).
This used to be necessary, because there was a single option struct that
could be accessed by multiple threads. For example, --config-dir sets
MPOpts.force_configdir, which was read whenever anything accessed the
mpv config dir (which could be on different threads, e.g. font
initialization tries to lookup fonts.conf from an arbitrary thread).
This isn't needed anymore, because threads now access these in a thread
safe way. In the case of --config-dir, the path is actually just copied
on init.
This M_OPT_FIXED mechanism is thus not strictly needed anymore. It still
prevents writing to some options that cannot take effect at runtime, but
even that can be dropped. In general, all mpv options can be changed any
time at runtime, even if they never take effect, and there's no need to
make an exception for a very low number of options. So just get rid of
it.
2019-11-10 22:49:23 +00:00
|
|
|
{"v", &m_option_type_dummy_flag, CONF_NOCFG | M_OPT_NOPROP,
|
2017-06-23 18:51:12 +00:00
|
|
|
.offset = -1},
|
options: remove M_OPT_FIXED
Options marked with this flag were changed to strictly read-only after
initialization (mpv_initialize() in the client API, after option parsing
and config file loading with the CLI player).
This used to be necessary, because there was a single option struct that
could be accessed by multiple threads. For example, --config-dir sets
MPOpts.force_configdir, which was read whenever anything accessed the
mpv config dir (which could be on different threads, e.g. font
initialization tries to lookup fonts.conf from an arbitrary thread).
This isn't needed anymore, because threads now access these in a thread
safe way. In the case of --config-dir, the path is actually just copied
on init.
This M_OPT_FIXED mechanism is thus not strictly needed anymore. It still
prevents writing to some options that cannot take effect at runtime, but
even that can be dropped. In general, all mpv options can be changed any
time at runtime, even if they never take effect, and there's no need to
make an exception for a very low number of options. So just get rid of
it.
2019-11-10 22:49:23 +00:00
|
|
|
{"playlist", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_MIN | M_OPT_FILE,
|
2014-06-13 00:16:47 +00:00
|
|
|
.min = 1, .offset = -1},
|
options: remove M_OPT_FIXED
Options marked with this flag were changed to strictly read-only after
initialization (mpv_initialize() in the client API, after option parsing
and config file loading with the CLI player).
This used to be necessary, because there was a single option struct that
could be accessed by multiple threads. For example, --config-dir sets
MPOpts.force_configdir, which was read whenever anything accessed the
mpv config dir (which could be on different threads, e.g. font
initialization tries to lookup fonts.conf from an arbitrary thread).
This isn't needed anymore, because threads now access these in a thread
safe way. In the case of --config-dir, the path is actually just copied
on init.
This M_OPT_FIXED mechanism is thus not strictly needed anymore. It still
prevents writing to some options that cannot take effect at runtime, but
even that can be dropped. In general, all mpv options can be changed any
time at runtime, even if they never take effect, and there's no need to
make an exception for a very low number of options. So just get rid of
it.
2019-11-10 22:49:23 +00:00
|
|
|
{"{", &m_option_type_dummy_flag, CONF_NOCFG | M_OPT_NOPROP,
|
2017-06-23 18:51:12 +00:00
|
|
|
.offset = -1},
|
options: remove M_OPT_FIXED
Options marked with this flag were changed to strictly read-only after
initialization (mpv_initialize() in the client API, after option parsing
and config file loading with the CLI player).
This used to be necessary, because there was a single option struct that
could be accessed by multiple threads. For example, --config-dir sets
MPOpts.force_configdir, which was read whenever anything accessed the
mpv config dir (which could be on different threads, e.g. font
initialization tries to lookup fonts.conf from an arbitrary thread).
This isn't needed anymore, because threads now access these in a thread
safe way. In the case of --config-dir, the path is actually just copied
on init.
This M_OPT_FIXED mechanism is thus not strictly needed anymore. It still
prevents writing to some options that cannot take effect at runtime, but
even that can be dropped. In general, all mpv options can be changed any
time at runtime, even if they never take effect, and there's no need to
make an exception for a very low number of options. So just get rid of
it.
2019-11-10 22:49:23 +00:00
|
|
|
{"}", &m_option_type_dummy_flag, CONF_NOCFG | M_OPT_NOPROP,
|
2017-06-23 18:51:12 +00:00
|
|
|
.offset = -1},
|
2013-07-27 19:26:00 +00:00
|
|
|
|
|
|
|
// handled in m_config.c
|
2016-09-24 18:41:07 +00:00
|
|
|
{ "include", CONF_TYPE_STRING, M_OPT_FILE, .offset = -1},
|
|
|
|
{ "profile", CONF_TYPE_STRING_LIST, 0, .offset = -1},
|
options: remove M_OPT_FIXED
Options marked with this flag were changed to strictly read-only after
initialization (mpv_initialize() in the client API, after option parsing
and config file loading with the CLI player).
This used to be necessary, because there was a single option struct that
could be accessed by multiple threads. For example, --config-dir sets
MPOpts.force_configdir, which was read whenever anything accessed the
mpv config dir (which could be on different threads, e.g. font
initialization tries to lookup fonts.conf from an arbitrary thread).
This isn't needed anymore, because threads now access these in a thread
safe way. In the case of --config-dir, the path is actually just copied
on init.
This M_OPT_FIXED mechanism is thus not strictly needed anymore. It still
prevents writing to some options that cannot take effect at runtime, but
even that can be dropped. In general, all mpv options can be changed any
time at runtime, even if they never take effect, and there's no need to
make an exception for a very low number of options. So just get rid of
it.
2019-11-10 22:49:23 +00:00
|
|
|
{ "show-profile", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_NOPROP |
|
|
|
|
M_OPT_OPTIONAL_PARAM, .offset = -1},
|
|
|
|
{ "list-options", &m_option_type_dummy_flag, CONF_NOCFG | M_OPT_NOPROP,
|
|
|
|
.offset = -1},
|
|
|
|
OPT_FLAG("list-properties", property_print_help, CONF_NOCFG | M_OPT_NOPROP),
|
|
|
|
{ "help", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_NOPROP | M_OPT_OPTIONAL_PARAM,
|
|
|
|
.offset = -1},
|
|
|
|
{ "h", CONF_TYPE_STRING, CONF_NOCFG | M_OPT_NOPROP | M_OPT_OPTIONAL_PARAM,
|
|
|
|
.offset = -1},
|
options: make mess to allow setting profile option with libmpv
Certain options, such as --profile, --help, and many others require
special-handling, because they don't fit conceptually into the option
and property model. They don't store data, but perform actions.
This caused the situation that profiles could not be set when using
libmpv in encoding mode (although you should probably not used libmpv in
encoding mode). Using libmpv always ends up in calling
m_config_set_option_raw_direct(), while --profile was handled in
m_config_parse_option().
Solve this by moving the handling of this from m_config_parse_option()
to m_config_set_option_raw_direct(). Actually we just stuff most of this
into m_config_handle_special_options(), which is only called by the
aforementioned function.
Strangely this also means that the --h/--help option declarations need
to be changed, because they used OPT_PRINT, and now the option "parser"
is always invoked before the special code. Thus, make them a string.
Them being OPT_PRINT was apparently always redundant. (The other option
declarations are moved for cosmetic purposes only.)
The most weird change is how co->data==NULL is handled. We now allow
passing down involved options to m_config_set_option_raw_direct(). The
thing is that we don't want them to error if the command line parser is
using them (with special handling done there), while all other code
paths should raise an error. We try using M_SETOPT_FROM_CMDLINE to
distinguish these cases.
Note that normal libmpv users are supposed to use the "apply-profile"
command instead.
This probably contains a bunch of bugs, which you should report.
2017-06-15 13:15:05 +00:00
|
|
|
|
|
|
|
OPT_PRINT("list-protocols", stream_print_proto_list),
|
|
|
|
OPT_PRINT("version", print_version),
|
|
|
|
OPT_PRINT("V", print_version),
|
2013-07-27 19:26:00 +00:00
|
|
|
|
test: make tests part of the mpv binary
Until now, each .c file in test/ was built as separate, self-contained
binary. Each binary could be run to execute the tests it contained.
Change this and make them part of the normal mpv binary. Now the tests
have to be invoked via the --unittest option. Do this for two reasons:
- Tests now run within a "properly" initialized mpv instance, so all
services are available.
- Possibly simplifying the situation for future build systems.
The first point is the main motivation. The mpv code is entangled with
mp_log and the option system. It feels like a bad idea to duplicate some
of the initialization of this just so you can call code using them.
I'm also getting rid of cmocka. There wouldn't be any problem to keep it
(it's a perfectly sane set of helpers), but NIH calls. I would have had
to aggregate all tests into a CMUnitTest list, and I don't see how I'd
get different types of entry points easily. Probably easily solvable,
but since we made only pretty basic use of this library, NIH-ing this is
actually easier (I needed a list of tests with custom metadata anyway,
so all what was left was reimplement the assert_* helpers).
Unit tests now don't output anything, and if they fail, they'll simply
crash and leave a message that typically requires inspecting the test
code to figure out what went wrong (and probably editing the test code
to get more information). I even merged the various test functions into
single ones. Sucks, but here you go.
chmap_sel.c is merged into chmap.c, because I didn't see the point of
this being separate. json.c drops the print_message() to go along with
the new silent-by-default idea, also there's a memory leak fix unrelated
to the rest of this commit.
The new code is enabled with --enable-tests (--enable-test goes away).
Due to waf's option parser, --enable-test still works, because it's a
unique prefix to --enable-tests.
2019-11-07 21:42:14 +00:00
|
|
|
#if HAVE_TESTS
|
options: remove M_OPT_FIXED
Options marked with this flag were changed to strictly read-only after
initialization (mpv_initialize() in the client API, after option parsing
and config file loading with the CLI player).
This used to be necessary, because there was a single option struct that
could be accessed by multiple threads. For example, --config-dir sets
MPOpts.force_configdir, which was read whenever anything accessed the
mpv config dir (which could be on different threads, e.g. font
initialization tries to lookup fonts.conf from an arbitrary thread).
This isn't needed anymore, because threads now access these in a thread
safe way. In the case of --config-dir, the path is actually just copied
on init.
This M_OPT_FIXED mechanism is thus not strictly needed anymore. It still
prevents writing to some options that cannot take effect at runtime, but
even that can be dropped. In general, all mpv options can be changed any
time at runtime, even if they never take effect, and there's no need to
make an exception for a very low number of options. So just get rid of
it.
2019-11-10 22:49:23 +00:00
|
|
|
OPT_STRING("unittest", test_mode, CONF_NOCFG | M_OPT_NOPROP),
|
test: make tests part of the mpv binary
Until now, each .c file in test/ was built as separate, self-contained
binary. Each binary could be run to execute the tests it contained.
Change this and make them part of the normal mpv binary. Now the tests
have to be invoked via the --unittest option. Do this for two reasons:
- Tests now run within a "properly" initialized mpv instance, so all
services are available.
- Possibly simplifying the situation for future build systems.
The first point is the main motivation. The mpv code is entangled with
mp_log and the option system. It feels like a bad idea to duplicate some
of the initialization of this just so you can call code using them.
I'm also getting rid of cmocka. There wouldn't be any problem to keep it
(it's a perfectly sane set of helpers), but NIH calls. I would have had
to aggregate all tests into a CMUnitTest list, and I don't see how I'd
get different types of entry points easily. Probably easily solvable,
but since we made only pretty basic use of this library, NIH-ing this is
actually easier (I needed a list of tests with custom metadata anyway,
so all what was left was reimplement the assert_* helpers).
Unit tests now don't output anything, and if they fail, they'll simply
crash and leave a message that typically requires inspecting the test
code to figure out what went wrong (and probably editing the test code
to get more information). I even merged the various test functions into
single ones. Sucks, but here you go.
chmap_sel.c is merged into chmap.c, because I didn't see the point of
this being separate. json.c drops the print_message() to go along with
the new silent-by-default idea, also there's a memory leak fix unrelated
to the rest of this commit.
The new code is enabled with --enable-tests (--enable-test goes away).
Due to waf's option parser, --enable-test still works, because it's a
unique prefix to --enable-tests.
2019-11-07 21:42:14 +00:00
|
|
|
#endif
|
|
|
|
|
2016-09-23 19:24:50 +00:00
|
|
|
OPT_CHOICE("player-operation-mode", operation_mode,
|
options: remove M_OPT_FIXED
Options marked with this flag were changed to strictly read-only after
initialization (mpv_initialize() in the client API, after option parsing
and config file loading with the CLI player).
This used to be necessary, because there was a single option struct that
could be accessed by multiple threads. For example, --config-dir sets
MPOpts.force_configdir, which was read whenever anything accessed the
mpv config dir (which could be on different threads, e.g. font
initialization tries to lookup fonts.conf from an arbitrary thread).
This isn't needed anymore, because threads now access these in a thread
safe way. In the case of --config-dir, the path is actually just copied
on init.
This M_OPT_FIXED mechanism is thus not strictly needed anymore. It still
prevents writing to some options that cannot take effect at runtime, but
even that can be dropped. In general, all mpv options can be changed any
time at runtime, even if they never take effect, and there's no need to
make an exception for a very low number of options. So just get rid of
it.
2019-11-10 22:49:23 +00:00
|
|
|
M_OPT_PRE_PARSE | M_OPT_NOPROP,
|
2016-09-23 19:24:50 +00:00
|
|
|
({"cplayer", 0}, {"pseudo-gui", 1})),
|
|
|
|
|
2015-02-16 19:04:05 +00:00
|
|
|
OPT_FLAG("shuffle", shuffle, 0),
|
2013-08-18 22:50:39 +00:00
|
|
|
|
2011-03-10 21:08:21 +00:00
|
|
|
// ------------------------- common options --------------------
|
2016-09-19 17:50:41 +00:00
|
|
|
OPT_FLAG("quiet", quiet, 0),
|
2017-06-23 18:42:20 +00:00
|
|
|
OPT_FLAG("really-quiet", msg_really_quiet, CONF_PRE_PARSE | UPDATE_TERM),
|
2016-09-19 17:54:54 +00:00
|
|
|
OPT_FLAG("terminal", use_terminal, CONF_PRE_PARSE | UPDATE_TERM),
|
2016-09-19 17:51:26 +00:00
|
|
|
OPT_GENERAL(char**, "msg-level", msg_levels, CONF_PRE_PARSE | UPDATE_TERM,
|
2016-09-01 18:00:43 +00:00
|
|
|
.type = &m_option_type_msglevels),
|
2017-11-20 21:18:54 +00:00
|
|
|
OPT_STRING("dump-stats", dump_stats, UPDATE_TERM | CONF_PRE_PARSE | M_OPT_FILE),
|
2016-09-19 17:51:26 +00:00
|
|
|
OPT_FLAG("msg-color", msg_color, CONF_PRE_PARSE | UPDATE_TERM),
|
|
|
|
OPT_STRING("log-file", log_file, CONF_PRE_PARSE | M_OPT_FILE | UPDATE_TERM),
|
|
|
|
OPT_FLAG("msg-module", msg_module, UPDATE_TERM),
|
|
|
|
OPT_FLAG("msg-time", msg_time, UPDATE_TERM),
|
2017-08-03 07:44:36 +00:00
|
|
|
#if HAVE_WIN32_DESKTOP
|
2016-09-28 11:47:30 +00:00
|
|
|
OPT_CHOICE("priority", w32_priority, UPDATE_PRIORITY,
|
2014-06-11 22:34:20 +00:00
|
|
|
({"no", 0},
|
2014-06-22 05:57:27 +00:00
|
|
|
{"realtime", REALTIME_PRIORITY_CLASS},
|
|
|
|
{"high", HIGH_PRIORITY_CLASS},
|
2014-06-11 22:34:20 +00:00
|
|
|
{"abovenormal", ABOVE_NORMAL_PRIORITY_CLASS},
|
|
|
|
{"normal", NORMAL_PRIORITY_CLASS},
|
|
|
|
{"belownormal", BELOW_NORMAL_PRIORITY_CLASS},
|
|
|
|
{"idle", IDLE_PRIORITY_CLASS})),
|
2011-03-10 21:08:21 +00:00
|
|
|
#endif
|
options: remove M_OPT_FIXED
Options marked with this flag were changed to strictly read-only after
initialization (mpv_initialize() in the client API, after option parsing
and config file loading with the CLI player).
This used to be necessary, because there was a single option struct that
could be accessed by multiple threads. For example, --config-dir sets
MPOpts.force_configdir, which was read whenever anything accessed the
mpv config dir (which could be on different threads, e.g. font
initialization tries to lookup fonts.conf from an arbitrary thread).
This isn't needed anymore, because threads now access these in a thread
safe way. In the case of --config-dir, the path is actually just copied
on init.
This M_OPT_FIXED mechanism is thus not strictly needed anymore. It still
prevents writing to some options that cannot take effect at runtime, but
even that can be dropped. In general, all mpv options can be changed any
time at runtime, even if they never take effect, and there's no need to
make an exception for a very low number of options. So just get rid of
it.
2019-11-10 22:49:23 +00:00
|
|
|
OPT_FLAG("config", load_config, CONF_PRE_PARSE),
|
2014-02-25 20:04:04 +00:00
|
|
|
OPT_STRING("config-dir", force_configdir,
|
options: remove M_OPT_FIXED
Options marked with this flag were changed to strictly read-only after
initialization (mpv_initialize() in the client API, after option parsing
and config file loading with the CLI player).
This used to be necessary, because there was a single option struct that
could be accessed by multiple threads. For example, --config-dir sets
MPOpts.force_configdir, which was read whenever anything accessed the
mpv config dir (which could be on different threads, e.g. font
initialization tries to lookup fonts.conf from an arbitrary thread).
This isn't needed anymore, because threads now access these in a thread
safe way. In the case of --config-dir, the path is actually just copied
on init.
This M_OPT_FIXED mechanism is thus not strictly needed anymore. It still
prevents writing to some options that cannot take effect at runtime, but
even that can be dropped. In general, all mpv options can be changed any
time at runtime, even if they never take effect, and there's no need to
make an exception for a very low number of options. So just get rid of
it.
2019-11-10 22:49:23 +00:00
|
|
|
CONF_NOCFG | CONF_PRE_PARSE | M_OPT_FILE),
|
2016-09-17 15:04:13 +00:00
|
|
|
OPT_STRINGLIST("reset-on-next-file", reset_options, 0),
|
2011-03-10 21:08:21 +00:00
|
|
|
|
2014-12-13 16:27:47 +00:00
|
|
|
#if HAVE_LUA || HAVE_JAVASCRIPT
|
options: remove M_OPT_FIXED
Options marked with this flag were changed to strictly read-only after
initialization (mpv_initialize() in the client API, after option parsing
and config file loading with the CLI player).
This used to be necessary, because there was a single option struct that
could be accessed by multiple threads. For example, --config-dir sets
MPOpts.force_configdir, which was read whenever anything accessed the
mpv config dir (which could be on different threads, e.g. font
initialization tries to lookup fonts.conf from an arbitrary thread).
This isn't needed anymore, because threads now access these in a thread
safe way. In the case of --config-dir, the path is actually just copied
on init.
This M_OPT_FIXED mechanism is thus not strictly needed anymore. It still
prevents writing to some options that cannot take effect at runtime, but
even that can be dropped. In general, all mpv options can be changed any
time at runtime, even if they never take effect, and there's no need to
make an exception for a very low number of options. So just get rid of
it.
2019-11-10 22:49:23 +00:00
|
|
|
OPT_PATHLIST("scripts", script_files, M_OPT_FILE),
|
2017-07-02 14:26:41 +00:00
|
|
|
OPT_CLI_ALIAS("script", "scripts-append"),
|
2016-09-17 15:04:13 +00:00
|
|
|
OPT_KEYVALUELIST("script-opts", script_opts, 0),
|
2014-12-13 16:27:47 +00:00
|
|
|
OPT_FLAG("load-scripts", auto_load_scripts, 0),
|
|
|
|
#endif
|
|
|
|
#if HAVE_LUA
|
2016-09-19 22:59:54 +00:00
|
|
|
OPT_FLAG("osc", lua_load_osc, UPDATE_BUILTIN_SCRIPTS),
|
|
|
|
OPT_FLAG("ytdl", lua_load_ytdl, UPDATE_BUILTIN_SCRIPTS),
|
2016-09-19 17:50:41 +00:00
|
|
|
OPT_STRING("ytdl-format", lua_ytdl_format, 0),
|
|
|
|
OPT_KEYVALUELIST("ytdl-raw-options", lua_ytdl_raw_options, 0),
|
2017-09-26 23:17:47 +00:00
|
|
|
OPT_FLAG("load-stats-overlay", lua_load_stats, UPDATE_BUILTIN_SCRIPTS),
|
Add initial Lua scripting support
This is preliminary. There are still tons of issues, and any aspect
of scripting may change in the future. I decided to merge this
(preliminary) work now because it makes it easier to develop it, not
because it's done. lua.rst is clear enough about it (plus some
sarcasm).
This requires linking to Lua. Lua has no official pkg-config file, but
there are distribution specific .pc files, all with different names.
Adding a non-pkg-config based configure test was considered, but we'd
rather not.
One major complication is that libquvi links against Lua too, and if
the Lua version is different from mpv's, you will get a crash as soon
as libquvi uses Lua. (libquvi by design always runs when a file is
opened.) I would consider this the problem of distros and whoever
builds mpv, but to make things easier for users, we add a terrible
runtime test to the configure script, which probes whether libquvi
will crash. This is disabled when cross-compiling, but in that case
we hope the user knows what he is doing.
2013-09-25 22:41:14 +00:00
|
|
|
#endif
|
|
|
|
|
2011-03-10 21:08:21 +00:00
|
|
|
// ------------------------- stream options --------------------
|
|
|
|
|
2019-09-13 13:29:27 +00:00
|
|
|
#if HAVE_DVDNAV
|
2016-09-08 19:46:48 +00:00
|
|
|
OPT_SUBSTRUCT("", dvd_opts, dvd_conf, 0),
|
2019-09-13 13:29:27 +00:00
|
|
|
#endif
|
2013-08-21 16:41:59 +00:00
|
|
|
OPT_CHOICE_OR_INT("edition", edition_id, 0, 0, 8190,
|
|
|
|
({"auto", -1})),
|
2014-07-14 23:49:02 +00:00
|
|
|
#if HAVE_LIBBLURAY
|
2014-08-13 21:24:46 +00:00
|
|
|
OPT_STRING("bluray-device", bluray_device, M_OPT_FILE),
|
2014-07-14 23:49:02 +00:00
|
|
|
#endif /* HAVE_LIBBLURAY */
|
2011-03-10 21:08:21 +00:00
|
|
|
|
|
|
|
// ------------------------- demuxer options --------------------
|
|
|
|
|
2016-09-21 14:19:56 +00:00
|
|
|
OPT_CHOICE_OR_INT("frames", play_frames, 0, 0, INT_MAX, ({"all", -1})),
|
2011-03-10 21:08:21 +00:00
|
|
|
|
2012-11-15 17:49:17 +00:00
|
|
|
OPT_REL_TIME("start", play_start, 0),
|
|
|
|
OPT_REL_TIME("end", play_end, 0),
|
|
|
|
OPT_REL_TIME("length", play_length, 0),
|
2011-03-10 21:08:21 +00:00
|
|
|
|
2019-05-31 14:33:20 +00:00
|
|
|
OPT_CHOICE("play-dir", play_dir, 0,
|
|
|
|
({"forward", 1}, {"+", 1}, {"backward", -1}, {"-", -1})),
|
Implement backwards playback
See manpage additions. This is a huge hack. You can bet there are shit
tons of bugs. It's literally forcing square pegs into round holes.
Hopefully, the manpage wall of text makes it clear enough that the whole
shit can easily crash and burn. (Although it shouldn't literally crash.
That would be a bug. It possibly _could_ start a fire by entering some
sort of endless loop, not a literal one, just something where it tries
to do work without making progress.)
(Some obvious bugs I simply ignored for this initial version, but
there's a number of potential bugs I can't even imagine. Normal playback
should remain completely unaffected, though.)
How this works is also described in the manpage. Basically, we demux in
reverse, then we decode in reverse, then we render in reverse.
The decoding part is the simplest: just reorder the decoder output. This
weirdly integrates with the timeline/ordered chapter code, which also
has special requirements on feeding the packets to the decoder in a
non-straightforward way (it doesn't conflict, although a bugmessmass
breaks correct slicing of segments, so EDL/ordered chapter playback is
broken in backward direction).
Backward demuxing is pretty involved. In theory, it could be much
easier: simply iterating the usual demuxer output backward. But this
just doesn't fit into our code, so there's a cthulhu nightmare of shit.
To be specific, each stream (audio, video) is reversed separately. At
least this means we can do backward playback within cached content (for
example, you could play backwards in a live stream; on that note, it
disables prefetching, which would lead to losing new live video, but
this could be avoided).
The fuckmess also meant that I didn't bother trying to support
subtitles. Subtitles are a problem because they're "sparse" streams.
They need to be "passively" demuxed: you don't try to read a subtitle
packet, you demux audio and video, and then look whether there was a
subtitle packet. This means to get subtitles for a time range, you need
to know that you demuxed video and audio over this range, which becomes
pretty messy when you demux audio and video backwards separately.
Backward display is the most weird (and potentially buggy) part. To
avoid that we need to touch a LOT of timing code, we negate all
timestamps. The basic idea is that due to the navigation, all
comparisons and subtractions of timestamps keep working, and you don't
need to touch every single of them to "reverse" them.
E.g.:
bool before = pts_a < pts_b;
would need to be:
bool before = forward
? pts_a < pts_b
: pts_a > pts_b;
or:
bool before = pts_a * dir < pts_b * dir;
or if you, as it's implemented now, just do this after decoding:
pts_a *= dir;
pts_b *= dir;
and then in the normal timing/renderer code:
bool before = pts_a < pts_b;
Consequently, we don't need many changes in the latter code. But some
assumptions inhererently true for forward playback may have been broken
anyway. What is mainly needed is fixing places where values are passed
between positive and negative "domains". For example, seeking and
timestamp user display always uses positive timestamps. The main mess is
that it's not obvious which domain a given variable should or does use.
Well, in my tests with a single file, it suddenly started to work when I
did this. I'm honestly surprised that it did, and that I didn't have to
change a single line in the timing code past decoder (just something
minor to make external/cached text subtitles display). I committed it
immediately while avoiding thinking about it. But there really likely
are subtle problems of all sorts.
As far as I'm aware, gstreamer also supports backward playback. When I
looked at this years ago, I couldn't find a way to actually try this,
and I didn't revisit it now. Back then I also read talk slides from the
person who implemented it, and I'm not sure if and which ideas I might
have taken from it. It's possible that the timestamp reversal is
inspired by it, but I didn't check. (I think it claimed that it could
avoid large changes by changing a sign?)
VapourSynth has some sort of reverse function, which provides a backward
view on a video. The function itself is trivial to implement, as
VapourSynth aims to provide random access to video by frame numbers (so
you just request decreasing frame numbers). From what I remember, it
wasn't exactly fluid, but it worked. It's implemented by creating an
index, and seeking to the target on demand, and a bunch of caching. mpv
could use it, but it would either require using VapourSynth as demuxer
and decoder for everything, or replacing the current file every time
something is supposed to be played backwards.
FFmpeg's libavfilter has reversal filters for audio and video. These
require buffering the entire media data of the file, and don't really
fit into mpv's architecture. It could be used by playing a libavfilter
graph that also demuxes, but that's like VapourSynth but worse.
2019-05-18 00:10:51 +00:00
|
|
|
OPT_BYTE_SIZE("video-reversal-buffer", video_reverse_size, 0, 0, (size_t)-1),
|
|
|
|
OPT_BYTE_SIZE("audio-reversal-buffer", audio_reverse_size, 0, 0, (size_t)-1),
|
|
|
|
|
2015-11-16 21:47:17 +00:00
|
|
|
OPT_FLAG("rebase-start-time", rebase_start_time, 0),
|
|
|
|
|
2014-11-17 23:09:42 +00:00
|
|
|
OPT_TIME("ab-loop-a", ab_loop[0], 0, .min = MP_NOPTS_VALUE),
|
|
|
|
OPT_TIME("ab-loop-b", ab_loop[1], 0, .min = MP_NOPTS_VALUE),
|
|
|
|
|
2016-09-18 11:38:45 +00:00
|
|
|
OPT_CHOICE_OR_INT("playlist-start", playlist_pos, 0, 0, INT_MAX,
|
|
|
|
({"auto", -1}, {"no", -1})),
|
2015-08-22 20:08:17 +00:00
|
|
|
|
2016-09-21 14:19:56 +00:00
|
|
|
OPT_FLAG("pause", pause, 0),
|
2015-02-27 17:31:24 +00:00
|
|
|
OPT_CHOICE("keep-open", keep_open, 0,
|
2014-12-12 22:45:16 +00:00
|
|
|
({"no", 0},
|
2015-02-27 17:31:24 +00:00
|
|
|
{"yes", 1},
|
2014-12-12 22:45:16 +00:00
|
|
|
{"always", 2})),
|
2017-03-27 09:34:02 +00:00
|
|
|
OPT_FLAG("keep-open-pause", keep_open_pause, 0),
|
2016-08-17 20:45:44 +00:00
|
|
|
OPT_DOUBLE("image-display-duration", image_display_duration,
|
|
|
|
M_OPT_RANGE, 0, INFINITY),
|
2012-02-08 23:36:53 +00:00
|
|
|
|
2014-06-13 00:05:37 +00:00
|
|
|
OPT_CHOICE("index", index_mode, 0, ({"default", 1}, {"recreate", 0})),
|
2011-03-10 21:08:21 +00:00
|
|
|
|
|
|
|
// select audio/video/subtitle stream
|
2015-05-22 19:00:24 +00:00
|
|
|
OPT_TRACKCHOICE("aid", stream_id[0][STREAM_AUDIO]),
|
|
|
|
OPT_TRACKCHOICE("vid", stream_id[0][STREAM_VIDEO]),
|
|
|
|
OPT_TRACKCHOICE("sid", stream_id[0][STREAM_SUB]),
|
|
|
|
OPT_TRACKCHOICE("secondary-sid", stream_id[1][STREAM_SUB]),
|
2016-08-31 15:09:10 +00:00
|
|
|
OPT_ALIAS("sub", "sid"),
|
|
|
|
OPT_ALIAS("video", "vid"),
|
|
|
|
OPT_ALIAS("audio", "aid"),
|
2015-05-22 19:00:24 +00:00
|
|
|
OPT_STRINGLIST("alang", stream_lang[STREAM_AUDIO], 0),
|
|
|
|
OPT_STRINGLIST("slang", stream_lang[STREAM_SUB], 0),
|
2017-10-12 22:31:43 +00:00
|
|
|
OPT_STRINGLIST("vlang", stream_lang[STREAM_VIDEO], 0),
|
2017-08-12 21:43:05 +00:00
|
|
|
OPT_FLAG("track-auto-selection", stream_auto_sel, 0),
|
2011-03-10 21:08:21 +00:00
|
|
|
|
2017-08-12 21:08:48 +00:00
|
|
|
OPT_STRING("lavfi-complex", lavfi_complex, UPDATE_LAVFI_COMPLEX),
|
2016-02-05 22:19:56 +00:00
|
|
|
|
2012-12-10 17:52:06 +00:00
|
|
|
OPT_CHOICE("audio-display", audio_display, 0,
|
|
|
|
({"no", 0}, {"attachment", 1})),
|
|
|
|
|
2015-07-13 11:34:58 +00:00
|
|
|
OPT_CHOICE_OR_INT("hls-bitrate", hls_bitrate, 0, 0, INT_MAX,
|
|
|
|
({"no", -1}, {"min", 0}, {"max", INT_MAX})),
|
2014-09-01 21:47:27 +00:00
|
|
|
|
2017-06-26 19:07:00 +00:00
|
|
|
OPT_STRINGLIST("display-tags", display_tags, 0),
|
2014-12-29 21:51:18 +00:00
|
|
|
|
2013-07-16 11:28:28 +00:00
|
|
|
#if HAVE_CDDA
|
2014-06-10 18:46:15 +00:00
|
|
|
OPT_SUBSTRUCT("cdda", stream_cdda_opts, stream_cdda_conf, 0),
|
2014-08-13 21:24:46 +00:00
|
|
|
OPT_STRING("cdrom-device", cdrom_device, M_OPT_FILE),
|
2011-03-10 21:08:21 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
// demuxer.c - select audio/sub file/demuxer
|
2017-11-20 21:18:54 +00:00
|
|
|
OPT_PATHLIST("audio-files", audio_files, M_OPT_FILE),
|
2017-07-02 14:26:41 +00:00
|
|
|
OPT_CLI_ALIAS("audio-file", "audio-files-append"),
|
2011-03-10 21:08:21 +00:00
|
|
|
OPT_STRING("demuxer", demuxer_name, 0),
|
|
|
|
OPT_STRING("audio-demuxer", audio_demuxer_name, 0),
|
|
|
|
OPT_STRING("sub-demuxer", sub_demuxer_name, 0),
|
2014-07-16 20:40:21 +00:00
|
|
|
OPT_FLAG("demuxer-thread", demuxer_thread, 0),
|
player: make playback termination asynchronous
Until now, stopping playback aborted the demuxer and I/O layer violently
by signaling mp_cancel (bound to libavformat's AVIOInterruptCB
mechanism). Change it to try closing them gracefully.
The main purpose is to silence those libavformat errors that happen when
you request termination. Most of libavformat barely cares about the
termination mechanism (AVIOInterruptCB), and essentially it's like the
network connection is abruptly severed, or file I/O suddenly returns I/O
errors. There were issues with dumb TLS warnings, parsers complaining
about incomplete data, and some special protocols that require server
communication to gracefully disconnect.
We still want to abort it forcefully if it refuses to terminate on its
own, so a timeout is required. Users can set the timeout to 0, which
should give them the old behavior.
This also removes the old mechanism that treats certain commands (like
"quit") specially, and tries to terminate the demuxers even if the core
is currently frozen. This is for situations where the core synchronized
to the demuxer or stream layer while network is unresponsive. This in
turn can only happen due to the "program" or "cache-size" properties in
the current code (see one of the previous commits). Also, the old
mechanism doesn't fit particularly well with the new one. We wouldn't
want to abort playback immediately on a "quit" command - the new code is
all about giving it a chance to end it gracefully. We'd need some sort
of watchdog thread or something equally complicated to handle this. So
just remove it.
The change in osd.c is to prevent that it clears the status line while
waiting for termination. The normal status line code doesn't output
anything useful at this point, and the code path taken clears it, both
of which is an annoying behavior change, so just let it show the old
one.
2018-05-19 16:41:13 +00:00
|
|
|
OPT_DOUBLE("demuxer-termination-timeout", demux_termination_timeout, 0),
|
2019-05-16 14:29:45 +00:00
|
|
|
OPT_FLAG("demuxer-cache-wait", demuxer_cache_wait, 0),
|
2017-01-18 18:02:50 +00:00
|
|
|
OPT_FLAG("prefetch-playlist", prefetch_open, 0),
|
2018-01-03 20:50:04 +00:00
|
|
|
OPT_FLAG("cache-pause", cache_pause, 0),
|
2018-01-03 20:48:42 +00:00
|
|
|
OPT_FLAG("cache-pause-initial", cache_pause_initial, 0),
|
2018-01-03 20:28:28 +00:00
|
|
|
OPT_FLOAT("cache-pause-wait", cache_pause_wait, M_OPT_MIN, .min = 0),
|
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
|
|
|
|
2014-06-10 20:48:11 +00:00
|
|
|
OPT_DOUBLE("mf-fps", mf_fps, 0),
|
|
|
|
OPT_STRING("mf-type", mf_type, 0),
|
2013-07-16 11:28:28 +00:00
|
|
|
#if HAVE_DVBIN
|
2014-06-10 19:44:50 +00:00
|
|
|
OPT_SUBSTRUCT("dvbin", stream_dvb_opts, stream_dvb_conf, 0),
|
2011-03-10 21:08:21 +00:00
|
|
|
#endif
|
2014-07-29 23:15:42 +00:00
|
|
|
OPT_SUBSTRUCT("", stream_lavf_opts, stream_lavf_conf, 0),
|
2011-03-10 21:08:21 +00:00
|
|
|
|
|
|
|
// ------------------------- a-v sync options --------------------
|
|
|
|
|
|
|
|
// set A-V sync correction speed (0=disables it):
|
2013-03-08 01:08:02 +00:00
|
|
|
OPT_FLOATRANGE("mc", default_max_pts_correction, 0, 0, 100),
|
2011-03-10 21:08:21 +00:00
|
|
|
|
|
|
|
// force video/audio rate:
|
2015-02-03 22:04:19 +00:00
|
|
|
OPT_DOUBLE("fps", force_fps, CONF_MIN, .min = 0),
|
2018-01-18 13:44:20 +00:00
|
|
|
OPT_INTRANGE("audio-samplerate", force_srate, UPDATE_AUDIO, 0, 16*48000),
|
2016-09-22 18:56:34 +00:00
|
|
|
OPT_CHANNELS("audio-channels", audio_output_channels, UPDATE_AUDIO),
|
|
|
|
OPT_AUDIOFORMAT("audio-format", audio_output_format, UPDATE_AUDIO),
|
2016-09-21 14:19:56 +00:00
|
|
|
OPT_DOUBLE("speed", playback_speed, M_OPT_RANGE, .min = 0.01, .max = 100.0),
|
2011-03-10 21:08:21 +00:00
|
|
|
|
2014-10-02 00:58:52 +00:00
|
|
|
OPT_FLAG("audio-pitch-correction", pitch_correction, 0),
|
|
|
|
|
2011-03-10 21:08:21 +00:00
|
|
|
// set a-v distance
|
2016-08-04 09:27:15 +00:00
|
|
|
OPT_FLOAT("audio-delay", audio_delay, 0),
|
2011-03-10 21:08:21 +00:00
|
|
|
|
|
|
|
// ------------------------- codec/vfilter options --------------------
|
|
|
|
|
2018-01-12 03:07:53 +00:00
|
|
|
OPT_SETTINGSLIST("af-defaults", af_defs, 0, &af_obj_list,
|
|
|
|
.deprecation_message = "use --af + enable/disable flags"),
|
2017-06-26 19:07:00 +00:00
|
|
|
OPT_SETTINGSLIST("af", af_settings, 0, &af_obj_list, ),
|
2018-01-12 03:07:53 +00:00
|
|
|
OPT_SETTINGSLIST("vf-defaults", vf_defs, 0, &vf_obj_list,
|
|
|
|
.deprecation_message = "use --vf + enable/disable flags"),
|
2017-06-26 19:07:00 +00:00
|
|
|
OPT_SETTINGSLIST("vf", vf_settings, 0, &vf_obj_list, ),
|
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
|
|
|
|
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
|
|
|
OPT_SUBSTRUCT("", filter_opts, filter_conf, 0),
|
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
|
|
|
|
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
|
|
|
OPT_STRING("ad", audio_decoders, 0),
|
|
|
|
OPT_STRING("vd", video_decoders, 0),
|
2013-06-28 13:26:30 +00:00
|
|
|
|
2015-06-05 20:35:43 +00:00
|
|
|
OPT_STRING("audio-spdif", audio_spdif, 0),
|
|
|
|
|
2019-10-24 22:47:45 +00:00
|
|
|
OPT_ASPECT("video-aspect-override", movie_aspect, UPDATE_IMGPAR | M_OPT_RANGE,
|
|
|
|
.min = -1, .max = 10),
|
2016-09-20 13:34:31 +00:00
|
|
|
OPT_CHOICE("video-aspect-method", aspect_method, UPDATE_IMGPAR,
|
2017-07-21 18:19:39 +00:00
|
|
|
({"bitstream", 1}, {"container", 2})),
|
2011-03-10 21:08:21 +00:00
|
|
|
|
2018-05-21 14:05:03 +00:00
|
|
|
OPT_SUBSTRUCT("", vd_lavc_params, vd_lavc_conf, 0),
|
2014-06-10 23:39:51 +00:00
|
|
|
OPT_SUBSTRUCT("ad-lavc", ad_lavc_params, ad_lavc_conf, 0),
|
2013-06-28 12:56:52 +00:00
|
|
|
|
2016-09-06 18:09:56 +00:00
|
|
|
OPT_SUBSTRUCT("", demux_lavf, demux_lavf_conf, 0),
|
2014-06-10 21:06:42 +00:00
|
|
|
OPT_SUBSTRUCT("demuxer-rawaudio", demux_rawaudio, demux_rawaudio_conf, 0),
|
|
|
|
OPT_SUBSTRUCT("demuxer-rawvideo", demux_rawvideo, demux_rawvideo_conf, 0),
|
2015-04-23 17:21:17 +00:00
|
|
|
OPT_SUBSTRUCT("demuxer-mkv", demux_mkv, demux_mkv_conf, 0),
|
2019-04-07 13:10:52 +00:00
|
|
|
OPT_SUBSTRUCT("demuxer-cue", demux_cue, demux_cue_conf, 0),
|
2013-06-28 13:26:30 +00:00
|
|
|
|
2011-03-10 21:08:21 +00:00
|
|
|
// ------------------------- subtitles options --------------------
|
|
|
|
|
2017-11-20 21:18:54 +00:00
|
|
|
OPT_PATHLIST("sub-files", sub_name, M_OPT_FILE),
|
2017-07-02 14:26:41 +00:00
|
|
|
OPT_CLI_ALIAS("sub-file", "sub-files-append"),
|
2017-11-20 21:18:54 +00:00
|
|
|
OPT_PATHLIST("sub-file-paths", sub_paths, M_OPT_FILE),
|
|
|
|
OPT_PATHLIST("audio-file-paths", audiofile_paths, M_OPT_FILE),
|
|
|
|
OPT_PATHLIST("external-files", external_files, M_OPT_FILE),
|
2017-07-29 14:40:08 +00:00
|
|
|
OPT_CLI_ALIAS("external-file", "external-files-append"),
|
2016-08-10 20:22:50 +00:00
|
|
|
OPT_FLAG("autoload-files", autoload_files, 0),
|
2014-05-04 08:31:24 +00:00
|
|
|
OPT_CHOICE("sub-auto", sub_auto, 0,
|
|
|
|
({"no", -1}, {"exact", 0}, {"fuzzy", 1}, {"all", 2})),
|
2015-02-02 20:23:12 +00:00
|
|
|
OPT_CHOICE("audio-file-auto", audiofile_auto, 0,
|
|
|
|
({"no", -1}, {"exact", 0}, {"fuzzy", 1}, {"all", 2})),
|
2017-12-29 16:19:25 +00:00
|
|
|
|
|
|
|
OPT_SUBSTRUCT("", subs_rend, mp_subtitle_sub_opts, 0),
|
|
|
|
OPT_SUBSTRUCT("", osd_rend, mp_osd_render_sub_opts, 0),
|
|
|
|
|
2016-09-19 18:16:44 +00:00
|
|
|
OPT_FLAG("osd-bar", osd_bar_visible, UPDATE_OSD),
|
2001-11-02 00:32:35 +00:00
|
|
|
|
2002-05-04 21:26:45 +00:00
|
|
|
//---------------------- libao/libvo options ------------------------
|
2018-05-21 13:11:19 +00:00
|
|
|
OPT_SUBSTRUCT("", ao_opts, ao_conf, 0),
|
2016-10-04 05:20:46 +00:00
|
|
|
OPT_FLAG("audio-exclusive", audio_exclusive, UPDATE_AUDIO),
|
2015-10-05 16:53:02 +00:00
|
|
|
OPT_FLAG("audio-fallback-to-null", ao_null_fallback, 0),
|
2016-08-09 14:22:06 +00:00
|
|
|
OPT_FLAG("audio-stream-silence", audio_stream_silence, 0),
|
2016-08-09 14:26:44 +00:00
|
|
|
OPT_FLOATRANGE("audio-wait-open", audio_wait_open, 0, 0, 60),
|
2015-05-08 19:47:39 +00:00
|
|
|
OPT_CHOICE("force-window", force_vo, 0,
|
|
|
|
({"no", 0}, {"yes", 1}, {"immediate", 2})),
|
2010-05-03 23:34:38 +00:00
|
|
|
|
2016-07-09 16:31:18 +00:00
|
|
|
OPT_FLOATRANGE("volume-max", softvol_max, 0, 100, 1000),
|
|
|
|
// values <0 for volume and mute are legacy and ignored
|
2017-04-26 19:45:50 +00:00
|
|
|
OPT_FLOATRANGE("volume", softvol_volume, UPDATE_VOL, -1, 1000),
|
|
|
|
OPT_CHOICE("mute", softvol_mute, UPDATE_VOL,
|
2016-09-18 09:58:24 +00:00
|
|
|
({"no", 0},
|
|
|
|
{"auto", 0},
|
2015-02-27 17:31:24 +00:00
|
|
|
{"yes", 1})),
|
2017-04-26 22:21:17 +00:00
|
|
|
OPT_CHOICE("replaygain", rgain_mode, UPDATE_VOL,
|
|
|
|
({"no", 0},
|
|
|
|
{"track", 1},
|
|
|
|
{"album", 2})),
|
2017-04-26 19:45:50 +00:00
|
|
|
OPT_FLOATRANGE("replaygain-preamp", rgain_preamp, UPDATE_VOL, -15, 15),
|
|
|
|
OPT_FLAG("replaygain-clip", rgain_clip, UPDATE_VOL),
|
|
|
|
OPT_FLOATRANGE("replaygain-fallback", rgain_fallback, UPDATE_VOL, -200, 60),
|
2015-02-27 17:31:24 +00:00
|
|
|
OPT_CHOICE("gapless-audio", gapless_audio, 0,
|
2014-06-08 21:54:05 +00:00
|
|
|
({"no", 0},
|
2015-02-27 17:31:24 +00:00
|
|
|
{"yes", 1},
|
2014-06-08 21:54:05 +00:00
|
|
|
{"weak", -1})),
|
2010-05-03 23:34:38 +00:00
|
|
|
|
2013-03-04 16:40:21 +00:00
|
|
|
OPT_STRING("title", wintitle, 0),
|
2015-05-22 18:03:14 +00:00
|
|
|
OPT_STRING("force-media-title", media_title, 0),
|
2016-09-20 13:34:31 +00:00
|
|
|
OPT_CHOICE_OR_INT("video-rotate", video_rotate, UPDATE_IMGPAR, 0, 359,
|
2014-05-24 12:08:39 +00:00
|
|
|
({"no", -1})),
|
2010-05-03 23:34:38 +00:00
|
|
|
|
2016-10-02 10:33:34 +00:00
|
|
|
OPT_FLAG("stop-screensaver", stop_screensaver, UPDATE_SCREENSAVER),
|
2009-07-06 23:26:13 +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
|
|
|
OPT_SUBSTRUCT("", video_equalizer, mp_csp_equalizer_conf, 0),
|
2002-05-04 21:26:45 +00:00
|
|
|
|
2015-02-16 19:04:05 +00:00
|
|
|
OPT_FLAG("use-filedir-conf", use_filedir_conf, 0),
|
2012-09-17 06:45:35 +00:00
|
|
|
OPT_CHOICE("osd-level", osd_level, 0,
|
|
|
|
({"0", 0}, {"1", 1}, {"2", 2}, {"3", 3})),
|
2018-01-21 23:36:08 +00:00
|
|
|
OPT_CHOICE("osd-on-seek", osd_on_seek, 0,
|
|
|
|
({"no", 0},
|
|
|
|
{"bar", 1},
|
|
|
|
{"msg", 2},
|
|
|
|
{"msg-bar", 3})),
|
2010-05-07 19:02:47 +00:00
|
|
|
OPT_INTRANGE("osd-duration", osd_duration, 0, 0, 3600000),
|
2013-02-08 20:09:18 +00:00
|
|
|
OPT_FLAG("osd-fractions", osd_fractions, 0),
|
2002-05-04 21:26:45 +00:00
|
|
|
|
2013-03-08 01:08:02 +00:00
|
|
|
OPT_DOUBLE("sstep", step_sec, CONF_MIN, 0),
|
2002-05-04 21:26:45 +00:00
|
|
|
|
2012-09-17 06:38:19 +00:00
|
|
|
OPT_CHOICE("framedrop", frame_dropping, 0,
|
|
|
|
({"no", 0},
|
video: add VO framedropping mode
This mostly uses the same idea as with vo_vdpau.c, but much simplified.
On X11, it tries to get the display framerate with XF86VM, and limits
the frequency of new video frames against it. Note that this is an old
extension, and is confirmed not to work correctly with multi-monitor
setups. But we're using it because it was already around (it is also
used by vo_vdpau).
This attempts to predict the next vsync event by using the time of the
last frame and the display FPS. Even if that goes completely wrong,
the results are still relatively good.
On other systems, or if the X11 code doesn't return a display FPS, a
framerate of 1000 is assumed. This is infinite for all practical
purposes, and means that only frames which are definitely too late are
dropped. This probably has worse results, but is still useful.
"--framedrop=yes" is basically replaced with "--framedrop=decoder". The
old framedropping mode is kept around, and should perhaps be improved.
Dropping on the decoder level is still useful if decoding itself is too
slow.
2014-08-15 21:33:33 +00:00
|
|
|
{"vo", 1},
|
|
|
|
{"decoder", 2},
|
|
|
|
{"decoder+vo", 3})),
|
2018-03-02 14:37:34 +00:00
|
|
|
OPT_FLAG("video-latency-hacks", video_latency_hacks, 0),
|
2002-05-04 21:26:45 +00:00
|
|
|
|
2015-02-03 22:04:19 +00:00
|
|
|
OPT_FLAG("untimed", untimed, 0),
|
2002-05-04 21:26:45 +00:00
|
|
|
|
2015-02-03 22:04:19 +00:00
|
|
|
OPT_STRING("stream-dump", stream_dump, M_OPT_FILE),
|
2013-05-11 20:19:33 +00:00
|
|
|
|
2014-10-28 18:51:44 +00:00
|
|
|
OPT_FLAG("stop-playback-on-init-failure", stop_playback_on_init_failure, 0),
|
|
|
|
|
2017-04-10 19:19:13 +00:00
|
|
|
OPT_CHOICE_OR_INT("loop-playlist", loop_times, 0, 1, 10000,
|
2015-02-12 21:41:45 +00:00
|
|
|
({"no", 1},
|
2015-05-22 12:56:26 +00:00
|
|
|
{"inf", -1}, {"yes", -1},
|
2015-02-12 21:41:45 +00:00
|
|
|
{"force", -2})),
|
2015-02-27 17:31:24 +00:00
|
|
|
OPT_CHOICE_OR_INT("loop-file", loop_file, 0, 0, 10000,
|
|
|
|
({"no", 0},
|
|
|
|
{"yes", -1},
|
2014-09-22 20:56:00 +00:00
|
|
|
{"inf", -1})),
|
2017-08-14 18:01:08 +00:00
|
|
|
OPT_ALIAS("loop", "loop-file"),
|
2012-08-05 21:34:28 +00:00
|
|
|
|
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
|
|
|
OPT_FLAG("resume-playback", position_resume, 0),
|
player: Optionally validate st_mtime when restoring playback state
I often watch sporting events. On many occasions I get files with the
same filename for each session. For example, for F1 I might have the
following directory structure:
F1/
FP1.mkv
FP2.mkv
FP3.mkv
Qualification.mkv
Race.mkv
Since usually one simply watches one race after the other, I usually
just rsync the new event's files over the old ones, so, for example,
Race.mkv will be replaced from the file for the last event with the file
from the new event.
One problem with this is that I like to use --resume-playback for other
kinds of media, so I have it on by default. That works great for, say, a
movie, but doesn't work so well with this scheme, because you can
trivially forget to pass --no-resume-playback on the command line and
end up 2 hours in, watching spoilers as the race results scroll down the
screen :-)
This patch adds a new option, --resume-playback-check-mtime, which
validates that the file's mtime hasn't changed since the watch_later
configuration was saved. It does this by setting the watch_later
configuration to have the same mtime as the file after it is saved.
Switching back and forth between checking mtime and not checking mtime
works fine, as we only choose whether to compare based on it, but we
update the watch_later configuration mtime regardless of its value.
2019-11-09 18:24:16 +00:00
|
|
|
OPT_FLAG("resume-playback-check-mtime", position_check_mtime, 0),
|
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
|
|
|
OPT_FLAG("save-position-on-quit", position_save_on_quit, 0),
|
2014-06-01 16:25:21 +00:00
|
|
|
OPT_FLAG("write-filename-in-watch-later-config", write_filename_in_watch_later_config, 0),
|
2014-12-12 22:57:49 +00:00
|
|
|
OPT_FLAG("ignore-path-in-watch-later-config", ignore_path_in_watch_later_config, 0),
|
2017-03-05 21:47:36 +00:00
|
|
|
OPT_STRING("watch-later-directory", watch_later_directory, M_OPT_FILE),
|
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
|
|
|
|
2013-02-08 20:09:18 +00:00
|
|
|
OPT_FLAG("ordered-chapters", ordered_chapters, 0),
|
2014-08-13 21:24:46 +00:00
|
|
|
OPT_STRING("ordered-chapters-files", ordered_chapters_files, M_OPT_FILE),
|
2010-11-26 14:56:05 +00:00
|
|
|
OPT_INTRANGE("chapter-merge-threshold", chapter_merge_threshold, 0, 0, 10000),
|
2009-04-07 23:37:27 +00:00
|
|
|
|
2013-08-14 01:25:50 +00:00
|
|
|
OPT_DOUBLE("chapter-seek-threshold", chapter_seek_threshold, 0),
|
|
|
|
|
2014-11-02 15:47:23 +00:00
|
|
|
OPT_STRING("chapters-file", chapter_file, M_OPT_FILE),
|
|
|
|
|
2013-08-25 18:40:21 +00:00
|
|
|
OPT_FLAG("load-unsafe-playlists", load_unsafe_playlists, 0),
|
2013-11-19 21:36:33 +00:00
|
|
|
OPT_FLAG("merge-files", merge_files, 0),
|
2013-08-25 18:40:21 +00:00
|
|
|
|
2010-05-03 23:34:38 +00:00
|
|
|
// a-v sync stuff:
|
2013-07-26 00:06:58 +00:00
|
|
|
OPT_FLAG("correct-pts", correct_pts, 0),
|
2013-02-08 20:09:18 +00:00
|
|
|
OPT_FLAG("initial-audio-sync", initial_audio_sync, 0),
|
2015-08-10 16:43:25 +00:00
|
|
|
OPT_CHOICE("video-sync", video_sync, 0,
|
|
|
|
({"audio", VS_DEFAULT},
|
|
|
|
{"display-resample", VS_DISP_RESAMPLE},
|
|
|
|
{"display-resample-vdrop", VS_DISP_RESAMPLE_VDROP},
|
|
|
|
{"display-resample-desync", VS_DISP_RESAMPLE_NONE},
|
2015-10-27 19:56:46 +00:00
|
|
|
{"display-adrop", VS_DISP_ADROP},
|
2015-08-10 16:43:25 +00:00
|
|
|
{"display-vdrop", VS_DISP_VDROP},
|
|
|
|
{"display-desync", VS_DISP_NONE},
|
|
|
|
{"desync", VS_NONE})),
|
|
|
|
OPT_DOUBLE("video-sync-max-video-change", sync_max_video_change,
|
|
|
|
M_OPT_MIN, .min = 0),
|
|
|
|
OPT_DOUBLE("video-sync-max-audio-change", sync_max_audio_change,
|
|
|
|
M_OPT_MIN | M_OPT_MAX, .min = 0, .max = 1),
|
2015-10-27 19:56:46 +00:00
|
|
|
OPT_DOUBLE("video-sync-adrop-size", sync_audio_drop_size,
|
|
|
|
M_OPT_MIN | M_OPT_MAX, .min = 0, .max = 1),
|
2010-12-14 23:09:47 +00:00
|
|
|
OPT_CHOICE("hr-seek", hr_seek, 0,
|
2015-04-15 12:26:54 +00:00
|
|
|
({"no", -1}, {"absolute", 0}, {"yes", 1}, {"always", 1})),
|
2015-04-20 18:03:05 +00:00
|
|
|
OPT_FLOAT("hr-seek-demuxer-offset", hr_seek_demuxer_offset, 0),
|
2014-05-07 20:01:17 +00:00
|
|
|
OPT_FLAG("hr-seek-framedrop", hr_seek_framedrop, 0),
|
2012-09-20 01:32:01 +00:00
|
|
|
OPT_CHOICE_OR_INT("autosync", autosync, 0, 0, 10000,
|
|
|
|
({"no", -1})),
|
2002-09-23 22:12:29 +00:00
|
|
|
|
2012-09-03 20:44:44 +00:00
|
|
|
OPT_CHOICE("term-osd", term_osd, 0,
|
2012-01-06 18:48:50 +00:00
|
|
|
({"force", 1},
|
2012-09-21 07:22:25 +00:00
|
|
|
{"auto", 2},
|
2012-09-18 13:50:24 +00:00
|
|
|
{"no", 0})),
|
2012-01-06 18:48:50 +00:00
|
|
|
|
2014-01-15 15:14:37 +00:00
|
|
|
OPT_FLAG("term-osd-bar", term_osd_bar, 0),
|
|
|
|
OPT_STRING("term-osd-bar-chars", term_osd_bar_chars, 0),
|
|
|
|
|
2014-04-24 16:16:47 +00:00
|
|
|
OPT_STRING("term-playing-msg", playing_msg, 0),
|
2014-09-01 22:09:03 +00:00
|
|
|
OPT_STRING("osd-playing-msg", osd_playing_msg, 0),
|
2014-04-24 16:16:47 +00:00
|
|
|
OPT_STRING("term-status-msg", status_msg, 0),
|
2014-02-20 13:46:23 +00:00
|
|
|
OPT_STRING("osd-status-msg", osd_status_msg, 0),
|
2014-09-17 23:19:27 +00:00
|
|
|
OPT_STRING("osd-msg1", osd_msg[0], 0),
|
|
|
|
OPT_STRING("osd-msg2", osd_msg[1], 0),
|
|
|
|
OPT_STRING("osd-msg3", osd_msg[2], 0),
|
2010-05-03 23:34:38 +00:00
|
|
|
|
2016-08-28 16:15:37 +00:00
|
|
|
OPT_FLAG("video-osd", video_osd, 0),
|
|
|
|
|
2015-02-27 17:31:24 +00:00
|
|
|
OPT_CHOICE("idle", player_idle_mode, 0,
|
2014-12-07 11:49:07 +00:00
|
|
|
({"no", 0},
|
|
|
|
{"once", 1},
|
2015-02-27 17:31:24 +00:00
|
|
|
{"yes", 2})),
|
2014-12-07 11:49:07 +00:00
|
|
|
|
2016-09-19 17:54:54 +00:00
|
|
|
OPT_FLAG("input-terminal", consolecontrols, UPDATE_TERM),
|
2002-05-04 21:26:45 +00:00
|
|
|
|
2019-11-16 14:28:18 +00:00
|
|
|
OPT_STRING("input-file", input_file, M_OPT_FILE | UPDATE_INPUT,
|
|
|
|
.deprecation_message = "use --input-ipc-server"),
|
2016-09-21 13:56:54 +00:00
|
|
|
OPT_STRING("input-ipc-server", ipc_path, M_OPT_FILE | UPDATE_INPUT),
|
2014-10-16 09:48:18 +00:00
|
|
|
|
2016-09-05 19:04:55 +00:00
|
|
|
OPT_SUBSTRUCT("screenshot", screenshot_image_opts, screenshot_conf, 0),
|
2014-06-13 00:17:31 +00:00
|
|
|
OPT_STRING("screenshot-template", screenshot_template, 0),
|
2017-03-05 21:47:36 +00:00
|
|
|
OPT_STRING("screenshot-directory", screenshot_directory, M_OPT_FILE),
|
2011-10-06 18:46:02 +00:00
|
|
|
|
2019-07-13 13:41:42 +00:00
|
|
|
OPT_STRING("record-file", record_file, M_OPT_FILE, .deprecation_message =
|
|
|
|
"use --stream-record or the dump-cache command"),
|
2017-02-07 16:05:17 +00:00
|
|
|
|
2018-01-18 13:44:20 +00:00
|
|
|
OPT_SUBSTRUCT("", resample_opts, resample_conf, 0),
|
2018-01-12 03:02:55 +00:00
|
|
|
|
2016-09-21 13:56:54 +00:00
|
|
|
OPT_SUBSTRUCT("", input_opts, input_config, 0),
|
2013-07-27 19:26:00 +00:00
|
|
|
|
2016-08-30 21:50:57 +00:00
|
|
|
OPT_SUBSTRUCT("", vo, vo_sub_opts, 0),
|
2016-09-06 18:09:56 +00:00
|
|
|
OPT_SUBSTRUCT("", demux_opts, demux_conf, 0),
|
demux: add a on-disk cache
Somewhat similar to the old --cache-file, except for the demuxer cache.
Instead of keeping packet data in memory, it's written to disk and read
back when needed.
The idea is to reduce main memory usage, while allowing fast seeking in
large cached network streams (especially live streams). Keeping the
packet metadata on disk would be rather hard (would use mmap or so, or
rewrite the entire demux.c packet queue handling), and since it's
relatively small, just keep it in memory.
Also for simplicity, the disk cache is append-only. If you're watching
really long livestreams, and need pruning, you're probably out of luck.
This still could be improved by trying to free unused blocks with
fallocate(), but since we're writing multiple streams in an interleaved
manner, this is slightly hard.
Some rather gross ugliness in packet.h: we want to store the file
position of the cached data somewhere, but on 32 bit architectures, we
don't have any usable 64 bit members for this, just the buf/len fields,
which add up to 64 bit - so the shitty union aliases this memory.
Error paths untested. Side data (the complicated part of trying to
serialize ffmpeg packets) untested.
Stream recording had to be adjusted. Some minor details change due to
this, but probably nothing important.
The change in attempt_range_joining() is because packets in cache
have no valid len field. It was a useful check (heuristically
finding broken cases), but not a necessary one.
Various other approaches were tried. It would be interesting to list
them and to mention the pros and cons, but I don't feel like it.
2019-06-13 17:10:32 +00:00
|
|
|
OPT_SUBSTRUCT("", demux_cache_opts, demux_cache_conf, 0),
|
stream: turn into a ring buffer, make size configurable
In some corner cases (see #6802), it can be beneficial to use a larger
stream buffer size. Use this as argument to rewrite everything for no
reason.
Turn stream.c itself into a ring buffer, with configurable size. The
latter would have been easily achievable with minimal changes, and the
ring buffer is the hard part. There is no reason to have a ring buffer
at all, except possibly if ffmpeg don't fix their awful mp4 demuxer, and
some subtle issues with demux_mkv.c wanting to seek back by small
offsets (the latter was handled with small stream_peek() calls, which
are unneeded now).
In addition, this turns small forward seeks into reads (where data is
simply skipped). Before this commit, only stream_skip() did this (which
also mean that stream_skip() simply calls stream_seek() now).
Replace all stream_peek() calls with something else (usually
stream_read_peek()). The function was a problem, because it returned a
pointer to the internal buffer, which is now a ring buffer with
wrapping. The new function just copies the data into a buffer, and in
some cases requires callers to dynamically allocate memory. (The most
common case, demux_lavf.c, required a separate buffer allocation anyway
due to FFmpeg "idiosyncrasies".) This is the bulk of the demuxer_*
changes.
I'm not happy with this. There still isn't a good reason why there
should be a ring buffer, that is complex, and most of the time just
wastes half of the available memory. Maybe another rewrite soon.
It also contains bugs; you're an alpha tester now.
2019-11-06 20:36:02 +00:00
|
|
|
OPT_SUBSTRUCT("", stream_opts, stream_conf, 0),
|
2016-08-30 21:50:57 +00:00
|
|
|
|
2016-09-02 13:59:40 +00:00
|
|
|
OPT_SUBSTRUCT("", gl_video_opts, gl_video_conf, 0),
|
2017-09-13 01:09:48 +00:00
|
|
|
OPT_SUBSTRUCT("", spirv_opts, spirv_conf, 0),
|
2016-09-02 13:59:40 +00:00
|
|
|
|
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
|
|
|
#if HAVE_GL
|
|
|
|
OPT_SUBSTRUCT("", opengl_opts, opengl_conf, 0),
|
|
|
|
#endif
|
|
|
|
|
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
|
|
|
#if HAVE_VULKAN
|
|
|
|
OPT_SUBSTRUCT("", vulkan_opts, vulkan_conf, 0),
|
|
|
|
#endif
|
|
|
|
|
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
|
|
|
#if HAVE_D3D11
|
|
|
|
OPT_SUBSTRUCT("", d3d11_opts, d3d11_conf, 0),
|
2017-11-01 11:38:41 +00:00
|
|
|
#if HAVE_D3D_HWACCEL
|
|
|
|
OPT_SUBSTRUCT("", d3d11va_opts, d3d11va_conf, 0),
|
|
|
|
#endif
|
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
|
|
|
#endif
|
|
|
|
|
2017-06-30 10:27:15 +00:00
|
|
|
#if HAVE_EGL_ANGLE_WIN32
|
2017-01-20 12:38:28 +00:00
|
|
|
OPT_SUBSTRUCT("", angle_opts, angle_conf, 0),
|
|
|
|
#endif
|
|
|
|
|
2017-02-20 19:34:57 +00:00
|
|
|
#if HAVE_GL_COCOA
|
|
|
|
OPT_SUBSTRUCT("", cocoa_opts, cocoa_conf, 0),
|
|
|
|
#endif
|
|
|
|
|
2018-02-16 12:07:15 +00:00
|
|
|
#if HAVE_MACOS_COCOA_CB
|
|
|
|
OPT_SUBSTRUCT("", macos_opts, macos_conf, 0),
|
|
|
|
#endif
|
|
|
|
|
2018-07-21 08:38:54 +00:00
|
|
|
#if HAVE_EGL_ANDROID
|
2017-12-25 15:04:09 +00:00
|
|
|
OPT_SUBSTRUCT("", android_opts, android_conf, 0),
|
|
|
|
#endif
|
|
|
|
|
2019-10-14 17:16:42 +00:00
|
|
|
#if HAVE_WAYLAND
|
|
|
|
OPT_SUBSTRUCT("", wayland_opts, wayland_conf, 0),
|
|
|
|
#endif
|
|
|
|
|
2017-01-20 13:02:17 +00:00
|
|
|
#if HAVE_GL_WIN32
|
|
|
|
OPT_CHOICE("opengl-dwmflush", wingl_dwm_flush, 0,
|
|
|
|
({"no", -1}, {"auto", 0}, {"windowed", 1}, {"yes", 2})),
|
|
|
|
#endif
|
|
|
|
|
2017-05-29 16:48:10 +00:00
|
|
|
#if HAVE_CUDA_HWACCEL
|
|
|
|
OPT_CHOICE_OR_INT("cuda-decode-device", cuda_device, 0,
|
|
|
|
0, INT_MAX, ({"auto", -1})),
|
|
|
|
#endif
|
|
|
|
|
2018-03-29 21:23:27 +00:00
|
|
|
#if HAVE_VAAPI
|
|
|
|
OPT_SUBSTRUCT("vaapi", vaapi_opts, vaapi_conf, 0),
|
|
|
|
#endif
|
|
|
|
|
2019-10-31 14:18:57 +00:00
|
|
|
OPT_SUBSTRUCT("sws", sws_opts, sws_conf, 0),
|
|
|
|
|
|
|
|
#if HAVE_ZIMG
|
|
|
|
OPT_SUBSTRUCT("zimg", zimg_opts, zimg_conf, 0),
|
|
|
|
#endif
|
|
|
|
|
2014-06-11 00:04:02 +00:00
|
|
|
OPT_SUBSTRUCT("", encode_opts, encode_config, 0),
|
2012-09-14 15:51:26 +00:00
|
|
|
|
2014-12-11 00:04:15 +00:00
|
|
|
OPT_REMOVED("a52drc", "use --ad-lavc-ac3drc=level"),
|
|
|
|
OPT_REMOVED("afm", "use --ad=..."),
|
2019-10-04 16:45:37 +00:00
|
|
|
OPT_REPLACED("aspect", "video-aspect-override"),
|
2014-12-11 00:04:15 +00:00
|
|
|
OPT_REMOVED("ass-bottom-margin", "use --vf=sub=bottom:top"),
|
|
|
|
OPT_REPLACED("ass", "sub-ass"),
|
|
|
|
OPT_REPLACED("audiofile", "audio-file"),
|
|
|
|
OPT_REMOVED("benchmark", "use --untimed (no stats)"),
|
2017-01-21 16:19:01 +00:00
|
|
|
OPT_REMOVED("capture", NULL),
|
|
|
|
OPT_REMOVED("stream-capture", NULL),
|
2014-12-11 00:04:15 +00:00
|
|
|
OPT_REMOVED("channels", "use --audio-channels (changed semantics)"),
|
|
|
|
OPT_REPLACED("cursor-autohide-delay", "cursor-autohide"),
|
|
|
|
OPT_REPLACED("delay", "audio-delay"),
|
|
|
|
OPT_REMOVED("dumpstream", "use --stream-dump=<filename>"),
|
|
|
|
OPT_REPLACED("dvdangle", "dvd-angle"),
|
|
|
|
OPT_REPLACED("endpos", "length"),
|
|
|
|
OPT_REPLACED("font", "osd-font"),
|
|
|
|
OPT_REPLACED("forcedsubsonly", "sub-forced-only"),
|
|
|
|
OPT_REPLACED("format", "audio-format"),
|
|
|
|
OPT_REMOVED("hardframedrop", NULL),
|
|
|
|
OPT_REMOVED("identify", "use TOOLS/mpv_identify.sh"),
|
|
|
|
OPT_REMOVED("lavdopts", "use --vd-lavc-..."),
|
|
|
|
OPT_REMOVED("lavfdopts", "use --demuxer-lavf-..."),
|
2014-12-14 23:31:30 +00:00
|
|
|
OPT_REPLACED("lua", "script"),
|
|
|
|
OPT_REPLACED("lua-opts", "script-opts"),
|
2014-12-11 00:04:15 +00:00
|
|
|
OPT_REMOVED("mixer-channel", "use AO suboptions (alsa, oss)"),
|
|
|
|
OPT_REMOVED("mixer", "use AO suboptions (alsa, oss)"),
|
|
|
|
OPT_REPLACED("mouse-movements", "input-cursor"),
|
|
|
|
OPT_REPLACED("msgcolor", "msg-color"),
|
|
|
|
OPT_REMOVED("msglevel", "use --msg-level (changed semantics)"),
|
|
|
|
OPT_REPLACED("msgmodule", "msg-module"),
|
|
|
|
OPT_REPLACED("name", "x11-name"),
|
|
|
|
OPT_REPLACED("noar", "no-input-appleremote"),
|
|
|
|
OPT_REPLACED("noautosub", "no-sub-auto"),
|
|
|
|
OPT_REPLACED("noconsolecontrols", "no-input-terminal"),
|
|
|
|
OPT_REPLACED("nosound", "no-audio"),
|
|
|
|
OPT_REPLACED("osdlevel", "osd-level"),
|
|
|
|
OPT_REMOVED("panscanrange", "use --video-zoom, --video-pan-x/y"),
|
|
|
|
OPT_REPLACED("playing-msg", "term-playing-msg"),
|
|
|
|
OPT_REMOVED("pp", NULL),
|
|
|
|
OPT_REMOVED("pphelp", NULL),
|
|
|
|
OPT_REMOVED("rawaudio", "use --demuxer-rawaudio-..."),
|
|
|
|
OPT_REMOVED("rawvideo", "use --demuxer-rawvideo-..."),
|
|
|
|
OPT_REPLACED("spugauss", "sub-gauss"),
|
|
|
|
OPT_REPLACED("srate", "audio-samplerate"),
|
|
|
|
OPT_REPLACED("ss", "start"),
|
|
|
|
OPT_REPLACED("stop-xscreensaver", "stop-screensaver"),
|
|
|
|
OPT_REPLACED("sub-fuzziness", "sub-auto"),
|
|
|
|
OPT_REPLACED("subcp", "sub-codepage"),
|
|
|
|
OPT_REPLACED("subdelay", "sub-delay"),
|
2015-08-20 22:05:07 +00:00
|
|
|
OPT_REPLACED("subfile", "sub-file"),
|
2014-12-11 00:04:15 +00:00
|
|
|
OPT_REPLACED("subfont-text-scale", "sub-scale"),
|
|
|
|
OPT_REPLACED("subfont", "sub-text-font"),
|
|
|
|
OPT_REPLACED("subfps", "sub-fps"),
|
|
|
|
OPT_REPLACED("subpos", "sub-pos"),
|
|
|
|
OPT_REPLACED("tvscan", "tv-scan"),
|
|
|
|
OPT_REMOVED("use-filename-title", "use --title='${filename}'"),
|
|
|
|
OPT_REMOVED("vc", "use --vd=..., --hwdec=..."),
|
|
|
|
OPT_REMOVED("vobsub", "use --sub-file (pass the .idx file)"),
|
|
|
|
OPT_REMOVED("xineramascreen", "use --screen (different values)"),
|
|
|
|
OPT_REMOVED("xy", "use --autofit"),
|
|
|
|
OPT_REMOVED("zoom", "Inverse available as ``--video-unscaled"),
|
|
|
|
OPT_REPLACED("media-keys", "input-media-keys"),
|
|
|
|
OPT_REPLACED("right-alt-gr", "input-right-alt-gr"),
|
|
|
|
OPT_REPLACED("autosub", "sub-auto"),
|
|
|
|
OPT_REPLACED("autosub-match", "sub-auto"),
|
|
|
|
OPT_REPLACED("status-msg", "term-status-msg"),
|
|
|
|
OPT_REPLACED("idx", "index"),
|
|
|
|
OPT_REPLACED("forceidx", "index"),
|
|
|
|
OPT_REMOVED("cache-pause-below", "for 'no', use --no-cache-pause"),
|
|
|
|
OPT_REMOVED("no-cache-pause-below", "use --no-cache-pause"),
|
|
|
|
OPT_REMOVED("volstep", "edit input.conf directly instead"),
|
2015-02-03 22:09:02 +00:00
|
|
|
OPT_REMOVED("fixed-vo", "--fixed-vo=yes is now the default"),
|
2014-12-11 22:23:50 +00:00
|
|
|
OPT_REPLACED("mkv-subtitle-preroll", "demuxer-mkv-subtitle-preroll"),
|
2015-02-16 19:04:15 +00:00
|
|
|
OPT_REPLACED("ass-use-margins", "sub-use-margins"),
|
2015-05-22 18:03:14 +00:00
|
|
|
OPT_REPLACED("media-title", "force-media-title"),
|
2016-03-18 07:46:13 +00:00
|
|
|
OPT_REPLACED("input-unix-socket", "input-ipc-server"),
|
2016-07-09 16:31:18 +00:00
|
|
|
OPT_REPLACED("softvol-max", "volume-max"),
|
2016-09-08 19:02:31 +00:00
|
|
|
OPT_REMOVED("bluray-angle", "this didn't do anything for a few releases"),
|
2016-10-02 15:08:14 +00:00
|
|
|
OPT_REPLACED("sub-text-font", "sub-font"),
|
|
|
|
OPT_REPLACED("sub-text-font-size", "sub-font-size"),
|
|
|
|
OPT_REPLACED("sub-text-color", "sub-color"),
|
|
|
|
OPT_REPLACED("sub-text-border-color", "sub-border-color"),
|
|
|
|
OPT_REPLACED("sub-text-shadow-color", "sub-shadow-color"),
|
|
|
|
OPT_REPLACED("sub-text-back-color", "sub-back-color"),
|
|
|
|
OPT_REPLACED("sub-text-border-size", "sub-border-size"),
|
|
|
|
OPT_REPLACED("sub-text-shadow-offset", "sub-shadow-offset"),
|
|
|
|
OPT_REPLACED("sub-text-spacing", "sub-spacing"),
|
|
|
|
OPT_REPLACED("sub-text-margin-x", "sub-margin-x"),
|
|
|
|
OPT_REPLACED("sub-text-margin-y", "sub-margin-y"),
|
|
|
|
OPT_REPLACED("sub-text-align-x", "sub-align-x"),
|
|
|
|
OPT_REPLACED("sub-text-align-y", "sub-align-y"),
|
|
|
|
OPT_REPLACED("sub-text-blur", "sub-blur"),
|
|
|
|
OPT_REPLACED("sub-text-bold", "sub-bold"),
|
|
|
|
OPT_REPLACED("sub-text-italic", "sub-italic"),
|
|
|
|
OPT_REPLACED("ass-line-spacing", "sub-ass-line-spacing"),
|
|
|
|
OPT_REPLACED("ass-force-margins", "sub-ass-force-margins"),
|
|
|
|
OPT_REPLACED("ass-vsfilter-aspect-compat", "sub-ass-vsfilter-aspect-compat"),
|
|
|
|
OPT_REPLACED("ass-vsfilter-color-compat", "sub-ass-vsfilter-color-compat"),
|
|
|
|
OPT_REPLACED("ass-vsfilter-blur-compat", "sub-ass-vsfilter-blur-compat"),
|
|
|
|
OPT_REPLACED("ass-force-style", "sub-ass-force-style"),
|
|
|
|
OPT_REPLACED("ass-styles", "sub-ass-styles"),
|
|
|
|
OPT_REPLACED("ass-hinting", "sub-ass-hinting"),
|
|
|
|
OPT_REPLACED("ass-shaper", "sub-ass-shaper"),
|
|
|
|
OPT_REPLACED("ass-style-override", "sub-ass-style-override"),
|
|
|
|
OPT_REPLACED("ass-scale-with-window", "sub-ass-scale-with-window"),
|
2017-06-06 20:16:29 +00:00
|
|
|
OPT_REPLACED("sub-ass-style-override", "sub-ass-override"),
|
2016-12-04 21:52:14 +00:00
|
|
|
OPT_REMOVED("fs-black-out-screens", NULL),
|
2017-07-02 14:26:41 +00:00
|
|
|
OPT_REPLACED("sub-paths", "sub-file-paths"),
|
2017-09-18 20:54:03 +00:00
|
|
|
OPT_REMOVED("heartbeat-cmd", "use Lua scripting instead"),
|
2017-12-16 12:14:26 +00:00
|
|
|
OPT_REMOVED("no-ometadata", "use --no-ocopy-metadata"),
|
2019-09-14 03:25:40 +00:00
|
|
|
OPT_REMOVED("video-stereo-mode", "removed, try --vf=stereo3d"),
|
2019-05-25 23:11:54 +00:00
|
|
|
OPT_REMOVED("chapter", "use '--start=#123' '--end=#124' (for chapter 123)"),
|
2019-10-04 16:45:37 +00:00
|
|
|
OPT_REPLACED("video-aspect", "video-aspect-override"),
|
2019-11-24 23:47:53 +00:00
|
|
|
OPT_REPLACED("display-fps", "override-display-fps"),
|
2014-12-11 22:23:50 +00:00
|
|
|
|
2014-06-11 00:04:02 +00:00
|
|
|
{0}
|
2001-03-18 23:32:31 +00:00
|
|
|
};
|
2008-01-01 21:35:58 +00:00
|
|
|
|
2019-11-28 23:16:52 +00:00
|
|
|
static const struct MPOpts mp_default_opts = {
|
2014-02-06 15:49:50 +00:00
|
|
|
.use_terminal = 1,
|
2013-12-21 22:11:12 +00:00
|
|
|
.msg_color = 1,
|
2016-12-23 17:03:16 +00:00
|
|
|
.audio_decoders = NULL,
|
2013-06-07 20:31:26 +00:00
|
|
|
.video_decoders = NULL,
|
2015-05-22 16:44:59 +00:00
|
|
|
.softvol_max = 130,
|
2016-07-09 16:31:18 +00:00
|
|
|
.softvol_volume = 100,
|
|
|
|
.softvol_mute = 0,
|
2014-06-30 16:24:20 +00:00
|
|
|
.gapless_audio = -1,
|
2015-08-09 19:45:37 +00:00
|
|
|
.wintitle = "${?media-title:${media-title}}${!media-title:No file} - mpv",
|
2013-06-13 22:24:41 +00:00
|
|
|
.stop_screensaver = 1,
|
2016-08-28 16:15:37 +00:00
|
|
|
.video_osd = 1,
|
2013-06-07 20:31:26 +00:00
|
|
|
.osd_level = 1,
|
2018-01-21 23:36:08 +00:00
|
|
|
.osd_on_seek = 1,
|
2013-06-07 20:31:26 +00:00
|
|
|
.osd_duration = 1000,
|
2014-05-12 23:14:07 +00:00
|
|
|
#if HAVE_LUA
|
2013-10-14 19:09:54 +00:00
|
|
|
.lua_load_osc = 1,
|
2014-12-09 20:53:38 +00:00
|
|
|
.lua_load_ytdl = 1,
|
2015-10-10 22:35:35 +00:00
|
|
|
.lua_ytdl_format = NULL,
|
2015-02-22 20:32:42 +00:00
|
|
|
.lua_ytdl_raw_options = NULL,
|
2017-09-26 23:17:47 +00:00
|
|
|
.lua_load_stats = 1,
|
2014-05-12 23:14:07 +00:00
|
|
|
#endif
|
2014-02-28 21:25:48 +00:00
|
|
|
.auto_load_scripts = 1,
|
2015-02-12 21:41:45 +00:00
|
|
|
.loop_times = 1,
|
2013-06-07 20:31:26 +00:00
|
|
|
.ordered_chapters = 1,
|
|
|
|
.chapter_merge_threshold = 100,
|
2013-08-14 01:25:50 +00:00
|
|
|
.chapter_seek_threshold = 5.0,
|
2014-05-07 20:01:17 +00:00
|
|
|
.hr_seek_framedrop = 1,
|
2015-08-10 16:43:25 +00:00
|
|
|
.sync_max_video_change = 1,
|
|
|
|
.sync_max_audio_change = 0.125,
|
2015-10-27 19:56:46 +00:00
|
|
|
.sync_audio_drop_size = 0.020,
|
2013-06-07 20:31:26 +00:00
|
|
|
.load_config = 1,
|
|
|
|
.position_resume = 1,
|
2016-08-10 20:22:50 +00:00
|
|
|
.autoload_files = 1,
|
2014-08-16 15:09:08 +00:00
|
|
|
.demuxer_thread = 1,
|
player: make playback termination asynchronous
Until now, stopping playback aborted the demuxer and I/O layer violently
by signaling mp_cancel (bound to libavformat's AVIOInterruptCB
mechanism). Change it to try closing them gracefully.
The main purpose is to silence those libavformat errors that happen when
you request termination. Most of libavformat barely cares about the
termination mechanism (AVIOInterruptCB), and essentially it's like the
network connection is abruptly severed, or file I/O suddenly returns I/O
errors. There were issues with dumb TLS warnings, parsers complaining
about incomplete data, and some special protocols that require server
communication to gracefully disconnect.
We still want to abort it forcefully if it refuses to terminate on its
own, so a timeout is required. Users can set the timeout to 0, which
should give them the old behavior.
This also removes the old mechanism that treats certain commands (like
"quit") specially, and tries to terminate the demuxers even if the core
is currently frozen. This is for situations where the core synchronized
to the demuxer or stream layer while network is unresponsive. This in
turn can only happen due to the "program" or "cache-size" properties in
the current code (see one of the previous commits). Also, the old
mechanism doesn't fit particularly well with the new one. We wouldn't
want to abort playback immediately on a "quit" command - the new code is
all about giving it a chance to end it gracefully. We'd need some sort
of watchdog thread or something equally complicated to handle this. So
just remove it.
The change in osd.c is to prevent that it clears the status line while
waiting for termination. The normal status line code doesn't output
anything useful at this point, and the code path taken clears it, both
of which is an annoying behavior change, so just let it show the old
one.
2018-05-19 16:41:13 +00:00
|
|
|
.demux_termination_timeout = 0.1,
|
2015-07-13 11:34:58 +00:00
|
|
|
.hls_bitrate = INT_MAX,
|
2018-01-03 20:50:04 +00:00
|
|
|
.cache_pause = 1,
|
2018-01-03 20:28:28 +00:00
|
|
|
.cache_pause_wait = 1.0,
|
2014-11-18 11:50:54 +00:00
|
|
|
.ab_loop = {MP_NOPTS_VALUE, MP_NOPTS_VALUE},
|
2013-06-07 20:31:26 +00:00
|
|
|
.edition_id = -1,
|
|
|
|
.default_max_pts_correction = -1,
|
2013-07-26 00:06:58 +00:00
|
|
|
.correct_pts = 1,
|
2013-06-07 20:31:26 +00:00
|
|
|
.initial_audio_sync = 1,
|
2014-08-17 00:51:13 +00:00
|
|
|
.frame_dropping = 1,
|
2013-06-07 20:31:26 +00:00
|
|
|
.term_osd = 2,
|
2014-01-15 15:14:37 +00:00
|
|
|
.term_osd_bar_chars = "[-+-]",
|
2013-06-07 20:31:26 +00:00
|
|
|
.consolecontrols = 1,
|
2015-08-22 20:08:17 +00:00
|
|
|
.playlist_pos = -1,
|
2013-06-07 20:31:26 +00:00
|
|
|
.play_frames = -1,
|
2015-11-16 21:47:17 +00:00
|
|
|
.rebase_start_time = 1,
|
2013-06-07 20:31:26 +00:00
|
|
|
.keep_open = 0,
|
2017-03-27 09:34:02 +00:00
|
|
|
.keep_open_pause = 1,
|
2016-08-17 20:45:44 +00:00
|
|
|
.image_display_duration = 1.0,
|
2015-05-22 19:00:24 +00:00
|
|
|
.stream_id = { { [STREAM_AUDIO] = -1,
|
|
|
|
[STREAM_VIDEO] = -1,
|
|
|
|
[STREAM_SUB] = -1, },
|
|
|
|
{ [STREAM_AUDIO] = -2,
|
|
|
|
[STREAM_VIDEO] = -2,
|
|
|
|
[STREAM_SUB] = -2, }, },
|
2017-08-12 21:43:05 +00:00
|
|
|
.stream_auto_sel = 1,
|
2013-06-07 20:31:26 +00:00
|
|
|
.audio_display = 1,
|
2013-08-25 16:23:40 +00:00
|
|
|
.audio_output_format = 0, // AF_FORMAT_UNKNOWN
|
2013-06-07 20:31:26 +00:00
|
|
|
.playback_speed = 1.,
|
2014-10-02 00:58:52 +00:00
|
|
|
.pitch_correction = 1,
|
2013-06-07 20:31:26 +00:00
|
|
|
.movie_aspect = -1.,
|
2017-06-29 20:34:57 +00:00
|
|
|
.aspect_method = 2,
|
2014-05-04 08:31:24 +00:00
|
|
|
.sub_auto = 0,
|
2017-04-20 03:29:04 +00:00
|
|
|
.audiofile_auto = -1,
|
2013-06-07 20:31:26 +00:00
|
|
|
.osd_bar_visible = 1,
|
2015-05-01 19:44:37 +00:00
|
|
|
.screenshot_template = "mpv-shot%n",
|
Implement backwards playback
See manpage additions. This is a huge hack. You can bet there are shit
tons of bugs. It's literally forcing square pegs into round holes.
Hopefully, the manpage wall of text makes it clear enough that the whole
shit can easily crash and burn. (Although it shouldn't literally crash.
That would be a bug. It possibly _could_ start a fire by entering some
sort of endless loop, not a literal one, just something where it tries
to do work without making progress.)
(Some obvious bugs I simply ignored for this initial version, but
there's a number of potential bugs I can't even imagine. Normal playback
should remain completely unaffected, though.)
How this works is also described in the manpage. Basically, we demux in
reverse, then we decode in reverse, then we render in reverse.
The decoding part is the simplest: just reorder the decoder output. This
weirdly integrates with the timeline/ordered chapter code, which also
has special requirements on feeding the packets to the decoder in a
non-straightforward way (it doesn't conflict, although a bugmessmass
breaks correct slicing of segments, so EDL/ordered chapter playback is
broken in backward direction).
Backward demuxing is pretty involved. In theory, it could be much
easier: simply iterating the usual demuxer output backward. But this
just doesn't fit into our code, so there's a cthulhu nightmare of shit.
To be specific, each stream (audio, video) is reversed separately. At
least this means we can do backward playback within cached content (for
example, you could play backwards in a live stream; on that note, it
disables prefetching, which would lead to losing new live video, but
this could be avoided).
The fuckmess also meant that I didn't bother trying to support
subtitles. Subtitles are a problem because they're "sparse" streams.
They need to be "passively" demuxed: you don't try to read a subtitle
packet, you demux audio and video, and then look whether there was a
subtitle packet. This means to get subtitles for a time range, you need
to know that you demuxed video and audio over this range, which becomes
pretty messy when you demux audio and video backwards separately.
Backward display is the most weird (and potentially buggy) part. To
avoid that we need to touch a LOT of timing code, we negate all
timestamps. The basic idea is that due to the navigation, all
comparisons and subtractions of timestamps keep working, and you don't
need to touch every single of them to "reverse" them.
E.g.:
bool before = pts_a < pts_b;
would need to be:
bool before = forward
? pts_a < pts_b
: pts_a > pts_b;
or:
bool before = pts_a * dir < pts_b * dir;
or if you, as it's implemented now, just do this after decoding:
pts_a *= dir;
pts_b *= dir;
and then in the normal timing/renderer code:
bool before = pts_a < pts_b;
Consequently, we don't need many changes in the latter code. But some
assumptions inhererently true for forward playback may have been broken
anyway. What is mainly needed is fixing places where values are passed
between positive and negative "domains". For example, seeking and
timestamp user display always uses positive timestamps. The main mess is
that it's not obvious which domain a given variable should or does use.
Well, in my tests with a single file, it suddenly started to work when I
did this. I'm honestly surprised that it did, and that I didn't have to
change a single line in the timing code past decoder (just something
minor to make external/cached text subtitles display). I committed it
immediately while avoiding thinking about it. But there really likely
are subtle problems of all sorts.
As far as I'm aware, gstreamer also supports backward playback. When I
looked at this years ago, I couldn't find a way to actually try this,
and I didn't revisit it now. Back then I also read talk slides from the
person who implemented it, and I'm not sure if and which ideas I might
have taken from it. It's possible that the timestamp reversal is
inspired by it, but I didn't check. (I think it claimed that it could
avoid large changes by changing a sign?)
VapourSynth has some sort of reverse function, which provides a backward
view on a video. The function itself is trivial to implement, as
VapourSynth aims to provide random access to video by frame numbers (so
you just request decreasing frame numbers). From what I remember, it
wasn't exactly fluid, but it worked. It's implemented by creating an
index, and seeking to the target on demand, and a bunch of caching. mpv
could use it, but it would either require using VapourSynth as demuxer
and decoder for everything, or replacing the current file every time
something is supposed to be played backwards.
FFmpeg's libavfilter has reversal filters for audio and video. These
require buffering the entire media data of the file, and don't really
fit into mpv's architecture. It could be used by playing a libavfilter
graph that also demuxes, but that's like VapourSynth but worse.
2019-05-18 00:10:51 +00:00
|
|
|
.play_dir = 1,
|
|
|
|
.video_reverse_size = 1 * 1024 * 1024 * 1024,
|
|
|
|
.audio_reverse_size = 64 * 1024 * 1024,
|
2013-06-07 20:31:26 +00:00
|
|
|
|
2017-04-05 09:07:08 +00:00
|
|
|
.audio_output_channels = {
|
|
|
|
.set = 1,
|
|
|
|
.auto_safe = 1,
|
|
|
|
},
|
|
|
|
|
2014-06-13 00:05:37 +00:00
|
|
|
.index_mode = 1,
|
2013-07-07 21:54:11 +00:00
|
|
|
|
2014-06-10 20:48:11 +00:00
|
|
|
.mf_fps = 1.0,
|
2014-12-29 21:51:18 +00:00
|
|
|
|
|
|
|
.display_tags = (char **)(const char*[]){
|
2018-03-04 22:00:23 +00:00
|
|
|
"Artist", "Album", "Album_Artist", "Comment", "Composer",
|
|
|
|
"Date", "Description", "Genre", "Performer", "Rating",
|
|
|
|
"Series", "Title", "Track", "icy-title", "service_name",
|
2014-12-29 21:51:18 +00:00
|
|
|
NULL
|
|
|
|
},
|
2017-05-29 16:48:10 +00:00
|
|
|
|
|
|
|
.cuda_device = -1,
|
2013-06-07 20:31:26 +00:00
|
|
|
};
|
|
|
|
|
2019-11-28 23:16:52 +00:00
|
|
|
const struct m_sub_options mp_opt_root = {
|
|
|
|
.opts = mp_opts,
|
|
|
|
.size = sizeof(struct MPOpts),
|
|
|
|
.defaults = &mp_default_opts,
|
|
|
|
};
|
|
|
|
|
2008-02-22 09:09:46 +00:00
|
|
|
#endif /* MPLAYER_CFG_MPLAYER_H */
|