Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4cc5080d
authored
Feb 16, 2023
by
kimvde
Committed by
christosts
Feb 17, 2023
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Rename occurrences of transform in lib-transformer
PiperOrigin-RevId: 510118760
parent
37768ed0
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
116 additions
and
129 deletions
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/FallbackDetails.java
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/TransformerAndroidTestRunner.java
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/HdrEditingTest.java
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/ToneMapHdrToSdrUsingMediaCodecTest.java
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/ToneMapHdrToSdrUsingOpenGlTest.java
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/TranscodeQualityTest.java
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/analysis/SsimMapperTest.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/ExoAssetLoaderBaseRenderer.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/ExoPlayerAssetLoader.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FallbackListener.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FrameworkMuxer.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/Muxer.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerInternal.java
library/transformer/src/test/java/com/google/android/exoplayer2/transformer/TransformerEndToEndTest.java
library/transformer/src/test/java/com/google/android/exoplayer2/transformer/TransformerTestRunner.java
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/FallbackDetails.java
View file @
4cc5080d
...
...
@@ -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
{
...
...
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/TransformerAndroidTestRunner.java
View file @
4cc5080d
...
...
@@ -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
())
...
...
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/HdrEditingTest.java
View file @
4cc5080d
...
...
@@ -69,8 +69,8 @@ public class HdrEditingTest {
.
build
();
@Test
public
void
transform_noRequestedTranscode_hdr10File_transform
sOrThrows
()
throws
Exception
{
String
testId
=
"
transform_noRequestedTranscode_hdr10File_transform
sOrThrows"
;
public
void
export_noRequestedTranscode_hdr10File_export
sOrThrows
()
throws
Exception
{
String
testId
=
"
export_noRequestedTranscode_hdr10File_export
sOrThrows"
;
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
,
"
Transform
ed."
);
Log
.
i
(
TAG
,
"
Export
ed."
);
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_transform
sOrThrows
()
throws
Exception
{
String
testId
=
"
transform_noRequestedTranscode_hlg10File_transform
sOrThrows"
;
public
void
export_noRequestedTranscode_hlg10File_export
sOrThrows
()
throws
Exception
{
String
testId
=
"
export_noRequestedTranscode_hlg10File_export
sOrThrows"
;
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
,
"
Transform
ed."
);
Log
.
i
(
TAG
,
"
Export
ed."
);
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
transform
AndTranscode_hdr10File_whenHdrEditingUnsupported_toneMapsOrThrows
()
public
void
export
AndTranscode_hdr10File_whenHdrEditingUnsupported_toneMapsOrThrows
()
throws
Exception
{
String
testId
=
"
transform
AndTranscode_hdr10File_whenHdrEditingUnsupported_toneMapsOrThrows"
;
String
testId
=
"
export
AndTranscode_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
transform
AndTranscode_hlg10File_whenHdrEditingUnsupported_toneMapsOrThrows
()
public
void
export
AndTranscode_hlg10File_whenHdrEditingUnsupported_toneMapsOrThrows
()
throws
Exception
{
String
testId
=
"
transform
AndTranscode_hlg10File_whenHdrEditingUnsupported_toneMapsOrThrows"
;
String
testId
=
"
export
AndTranscode_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
transform
UnexpectedColorInfo
()
throws
Exception
{
String
testId
=
"
transform
UnexpectedColorInfo"
;
public
void
export
UnexpectedColorInfo
()
throws
Exception
{
String
testId
=
"
export
UnexpectedColorInfo"
;
Context
context
=
ApplicationProvider
.
getApplicationContext
();
if
(
Util
.
SDK_INT
<
29
)
{
recordTestSkipped
(
...
...
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/ToneMapHdrToSdrUsingMediaCodecTest.java
View file @
4cc5080d
...
...
@@ -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
=
...
...
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/ToneMapHdrToSdrUsingOpenGlTest.java
View file @
4cc5080d
...
...
@@ -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
(
...
...
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/TranscodeQualityTest.java
View file @
4cc5080d
...
...
@@ -39,7 +39,7 @@ import org.junit.runner.RunWith;
@RunWith
(
AndroidJUnit4
.
class
)
public
final
class
TranscodeQualityTest
{
@Test
public
void
transform
HighQualityTargetingAvcToAvc1920x1080_ssimIsGreaterThan95Percent
()
public
void
export
HighQualityTargetingAvcToAvc1920x1080_ssimIsGreaterThan95Percent
()
throws
Exception
{
Context
context
=
ApplicationProvider
.
getApplicationContext
();
String
testId
=
"transformHighQualityTargetingAvcToAvc1920x1080_ssim"
;
...
...
library/transformer/src/androidTest/java/com/google/android/exoplayer2/transformer/mh/analysis/SsimMapperTest.java
View file @
4cc5080d
...
...
@@ -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_
TRANSFORMATION
S
=
12
;
private
static
final
int
MAX_
EXPORT
S
=
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
transformation
sLeft
;
private
int
export
sLeft
;
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_TRANSFORMATION
S
;
exportsLeft
=
MAX_EXPORT
S
;
format
=
AndroidTestUtil
.
getFormatForTestFile
(
videoUri
);
}
...
...
@@ -208,7 +208,7 @@ public class SsimMapperTest {
int
maxBitrateToCheck
=
currentBitrate
*
32
;
do
{
double
currentSsim
=
transform
AndGetSsim
(
currentBitrate
);
double
currentSsim
=
export
AndGetSsim
(
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
transformation
sLeft
>
0
;
return
export
sLeft
>
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
transformation
s is reached.
* <p>Runs until the target SSIM is found or the maximum number of
export
s is reached.
*/
public
void
search
()
throws
Exception
{
if
(!
setupBinarySearchBounds
())
{
return
;
}
while
(
transformation
sLeft
>
0
)
{
while
(
export
sLeft
>
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
=
transform
AndGetSsim
(
currentBitrate
);
double
currentSsim
=
export
AndGetSsim
(
currentBitrate
);
if
(
isSsimAcceptable
(
currentSsim
))
{
return
;
}
...
...
@@ -272,7 +271,7 @@ public class SsimMapperTest {
}
}
private
double
transform
AndGetSsim
(
int
bitrate
)
throws
Exception
{
private
double
export
AndGetSsim
(
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
();
transformation
sLeft
--;
export
sLeft
--;
double
ssim
=
new
TransformerAndroidTestRunner
.
Builder
(
context
,
transformer
)
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/ExoAssetLoaderBaseRenderer.java
View file @
4cc5080d
...
...
@@ -47,7 +47,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
private
final
AssetLoader
.
Listener
assetLoaderListener
;
private
final
DecoderInputBuffer
decoderInputBuffer
;
private
boolean
is
Transformation
Running
;
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
(!
is
Transformation
Running
||
isEnded
()
||
!
ensureConfigured
())
{
if
(!
isRunning
||
isEnded
()
||
!
ensureConfigured
())
{
return
;
}
...
...
@@ -102,7 +102,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
while
(
feedConsumerFromInput
())
{}
}
}
catch
(
ExportException
e
)
{
is
Transformation
Running
=
false
;
isRunning
=
false
;
assetLoaderListener
.
onError
(
e
);
}
}
...
...
@@ -120,12 +120,12 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
@Override
protected
void
onStarted
()
{
is
Transformation
Running
=
true
;
isRunning
=
true
;
}
@Override
protected
void
onStopped
()
{
is
Transformation
Running
=
false
;
isRunning
=
false
;
}
@Override
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/ExoPlayerAssetLoader.java
View file @
4cc5080d
...
...
@@ -142,7 +142,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
(
...
...
@@ -280,7 +280,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
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FallbackListener.java
View file @
4cc5080d
...
...
@@ -41,7 +41,7 @@ import com.google.android.exoplayer2.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
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/FrameworkMuxer.java
View file @
4cc5080d
...
...
@@ -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
);
}
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/Muxer.java
View file @
4cc5080d
...
...
@@ -91,7 +91,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.
...
...
@@ -105,8 +105,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
();
}
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerInternal.java
View file @
4cc5080d
...
...
@@ -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 a
n 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.
...
...
library/transformer/src/test/java/com/google/android/exoplayer2/transformer/TransformerEndToEndTest.java
View file @
4cc5080d
...
...
@@ -131,7 +131,7 @@ public final class TransformerEndToEndTest {
}
@Test
public
void
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation_concurrentTransformation
s_throwsError
()
{
public
void
start
_concurrentExport
s_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_withAudioEncoderFormatUnsupported_completesWithError
()
{
public
void
start_withAudioEncoderFormatUnsupported_completesWithError
()
{
Transformer
transformer
=
createTransformerBuilder
(
/* enableFallback= */
false
)
.
setTransformationRequest
(
...
...
@@ -722,7 +718,7 @@ public final class TransformerEndToEndTest {
}
@Test
public
void
start
Transformation
_withAudioDecoderFormatUnsupported_completesWithError
()
{
public
void
start_withAudioDecoderFormatUnsupported_completesWithError
()
{
Transformer
transformer
=
createTransformerBuilder
(
/* enableFallback= */
false
)
.
setTransformationRequest
(
...
...
@@ -741,7 +737,7 @@ public final class TransformerEndToEndTest {
}
@Test
public
void
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_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
start
Transformation
_withAssetLoaderNotDecodingAndDecodingNeeded_completesWithError
()
{
public
void
start_withAssetLoaderNotDecodingAndDecodingNeeded_completesWithError
()
{
Transformer
transformer
=
createTransformerBuilder
(
/* enableFallback= */
false
)
.
setAssetLoaderFactory
(
...
...
@@ -948,7 +940,7 @@ public final class TransformerEndToEndTest {
}
@Test
public
void
start
Transformation
_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_noCurrent
Transformation_returnsNoTransformation
()
throws
Exception
{
public
void
getProgress_noCurrent
Export_returnsNotStarted
()
throws
Exception
{
Transformer
transformer
=
createTransformerBuilder
(
/* enableFallback= */
false
).
build
();
MediaItem
mediaItem
=
MediaItem
.
fromUri
(
ASSET_URI_PREFIX
+
FILE_VIDEO_ONLY
);
...
...
library/transformer/src/test/java/com/google/android/exoplayer2/transformer/TransformerTestRunner.java
View file @
4cc5080d
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment