Increase transformer min API version to 21

This will remove the need to implement compat code handling very old API
versions where some symbols are not available, and it reduces the burden of
dealing with media framework issues around concurrent codec usage that are
worse on older API versions. Top apps that we've surveyed as potential users
for transformer library features are using API 21 or later.

PiperOrigin-RevId: 413341540
This commit is contained in:
andrewlewis 2021-12-01 08:43:44 +00:00 committed by tonihei
parent 6f63701307
commit a803604605
12 changed files with 1 additions and 21 deletions

View File

@ -15,6 +15,7 @@ apply from: "$gradle.ext.androidxMediaSettingsDir/common_library_config.gradle"
android {
defaultConfig {
minSdkVersion 21
// The following argument makes the Android Test Orchestrator run its
// "pm clear" command after each test invocation. This command ensures
// that the app's state is completely cleared between tests.

View File

@ -23,7 +23,6 @@ import static java.lang.Math.min;
import android.media.MediaCodec.BufferInfo;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.media3.common.C;
import androidx.media3.common.Format;
import androidx.media3.common.PlaybackException;
@ -41,7 +40,6 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
/**
* Pipeline to decode audio samples, apply transformations on the raw samples, and re-encode them.
*/
@RequiresApi(18)
/* package */ final class AudioSamplePipeline implements SamplePipeline {
private static final String TAG = "AudioSamplePipeline";

View File

@ -24,7 +24,6 @@ import android.opengl.EGLExt;
import android.opengl.EGLSurface;
import android.opengl.GLES20;
import android.view.Surface;
import androidx.annotation.RequiresApi;
import androidx.media3.common.util.GlUtil;
import java.io.IOException;
@ -32,7 +31,6 @@ import java.io.IOException;
* FrameEditor applies changes to individual video frames. Changes include just resolution for now,
* but may later include brightness, cropping, rotation, etc.
*/
@RequiresApi(18)
/* package */ final class FrameEditor {
static {

View File

@ -36,7 +36,6 @@ import java.lang.reflect.Field;
import java.nio.ByteBuffer;
/** Muxer implementation that uses a {@link MediaMuxer}. */
@RequiresApi(18)
/* package */ final class FrameworkMuxer implements Muxer {
public static final class Factory implements Muxer.Factory {

View File

@ -26,7 +26,6 @@ import android.media.MediaCodecInfo.CodecCapabilities;
import android.media.MediaFormat;
import android.view.Surface;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.media3.common.C;
import androidx.media3.common.Format;
import androidx.media3.common.MimeTypes;
@ -50,7 +49,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* through {@link MediaCodecAdapter}. This is done by simplifying the calls needed to queue and
* dequeue buffers, removing the need to track buffer indices and codec events.
*/
@RequiresApi(18)
/* package */ final class MediaCodecAdapterWrapper {
// MediaCodec decoders always output 16 bit PCM, unless configured to output PCM float.
@ -303,7 +301,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
inputBuffer.data = null;
}
@RequiresApi(18)
public void signalEndOfInputStream() {
codec.signalEndOfInputStream();
}

View File

@ -22,7 +22,6 @@ import static androidx.media3.common.util.Util.minValue;
import android.util.SparseIntArray;
import android.util.SparseLongArray;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.media3.common.C;
import androidx.media3.common.Format;
import androidx.media3.common.MimeTypes;
@ -34,7 +33,6 @@ import java.nio.ByteBuffer;
*
* <p>This wrapper can contain at most one video track and one audio track.
*/
@RequiresApi(18)
/* package */ final class MuxerWrapper {
/**

View File

@ -80,7 +80,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* of the application's main thread is used. In all cases the Looper of the thread from which the
* transformer must be accessed can be queried using {@link #getApplicationLooper()}.
*/
@RequiresApi(18)
@UnstableApi
public final class Transformer {

View File

@ -20,7 +20,6 @@ import static androidx.media3.common.util.Assertions.checkNotNull;
import static androidx.media3.exoplayer.source.SampleStream.FLAG_REQUIRE_FORMAT;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.media3.common.C;
import androidx.media3.common.Format;
import androidx.media3.common.Metadata;
@ -30,7 +29,6 @@ import androidx.media3.exoplayer.FormatHolder;
import androidx.media3.exoplayer.source.SampleStream.ReadDataResult;
import androidx.media3.extractor.metadata.mp4.SlowMotionData;
@RequiresApi(18)
/* package */ final class TransformerAudioRenderer extends TransformerBaseRenderer {
private static final String TAG = "TransformerAudioRenderer";

View File

@ -19,7 +19,6 @@ package androidx.media3.transformer;
import static androidx.media3.common.util.Assertions.checkStateNotNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.media3.common.C;
import androidx.media3.common.Format;
import androidx.media3.common.MimeTypes;
@ -34,7 +33,6 @@ import org.checkerframework.checker.nullness.qual.EnsuresNonNullIf;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
@RequiresApi(18)
/* package */ abstract class TransformerBaseRenderer extends BaseRenderer {
protected final MuxerWrapper muxerWrapper;

View File

@ -18,12 +18,10 @@ package androidx.media3.transformer;
import static androidx.media3.common.util.Util.minValue;
import android.util.SparseLongArray;
import androidx.annotation.RequiresApi;
import androidx.media3.common.C;
import androidx.media3.common.PlaybackParameters;
import androidx.media3.exoplayer.MediaClock;
@RequiresApi(18)
/* package */ final class TransformerMediaClock implements MediaClock {
private final SparseLongArray trackTypeToTimeUs;

View File

@ -20,7 +20,6 @@ import static androidx.media3.common.util.Assertions.checkNotNull;
import static androidx.media3.exoplayer.source.SampleStream.FLAG_REQUIRE_FORMAT;
import android.content.Context;
import androidx.annotation.RequiresApi;
import androidx.media3.common.C;
import androidx.media3.common.Format;
import androidx.media3.decoder.DecoderInputBuffer;
@ -31,7 +30,6 @@ import java.nio.ByteBuffer;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.checkerframework.checker.nullness.qual.RequiresNonNull;
@RequiresApi(18)
/* package */ final class TransformerVideoRenderer extends TransformerBaseRenderer {
private static final String TAG = "TransformerTranscodingVideoRenderer";

View File

@ -21,7 +21,6 @@ import static androidx.media3.common.util.Assertions.checkNotNull;
import android.content.Context;
import android.media.MediaCodec;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.media3.common.C;
import androidx.media3.common.Format;
import androidx.media3.common.PlaybackException;
@ -33,7 +32,6 @@ import java.io.IOException;
/**
* Pipeline to decode video samples, apply transformations on the raw samples, and re-encode them.
*/
@RequiresApi(18)
/* package */ final class VideoSamplePipeline implements SamplePipeline {
private static final String TAG = "VideoSamplePipeline";