mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix review comments
This commit is contained in:
parent
8e6d3e7541
commit
a1767d349a
4 changed files with 18 additions and 34 deletions
|
|
@ -24,7 +24,6 @@ import androidx.media3.common.DrmInitData;
|
||||||
import androidx.media3.common.util.UnstableApi;
|
import androidx.media3.common.util.UnstableApi;
|
||||||
import androidx.media3.common.util.Util;
|
import androidx.media3.common.util.Util;
|
||||||
import androidx.media3.decoder.CryptoConfig;
|
import androidx.media3.decoder.CryptoConfig;
|
||||||
import com.google.common.collect.ImmutableList;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -121,17 +120,6 @@ public final class DummyExoMediaDrm implements ExoMediaDrm {
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void removeOfflineLicense(byte[] keySetId) {
|
|
||||||
// Should not be invoked. No session should exist.
|
|
||||||
throw new IllegalStateException();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ImmutableList<byte[]> getOfflineLicenseKeySetIds() {
|
|
||||||
return ImmutableList.of();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
public PersistableBundle getMetrics() {
|
public PersistableBundle getMetrics() {
|
||||||
|
|
|
||||||
|
|
@ -536,18 +536,26 @@ public interface ExoMediaDrm {
|
||||||
* <p>See {@link MediaDrm#removeOfflineLicense(byte[])} for more details.
|
* <p>See {@link MediaDrm#removeOfflineLicense(byte[])} for more details.
|
||||||
*
|
*
|
||||||
* @param keySetId The {@code keySetId} of the license to remove.
|
* @param keySetId The {@code keySetId} of the license to remove.
|
||||||
|
* @throws UnsupportedOperationException if the implementation doesn't support this method.
|
||||||
*/
|
*/
|
||||||
void removeOfflineLicense(byte[] keySetId);
|
default void removeOfflineLicense(byte[] keySetId) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of the {@code keySetIds} for all offline licenses.
|
* Returns a list of the {@code keySetIds} for all offline licenses.
|
||||||
*
|
*
|
||||||
* <p>This is an optional method, and some implementations may only support it on certain Android
|
* <p>This is an optional method, and some implementations may only support it on certain Android
|
||||||
* API levels. If the method is unsupported an empty list is returned.
|
* API levels.
|
||||||
*
|
*
|
||||||
* <p>See {@link MediaDrm#getOfflineLicenseKeySetIds()} for more details.
|
* <p>See {@link MediaDrm#getOfflineLicenseKeySetIds()} for more details.
|
||||||
|
*
|
||||||
|
* @return The list of {@code keySetIds} for all offline licenses.
|
||||||
|
* @throws UnsupportedOperationException if the implementation doesn't support this method.
|
||||||
*/
|
*/
|
||||||
List<byte[]> getOfflineLicenseKeySetIds();
|
default List<byte[]> getOfflineLicenseKeySetIds() {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns metrics data for this ExoMediaDrm instance, or {@code null} if metrics are unavailable.
|
* Returns metrics data for this ExoMediaDrm instance, or {@code null} if metrics are unavailable.
|
||||||
|
|
@ -609,6 +617,4 @@ public interface ExoMediaDrm {
|
||||||
*/
|
*/
|
||||||
@C.CryptoType
|
@C.CryptoType
|
||||||
int getCryptoType();
|
int getCryptoType();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@ import android.media.MediaDrmException;
|
||||||
import android.media.NotProvisionedException;
|
import android.media.NotProvisionedException;
|
||||||
import android.media.UnsupportedSchemeException;
|
import android.media.UnsupportedSchemeException;
|
||||||
import android.media.metrics.LogSessionId;
|
import android.media.metrics.LogSessionId;
|
||||||
import android.os.Build;
|
|
||||||
import android.os.PersistableBundle;
|
import android.os.PersistableBundle;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import androidx.annotation.DoNotInline;
|
import androidx.annotation.DoNotInline;
|
||||||
|
|
@ -44,7 +43,6 @@ import androidx.media3.common.util.Util;
|
||||||
import androidx.media3.exoplayer.analytics.PlayerId;
|
import androidx.media3.exoplayer.analytics.PlayerId;
|
||||||
import androidx.media3.extractor.mp4.PsshAtomUtil;
|
import androidx.media3.extractor.mp4.PsshAtomUtil;
|
||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
import com.google.common.collect.ImmutableList;
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.ByteOrder;
|
import java.nio.ByteOrder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -330,19 +328,21 @@ public final class FrameworkMediaDrm implements ExoMediaDrm {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@RequiresApi(Build.VERSION_CODES.Q)
|
@UnstableApi
|
||||||
|
@RequiresApi(29)
|
||||||
public void removeOfflineLicense(byte[] keySetId) {
|
public void removeOfflineLicense(byte[] keySetId) {
|
||||||
if (Util.SDK_INT < Build.VERSION_CODES.Q) {
|
if (Util.SDK_INT < 29) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
mediaDrm.removeOfflineLicense(keySetId);
|
mediaDrm.removeOfflineLicense(keySetId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@RequiresApi(Build.VERSION_CODES.Q)
|
@UnstableApi
|
||||||
|
@RequiresApi(29)
|
||||||
public List<byte[]> getOfflineLicenseKeySetIds() {
|
public List<byte[]> getOfflineLicenseKeySetIds() {
|
||||||
if (Util.SDK_INT < Build.VERSION_CODES.Q) {
|
if (Util.SDK_INT < 29) {
|
||||||
return ImmutableList.of();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
return mediaDrm.getOfflineLicenseKeySetIds();
|
return mediaDrm.getOfflineLicenseKeySetIds();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -361,16 +361,6 @@ public final class FakeExoMediaDrm implements ExoMediaDrm {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void removeOfflineLicense(byte[] keySetId) {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ImmutableList<byte[]> getOfflineLicenseKeySetIds() {
|
|
||||||
return ImmutableList.of();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public PersistableBundle getMetrics() {
|
public PersistableBundle getMetrics() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue