History

command: add dolby-vision-profile and dolby-vision-level to track-list

Kacper Michajłow committed 2 years ago

Commit aa3cf6d1 parent c83c2736 files · +24 −0Browse files

Unified · Split

6 files
  1. DOCS/interface-changes/dolby-vision-configuration.txt +1 −0
  2. DOCS/man/input.rst +6 −0
  3. demux/demux_lavf.c +3 −0
  4. demux/demux_mkv.c +6 −0
  5. demux/stheader.h +4 −0
  6. player/command.c +4 −0
DOCS/interface-changes/dolby-vision-configuration.txt+1−0
@@ -0,0 +1 @@
1add `track-list/N/dolby-vision-profile` and `track-list/N/dolby-vision-level`
DOCS/man/input.rst+6−0
@@ -3185,6 +3185,10 @@ Property list · 3184 unmodified lines
3185 values currently. It's possible that future mpv versions will make3185 values currently. It's possible that future mpv versions will make
3186 these properties unavailable instead in this case.3186 these properties unavailable instead in this case.
3187 3187
3188 ``track-list/N/dolby-vision-profile``, ``track-list/N/dolby-vision-level``
3189 Dolby Vision profile and level. May not be available if the container
3190 does not provide this information.
3191
3188 When querying the property with the client API using ``MPV_FORMAT_NODE``,3192 When querying the property with the client API using ``MPV_FORMAT_NODE``,
3189 or with Lua ``mp.get_property_native``, this will return a mpv_node with3193 or with Lua ``mp.get_property_native``, this will return a mpv_node with
3190 the following contents:3194 the following contents:
@@ -3229,6 +3233,8 @@ Property list · 38 unmodified lines
3229 "replaygain-track-gain" MPV_FORMAT_DOUBLE3233 "replaygain-track-gain" MPV_FORMAT_DOUBLE
3230 "replaygain-album-peak" MPV_FORMAT_DOUBLE3234 "replaygain-album-peak" MPV_FORMAT_DOUBLE
3231 "replaygain-album-gain" MPV_FORMAT_DOUBLE3235 "replaygain-album-gain" MPV_FORMAT_DOUBLE
3236 "dolby-vision-profile" MPV_FORMAT_INT64
3237 "dolby-vision-level" MPV_FORMAT_INT64
3232 3238
3233``current-tracks/...``3239``current-tracks/...``
3234 This gives access to currently selected tracks. It redirects to the correct3240 This gives access to currently selected tracks. It redirects to the correct
demux/demux_lavf.c+3−0
@@ -796,6 +796,9 @@ static void handle_new_stream(demuxer_t *demuxer, int i) · 795 unmodified lines
796 MP_VERBOSE(demuxer, "Found Dolby Vision config record: profile "796 MP_VERBOSE(demuxer, "Found Dolby Vision config record: profile "
797 "%d level %d\n", cfg->dv_profile, cfg->dv_level);797 "%d level %d\n", cfg->dv_profile, cfg->dv_level);
798 av_format_inject_global_side_data(avfc);798 av_format_inject_global_side_data(avfc);
799 sh->codec->dovi = true;
800 sh->codec->dv_profile = cfg->dv_profile;
801 sh->codec->dv_level = cfg->dv_level;
799 }802 }
800 803
801 // This also applies to vfw-muxed mkv, but we can't detect these easily.804 // This also applies to vfw-muxed mkv, but we can't detect these easily.
demux/demux_mkv.c+6−0
@@ -1687,6 +1687,12 @@ static int demux_mkv_open_video(demuxer_t *demuxer, mkv_track_t *track) · 1686 unmodified lines
1687 sh_v->rotate = rotate;1687 sh_v->rotate = rotate;
1688 }1688 }
1689 1689
1690 if (track->dovi_config) {
1691 sh_v->dovi = true;
1692 sh_v->dv_level = track->dovi_config->dv_level;
1693 sh_v->dv_profile = track->dovi_config->dv_profile;
1694 }
1695
1690done:1696done:
1691 demux_add_sh_stream(demuxer, sh);1697 demux_add_sh_stream(demuxer, sh);
1692 1698
demux/stheader.h+4−0
@@ -121,6 +121,10 @@ struct mp_codec_params { · 120 unmodified lines
121 struct pl_color_repr repr; // color representaion info where available121 struct pl_color_repr repr; // color representaion info where available
122 struct mp_rect crop; // crop to be applied122 struct mp_rect crop; // crop to be applied
123 123
124 bool dovi;
125 uint8_t dv_profile;
126 uint8_t dv_level;
127
124 // STREAM_VIDEO + STREAM_AUDIO128 // STREAM_VIDEO + STREAM_AUDIO
125 int bits_per_coded_sample;129 int bits_per_coded_sample;
126 char *format_name; // pixel format (video) or sample format (audio)130 char *format_name; // pixel format (video) or sample format (audio)
player/command.c+4−0
@@ -2079,6 +2079,10 @@ static int get_track_entry(int item, int action, void *arg, void *ctx) · 2078 unmodified lines
2079 .unavailable = !has_rg},2079 .unavailable = !has_rg},
2080 {"replaygain-album-gain", SUB_PROP_FLOAT(rg.album_gain),2080 {"replaygain-album-gain", SUB_PROP_FLOAT(rg.album_gain),
2081 .unavailable = !has_rg},2081 .unavailable = !has_rg},
2082 {"dolby-vision-profile", SUB_PROP_INT(p.dv_profile),
2083 .unavailable = !p.dovi},
2084 {"dolby-vision-level", SUB_PROP_INT(p.dv_level),
2085 .unavailable = !p.dovi},
2082 {0}2086 {0}
2083 };2087 };
2084 2088

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t