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 @@
1+add `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
31853185 values currently. It's possible that future mpv versions will make
31863186 these properties unavailable instead in this case.
31873187
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+
31883192 When querying the property with the client API using ``MPV_FORMAT_NODE``,
31893193 or with Lua ``mp.get_property_native``, this will return a mpv_node with
31903194 the following contents:
@@ -3229,6 +3233,8 @@ Property list · 38 unmodified lines
32293233 "replaygain-track-gain" MPV_FORMAT_DOUBLE
32303234 "replaygain-album-peak" MPV_FORMAT_DOUBLE
32313235 "replaygain-album-gain" MPV_FORMAT_DOUBLE
3236+ "dolby-vision-profile" MPV_FORMAT_INT64
3237+ "dolby-vision-level" MPV_FORMAT_INT64
32323238
32333239 ``current-tracks/...``
32343240 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
796796 MP_VERBOSE(demuxer, "Found Dolby Vision config record: profile "
797797 "%d level %d\n", cfg->dv_profile, cfg->dv_level);
798798 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;
799802 }
800803
801804 // 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
16871687 sh_v->rotate = rotate;
16881688 }
16891689
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+
16901696 done:
16911697 demux_add_sh_stream(demuxer, sh);
16921698
demux/stheader.h+4−0
@@ -121,6 +121,10 @@ struct mp_codec_params { · 120 unmodified lines
121121 struct pl_color_repr repr; // color representaion info where available
122122 struct mp_rect crop; // crop to be applied
123123
124+ bool dovi;
125+ uint8_t dv_profile;
126+ uint8_t dv_level;
127+
124128 // STREAM_VIDEO + STREAM_AUDIO
125129 int bits_per_coded_sample;
126130 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
20792079 .unavailable = !has_rg},
20802080 {"replaygain-album-gain", SUB_PROP_FLOAT(rg.album_gain),
20812081 .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},
20822086 {0}
20832087 };
20842088

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