Migrate usages of DrmConfiguration.sessionForClearTypes to new field
The new forcedSessionTrackTypes field was introduced in <unknown commit>. These usages are migrated in a follow-up change to add confidence that the deprecated field continued to work correctly. PiperOrigin-RevId: 403342893
This commit is contained in:
parent
61c8f8c27e
commit
18b1f3d624
@ -226,13 +226,14 @@ public class IntentUtil {
|
|||||||
}
|
}
|
||||||
intent.putExtra(DRM_KEY_REQUEST_PROPERTIES_EXTRA + extrasKeySuffix, drmKeyRequestProperties);
|
intent.putExtra(DRM_KEY_REQUEST_PROPERTIES_EXTRA + extrasKeySuffix, drmKeyRequestProperties);
|
||||||
|
|
||||||
List<@C.TrackType Integer> drmSessionForClearTypes = drmConfiguration.sessionForClearTypes;
|
List<@C.TrackType Integer> forcedDrmSessionTrackTypes =
|
||||||
if (!drmSessionForClearTypes.isEmpty()) {
|
drmConfiguration.forcedSessionTrackTypes;
|
||||||
|
if (!forcedDrmSessionTrackTypes.isEmpty()) {
|
||||||
// Only video and audio together are supported.
|
// Only video and audio together are supported.
|
||||||
Assertions.checkState(
|
Assertions.checkState(
|
||||||
drmSessionForClearTypes.size() == 2
|
forcedDrmSessionTrackTypes.size() == 2
|
||||||
&& drmSessionForClearTypes.contains(C.TRACK_TYPE_VIDEO)
|
&& forcedDrmSessionTrackTypes.contains(C.TRACK_TYPE_VIDEO)
|
||||||
&& drmSessionForClearTypes.contains(C.TRACK_TYPE_AUDIO));
|
&& forcedDrmSessionTrackTypes.contains(C.TRACK_TYPE_AUDIO));
|
||||||
intent.putExtra(DRM_SESSION_FOR_CLEAR_CONTENT + extrasKeySuffix, true);
|
intent.putExtra(DRM_SESSION_FOR_CLEAR_CONTENT + extrasKeySuffix, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,8 @@ public final class DefaultDrmSessionManagerProvider implements DrmSessionManager
|
|||||||
drmConfiguration.scheme, FrameworkMediaDrm.DEFAULT_PROVIDER)
|
drmConfiguration.scheme, FrameworkMediaDrm.DEFAULT_PROVIDER)
|
||||||
.setMultiSession(drmConfiguration.multiSession)
|
.setMultiSession(drmConfiguration.multiSession)
|
||||||
.setPlayClearSamplesWithoutKeys(drmConfiguration.playClearContentWithoutKey)
|
.setPlayClearSamplesWithoutKeys(drmConfiguration.playClearContentWithoutKey)
|
||||||
.setUseDrmSessionsForClearContent(Ints.toArray(drmConfiguration.sessionForClearTypes))
|
.setUseDrmSessionsForClearContent(
|
||||||
|
Ints.toArray(drmConfiguration.forcedSessionTrackTypes))
|
||||||
.build(httpDrmCallback);
|
.build(httpDrmCallback);
|
||||||
drmSessionManager.setMode(MODE_PLAYBACK, drmConfiguration.getKeySetId());
|
drmSessionManager.setMode(MODE_PLAYBACK, drmConfiguration.getKeySetId());
|
||||||
return drmSessionManager;
|
return drmSessionManager;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user