Skip to content

Commit 8740b35

Browse files
v-nova-romasavelad
authored andcommitted
fix(UI): Add LCEVC label in resolution menu (#9186)
This PR adds `isLCEVC` check to the `basicResolutionComparison` and appends `'LCEVC'` to the label text in `getResolutionLabel_` if the track is LCEVC. This makes it easier to tell LCEVC profiles apart and fixes an issue we were seeing when many different Dual-Track profiles are contained in the manifest, it might be hard to differentiate them (e.g. base and LCEVC profile with the same 1080p resolution).
1 parent e73b149 commit 8740b35

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

lib/util/mime_utils.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ shaka.util.MimeUtils = class {
198198
case base === 'dvc1':
199199
case base === 'dvi1':
200200
return 'dovi-vvc'; // Dolby Vision based in VVC
201+
case base === 'lvc1':
202+
return 'lcevc'; // LCEVC
201203
}
202204
return base;
203205
}

test/util/mime_utils_unit.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ describe('MimeUtils', () => {
7171

7272
expect(getNormalizedCodec('dvc1.05')).toBe('dovi-vvc');
7373
expect(getNormalizedCodec('dvi1.05')).toBe('dovi-vvc');
74+
75+
expect(getNormalizedCodec('lvc1')).toBe('lcevc');
7476
});
7577

7678
it('isHlsType', () => {

ui/resolution_selection.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,13 +482,23 @@ shaka.ui.ResolutionSelection = class extends shaka.ui.SettingsMenu {
482482
const codec = shaka.util.MimeUtils.getNormalizedCodec(t.codecs);
483483
return codec.startsWith('dovi-');
484484
};
485+
const isLCEVC = (t) => {
486+
if (!t.codecs) {
487+
return false;
488+
}
489+
const codec = shaka.util.MimeUtils.getNormalizedCodec(t.codecs);
490+
return codec.startsWith('lcevc');
491+
};
485492
if (track.hdr == 'PQ' || track.hdr == 'HLG') {
486493
if (isDolbyVision(track)) {
487494
text += ' Dolby Vision';
488495
} else {
489496
text += ' HDR';
490497
}
491498
}
499+
if (isLCEVC(track)) {
500+
text += ' LCEVC';
501+
}
492502
const videoLayout = track.videoLayout || '';
493503
if (videoLayout.includes('CH-STEREO')) {
494504
text += ' 3D';
@@ -498,6 +508,7 @@ shaka.ui.ResolutionSelection = class extends shaka.ui.SettingsMenu {
498508
firstTrack.height == secondTrack.height &&
499509
firstTrack.hdr == secondTrack.hdr &&
500510
isDolbyVision(firstTrack) == isDolbyVision(secondTrack) &&
511+
isLCEVC(firstTrack) == isLCEVC(secondTrack) &&
501512
Math.round(firstTrack.frameRate || 0) ==
502513
Math.round(secondTrack.frameRate || 0);
503514
};

0 commit comments

Comments
 (0)