Commit fa803967 by aquilescanta Committed by Oliver Woodman

Remove mediaDrm methods from DefaultDrmSessionManager

DrmSessionManagers may now be in released state, in which case they
may release their MediaDrm. In that case, it would be invalid to
forward method calls to the underlying MediaDrms. Users should
instead call these methods directly on the MediaDrm.

Issue:#4721
PiperOrigin-RevId: 270963393
parent 4df2262b
...@@ -234,54 +234,6 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto> ...@@ -234,54 +234,6 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto>
} }
/** /**
* Provides access to {@link ExoMediaDrm#getPropertyString(String)}.
*
* <p>This method may be called when the manager is in any state.
*
* @param key The key to request.
* @return The retrieved property.
*/
public final String getPropertyString(String key) {
return mediaDrm.getPropertyString(key);
}
/**
* Provides access to {@link ExoMediaDrm#setPropertyString(String, String)}.
*
* <p>This method may be called when the manager is in any state.
*
* @param key The property to write.
* @param value The value to write.
*/
public final void setPropertyString(String key, String value) {
mediaDrm.setPropertyString(key, value);
}
/**
* Provides access to {@link ExoMediaDrm#getPropertyByteArray(String)}.
*
* <p>This method may be called when the manager is in any state.
*
* @param key The key to request.
* @return The retrieved property.
*/
public final byte[] getPropertyByteArray(String key) {
return mediaDrm.getPropertyByteArray(key);
}
/**
* Provides access to {@link ExoMediaDrm#setPropertyByteArray(String, byte[])}.
*
* <p>This method may be called when the manager is in any state.
*
* @param key The property to write.
* @param value The value to write.
*/
public final void setPropertyByteArray(String key, byte[] value) {
mediaDrm.setPropertyByteArray(key, value);
}
/**
* Sets the mode, which determines the role of sessions acquired from the instance. This must be * Sets the mode, which determines the role of sessions acquired from the instance. This must be
* called before {@link #acquireSession(Looper, DrmInitData)} or {@link * called before {@link #acquireSession(Looper, DrmInitData)} or {@link
* #acquirePlaceholderSession(Looper)} is called. * #acquirePlaceholderSession(Looper)} is called.
......
...@@ -153,34 +153,6 @@ public final class OfflineLicenseHelper<T extends ExoMediaCrypto> { ...@@ -153,34 +153,6 @@ public final class OfflineLicenseHelper<T extends ExoMediaCrypto> {
} }
/** /**
* @see DefaultDrmSessionManager#getPropertyByteArray
*/
public synchronized byte[] getPropertyByteArray(String key) {
return drmSessionManager.getPropertyByteArray(key);
}
/**
* @see DefaultDrmSessionManager#setPropertyByteArray
*/
public synchronized void setPropertyByteArray(String key, byte[] value) {
drmSessionManager.setPropertyByteArray(key, value);
}
/**
* @see DefaultDrmSessionManager#getPropertyString
*/
public synchronized String getPropertyString(String key) {
return drmSessionManager.getPropertyString(key);
}
/**
* @see DefaultDrmSessionManager#setPropertyString
*/
public synchronized void setPropertyString(String key, String value) {
drmSessionManager.setPropertyString(key, value);
}
/**
* Downloads an offline license. * Downloads an offline license.
* *
* @param drmInitData The {@link DrmInitData} for the content whose license is to be downloaded. * @param drmInitData The {@link DrmInitData} for the content whose license is to be downloaded.
......
...@@ -266,17 +266,17 @@ public final class DashTestRunner { ...@@ -266,17 +266,17 @@ public final class DashTestRunner {
try { try {
MediaDrmCallback drmCallback = new HttpMediaDrmCallback(widevineLicenseUrl, MediaDrmCallback drmCallback = new HttpMediaDrmCallback(widevineLicenseUrl,
new DefaultHttpDataSourceFactory(userAgent)); new DefaultHttpDataSourceFactory(userAgent));
FrameworkMediaDrm frameworkMediaDrm = FrameworkMediaDrm.newInstance(WIDEVINE_UUID);
DefaultDrmSessionManager<FrameworkMediaCrypto> drmSessionManager = DefaultDrmSessionManager<FrameworkMediaCrypto> drmSessionManager =
new DefaultDrmSessionManager<>( new DefaultDrmSessionManager<>(
C.WIDEVINE_UUID, C.WIDEVINE_UUID,
FrameworkMediaDrm.newInstance(C.WIDEVINE_UUID), frameworkMediaDrm,
drmCallback, drmCallback,
/* optionalKeyRequestParameters= */ null, /* optionalKeyRequestParameters= */ null,
/* multiSession= */ false, /* multiSession= */ false,
DefaultDrmSessionManager.INITIAL_DRM_REQUEST_RETRY_COUNT); DefaultDrmSessionManager.INITIAL_DRM_REQUEST_RETRY_COUNT);
if (!useL1Widevine) { if (!useL1Widevine) {
drmSessionManager.setPropertyString( frameworkMediaDrm.setPropertyString(SECURITY_LEVEL_PROPERTY, WIDEVINE_SECURITY_LEVEL_3);
SECURITY_LEVEL_PROPERTY, WIDEVINE_SECURITY_LEVEL_3);
} }
if (offlineLicenseKeySetId != null) { if (offlineLicenseKeySetId != null) {
drmSessionManager.setMode(DefaultDrmSessionManager.MODE_PLAYBACK, drmSessionManager.setMode(DefaultDrmSessionManager.MODE_PLAYBACK,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment