Compare commits
25
Commits
harmony-port
...
v0.7.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18b15a436f | ||
|
|
6583ad6970 | ||
|
|
863701391c | ||
|
|
3803c14279 | ||
|
|
39126c3828 | ||
|
|
b9cfc3622c | ||
|
|
1b0bf6507e | ||
|
|
7ca6aa4ad0 | ||
|
|
b82a98722a | ||
|
|
3d6d7012ff | ||
|
|
3051ff9f25 | ||
|
|
9bf66294f8 | ||
|
|
577378b827 | ||
|
|
1679222e18 | ||
|
|
74270cd1db | ||
|
|
718bf3b39e | ||
|
|
5ecb381d78 | ||
|
|
17f1332955 | ||
|
|
f4a1dfdffb | ||
|
|
d3972125a1 | ||
|
|
71f504a43d | ||
|
|
bc1370041d | ||
|
|
4f74869cd8 | ||
|
|
8d8b36df1b | ||
|
|
2da6c95208 |
No files matched your search
@@ -25,6 +25,7 @@ API changes
|
||||
|
||||
::
|
||||
|
||||
--- mpv 0.7.0 is released ---
|
||||
1.10 - deprecate/disable everything directly related to script_dispatch
|
||||
(most likely affects nobody)
|
||||
1.9 - add enum mpv_end_file_reason for mpv_event_end_file.reason
|
||||
|
||||
+1
-1
@@ -573,7 +573,7 @@ strictly part of the guaranteed API.
|
||||
Runs an external process and waits until it exits. Returns process status
|
||||
and the captured output.
|
||||
|
||||
The paramater ``t`` is a table. The function reads the following entries:
|
||||
The parameter ``t`` is a table. The function reads the following entries:
|
||||
|
||||
``args``
|
||||
Array of strings. The first array entry is the executable. This
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
Release 0.7.1
|
||||
=============
|
||||
|
||||
Changes
|
||||
-------
|
||||
|
||||
- Don't show the volume neutral marker on the OSD if softvol is disabled.
|
||||
- Don't select a subtitle track when executing the sub_add input command in
|
||||
"auto" mode.
|
||||
|
||||
Bug fixes
|
||||
---------
|
||||
|
||||
- Fix busy loop when seeking while paused (this fixes a problem with pulseaudio
|
||||
that caused mpv and the pulseaudio daemon to use 100% CPU).
|
||||
- Fix Lua function utils.subprocess() in Windows versions older than Vista.
|
||||
- Avoid creating a window bigger than the screen on Windows.
|
||||
- Don't ignore the last line in m3u playlists.
|
||||
- Don't crash if a codec could not be opened.
|
||||
- Dynamically allocate audio channel map entries (this should fix a crash in
|
||||
the alsa and coreaudio AOs with audio devices that support more than 20
|
||||
channel maps).
|
||||
- Ignore the "srgb" option in the opengl VO if hardware decoding is enabled.
|
||||
- Linearize non-RGB sRGB files correctly (eg. JPEG).
|
||||
- Fix opening reference URLs (.file/id=) on OS X.
|
||||
|
||||
This listing is not complete. There are many more bug fixes and changes. The
|
||||
complete change log can be viewed by running ``git log 8d8b36d..6583ad6`` in
|
||||
the git repository.
|
||||
|
||||
Release 0.7.0
|
||||
=============
|
||||
|
||||
Changes
|
||||
-------
|
||||
|
||||
- Buffer partial log messages in the client API (the client API will now only
|
||||
pass full log messages to clients).
|
||||
- Remove ncurses/terminfo/termcap support (it was disabled by default and
|
||||
replaced by new code since v0.6.0).
|
||||
- Enable cdda:// support by default again (it was disabled since v0.6.0).
|
||||
- Cascade-load input.conf (if there are several input.confs in the set of valid
|
||||
config paths, load them all).
|
||||
- Draw the OSD twice in 3D mode (this fixes subtitles display in 3D mode).
|
||||
- Make wasapi the default AO on Windows again since many of its problems have
|
||||
been solved.
|
||||
- Use "site-functions" subdir to install the zsh completion script instead of
|
||||
the Debian-specific "vendor-completions" (also provide the --zshdir waf
|
||||
configure option for changing this value).
|
||||
- Improve synchronization between the Cocoa GUI and the player (this fixes some
|
||||
long standing deadlock issues on Mac OS X).
|
||||
- Remove --fs-missioncontrol option (only relevant to Mac OS X).
|
||||
|
||||
New features
|
||||
------------
|
||||
|
||||
- Enable pitch correction by default when playing at higher speeds (this can be
|
||||
controlled with the --audio-pitch-correction option).
|
||||
- Open stream and demuxer asynchronously (this should avoid having the player
|
||||
get blocked on network streams).
|
||||
- Add cache-buffering-state property for querying the cache fill status until
|
||||
the player unpauses.
|
||||
- Add support for listing and selecting the audio device (note that it is not
|
||||
implemented for all AOs, see the --audio-device option for more information).
|
||||
- Add support for a JSON-based IPC mechanism (note that this is not currently
|
||||
supported on Windows, see the JSON IPC section in the manpage for more
|
||||
information).
|
||||
- Add Lua utility function for starting processes (see utils.subprocess() in the
|
||||
manpage).
|
||||
- Add Lua utility function for parsing JSON (see utils.parse_json() in the
|
||||
manpage).
|
||||
- Add field-dominance property (see --field-dominance option).
|
||||
- Add video-rotate property (see --video-rotate option).
|
||||
- Add playback-abort property for querying whether playback is stopped or is to
|
||||
be stopped.
|
||||
- Add cursor-autohide property (see --cursor-autohide option).
|
||||
- Add vo-configured property for querying whether a window is created.
|
||||
- Add support for dxva2 hardware acceleration on Windows.
|
||||
- Drop libquvi support (this has been replaced by a built-in Lua script that
|
||||
invokes the youtube-dl tool, which needs to be installed, see the --ytdl
|
||||
option).
|
||||
- Add support for loading chapters from an external file (see the
|
||||
--chapters-file option).
|
||||
- Add window-minimized property for querying whether the window is minimized
|
||||
(works for X11 only).
|
||||
- Make it possible to configure the OSC seekbar style (see the "seekbarstyle"
|
||||
OSC option).
|
||||
- Add support for libmpv on Mac OS X (it used to be broken, now it's fully
|
||||
functional and also provides support for embedding the mpv window inside a
|
||||
Cocoa/Qt application).
|
||||
- Try to use the audio channel map reported by ALSA in the alsa AO.
|
||||
- Add option to disable text OSD rendering completely (useful for working around
|
||||
certain fontconfig issues, see the --use-text-osd option).
|
||||
|
||||
This listing is not complete. There are many more bug fixes and changes. The
|
||||
complete change log can be viewed by running ``git log 7759c18..9479daa`` in
|
||||
the git repository.
|
||||
+12
-5
@@ -81,14 +81,21 @@ void mp_chmap_sel_add_alsa_def(struct mp_chmap_sel *s)
|
||||
}
|
||||
}
|
||||
|
||||
#define ARRAY_LEN(x) (sizeof(x) / sizeof((x)[0]))
|
||||
|
||||
// Add a channel map that should be allowed.
|
||||
void mp_chmap_sel_add_map(struct mp_chmap_sel *s, const struct mp_chmap *map)
|
||||
{
|
||||
assert(s->num_chmaps < ARRAY_LEN(s->chmaps));
|
||||
if (mp_chmap_is_valid(map))
|
||||
s->chmaps[s->num_chmaps++] = *map;
|
||||
if (!mp_chmap_is_valid(map))
|
||||
return;
|
||||
if (!s->chmaps)
|
||||
s->chmaps = s->chmaps_storage;
|
||||
if (s->num_chmaps == MP_ARRAY_SIZE(s->chmaps_storage)) {
|
||||
if (!s->tmp)
|
||||
return;
|
||||
s->chmaps = talloc_memdup(s->tmp, s->chmaps, sizeof(s->chmaps_storage));
|
||||
}
|
||||
if (s->chmaps != s->chmaps_storage)
|
||||
MP_TARRAY_GROW(s->tmp, s->chmaps, s->num_chmaps);
|
||||
s->chmaps[s->num_chmaps++] = *map;
|
||||
}
|
||||
|
||||
// Allow all waveext formats in default order.
|
||||
|
||||
+5
-1
@@ -26,8 +26,12 @@ struct mp_chmap_sel {
|
||||
// should be considered opaque
|
||||
bool allow_any, allow_waveext;
|
||||
bool speakers[MP_SPEAKER_ID_COUNT];
|
||||
struct mp_chmap chmaps[20];
|
||||
struct mp_chmap *chmaps;
|
||||
int num_chmaps;
|
||||
|
||||
struct mp_chmap chmaps_storage[20];
|
||||
|
||||
void *tmp; // set to any talloc context to allow more chmaps entries
|
||||
};
|
||||
|
||||
void mp_chmap_sel_add_any(struct mp_chmap_sel *s);
|
||||
|
||||
+2
-2
@@ -36,7 +36,7 @@ struct mixer {
|
||||
struct ao *ao;
|
||||
struct af_stream *af;
|
||||
// Static, dependent on ao/softvol settings
|
||||
bool softvol; // use AO (true) or af_volume (false)
|
||||
bool softvol; // use AO (false) or af_volume (true)
|
||||
bool ao_softvol; // AO has private or per-app volume
|
||||
bool emulate_mute; // if true, emulate mute with volume=0
|
||||
// Last known values (possibly out of sync with reality)
|
||||
@@ -72,7 +72,7 @@ bool mixer_audio_initialized(struct mixer *mixer)
|
||||
float mixer_getneutralvolume(struct mixer *mixer)
|
||||
{
|
||||
// gain == 1
|
||||
return 1.0 / mixer->opts->softvol_max * 100.0 * 100.0;
|
||||
return mixer->softvol ? 1.0 / mixer->opts->softvol_max * 100.0 * 100.0 : 100;
|
||||
}
|
||||
|
||||
static void checkvolume(struct mixer *mixer)
|
||||
|
||||
+1
-1
@@ -279,7 +279,7 @@ static int find_alsa_channel(int mp_channel)
|
||||
static bool query_chmaps(struct ao *ao, struct mp_chmap *chmap)
|
||||
{
|
||||
struct priv *p = ao->priv;
|
||||
struct mp_chmap_sel chmap_sel = {0};
|
||||
struct mp_chmap_sel chmap_sel = {.tmp = p};
|
||||
|
||||
snd_pcm_chmap_query_t **maps = snd_pcm_query_chmaps(p->alsa);
|
||||
if (!maps)
|
||||
|
||||
@@ -185,7 +185,7 @@ static bool init_chmap(struct ao *ao)
|
||||
&layouts, &n_layouts);
|
||||
CHECK_CA_ERROR("could not get audio device prefered layouts");
|
||||
|
||||
struct mp_chmap_sel chmap_sel = {0};
|
||||
struct mp_chmap_sel chmap_sel = {.tmp = p};
|
||||
for (int i = 0; i < n_layouts; i++) {
|
||||
struct mp_chmap chmap = {0};
|
||||
if (ca_layout_to_mp_chmap(ao, &layouts[i], &chmap))
|
||||
|
||||
@@ -62,7 +62,7 @@ OSStatus ca_get_ary(AudioObjectID id, ca_scope scope, ca_sel selector,
|
||||
err = AudioObjectGetPropertyDataSize(id, &p_addr, 0, NULL, &p_size);
|
||||
CHECK_CA_ERROR_SILENT_L(coreaudio_error);
|
||||
|
||||
*data = talloc_size(NULL, p_size);
|
||||
*data = talloc_zero_size(NULL, p_size);
|
||||
*elements = p_size / element_size;
|
||||
|
||||
err = ca_get(id, scope, selector, p_size, *data);
|
||||
@@ -87,7 +87,7 @@ OSStatus ca_get_str(AudioObjectID id, ca_scope scope, ca_sel selector,
|
||||
CFStringGetMaximumSizeForEncoding(
|
||||
CFStringGetLength(string), CA_CFSTR_ENCODING) + 1;
|
||||
|
||||
*data = talloc_size(NULL, size);
|
||||
*data = talloc_zero_size(NULL, size);
|
||||
CFStringGetCString(string, *data, size, CA_CFSTR_ENCODING);
|
||||
CFRelease(string);
|
||||
coreaudio_error:
|
||||
|
||||
+8
-6
@@ -1414,20 +1414,22 @@ static int demux_mkv_open_audio(demuxer_t *demuxer, mkv_track_t *track)
|
||||
sh_a->bitrate = 16000 * 8;
|
||||
sh_a->block_align = 1024;
|
||||
|
||||
if (!strcmp(track->codec_id, MKV_A_AAC) && track->private_data) {
|
||||
if (!extradata_len) {
|
||||
if (!strcmp(track->codec_id, MKV_A_AAC)) {
|
||||
if (track->private_data && !extradata_len) {
|
||||
extradata = track->private_data;
|
||||
extradata_len = track->private_size;
|
||||
}
|
||||
} else {
|
||||
/* Recreate the 'private data' */
|
||||
/* which faad2 uses in its initialization */
|
||||
srate_idx = aac_get_sample_rate_index(track->a_sfreq);
|
||||
if (!strncmp(&track->codec_id[12], "MAIN", 4))
|
||||
const char *tail = "";
|
||||
if (strlen(track->codec_id) >= 12)
|
||||
tail = &track->codec_id[12];
|
||||
if (!strncmp(tail, "MAIN", 4))
|
||||
profile = 0;
|
||||
else if (!strncmp(&track->codec_id[12], "LC", 2))
|
||||
else if (!strncmp(tail, "LC", 2))
|
||||
profile = 1;
|
||||
else if (!strncmp(&track->codec_id[12], "SSR", 3))
|
||||
else if (!strncmp(tail, "SSR", 3))
|
||||
profile = 2;
|
||||
else
|
||||
profile = 3;
|
||||
|
||||
@@ -86,7 +86,7 @@ static int parse_m3u(struct pl_parser *p)
|
||||
return -1;
|
||||
if (p->probing)
|
||||
return 0;
|
||||
while (!pl_eof(p)) {
|
||||
while (line.len || !pl_eof(p)) {
|
||||
if (line.len > 0 && !bstr_startswith0(line, "#"))
|
||||
pl_add(p, line);
|
||||
line = bstr_strip(pl_get_line(p));
|
||||
@@ -110,7 +110,7 @@ static int parse_ref_init(struct pl_parser *p)
|
||||
"application/vnd.ms.wms-hdr.asfv1", NULL};
|
||||
bstr burl = bstr0(p->s->url);
|
||||
if (bstr_eatstart0(&burl, "http://") && check_mimetype(p->s, mmsh_types)) {
|
||||
MP_INFO(p, "Redirectiong to mmsh://\n");
|
||||
MP_INFO(p, "Redirecting to mmsh://\n");
|
||||
playlist_add_file(p->pl, talloc_asprintf(p, "mmsh://%.*s", BSTR_P(burl)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
+2
-2
@@ -2146,7 +2146,7 @@ static int parse_chmap(struct mp_log *log, const m_option_t *opt,
|
||||
|
||||
const m_option_type_t m_option_type_chmap = {
|
||||
.name = "Audio channels or channel map",
|
||||
.size = sizeof(struct mp_chmap *),
|
||||
.size = sizeof(struct mp_chmap),
|
||||
.parse = parse_chmap,
|
||||
.copy = copy_opt,
|
||||
};
|
||||
@@ -2620,7 +2620,7 @@ static int parse_obj_settings(struct mp_log *log, struct bstr opt,
|
||||
if (m_obj_list_find(&desc, list, str)) {
|
||||
if (desc.replaced_name)
|
||||
mp_warn(log, "Driver '%s' has been replaced with '%s'!\n",
|
||||
desc.name, desc.replaced_name);
|
||||
desc.replaced_name, desc.name);
|
||||
} else {
|
||||
if (!list->allow_unknown_entries) {
|
||||
mp_err(log, "Option %.*s: %.*s doesn't exist.\n",
|
||||
|
||||
@@ -440,8 +440,10 @@ void cocoa_set_input_context(struct input_ctx *input_context)
|
||||
size_t num_files = [files count];
|
||||
char **files_utf8 = talloc_array(NULL, char*, num_files);
|
||||
[files enumerateObjectsUsingBlock:^(id obj, NSUInteger i, BOOL *_){
|
||||
char *filename = (char *)[obj UTF8String];
|
||||
size_t bytes = [obj lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
|
||||
NSURL *url = [NSURL URLWithString:obj];
|
||||
NSString *path = [url path];
|
||||
char *filename = (char *)[path UTF8String];
|
||||
size_t bytes = [path lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
|
||||
files_utf8[i] = talloc_memdup(files_utf8, filename, bytes + 1);
|
||||
}];
|
||||
mp_event_drop_files(_inputContext, num_files, files_utf8);
|
||||
|
||||
@@ -111,9 +111,8 @@ static int create_overlapped_pipe(HANDLE *read, HANDLE *write)
|
||||
// overlapped pipes, so instead, use a named pipe with a unique name
|
||||
*read = CreateNamedPipeW(buf, PIPE_ACCESS_INBOUND |
|
||||
FILE_FLAG_FIRST_PIPE_INSTANCE | FILE_FLAG_OVERLAPPED,
|
||||
PIPE_TYPE_BYTE | PIPE_WAIT | PIPE_REJECT_REMOTE_CLIENTS,
|
||||
1, 0, 4096, 0, NULL);
|
||||
if (!*read)
|
||||
PIPE_TYPE_BYTE | PIPE_WAIT, 1, 0, 4096, 0, NULL);
|
||||
if (*read == INVALID_HANDLE_VALUE)
|
||||
goto error;
|
||||
|
||||
// Open the write end of the pipe as a synchronous handle
|
||||
|
||||
@@ -515,7 +515,6 @@ static void do_fill_audio_out_buffers(struct MPContext *mpctx, double endpts)
|
||||
// later. Retrying is needed to get the correct sync PTS.
|
||||
if (mpctx->audio_status >= STATUS_DRAINING && status == AD_OK) {
|
||||
mpctx->audio_status = STATUS_SYNCING;
|
||||
mpctx->sleeptime = 0;
|
||||
return; // retry on next iteration
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -4350,7 +4350,9 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd)
|
||||
struct track *sub = mp_add_subtitles(mpctx, cmd->args[0].v.s);
|
||||
if (!sub)
|
||||
return -1;
|
||||
if (cmd->args[1].v.i != 1) {
|
||||
if (cmd->args[1].v.i == 1) {
|
||||
sub->no_default = true;
|
||||
} else {
|
||||
mp_switch_track(mpctx, sub->type, sub);
|
||||
mp_mark_user_track_selection(mpctx, 0, sub->type);
|
||||
}
|
||||
|
||||
+8
-5
@@ -300,14 +300,17 @@ double timeline_set_from_time(struct MPContext *mpctx, double pts, bool *need_re
|
||||
{
|
||||
if (pts < 0)
|
||||
pts = 0;
|
||||
|
||||
int new = mpctx->num_timeline_parts - 1;
|
||||
for (int i = 0; i < mpctx->num_timeline_parts; i++) {
|
||||
struct timeline_part *p = mpctx->timeline + i;
|
||||
if (pts < (p + 1)->start) {
|
||||
*need_reset = timeline_set_part(mpctx, i, false);
|
||||
return pts - p->start + p->source_start;
|
||||
if (pts < mpctx->timeline[i + 1].start) {
|
||||
new = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return MP_NOPTS_VALUE;
|
||||
|
||||
*need_reset = timeline_set_part(mpctx, new, false);
|
||||
return pts - mpctx->timeline[new].start + mpctx->timeline[new].source_start;
|
||||
}
|
||||
|
||||
static int find_new_tid(struct MPContext *mpctx, enum stream_type t)
|
||||
|
||||
+3
-12
@@ -214,16 +214,6 @@ static int mp_seek(MPContext *mpctx, struct seek_params seek,
|
||||
bool need_reset = false;
|
||||
demuxer_amount = timeline_set_from_time(mpctx, seek.amount,
|
||||
&need_reset);
|
||||
if (demuxer_amount == MP_NOPTS_VALUE) {
|
||||
assert(!need_reset);
|
||||
mpctx->stop_play = AT_END_OF_FILE;
|
||||
// When seeking outside of the file, but not when ending last segment.
|
||||
if (!timeline_fallthrough) {
|
||||
clear_audio_output_buffers(mpctx);
|
||||
reset_playback_state(mpctx);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
if (need_reset) {
|
||||
reinit_video_chain(mpctx);
|
||||
reinit_audio_chain(mpctx);
|
||||
@@ -961,10 +951,11 @@ void run_playloop(struct MPContext *mpctx)
|
||||
mpctx->audio_status == STATUS_EOF &&
|
||||
mpctx->video_status == STATUS_EOF)
|
||||
{
|
||||
if (end_is_new_segment) {
|
||||
int new_part = mpctx->timeline_part + 1;
|
||||
if (end_is_new_segment && new_part < mpctx->num_timeline_parts) {
|
||||
mp_seek(mpctx, (struct seek_params){
|
||||
.type = MPSEEK_ABSOLUTE,
|
||||
.amount = mpctx->timeline[mpctx->timeline_part+1].start
|
||||
.amount = mpctx->timeline[new_part].start
|
||||
}, true);
|
||||
} else
|
||||
mpctx->stop_play = AT_END_OF_FILE;
|
||||
|
||||
@@ -67,6 +67,13 @@ enum mp_csp_prim {
|
||||
MP_CSP_PRIM_COUNT
|
||||
};
|
||||
|
||||
enum mp_csp_trc {
|
||||
MP_CSP_TRC_NONE,
|
||||
MP_CSP_TRC_BT_2020_APPROX,
|
||||
MP_CSP_TRC_BT_2020_EXACT,
|
||||
MP_CSP_TRC_SRGB
|
||||
};
|
||||
|
||||
// Any enum mp_csp_prim value is a valid index (except MP_CSP_PRIM_COUNT)
|
||||
extern const char *const mp_csp_prim_names[MP_CSP_PRIM_COUNT];
|
||||
|
||||
|
||||
@@ -430,7 +430,7 @@ static void uninit_avctx(struct dec_video *vd)
|
||||
vd_ffmpeg_ctx *ctx = vd->priv;
|
||||
AVCodecContext *avctx = ctx->avctx;
|
||||
|
||||
if (avctx)
|
||||
if (avctx && avctx->codec)
|
||||
avcodec_flush_buffers(avctx);
|
||||
|
||||
if (ctx->hwdec && ctx->hwdec->uninit)
|
||||
|
||||
+26
-7
@@ -901,10 +901,25 @@ static void compile_shaders(struct gl_video *p)
|
||||
bool use_conv_gamma = p->conv_gamma != 1.0;
|
||||
bool use_const_luma = p->image_params.colorspace == MP_CSP_BT_2020_C;
|
||||
|
||||
enum mp_csp_trc gamma_fun = MP_CSP_TRC_NONE;
|
||||
|
||||
// Linear light scaling is only enabled when either color correction
|
||||
// option (3dlut or srgb) is enabled, otherwise scaling is done in the
|
||||
// source space. We also need to linearize for constant luminance systems.
|
||||
bool convert_to_linear_gamma = !p->is_linear_rgb && use_cms || use_const_luma;
|
||||
if ((!p->is_linear_rgb && use_cms) || use_const_luma) {
|
||||
// We just use the color level range to distinguish between PC
|
||||
// content like images, which are most likely sRGB, and TV content
|
||||
// like movies, which are most likely BT.2020
|
||||
if (p->image_params.colorlevels == MP_CSP_LEVELS_PC && !p->hwdec_active) {
|
||||
// FIXME: I don't know if hwdec sets the color levels to PC or not,
|
||||
// but let's avoid the bug just in case.
|
||||
gamma_fun = MP_CSP_TRC_SRGB;
|
||||
} else if (p->opts.approx_gamma) {
|
||||
gamma_fun = MP_CSP_TRC_BT_2020_APPROX;
|
||||
} else {
|
||||
gamma_fun = MP_CSP_TRC_BT_2020_EXACT;
|
||||
}
|
||||
}
|
||||
|
||||
// Figure out the right color spaces we need to convert, if any
|
||||
enum mp_csp_prim prim_src = p->image_params.primaries, prim_dest;
|
||||
@@ -943,9 +958,11 @@ static void compile_shaders(struct gl_video *p)
|
||||
|
||||
char *header_osd = talloc_strdup(tmp, header);
|
||||
shader_def_opt(&header_osd, "USE_OSD_LINEAR_CONV_APPROX",
|
||||
use_cms && p->opts.approx_gamma);
|
||||
use_cms && gamma_fun == MP_CSP_TRC_BT_2020_APPROX);
|
||||
shader_def_opt(&header_osd, "USE_OSD_LINEAR_CONV_BT2020",
|
||||
use_cms && !p->opts.approx_gamma);
|
||||
use_cms && gamma_fun == MP_CSP_TRC_BT_2020_EXACT);
|
||||
shader_def_opt(&header_osd, "USE_OSD_LINEAR_CONV_SRGB",
|
||||
use_cms && gamma_fun == MP_CSP_TRC_SRGB);
|
||||
shader_def_opt(&header_osd, "USE_OSD_CMS_MATRIX", use_cms_matrix);
|
||||
shader_def_opt(&header_osd, "USE_OSD_3DLUT", p->use_lut_3d);
|
||||
// 3DLUT overrides SRGB
|
||||
@@ -980,9 +997,11 @@ static void compile_shaders(struct gl_video *p)
|
||||
shader_def_opt(&header_conv, "USE_CONV_GAMMA", use_conv_gamma);
|
||||
shader_def_opt(&header_conv, "USE_CONST_LUMA", use_const_luma);
|
||||
shader_def_opt(&header_conv, "USE_LINEAR_LIGHT_APPROX",
|
||||
convert_to_linear_gamma && p->opts.approx_gamma);
|
||||
gamma_fun == MP_CSP_TRC_BT_2020_APPROX);
|
||||
shader_def_opt(&header_conv, "USE_LINEAR_LIGHT_BT2020",
|
||||
convert_to_linear_gamma && !p->opts.approx_gamma);
|
||||
gamma_fun == MP_CSP_TRC_BT_2020_EXACT);
|
||||
shader_def_opt(&header_conv, "USE_LINEAR_LIGHT_SRGB",
|
||||
gamma_fun == MP_CSP_TRC_SRGB);
|
||||
if (p->opts.alpha_mode > 0 && p->has_alpha && p->plane_count > 3)
|
||||
shader_def(&header_conv, "USE_ALPHA_PLANE", "3");
|
||||
if (p->opts.alpha_mode == 2 && p->has_alpha)
|
||||
@@ -1018,7 +1037,7 @@ static void compile_shaders(struct gl_video *p)
|
||||
|
||||
// Don't sample from input video textures before converting the input to
|
||||
// linear light.
|
||||
if (use_input_gamma || use_conv_gamma)
|
||||
if (use_input_gamma || use_conv_gamma || gamma_fun != MP_CSP_TRC_NONE)
|
||||
use_indirect = true;
|
||||
|
||||
// It doesn't make sense to scale the chroma with cscale in the 1. scale
|
||||
@@ -1409,7 +1428,7 @@ static void init_video(struct gl_video *p, const struct mp_image_params *params)
|
||||
p->image_dh = params->d_h;
|
||||
p->image_params = *params;
|
||||
|
||||
if (p->is_rgb && (p->opts.srgb || p->use_lut_3d)) {
|
||||
if (p->is_rgb && (p->opts.srgb || p->use_lut_3d) && !p->hwdec_active) {
|
||||
// If we're opening an RGB source like a png file or similar,
|
||||
// we just sample it using GL_SRGB which treats it as an sRGB source
|
||||
// and pretend it's linear as far as CMS is concerned
|
||||
|
||||
@@ -43,6 +43,12 @@
|
||||
|
||||
// Earlier GLSL doesn't support mix() with bvec
|
||||
#if __VERSION__ >= 130
|
||||
vec3 srgb_expand(vec3 v)
|
||||
{
|
||||
return mix(v / 12.92, pow((v + vec3(0.055))/1.055, vec3(2.4)),
|
||||
lessThanEqual(vec3(0.04045), v));
|
||||
}
|
||||
|
||||
vec3 srgb_compand(vec3 v)
|
||||
{
|
||||
return mix(v * 12.92, 1.055 * pow(v, vec3(1.0/2.4)) - 0.055,
|
||||
@@ -98,6 +104,9 @@ void main() {
|
||||
#ifdef USE_OSD_LINEAR_CONV_BT2020
|
||||
color.rgb = bt2020_expand(color.rgb);
|
||||
#endif
|
||||
#ifdef USE_OSD_LINEAR_CONV_SRGB
|
||||
color.rgb = srgb_expand(color.rgb);
|
||||
#endif
|
||||
#ifdef USE_OSD_CMS_MATRIX
|
||||
// Convert to the right target gamut first (to BT.709 for sRGB,
|
||||
// and to BT.2020 for 3DLUT). Normal clamping here as perceptually
|
||||
@@ -419,8 +428,9 @@ void main() {
|
||||
lessThanEqual(color.br, vec2(0))) + color.gg;
|
||||
#endif
|
||||
#ifdef USE_COLORMATRIX
|
||||
// Clamp down here to avoid clipping CbCr details before CONST_LUMA
|
||||
// has a chance to convert them.
|
||||
// CONST_LUMA involves numbers outside the [0,1] range so we make sure
|
||||
// to clip here, after the (possible) USE_CONST_LUMA calculations are done,
|
||||
// instead of immediately after the colormatrix conversion.
|
||||
color = clamp(color, 0, 1);
|
||||
#endif
|
||||
// If we are scaling in linear light (SRGB or 3DLUT option enabled), we
|
||||
@@ -438,6 +448,13 @@ void main() {
|
||||
// ... and actual BT.2020 (two-part function)
|
||||
color = bt2020_expand(color);
|
||||
#endif
|
||||
#ifdef USE_LINEAR_LIGHT_SRGB
|
||||
// This is not needed for most sRGB content since we can use GL_SRGB to
|
||||
// directly sample RGB texture in linear light, but for things which are
|
||||
// also sRGB but in a different format (such as JPEG's YUV), we need
|
||||
// to convert to linear light manually.
|
||||
color = srgb_expand(color);
|
||||
#endif
|
||||
#ifdef USE_CONST_LUMA
|
||||
// Calculate the green channel from the expanded RYcB
|
||||
// The BT.2020 specification says Yc = 0.2627*R + 0.6780*G + 0.0593*B
|
||||
|
||||
@@ -904,8 +904,8 @@ static int reinit_window_state(struct vo_w32_state *w32)
|
||||
// Center the final window
|
||||
n_w = r.right - r.left;
|
||||
n_h = r.bottom - r.top;
|
||||
r.left = screen_w / 2 - n_w / 2;
|
||||
r.top = screen_h / 2 - n_h / 2;
|
||||
r.left = w32->screenrc.x0 + screen_w / 2 - n_w / 2;
|
||||
r.top = w32->screenrc.y0 + screen_h / 2 - n_h / 2;
|
||||
r.right = r.left + n_w;
|
||||
r.bottom = r.top + n_h;
|
||||
}
|
||||
|
||||
@@ -825,14 +825,14 @@ def options(opt):
|
||||
|
||||
opt.parse_features('build and install options', build_options)
|
||||
optional_features = main_dependencies + libav_dependencies
|
||||
opt.parse_features('optional feaures', optional_features)
|
||||
opt.parse_features('optional features', optional_features)
|
||||
opt.parse_features('audio outputs', audio_output_features)
|
||||
opt.parse_features('video outputs', video_output_features)
|
||||
opt.parse_features('hwaccels', hwaccel_features)
|
||||
opt.parse_features('tv features', radio_and_tv_features)
|
||||
opt.parse_features('standalone app', standalone_features)
|
||||
|
||||
group = opt.get_option_group("optional feaures")
|
||||
group = opt.get_option_group("optional features")
|
||||
group.add_option('--lua',
|
||||
type = 'string',
|
||||
dest = 'LUA_VER',
|
||||
|
||||
Reference in new issue
Block a user