Remove unused field in MediaCodecAdapter
The field is always 0 as the only publicly accessible creator methods set it to zero in all cases. PiperOrigin-RevId: 652858810
This commit is contained in:
parent
f68cf30791
commit
b4975a1b49
@ -26,6 +26,8 @@
|
||||
* Add `BasePreloadManager.Listener` to propagate preload events to apps.
|
||||
* Allow changing SNTP client timeout
|
||||
([#1540](https://github.com/androidx/media/issues/1540)).
|
||||
* Remove `MediaCodecAdapter.Configuration.flags` as the field was always
|
||||
zero.
|
||||
* Transformer:
|
||||
* Add `SurfaceAssetLoader`, which supports queueing video data to
|
||||
Transformer via a `Surface`.
|
||||
|
@ -103,7 +103,7 @@ import java.nio.ByteBuffer;
|
||||
try {
|
||||
TraceUtil.beginSection("createCodec:" + codecName);
|
||||
codec = MediaCodec.createByCodecName(codecName);
|
||||
int flags = configuration.flags;
|
||||
int flags = 0;
|
||||
MediaCodecBufferEnqueuer bufferEnqueuer;
|
||||
if (enableSynchronousBufferQueueingWithAsyncCryptoFlag
|
||||
&& useSynchronousBufferQueueingWithAsyncCryptoFlag(configuration.format)) {
|
||||
|
@ -57,8 +57,7 @@ public interface MediaCodecAdapter {
|
||||
MediaFormat mediaFormat,
|
||||
Format format,
|
||||
@Nullable MediaCrypto crypto) {
|
||||
return new Configuration(
|
||||
codecInfo, mediaFormat, format, /* surface= */ null, crypto, /* flags= */ 0);
|
||||
return new Configuration(codecInfo, mediaFormat, format, /* surface= */ null, crypto);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -77,7 +76,7 @@ public interface MediaCodecAdapter {
|
||||
Format format,
|
||||
@Nullable Surface surface,
|
||||
@Nullable MediaCrypto crypto) {
|
||||
return new Configuration(codecInfo, mediaFormat, format, surface, crypto, /* flags= */ 0);
|
||||
return new Configuration(codecInfo, mediaFormat, format, surface, crypto);
|
||||
}
|
||||
|
||||
/** Information about the {@link MediaCodec} being configured. */
|
||||
@ -99,22 +98,17 @@ public interface MediaCodecAdapter {
|
||||
/** For DRM protected playbacks, a {@link MediaCrypto} to use for decryption. */
|
||||
@Nullable public final MediaCrypto crypto;
|
||||
|
||||
/** See {@link MediaCodec#configure}. */
|
||||
public final int flags;
|
||||
|
||||
private Configuration(
|
||||
MediaCodecInfo codecInfo,
|
||||
MediaFormat mediaFormat,
|
||||
Format format,
|
||||
@Nullable Surface surface,
|
||||
@Nullable MediaCrypto crypto,
|
||||
int flags) {
|
||||
@Nullable MediaCrypto crypto) {
|
||||
this.codecInfo = codecInfo;
|
||||
this.mediaFormat = mediaFormat;
|
||||
this.format = format;
|
||||
this.surface = surface;
|
||||
this.crypto = crypto;
|
||||
this.flags = flags;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,10 +50,7 @@ public final class SynchronousMediaCodecAdapter implements MediaCodecAdapter {
|
||||
codec = createCodec(configuration);
|
||||
TraceUtil.beginSection("configureCodec");
|
||||
codec.configure(
|
||||
configuration.mediaFormat,
|
||||
configuration.surface,
|
||||
configuration.crypto,
|
||||
configuration.flags);
|
||||
configuration.mediaFormat, configuration.surface, configuration.crypto, /* flags= */ 0);
|
||||
TraceUtil.endSection();
|
||||
TraceUtil.beginSection("startCodec");
|
||||
codec.start();
|
||||
|
Loading…
x
Reference in New Issue
Block a user