Rename occurrences of transform in lib-transformer
PiperOrigin-RevId: 510118760
This commit is contained in:
parent
5d8a83f924
commit
221c5afb1b
@ -23,8 +23,7 @@ import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
/**
|
||||
* A test only class for holding the details of what fallbacks were applied during a test
|
||||
* transformation.
|
||||
* A test only class for holding the details of what fallbacks were applied during a test export.
|
||||
*/
|
||||
/* package */ final class FallbackDetails {
|
||||
|
||||
|
@ -45,7 +45,7 @@ import org.json.JSONObject;
|
||||
public class TransformerAndroidTestRunner {
|
||||
private static final String TAG = "TransformerAndroidTest";
|
||||
|
||||
/** The default transformation timeout value. */
|
||||
/** The default export timeout value. */
|
||||
public static final int DEFAULT_TIMEOUT_SECONDS = 120;
|
||||
|
||||
/** A {@link Builder} for {@link TransformerAndroidTestRunner} instances. */
|
||||
@ -61,7 +61,7 @@ public class TransformerAndroidTestRunner {
|
||||
* Creates a {@link Builder}.
|
||||
*
|
||||
* @param context The {@link Context}.
|
||||
* @param transformer The {@link Transformer} that performs the transformation.
|
||||
* @param transformer The {@link Transformer} that performs the export.
|
||||
*/
|
||||
public Builder(Context context, Transformer transformer) {
|
||||
this.context = context;
|
||||
@ -70,7 +70,7 @@ public class TransformerAndroidTestRunner {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the timeout in seconds for a single transformation. An exception is thrown when this is
|
||||
* Sets the timeout in seconds for a single export. An exception is thrown when this is
|
||||
* exceeded.
|
||||
*
|
||||
* <p>The default value is {@link #DEFAULT_TIMEOUT_SECONDS}.
|
||||
@ -85,7 +85,7 @@ public class TransformerAndroidTestRunner {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether to calculate the SSIM of the transformation output compared to the input, if
|
||||
* Sets whether to calculate the SSIM of the exported output compared to the input, if
|
||||
* supported. Calculating SSIM is not supported if the input and output video dimensions don't
|
||||
* match, or if the input video is trimmed.
|
||||
*
|
||||
@ -104,8 +104,8 @@ public class TransformerAndroidTestRunner {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether to suppress failures that occurs as a result of post-transformation analysis,
|
||||
* such as SSIM calculation.
|
||||
* Sets whether to suppress failures that occurs as a result of post-export analysis, such as
|
||||
* SSIM calculation.
|
||||
*
|
||||
* <p>Regardless of this value, analysis exceptions are attached to the analysis file.
|
||||
*
|
||||
@ -124,13 +124,13 @@ public class TransformerAndroidTestRunner {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a {@link Map} of transformer input values, which are propagated to the transformation
|
||||
* summary JSON file.
|
||||
* Sets a {@link Map} of transformer input values, which are propagated to the export summary
|
||||
* JSON file.
|
||||
*
|
||||
* <p>Values in the map should be convertible according to {@link JSONObject#wrap(Object)} to be
|
||||
* recorded properly in the summary file.
|
||||
*
|
||||
* @param inputValues A {@link Map} of values to be written to the transformation summary.
|
||||
* @param inputValues A {@link Map} of values to be written to the export summary.
|
||||
* @return This {@link Builder}.
|
||||
*/
|
||||
@CanIgnoreReturnValue
|
||||
@ -337,7 +337,7 @@ public class TransformerAndroidTestRunner {
|
||||
.build();
|
||||
}
|
||||
|
||||
// No exceptions raised, transformation has succeeded.
|
||||
// No exceptions raised, export has succeeded.
|
||||
ExportTestResult.Builder testResultBuilder =
|
||||
new ExportTestResult.Builder(
|
||||
checkNotNull(exportResultReference.get())
|
||||
|
@ -69,8 +69,8 @@ public class HdrEditingTest {
|
||||
.build();
|
||||
|
||||
@Test
|
||||
public void transform_noRequestedTranscode_hdr10File_transformsOrThrows() throws Exception {
|
||||
String testId = "transform_noRequestedTranscode_hdr10File_transformsOrThrows";
|
||||
public void export_noRequestedTranscode_hdr10File_exportsOrThrows() throws Exception {
|
||||
String testId = "export_noRequestedTranscode_hdr10File_exportsOrThrows";
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
|
||||
Transformer transformer = new Transformer.Builder(context).build();
|
||||
@ -81,7 +81,7 @@ public class HdrEditingTest {
|
||||
new TransformerAndroidTestRunner.Builder(context, transformer)
|
||||
.build()
|
||||
.run(testId, mediaItem);
|
||||
Log.i(TAG, "Transformed.");
|
||||
Log.i(TAG, "Exported.");
|
||||
assertFileHasColorTransfer(exportTestResult.filePath, C.COLOR_TRANSFER_ST2084);
|
||||
} catch (ExportException exception) {
|
||||
Log.i(TAG, checkNotNull(exception.getCause()).toString());
|
||||
@ -94,8 +94,8 @@ public class HdrEditingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void transform_noRequestedTranscode_hlg10File_transformsOrThrows() throws Exception {
|
||||
String testId = "transform_noRequestedTranscode_hlg10File_transformsOrThrows";
|
||||
public void export_noRequestedTranscode_hlg10File_exportsOrThrows() throws Exception {
|
||||
String testId = "export_noRequestedTranscode_hlg10File_exportsOrThrows";
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
|
||||
Transformer transformer = new Transformer.Builder(context).build();
|
||||
@ -106,7 +106,7 @@ public class HdrEditingTest {
|
||||
new TransformerAndroidTestRunner.Builder(context, transformer)
|
||||
.build()
|
||||
.run(testId, mediaItem);
|
||||
Log.i(TAG, "Transformed.");
|
||||
Log.i(TAG, "Exported.");
|
||||
assertFileHasColorTransfer(exportTestResult.filePath, C.COLOR_TRANSFER_HLG);
|
||||
} catch (ExportException exception) {
|
||||
Log.i(TAG, checkNotNull(exception.getCause()).toString());
|
||||
@ -119,9 +119,8 @@ public class HdrEditingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void transformAndTranscode_hdr10File_whenHdrEditingIsSupported_transforms()
|
||||
throws Exception {
|
||||
String testId = "transformAndTranscode_hdr10File_whenHdrEditingIsSupported_transforms";
|
||||
public void exportAndTranscode_hdr10File_whenHdrEditingIsSupported_exports() throws Exception {
|
||||
String testId = "exportAndTranscode_hdr10File_whenHdrEditingIsSupported_exports";
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
if (!deviceSupportsHdrEditing(VIDEO_H265, HDR10_DEFAULT_COLOR_INFO)) {
|
||||
recordTestSkipped(context, testId, /* reason= */ "Device lacks HDR10 editing support.");
|
||||
@ -144,9 +143,8 @@ public class HdrEditingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void transformAndTranscode_hlg10File_whenHdrEditingIsSupported_transforms()
|
||||
throws Exception {
|
||||
String testId = "transformAndTranscode_hlg10File_whenHdrEditingIsSupported_transforms";
|
||||
public void exportAndTranscode_hlg10File_whenHdrEditingIsSupported_exports() throws Exception {
|
||||
String testId = "exportAndTranscode_hlg10File_whenHdrEditingIsSupported_exports";
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
if (!deviceSupportsHdrEditing(VIDEO_H265, HLG10_DEFAULT_COLOR_INFO)) {
|
||||
recordTestSkipped(context, testId, /* reason= */ "Device lacks HLG10 editing support.");
|
||||
@ -169,9 +167,9 @@ public class HdrEditingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void transformAndTranscode_hdr10File_whenHdrEditingUnsupported_toneMapsOrThrows()
|
||||
public void exportAndTranscode_hdr10File_whenHdrEditingUnsupported_toneMapsOrThrows()
|
||||
throws Exception {
|
||||
String testId = "transformAndTranscode_hdr10File_whenHdrEditingUnsupported_toneMapsOrThrows";
|
||||
String testId = "exportAndTranscode_hdr10File_whenHdrEditingUnsupported_toneMapsOrThrows";
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
if (deviceSupportsHdrEditing(VIDEO_H265, HDR10_DEFAULT_COLOR_INFO)) {
|
||||
recordTestSkipped(context, testId, /* reason= */ "Device supports HDR10 editing.");
|
||||
@ -223,9 +221,9 @@ public class HdrEditingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void transformAndTranscode_hlg10File_whenHdrEditingUnsupported_toneMapsOrThrows()
|
||||
public void exportAndTranscode_hlg10File_whenHdrEditingUnsupported_toneMapsOrThrows()
|
||||
throws Exception {
|
||||
String testId = "transformAndTranscode_hlg10File_whenHdrEditingUnsupported_toneMapsOrThrows";
|
||||
String testId = "exportAndTranscode_hlg10File_whenHdrEditingUnsupported_toneMapsOrThrows";
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
if (deviceSupportsHdrEditing(VIDEO_H265, HLG10_DEFAULT_COLOR_INFO)) {
|
||||
recordTestSkipped(context, testId, /* reason= */ "Device supports HLG10 editing.");
|
||||
@ -277,8 +275,8 @@ public class HdrEditingTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void transformUnexpectedColorInfo() throws Exception {
|
||||
String testId = "transformUnexpectedColorInfo";
|
||||
public void exportUnexpectedColorInfo() throws Exception {
|
||||
String testId = "exportUnexpectedColorInfo";
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
if (Util.SDK_INT < 29) {
|
||||
recordTestSkipped(
|
||||
|
@ -51,8 +51,8 @@ public class ToneMapHdrToSdrUsingMediaCodecTest {
|
||||
public static final String TAG = "ToneMapHdrToSdrUsingMediaCodecTest";
|
||||
|
||||
@Test
|
||||
public void transform_toneMapNoRequestedTranscode_hdr10File_toneMapsOrThrows() throws Exception {
|
||||
String testId = "transform_toneMapNoRequestedTranscode_hdr10File_toneMapsOrThrows";
|
||||
public void export_toneMapNoRequestedTranscode_hdr10File_toneMapsOrThrows() throws Exception {
|
||||
String testId = "export_toneMapNoRequestedTranscode_hdr10File_toneMapsOrThrows";
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
|
||||
Transformer transformer =
|
||||
@ -93,8 +93,8 @@ public class ToneMapHdrToSdrUsingMediaCodecTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void transform_toneMapNoRequestedTranscode_hlg10File_toneMapsOrThrows() throws Exception {
|
||||
String testId = "transform_toneMapNoRequestedTranscode_hlg10File_toneMapsOrThrows";
|
||||
public void export_toneMapNoRequestedTranscode_hlg10File_toneMapsOrThrows() throws Exception {
|
||||
String testId = "export_toneMapNoRequestedTranscode_hlg10File_toneMapsOrThrows";
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
|
||||
Transformer transformer =
|
||||
@ -135,8 +135,8 @@ public class ToneMapHdrToSdrUsingMediaCodecTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void transform_toneMapAndTranscode_hdr10File_toneMapsOrThrows() throws Exception {
|
||||
String testId = "transform_toneMapAndTranscode_hdr10File_toneMapsOrThrows";
|
||||
public void export_toneMapAndTranscode_hdr10File_toneMapsOrThrows() throws Exception {
|
||||
String testId = "export_toneMapAndTranscode_hdr10File_toneMapsOrThrows";
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
|
||||
Transformer transformer =
|
||||
@ -182,8 +182,8 @@ public class ToneMapHdrToSdrUsingMediaCodecTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void transform_toneMapAndTranscode_hlg10File_toneMapsOrThrows() throws Exception {
|
||||
String testId = "transform_toneMapAndTranscode_hlg10File_toneMapsOrThrows";
|
||||
public void export_toneMapAndTranscode_hlg10File_toneMapsOrThrows() throws Exception {
|
||||
String testId = "export_toneMapAndTranscode_hlg10File_toneMapsOrThrows";
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
|
||||
Transformer transformer =
|
||||
|
@ -50,8 +50,8 @@ public class ToneMapHdrToSdrUsingOpenGlTest {
|
||||
public static final String TAG = "ToneMapHdrToSdrUsingOpenGlTest";
|
||||
|
||||
@Test
|
||||
public void transform_toneMap_hlg10File_toneMapsOrThrows() throws Exception {
|
||||
String testId = "transform_glToneMap_hlg10File_toneMapsOrThrows";
|
||||
public void export_toneMap_hlg10File_toneMapsOrThrows() throws Exception {
|
||||
String testId = "export_glToneMap_hlg10File_toneMapsOrThrows";
|
||||
|
||||
if (Util.SDK_INT < 29) {
|
||||
recordTestSkipped(
|
||||
@ -100,8 +100,8 @@ public class ToneMapHdrToSdrUsingOpenGlTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void transform_toneMap_hdr10File_toneMapsOrThrows() throws Exception {
|
||||
String testId = "transform_glToneMap_hdr10File_toneMapsOrThrows";
|
||||
public void export_toneMap_hdr10File_toneMapsOrThrows() throws Exception {
|
||||
String testId = "export_glToneMap_hdr10File_toneMapsOrThrows";
|
||||
|
||||
if (Util.SDK_INT < 29) {
|
||||
recordTestSkipped(
|
||||
|
@ -39,7 +39,7 @@ import org.junit.runner.RunWith;
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public final class TranscodeQualityTest {
|
||||
@Test
|
||||
public void transformHighQualityTargetingAvcToAvc1920x1080_ssimIsGreaterThan95Percent()
|
||||
public void exportHighQualityTargetingAvcToAvc1920x1080_ssimIsGreaterThan95Percent()
|
||||
throws Exception {
|
||||
Context context = ApplicationProvider.getApplicationContext();
|
||||
String testId = "transformHighQualityTargetingAvcToAvc1920x1080_ssim";
|
||||
|
@ -158,7 +158,7 @@ public class SsimMapperTest {
|
||||
private static final String TAG = "SsimBinarySearcher";
|
||||
private static final double SSIM_ACCEPTABLE_TOLERANCE = 0.005;
|
||||
private static final double SSIM_TARGET = 0.95;
|
||||
private static final int MAX_TRANSFORMATIONS = 12;
|
||||
private static final int MAX_EXPORTS = 12;
|
||||
|
||||
private final Context context;
|
||||
private final String testIdPrefix;
|
||||
@ -166,7 +166,7 @@ public class SsimMapperTest {
|
||||
private final Format format;
|
||||
private final String outputMimeType;
|
||||
|
||||
private int transformationsLeft;
|
||||
private int exportsLeft;
|
||||
private double ssimLowerBound;
|
||||
private double ssimUpperBound;
|
||||
private int bitrateLowerBound;
|
||||
@ -187,7 +187,7 @@ public class SsimMapperTest {
|
||||
this.testIdPrefix = testIdPrefix;
|
||||
this.videoUri = videoUri;
|
||||
this.outputMimeType = outputMimeType;
|
||||
transformationsLeft = MAX_TRANSFORMATIONS;
|
||||
exportsLeft = MAX_EXPORTS;
|
||||
format = AndroidTestUtil.getFormatForTestFile(videoUri);
|
||||
}
|
||||
|
||||
@ -208,7 +208,7 @@ public class SsimMapperTest {
|
||||
int maxBitrateToCheck = currentBitrate * 32;
|
||||
|
||||
do {
|
||||
double currentSsim = transformAndGetSsim(currentBitrate);
|
||||
double currentSsim = exportAndGetSsim(currentBitrate);
|
||||
if (isSsimAcceptable(currentSsim)) {
|
||||
return false;
|
||||
}
|
||||
@ -228,10 +228,9 @@ public class SsimMapperTest {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} while ((ssimLowerBound == SSIM_UNSET || ssimUpperBound == SSIM_UNSET)
|
||||
&& transformationsLeft > 0);
|
||||
} while ((ssimLowerBound == SSIM_UNSET || ssimUpperBound == SSIM_UNSET) && exportsLeft > 0);
|
||||
|
||||
return transformationsLeft > 0;
|
||||
return exportsLeft > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -240,19 +239,19 @@ public class SsimMapperTest {
|
||||
* <p>Performs a binary search of the bitrate between the {@link #bitrateLowerBound} and {@link
|
||||
* #bitrateUpperBound}.
|
||||
*
|
||||
* <p>Runs until the target SSIM is found or the maximum number of transformations is reached.
|
||||
* <p>Runs until the target SSIM is found or the maximum number of exports is reached.
|
||||
*/
|
||||
public void search() throws Exception {
|
||||
if (!setupBinarySearchBounds()) {
|
||||
return;
|
||||
}
|
||||
|
||||
while (transformationsLeft > 0) {
|
||||
while (exportsLeft > 0) {
|
||||
// At this point, we have under and over bitrate bounds, with associated SSIMs.
|
||||
// Go between the two, and replace either the under or the over.
|
||||
|
||||
int currentBitrate = (bitrateUpperBound + bitrateLowerBound) / 2;
|
||||
double currentSsim = transformAndGetSsim(currentBitrate);
|
||||
double currentSsim = exportAndGetSsim(currentBitrate);
|
||||
if (isSsimAcceptable(currentSsim)) {
|
||||
return;
|
||||
}
|
||||
@ -272,7 +271,7 @@ public class SsimMapperTest {
|
||||
}
|
||||
}
|
||||
|
||||
private double transformAndGetSsim(int bitrate) throws Exception {
|
||||
private double exportAndGetSsim(int bitrate) throws Exception {
|
||||
// TODO(b/238094555): Force specific encoders to be used.
|
||||
|
||||
String fileName = checkNotNull(getLast(FORWARD_SLASH_SPLITTER.split(videoUri)));
|
||||
@ -305,7 +304,7 @@ public class SsimMapperTest {
|
||||
.setRemoveAudio(true)
|
||||
.build();
|
||||
|
||||
transformationsLeft--;
|
||||
exportsLeft--;
|
||||
|
||||
double ssim =
|
||||
new TransformerAndroidTestRunner.Builder(context, transformer)
|
||||
|
@ -47,7 +47,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
private final AssetLoader.Listener assetLoaderListener;
|
||||
private final DecoderInputBuffer decoderInputBuffer;
|
||||
|
||||
private boolean isTransformationRunning;
|
||||
private boolean isRunning;
|
||||
private long streamStartPositionUs;
|
||||
|
||||
public ExoAssetLoaderBaseRenderer(
|
||||
@ -92,7 +92,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
@Override
|
||||
public void render(long positionUs, long elapsedRealtimeUs) {
|
||||
try {
|
||||
if (!isTransformationRunning || isEnded() || !ensureConfigured()) {
|
||||
if (!isRunning || isEnded() || !ensureConfigured()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
while (feedConsumerFromInput()) {}
|
||||
}
|
||||
} catch (ExportException e) {
|
||||
isTransformationRunning = false;
|
||||
isRunning = false;
|
||||
assetLoaderListener.onError(e);
|
||||
}
|
||||
}
|
||||
@ -120,12 +120,12 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
|
||||
@Override
|
||||
protected void onStarted() {
|
||||
isTransformationRunning = true;
|
||||
isRunning = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStopped() {
|
||||
isTransformationRunning = false;
|
||||
isRunning = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -144,7 +144,7 @@ public final class ExoPlayerAssetLoader implements AssetLoader {
|
||||
.setForceHighestSupportedBitrate(true)
|
||||
.build());
|
||||
// Arbitrarily decrease buffers for playback so that samples start being sent earlier to the
|
||||
// pipelines (rebuffers are less problematic for the transformation use case).
|
||||
// pipelines (rebuffers are less problematic for the export use case).
|
||||
DefaultLoadControl loadControl =
|
||||
new DefaultLoadControl.Builder()
|
||||
.setBufferDurationsMs(
|
||||
@ -282,7 +282,7 @@ public final class ExoPlayerAssetLoader implements AssetLoader {
|
||||
if (!window.isPlaceholder) {
|
||||
long durationUs = window.durationUs;
|
||||
// Make progress permanently unavailable if the duration is unknown, so that it doesn't jump
|
||||
// to a high value at the end of the transformation if the duration is set once the media is
|
||||
// to a high value at the end of the export if the duration is set once the media is
|
||||
// entirely loaded.
|
||||
progressState =
|
||||
durationUs <= 0 || durationUs == C.TIME_UNSET
|
||||
|
@ -41,7 +41,7 @@ import androidx.media3.common.util.Util;
|
||||
/**
|
||||
* Creates a new instance.
|
||||
*
|
||||
* @param composition The {@link Composition} to transform.
|
||||
* @param composition The {@link Composition} to export.
|
||||
* @param transformerListeners The {@linkplain Transformer.Listener listeners} to call {@link
|
||||
* Transformer.Listener#onFallbackApplied} on.
|
||||
* @param transformerListenerHandler The {@link HandlerWrapper} to call {@link
|
||||
|
@ -204,7 +204,7 @@ import java.nio.ByteBuffer;
|
||||
try {
|
||||
stopMuxer(mediaMuxer);
|
||||
} catch (RuntimeException e) {
|
||||
// It doesn't matter that stopping the muxer throws if the transformation is being cancelled.
|
||||
// It doesn't matter that stopping the muxer throws if the export is being cancelled.
|
||||
if (!forCancellation) {
|
||||
throw new MuxerException("Failed to stop the muxer", e);
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ public interface Muxer {
|
||||
*
|
||||
* <p>The muxer cannot be used anymore once this method has been called.
|
||||
*
|
||||
* @param forCancellation Whether the reason for releasing the resources is the transformation
|
||||
* @param forCancellation Whether the reason for releasing the resources is the export
|
||||
* cancellation.
|
||||
* @throws MuxerException If the muxer fails to finish writing the output and {@code
|
||||
* forCancellation} is false.
|
||||
@ -107,8 +107,8 @@ public interface Muxer {
|
||||
* <p>This is the maximum delay between samples of any track. They can be of the same or of
|
||||
* different track types.
|
||||
*
|
||||
* <p>This value is used to abort the transformation when the maximum delay is reached. Note that
|
||||
* there is no guarantee that the transformation will be aborted exactly at that time.
|
||||
* <p>This value is used to abort the export when the maximum delay is reached. Note that there is
|
||||
* no guarantee that the export will be aborted exactly at that time.
|
||||
*/
|
||||
long getMaxDelayBetweenSamplesMs();
|
||||
}
|
||||
|
@ -61,19 +61,19 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a reason for ending a transformation. May be one of {@link #END_REASON_COMPLETED},
|
||||
* {@link #END_REASON_CANCELLED} or {@link #END_REASON_ERROR}.
|
||||
* Represents a reason for ending an export. May be one of {@link #END_REASON_COMPLETED}, {@link
|
||||
* #END_REASON_CANCELLED} or {@link #END_REASON_ERROR}.
|
||||
*/
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@Target(TYPE_USE)
|
||||
@IntDef({END_REASON_COMPLETED, END_REASON_CANCELLED, END_REASON_ERROR})
|
||||
private @interface EndReason {}
|
||||
/** The transformation completed successfully. */
|
||||
/** The export completed successfully. */
|
||||
private static final int END_REASON_COMPLETED = 0;
|
||||
/** The transformation was cancelled. */
|
||||
/** The export was cancelled. */
|
||||
private static final int END_REASON_CANCELLED = 1;
|
||||
/** An error occurred during the transformation. */
|
||||
/** An error occurred during the export. */
|
||||
private static final int END_REASON_ERROR = 2;
|
||||
|
||||
// Internal messages.
|
||||
|
@ -131,7 +131,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_videoOnlyPassthrough_completesSuccessfully() throws Exception {
|
||||
public void start_videoOnlyPassthrough_completesSuccessfully() throws Exception {
|
||||
Transformer transformer = createTransformerBuilder(/* enableFallback= */ false).build();
|
||||
MediaItem mediaItem = MediaItem.fromUri(ASSET_URI_PREFIX + FILE_VIDEO_ONLY);
|
||||
|
||||
@ -142,7 +142,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_audioOnlyPassthrough_completesSuccessfully() throws Exception {
|
||||
public void start_audioOnlyPassthrough_completesSuccessfully() throws Exception {
|
||||
Transformer transformer = createTransformerBuilder(/* enableFallback= */ false).build();
|
||||
MediaItem mediaItem = MediaItem.fromUri(ASSET_URI_PREFIX + FILE_AUDIO_UNSUPPORTED_BY_ENCODER);
|
||||
|
||||
@ -154,7 +154,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_audioOnlyTranscoding_completesSuccessfully() throws Exception {
|
||||
public void start_audioOnlyTranscoding_completesSuccessfully() throws Exception {
|
||||
Transformer transformer =
|
||||
createTransformerBuilder(/* enableFallback= */ false)
|
||||
.setTransformationRequest(
|
||||
@ -172,7 +172,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_audioAndVideo_completesSuccessfully() throws Exception {
|
||||
public void start_audioAndVideo_completesSuccessfully() throws Exception {
|
||||
Transformer transformer = createTransformerBuilder(/* enableFallback= */ false).build();
|
||||
MediaItem mediaItem = MediaItem.fromUri(ASSET_URI_PREFIX + FILE_AUDIO_VIDEO);
|
||||
|
||||
@ -183,7 +183,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_audioAndVideo_withClippingStartAtKeyFrame_completesSuccessfully()
|
||||
public void start_audioAndVideo_withClippingStartAtKeyFrame_completesSuccessfully()
|
||||
throws Exception {
|
||||
Transformer transformer = createTransformerBuilder(/* enableFallback= */ false).build();
|
||||
MediaItem mediaItem =
|
||||
@ -207,7 +207,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_withSubtitles_completesSuccessfully() throws Exception {
|
||||
public void start_withSubtitles_completesSuccessfully() throws Exception {
|
||||
Transformer transformer =
|
||||
createTransformerBuilder(/* enableFallback= */ false)
|
||||
.setTransformationRequest(
|
||||
@ -222,8 +222,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_successiveTransformations_completesSuccessfully()
|
||||
throws Exception {
|
||||
public void start_successiveExports_completesSuccessfully() throws Exception {
|
||||
Transformer transformer = createTransformerBuilder(/* enableFallback= */ false).build();
|
||||
MediaItem mediaItem = MediaItem.fromUri(ASSET_URI_PREFIX + FILE_AUDIO_VIDEO);
|
||||
|
||||
@ -240,7 +239,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_concurrentTransformations_throwsError() {
|
||||
public void start_concurrentExports_throwsError() {
|
||||
Transformer transformer = createTransformerBuilder(/* enableFallback= */ false).build();
|
||||
MediaItem mediaItem = MediaItem.fromUri(ASSET_URI_PREFIX + FILE_VIDEO_ONLY);
|
||||
|
||||
@ -250,7 +249,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_removeAudio_completesSuccessfully() throws Exception {
|
||||
public void start_removeAudio_completesSuccessfully() throws Exception {
|
||||
Transformer transformer = createTransformerBuilder(/* enableFallback= */ false).build();
|
||||
EditedMediaItem editedMediaItem =
|
||||
new EditedMediaItem.Builder(MediaItem.fromUri(ASSET_URI_PREFIX + FILE_AUDIO_VIDEO))
|
||||
@ -265,7 +264,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_removeVideo_completesSuccessfully() throws Exception {
|
||||
public void start_removeVideo_completesSuccessfully() throws Exception {
|
||||
Transformer transformer = createTransformerBuilder(/* enableFallback= */ false).build();
|
||||
EditedMediaItem editedMediaItem =
|
||||
new EditedMediaItem.Builder(MediaItem.fromUri(ASSET_URI_PREFIX + FILE_AUDIO_VIDEO))
|
||||
@ -280,7 +279,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_silentAudioOnAudioOnly_isIgnored() throws Exception {
|
||||
public void start_silentAudioOnAudioOnly_isIgnored() throws Exception {
|
||||
Transformer transformer =
|
||||
createTransformerBuilder(/* enableFallback= */ false)
|
||||
.experimentalSetGenerateSilentAudio(true)
|
||||
@ -295,7 +294,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_silentAudioOnAudioVideo_isIgnored() throws Exception {
|
||||
public void start_silentAudioOnAudioVideo_isIgnored() throws Exception {
|
||||
Transformer transformer =
|
||||
createTransformerBuilder(/* enableFallback= */ false)
|
||||
.experimentalSetGenerateSilentAudio(true)
|
||||
@ -309,7 +308,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_silentAudioRemoveAudio_completesSuccessfully() throws Exception {
|
||||
public void start_silentAudioRemoveAudio_completesSuccessfully() throws Exception {
|
||||
Transformer transformer =
|
||||
createTransformerBuilder(/* enableFallback= */ false)
|
||||
.experimentalSetGenerateSilentAudio(true)
|
||||
@ -327,7 +326,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_silentAudioRemoveVideo_isIgnored() throws Exception {
|
||||
public void start_silentAudioRemoveVideo_isIgnored() throws Exception {
|
||||
Transformer transformer =
|
||||
createTransformerBuilder(/* enableFallback= */ false)
|
||||
.experimentalSetGenerateSilentAudio(true)
|
||||
@ -344,7 +343,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_silentAudioOnVideoOnly_completesSuccessfully() throws Exception {
|
||||
public void start_silentAudioOnVideoOnly_completesSuccessfully() throws Exception {
|
||||
Transformer transformer =
|
||||
createTransformerBuilder(/* enableFallback= */ false)
|
||||
.experimentalSetGenerateSilentAudio(true)
|
||||
@ -359,7 +358,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_adjustSampleRate_completesSuccessfully() throws Exception {
|
||||
public void start_adjustSampleRate_completesSuccessfully() throws Exception {
|
||||
SonicAudioProcessor sonicAudioProcessor = new SonicAudioProcessor();
|
||||
sonicAudioProcessor.setOutputSampleRateHz(48000);
|
||||
Transformer transformer = createTransformerBuilder(/* enableFallback= */ false).build();
|
||||
@ -377,8 +376,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_concatenateMediaItemsWithSameFormat_completesSuccessfully()
|
||||
throws Exception {
|
||||
public void start_concatenateMediaItemsWithSameFormat_completesSuccessfully() throws Exception {
|
||||
Transformer transformer =
|
||||
createTransformerBuilder(/* enableFallback= */ false).setTransmux(true).build();
|
||||
MediaItem mediaItem = MediaItem.fromUri(ASSET_URI_PREFIX + FILE_AUDIO_VIDEO);
|
||||
@ -397,9 +395,8 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void
|
||||
startTransformation_concatenateMediaItemsWithSameFormatAndEffects_completesSuccessfully()
|
||||
throws Exception {
|
||||
public void start_concatenateMediaItemsWithSameFormatAndEffects_completesSuccessfully()
|
||||
throws Exception {
|
||||
Transformer transformer = createTransformerBuilder(/* enableFallback= */ false).build();
|
||||
MediaItem mediaItem = MediaItem.fromUri(ASSET_URI_PREFIX + FILE_AUDIO_VIDEO);
|
||||
AudioProcessor audioProcessor = new SilenceSkippingAudioProcessor();
|
||||
@ -425,7 +422,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_singleMediaItemAndTransmux_ignoresTransmux() throws Exception {
|
||||
public void start_singleMediaItemAndTransmux_ignoresTransmux() throws Exception {
|
||||
SonicAudioProcessor sonicAudioProcessor = new SonicAudioProcessor();
|
||||
sonicAudioProcessor.setOutputSampleRateHz(48000);
|
||||
Transformer transformer =
|
||||
@ -444,8 +441,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_multipleMediaItemsWithEffectsAndTransmux_ignoresTransmux()
|
||||
throws Exception {
|
||||
public void start_multipleMediaItemsWithEffectsAndTransmux_ignoresTransmux() throws Exception {
|
||||
Transformer transformer =
|
||||
createTransformerBuilder(/* enableFallback= */ false).setTransmux(true).build();
|
||||
MediaItem mediaItem = MediaItem.fromUri(ASSET_URI_PREFIX + FILE_AUDIO_VIDEO);
|
||||
@ -470,7 +466,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_withMultipleListeners_callsEachOnCompletion() throws Exception {
|
||||
public void start_withMultipleListeners_callsEachOnCompletion() throws Exception {
|
||||
Transformer.Listener mockListener1 = mock(Transformer.Listener.class);
|
||||
Transformer.Listener mockListener2 = mock(Transformer.Listener.class);
|
||||
Transformer.Listener mockListener3 = mock(Transformer.Listener.class);
|
||||
@ -492,7 +488,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_withMultipleListeners_callsEachOnError() {
|
||||
public void start_withMultipleListeners_callsEachOnError() {
|
||||
Transformer.Listener mockListener1 = mock(Transformer.Listener.class);
|
||||
Transformer.Listener mockListener2 = mock(Transformer.Listener.class);
|
||||
Transformer.Listener mockListener3 = mock(Transformer.Listener.class);
|
||||
@ -517,7 +513,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_withMultipleListeners_callsEachOnFallback() throws Exception {
|
||||
public void start_withMultipleListeners_callsEachOnFallback() throws Exception {
|
||||
Transformer.Listener mockListener1 = mock(Transformer.Listener.class);
|
||||
Transformer.Listener mockListener2 = mock(Transformer.Listener.class);
|
||||
Transformer.Listener mockListener3 = mock(Transformer.Listener.class);
|
||||
@ -551,7 +547,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_success_callsDeprecatedCompletionCallbacks() throws Exception {
|
||||
public void start_success_callsDeprecatedCompletionCallbacks() throws Exception {
|
||||
AtomicBoolean deprecatedFallbackCalled1 = new AtomicBoolean();
|
||||
AtomicBoolean deprecatedFallbackCalled2 = new AtomicBoolean();
|
||||
Transformer transformer =
|
||||
@ -582,7 +578,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_withError_callsDeprecatedErrorCallbacks() throws Exception {
|
||||
public void start_withError_callsDeprecatedErrorCallbacks() throws Exception {
|
||||
AtomicBoolean deprecatedFallbackCalled1 = new AtomicBoolean();
|
||||
AtomicBoolean deprecatedFallbackCalled2 = new AtomicBoolean();
|
||||
AtomicBoolean deprecatedFallbackCalled3 = new AtomicBoolean();
|
||||
@ -629,7 +625,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_withFallback_callsDeprecatedFallbackCallbacks() throws Exception {
|
||||
public void start_withFallback_callsDeprecatedFallbackCallbacks() throws Exception {
|
||||
AtomicBoolean deprecatedFallbackCalled = new AtomicBoolean();
|
||||
Transformer transformer =
|
||||
createTransformerBuilder(/* enableFallback= */ true)
|
||||
@ -653,7 +649,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_afterBuildUponWithListenerRemoved_onlyCallsRemainingListeners()
|
||||
public void start_afterBuildUponWithListenerRemoved_onlyCallsRemainingListeners()
|
||||
throws Exception {
|
||||
Transformer.Listener mockListener1 = mock(Transformer.Listener.class);
|
||||
Transformer.Listener mockListener2 = mock(Transformer.Listener.class);
|
||||
@ -676,7 +672,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_flattenForSlowMotion_completesSuccessfully() throws Exception {
|
||||
public void start_flattenForSlowMotion_completesSuccessfully() throws Exception {
|
||||
Transformer transformer = createTransformerBuilder(/* enableFallback= */ false).build();
|
||||
EditedMediaItem editedMediaItem =
|
||||
new EditedMediaItem.Builder(MediaItem.fromUri(ASSET_URI_PREFIX + FILE_WITH_SEF_SLOW_MOTION))
|
||||
@ -690,7 +686,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_completesWithValidBitrate() throws Exception {
|
||||
public void start_completesWithValidBitrate() throws Exception {
|
||||
Transformer transformer = createTransformerBuilder(/* enableFallback= */ false).build();
|
||||
MediaItem mediaItem = MediaItem.fromUri(ASSET_URI_PREFIX + FILE_AUDIO_VIDEO);
|
||||
|
||||
@ -702,7 +698,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_withAudioEncoderFormatUnsupported_completesWithError() {
|
||||
public void start_withAudioEncoderFormatUnsupported_completesWithError() {
|
||||
Transformer transformer =
|
||||
createTransformerBuilder(/* enableFallback= */ false)
|
||||
.setTransformationRequest(
|
||||
@ -722,7 +718,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_withAudioDecoderFormatUnsupported_completesWithError() {
|
||||
public void start_withAudioDecoderFormatUnsupported_completesWithError() {
|
||||
Transformer transformer =
|
||||
createTransformerBuilder(/* enableFallback= */ false)
|
||||
.setTransformationRequest(
|
||||
@ -741,7 +737,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_withIoError_completesWithError() {
|
||||
public void start_withIoError_completesWithError() {
|
||||
Transformer transformer = createTransformerBuilder(/* enableFallback= */ false).build();
|
||||
MediaItem mediaItem = MediaItem.fromUri("asset:///non-existing-path.mp4");
|
||||
|
||||
@ -753,8 +749,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_withAudioMuxerFormatUnsupported_completesSuccessfully()
|
||||
throws Exception {
|
||||
public void start_withAudioMuxerFormatUnsupported_completesSuccessfully() throws Exception {
|
||||
// Test succeeds because MIME type fallback is mandatory.
|
||||
Transformer.Listener mockListener = mock(Transformer.Listener.class);
|
||||
TransformationRequest originalTransformationRequest =
|
||||
@ -778,8 +773,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_withAudioMuxerFormatFallback_completesSuccessfully()
|
||||
throws Exception {
|
||||
public void start_withAudioMuxerFormatFallback_completesSuccessfully() throws Exception {
|
||||
Transformer.Listener mockListener = mock(Transformer.Listener.class);
|
||||
TransformationRequest originalTransformationRequest =
|
||||
new TransformationRequest.Builder().build();
|
||||
@ -802,7 +796,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_withSlowOutputSampleRate_completesWithError() {
|
||||
public void start_withSlowOutputSampleRate_completesWithError() {
|
||||
MediaSource.Factory mediaSourceFactory =
|
||||
new DefaultMediaSourceFactory(
|
||||
context, new SlowExtractorsFactory(/* delayBetweenReadsMs= */ 10));
|
||||
@ -825,8 +819,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_withUnsetMaxDelayBetweenSamples_completesSuccessfully()
|
||||
throws Exception {
|
||||
public void start_withUnsetMaxDelayBetweenSamples_completesSuccessfully() throws Exception {
|
||||
Muxer.Factory muxerFactory = new TestMuxerFactory(/* maxDelayBetweenSamplesMs= */ C.TIME_UNSET);
|
||||
Transformer transformer =
|
||||
createTransformerBuilder(/* enableFallback= */ false).setMuxerFactory(muxerFactory).build();
|
||||
@ -839,7 +832,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_afterCancellation_completesSuccessfully() throws Exception {
|
||||
public void start_afterCancellation_completesSuccessfully() throws Exception {
|
||||
Transformer transformer = createTransformerBuilder(/* enableFallback= */ false).build();
|
||||
MediaItem mediaItem = MediaItem.fromUri(ASSET_URI_PREFIX + FILE_AUDIO_VIDEO);
|
||||
|
||||
@ -847,16 +840,16 @@ public final class TransformerEndToEndTest {
|
||||
transformer.cancel();
|
||||
Files.delete(Paths.get(outputPath));
|
||||
|
||||
// This would throw if the previous transformation had not been cancelled.
|
||||
// This would throw if the previous export had not been cancelled.
|
||||
transformer.start(mediaItem, outputPath);
|
||||
ExportResult exportResult = TransformerTestRunner.runLooper(transformer);
|
||||
|
||||
// TODO(b/264974805): Make transformation output deterministic and check it against dump file.
|
||||
// TODO(b/264974805): Make export output deterministic and check it against dump file.
|
||||
assertThat(exportResult.exportException).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_fromSpecifiedThread_completesSuccessfully() throws Exception {
|
||||
public void start_fromSpecifiedThread_completesSuccessfully() throws Exception {
|
||||
HandlerThread anotherThread = new HandlerThread("AnotherThread");
|
||||
anotherThread.start();
|
||||
Looper looper = anotherThread.getLooper();
|
||||
@ -885,7 +878,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_fromWrongThread_throwsError() throws Exception {
|
||||
public void start_fromWrongThread_throwsError() throws Exception {
|
||||
Transformer transformer = createTransformerBuilder(/* enableFallback= */ false).build();
|
||||
MediaItem mediaItem = MediaItem.fromUri(ASSET_URI_PREFIX + FILE_AUDIO_VIDEO);
|
||||
HandlerThread anotherThread = new HandlerThread("AnotherThread");
|
||||
@ -910,8 +903,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_withAssetLoaderAlwaysDecoding_pipelineExpectsDecoded()
|
||||
throws Exception {
|
||||
public void start_withAssetLoaderAlwaysDecoding_pipelineExpectsDecoded() throws Exception {
|
||||
AtomicReference<SampleConsumer> sampleConsumerRef = new AtomicReference<>();
|
||||
Transformer transformer =
|
||||
createTransformerBuilder(/* enableFallback= */ false)
|
||||
@ -927,7 +919,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_withAssetLoaderNotDecodingAndDecodingNeeded_completesWithError() {
|
||||
public void start_withAssetLoaderNotDecodingAndDecodingNeeded_completesWithError() {
|
||||
Transformer transformer =
|
||||
createTransformerBuilder(/* enableFallback= */ false)
|
||||
.setAssetLoaderFactory(
|
||||
@ -948,7 +940,7 @@ public final class TransformerEndToEndTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startTransformation_withNoOpEffects_transmuxes() throws Exception {
|
||||
public void start_withNoOpEffects_transmuxes() throws Exception {
|
||||
Transformer transformer = createTransformerBuilder(/* enableFallback= */ false).build();
|
||||
MediaItem mediaItem = MediaItem.fromUri(ASSET_URI_PREFIX + FILE_VIDEO_ONLY);
|
||||
int mediaItemHeightPixels = 720;
|
||||
@ -1041,15 +1033,14 @@ public final class TransformerEndToEndTest {
|
||||
|
||||
assertThat(progresses).isInOrder();
|
||||
if (!progresses.isEmpty()) {
|
||||
// The progress list could be empty if the transformation ends before any progress can be
|
||||
// retrieved.
|
||||
// The progress list could be empty if the export ends before any progress can be retrieved.
|
||||
assertThat(progresses.get(0)).isAtLeast(0);
|
||||
assertThat(Iterables.getLast(progresses)).isLessThan(100);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getProgress_noCurrentTransformation_returnsNoTransformation() throws Exception {
|
||||
public void getProgress_noCurrentExport_returnsNotStarted() throws Exception {
|
||||
Transformer transformer = createTransformerBuilder(/* enableFallback= */ false).build();
|
||||
MediaItem mediaItem = MediaItem.fromUri(ASSET_URI_PREFIX + FILE_VIDEO_ONLY);
|
||||
|
||||
|
@ -36,7 +36,7 @@ public final class TransformerTestRunner {
|
||||
*
|
||||
* @param transformer The {@link Transformer}.
|
||||
* @return The {@link ExportResult}.
|
||||
* @throws ExportException If the transformation threw an exception.
|
||||
* @throws ExportException If the export threw an exception.
|
||||
* @throws TimeoutException If the {@link RobolectricUtil#DEFAULT_TIMEOUT_MS default timeout} is
|
||||
* exceeded.
|
||||
* @throws IllegalStateException If the method is not called from the main thread.
|
||||
|
Loading…
x
Reference in New Issue
Block a user