Rename DedicatedThreadAsyncMediaCodecAdapter

Rename the DedicatedThreadAsyncMediaCodecAdapter to
AsynchronousMediaCodecAdapter as it is the only asynchronous adapter
implementation left after the clean-up.

PiperOrigin-RevId: 315873431
This commit is contained in:
christosts 2020-06-11 12:20:30 +01:00 committed by Oliver Woodman
parent e111f850d0
commit 285cce629f
3 changed files with 10 additions and 10 deletions

View File

@ -40,7 +40,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* <p>This adapter supports queueing input buffers asynchronously.
*/
@RequiresApi(23)
/* package */ final class DedicatedThreadAsyncMediaCodecAdapter extends MediaCodec.Callback
/* package */ final class AsynchronousMediaCodecAdapter extends MediaCodec.Callback
implements MediaCodecAdapter {
@Documented
@ -70,7 +70,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* @param trackType One of {@link C#TRACK_TYPE_AUDIO} or {@link C#TRACK_TYPE_VIDEO}. Used for
* labelling the internal thread accordingly.
*/
/* package */ DedicatedThreadAsyncMediaCodecAdapter(MediaCodec codec, int trackType) {
/* package */ AsynchronousMediaCodecAdapter(MediaCodec codec, int trackType) {
this(
codec,
/* enableAsynchronousQueueing= */ false,
@ -86,7 +86,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* @param trackType One of {@link C#TRACK_TYPE_AUDIO} or {@link C#TRACK_TYPE_VIDEO}. Used for
* labelling the internal thread accordingly.
*/
/* package */ DedicatedThreadAsyncMediaCodecAdapter(
/* package */ AsynchronousMediaCodecAdapter(
MediaCodec codec, boolean enableAsynchronousQueueing, int trackType) {
this(
codec,
@ -96,7 +96,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
}
@VisibleForTesting
/* package */ DedicatedThreadAsyncMediaCodecAdapter(
/* package */ AsynchronousMediaCodecAdapter(
MediaCodec codec,
boolean enableAsynchronousQueueing,
int trackType,

View File

@ -1075,12 +1075,12 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
codec = MediaCodec.createByCodecName(codecName);
if (mediaCodecOperationMode == OPERATION_MODE_ASYNCHRONOUS_DEDICATED_THREAD
&& Util.SDK_INT >= 23) {
codecAdapter = new DedicatedThreadAsyncMediaCodecAdapter(codec, getTrackType());
codecAdapter = new AsynchronousMediaCodecAdapter(codec, getTrackType());
} else if (mediaCodecOperationMode
== OPERATION_MODE_ASYNCHRONOUS_DEDICATED_THREAD_ASYNCHRONOUS_QUEUEING
&& Util.SDK_INT >= 23) {
codecAdapter =
new DedicatedThreadAsyncMediaCodecAdapter(
new AsynchronousMediaCodecAdapter(
codec, /* enableAsynchronousQueueing= */ true, getTrackType());
} else {
codecAdapter = new SynchronousMediaCodecAdapter(codec);

View File

@ -40,11 +40,11 @@ import org.robolectric.Shadows;
import org.robolectric.annotation.LooperMode;
import org.robolectric.shadows.ShadowLooper;
/** Unit tests for {@link DedicatedThreadAsyncMediaCodecAdapter}. */
/** Unit tests for {@link AsynchronousMediaCodecAdapter}. */
@LooperMode(LEGACY)
@RunWith(AndroidJUnit4.class)
public class DedicatedThreadAsyncMediaCodecAdapterTest {
private DedicatedThreadAsyncMediaCodecAdapter adapter;
public class AsynchronousMediaCodecAdapterTest {
private AsynchronousMediaCodecAdapter adapter;
private MediaCodec codec;
private TestHandlerThread handlerThread;
private MediaCodec.BufferInfo bufferInfo;
@ -54,7 +54,7 @@ public class DedicatedThreadAsyncMediaCodecAdapterTest {
codec = MediaCodec.createByCodecName("h264");
handlerThread = new TestHandlerThread("TestHandlerThread");
adapter =
new DedicatedThreadAsyncMediaCodecAdapter(
new AsynchronousMediaCodecAdapter(
codec,
/* enableAsynchronousQueueing= */ false,
/* trackType= */ C.TRACK_TYPE_VIDEO,