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
83074c0d
authored
Feb 03, 2023
by
kimvde
Committed by
microkatz
Feb 08, 2023
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Rename Transformer callbacks
PiperOrigin-RevId: 506890459
parent
eb4b6f81
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
56 additions
and
61 deletions
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/AssetLoader.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/CompositeAssetLoader.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/ImageAssetLoader.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/MuxerWrapper.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/Transformer.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerInternal.java
library/transformer/src/test/java/com/google/android/exoplayer2/transformer/ExoPlayerAssetLoaderTest.java
library/transformer/src/test/java/com/google/android/exoplayer2/transformer/TransformerEndToEndTest.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/AssetLoader.java
View file @
83074c0d
...
@@ -108,7 +108,7 @@ public interface AssetLoader {
...
@@ -108,7 +108,7 @@ public interface AssetLoader {
* Called if an error occurs in the asset loader. In this case, the asset loader will be
* Called if an error occurs in the asset loader. In this case, the asset loader will be
* {@linkplain #release() released} automatically.
* {@linkplain #release() released} automatically.
*/
*/
void
on
Transformation
Error
(
TransformationException
exception
);
void
onError
(
TransformationException
exception
);
}
}
/**
/**
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/CompositeAssetLoader.java
View file @
83074c0d
...
@@ -189,8 +189,8 @@ import java.util.concurrent.atomic.AtomicLong;
...
@@ -189,8 +189,8 @@ import java.util.concurrent.atomic.AtomicLong;
}
}
@Override
@Override
public
void
on
Transformation
Error
(
TransformationException
exception
)
{
public
void
onError
(
TransformationException
exception
)
{
compositeAssetLoaderListener
.
on
Transformation
Error
(
exception
);
compositeAssetLoaderListener
.
onError
(
exception
);
}
}
private
final
class
SampleConsumerWrapper
implements
SampleConsumer
{
private
final
class
SampleConsumerWrapper
implements
SampleConsumer
{
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/ExoAssetLoaderBaseRenderer.java
View file @
83074c0d
...
@@ -103,7 +103,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -103,7 +103,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
}
}
}
catch
(
TransformationException
e
)
{
}
catch
(
TransformationException
e
)
{
isTransformationRunning
=
false
;
isTransformationRunning
=
false
;
assetLoaderListener
.
on
Transformation
Error
(
e
);
assetLoaderListener
.
onError
(
e
);
}
}
}
}
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/ExoPlayerAssetLoader.java
View file @
83074c0d
...
@@ -300,7 +300,7 @@ public final class ExoPlayerAssetLoader implements AssetLoader {
...
@@ -300,7 +300,7 @@ public final class ExoPlayerAssetLoader implements AssetLoader {
trackCount
++;
trackCount
++;
}
}
if
(
trackCount
==
0
)
{
if
(
trackCount
==
0
)
{
assetLoaderListener
.
on
Transformation
Error
(
assetLoaderListener
.
onError
(
TransformationException
.
createForAssetLoader
(
TransformationException
.
createForAssetLoader
(
new
IllegalStateException
(
"The asset loader has no track to output."
),
new
IllegalStateException
(
"The asset loader has no track to output."
),
ERROR_CODE_FAILED_RUNTIME_CHECK
));
ERROR_CODE_FAILED_RUNTIME_CHECK
));
...
@@ -320,8 +320,7 @@ public final class ExoPlayerAssetLoader implements AssetLoader {
...
@@ -320,8 +320,7 @@ public final class ExoPlayerAssetLoader implements AssetLoader {
checkNotNull
(
checkNotNull
(
TransformationException
.
NAME_TO_ERROR_CODE
.
getOrDefault
(
TransformationException
.
NAME_TO_ERROR_CODE
.
getOrDefault
(
error
.
getErrorCodeName
(),
ERROR_CODE_UNSPECIFIED
));
error
.
getErrorCodeName
(),
ERROR_CODE_UNSPECIFIED
));
assetLoaderListener
.
onTransformationError
(
assetLoaderListener
.
onError
(
TransformationException
.
createForAssetLoader
(
error
,
errorCode
));
TransformationException
.
createForAssetLoader
(
error
,
errorCode
));
}
}
}
}
}
}
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/ImageAssetLoader.java
View file @
83074c0d
...
@@ -100,9 +100,9 @@ public final class ImageAssetLoader implements AssetLoader {
...
@@ -100,9 +100,9 @@ public final class ImageAssetLoader implements AssetLoader {
bitmap
,
editedMediaItem
.
durationUs
,
editedMediaItem
.
frameRate
);
bitmap
,
editedMediaItem
.
durationUs
,
editedMediaItem
.
frameRate
);
sampleConsumer
.
signalEndOfVideoInput
();
sampleConsumer
.
signalEndOfVideoInput
();
}
catch
(
TransformationException
e
)
{
}
catch
(
TransformationException
e
)
{
listener
.
on
Transformation
Error
(
e
);
listener
.
onError
(
e
);
}
catch
(
RuntimeException
e
)
{
}
catch
(
RuntimeException
e
)
{
listener
.
on
Transformation
Error
(
listener
.
onError
(
TransformationException
.
createForAssetLoader
(
e
,
ERROR_CODE_UNSPECIFIED
));
TransformationException
.
createForAssetLoader
(
e
,
ERROR_CODE_UNSPECIFIED
));
}
}
progress
=
100
;
progress
=
100
;
...
@@ -110,7 +110,7 @@ public final class ImageAssetLoader implements AssetLoader {
...
@@ -110,7 +110,7 @@ public final class ImageAssetLoader implements AssetLoader {
@Override
@Override
public
void
onFailure
(
Throwable
t
)
{
public
void
onFailure
(
Throwable
t
)
{
listener
.
on
Transformation
Error
(
listener
.
onError
(
TransformationException
.
createForAssetLoader
(
t
,
ERROR_CODE_IO_UNSPECIFIED
));
TransformationException
.
createForAssetLoader
(
t
,
ERROR_CODE_IO_UNSPECIFIED
));
}
}
},
},
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/MuxerWrapper.java
View file @
83074c0d
...
@@ -53,7 +53,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -53,7 +53,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
void
onEnded
(
long
durationMs
,
long
fileSizeBytes
);
void
onEnded
(
long
durationMs
,
long
fileSizeBytes
);
void
on
Transformation
Error
(
TransformationException
transformationException
);
void
onError
(
TransformationException
transformationException
);
}
}
/**
/**
...
@@ -276,7 +276,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
...
@@ -276,7 +276,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
return
;
return
;
}
}
isAborted
=
true
;
isAborted
=
true
;
listener
.
on
Transformation
Error
(
listener
.
onError
(
TransformationException
.
createForMuxer
(
TransformationException
.
createForMuxer
(
new
IllegalStateException
(
new
IllegalStateException
(
"No output sample written in the last "
"No output sample written in the last "
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/Transformer.java
View file @
83074c0d
...
@@ -217,7 +217,7 @@ public final class Transformer {
...
@@ -217,7 +217,7 @@ public final class Transformer {
}
}
/**
/**
* Adds a {@link Transformer.Listener} to listen to the
transformation
events.
* Adds a {@link Transformer.Listener} to listen to the
export
events.
*
*
* <p>This is equivalent to {@link Transformer#addListener(Listener)}.
* <p>This is equivalent to {@link Transformer#addListener(Listener)}.
*
*
...
@@ -443,19 +443,17 @@ public final class Transformer {
...
@@ -443,19 +443,17 @@ public final class Transformer {
}
}
}
}
/** A listener for the
transformation
events. */
/** A listener for the
export
events. */
public
interface
Listener
{
public
interface
Listener
{
/**
/**
* @deprecated Use {@link #onTransformationCompleted(Composition, TransformationResult)}
* @deprecated Use {@link #onCompleted(Composition, TransformationResult)} instead.
* instead.
*/
*/
@Deprecated
@Deprecated
default
void
onTransformationCompleted
(
MediaItem
inputMediaItem
)
{}
default
void
onTransformationCompleted
(
MediaItem
inputMediaItem
)
{}
/**
/**
* @deprecated Use {@link #onTransformationCompleted(Composition, TransformationResult)}
* @deprecated Use {@link #onCompleted(Composition, TransformationResult)} instead.
* instead.
*/
*/
@Deprecated
@Deprecated
default
void
onTransformationCompleted
(
MediaItem
inputMediaItem
,
TransformationResult
result
)
{
default
void
onTransformationCompleted
(
MediaItem
inputMediaItem
,
TransformationResult
result
)
{
...
@@ -463,26 +461,26 @@ public final class Transformer {
...
@@ -463,26 +461,26 @@ public final class Transformer {
}
}
/**
/**
* Called when the
transformation
is completed successfully.
* Called when the
export
is completed successfully.
*
*
* @param composition The {@link Composition} for which the
transformation
is completed.
* @param composition The {@link Composition} for which the
export
is completed.
* @param result The {@link TransformationResult} of the
transformation
.
* @param result The {@link TransformationResult} of the
export
.
*/
*/
default
void
on
Transformation
Completed
(
Composition
composition
,
TransformationResult
result
)
{
default
void
onCompleted
(
Composition
composition
,
TransformationResult
result
)
{
MediaItem
mediaItem
=
composition
.
sequences
.
get
(
0
).
editedMediaItems
.
get
(
0
).
mediaItem
;
MediaItem
mediaItem
=
composition
.
sequences
.
get
(
0
).
editedMediaItems
.
get
(
0
).
mediaItem
;
onTransformationCompleted
(
mediaItem
,
result
);
onTransformationCompleted
(
mediaItem
,
result
);
}
}
/**
/**
* @deprecated Use {@link #on
TransformationError(Composition, TransformationResult,
* @deprecated Use {@link #on
Error(Composition, TransformationResult, TransformationException)}
*
TransformationException)}
instead.
* instead.
*/
*/
@Deprecated
@Deprecated
default
void
onTransformationError
(
MediaItem
inputMediaItem
,
Exception
exception
)
{}
default
void
onTransformationError
(
MediaItem
inputMediaItem
,
Exception
exception
)
{}
/**
/**
* @deprecated Use {@link #on
TransformationError(Composition, TransformationResult,
* @deprecated Use {@link #on
Error(Composition, TransformationResult, TransformationException)}
*
TransformationException)}
instead.
* instead.
*/
*/
@Deprecated
@Deprecated
default
void
onTransformationError
(
default
void
onTransformationError
(
...
@@ -491,8 +489,8 @@ public final class Transformer {
...
@@ -491,8 +489,8 @@ public final class Transformer {
}
}
/**
/**
* @deprecated Use {@link #on
TransformationError(Composition, TransformationResult,
* @deprecated Use {@link #on
Error(Composition, TransformationResult, TransformationException)}
*
TransformationException)}
instead.
* instead.
*/
*/
@Deprecated
@Deprecated
default
void
onTransformationError
(
default
void
onTransformationError
(
...
@@ -501,13 +499,15 @@ public final class Transformer {
...
@@ -501,13 +499,15 @@ public final class Transformer {
}
}
/**
/**
* Called if an exception occurs during the
transformation
.
* Called if an exception occurs during the
export
.
*
*
* @param composition The {@link Composition} for which the exception occurs.
* @param composition The {@link Composition} for which the exception occurs.
* @param result The {@link TransformationResult} of the transformation.
* @param result The {@link TransformationResult} of the export.
* @param exception The {@link TransformationException} describing the exception.
* @param exception The {@link TransformationException} describing the exception. This is the
* same instance as the {@linkplain TransformationResult#transformationException exception}
* in {@code result}.
*/
*/
default
void
on
Transformation
Error
(
default
void
onError
(
Composition
composition
,
TransformationResult
result
,
TransformationException
exception
)
{
Composition
composition
,
TransformationResult
result
,
TransformationException
exception
)
{
MediaItem
mediaItem
=
composition
.
sequences
.
get
(
0
).
editedMediaItems
.
get
(
0
).
mediaItem
;
MediaItem
mediaItem
=
composition
.
sequences
.
get
(
0
).
editedMediaItems
.
get
(
0
).
mediaItem
;
onTransformationError
(
mediaItem
,
result
,
exception
);
onTransformationError
(
mediaItem
,
result
,
exception
);
...
@@ -527,7 +527,7 @@ public final class Transformer {
...
@@ -527,7 +527,7 @@ public final class Transformer {
* Called when falling back to an alternative {@link TransformationRequest} or changing the
* Called when falling back to an alternative {@link TransformationRequest} or changing the
* video frames' resolution is necessary to comply with muxer or device constraints.
* video frames' resolution is necessary to comply with muxer or device constraints.
*
*
* @param composition The {@link Composition} for which the
transformation
is requested.
* @param composition The {@link Composition} for which the
export
is requested.
* @param originalTransformationRequest The unsupported {@link TransformationRequest} used when
* @param originalTransformationRequest The unsupported {@link TransformationRequest} used when
* building {@link Transformer}.
* building {@link Transformer}.
* @param fallbackTransformationRequest The alternative {@link TransformationRequest}, with
* @param fallbackTransformationRequest The alternative {@link TransformationRequest}, with
...
@@ -644,7 +644,7 @@ public final class Transformer {
...
@@ -644,7 +644,7 @@ public final class Transformer {
}
}
/**
/**
* Adds a {@link Transformer.Listener} to listen to the
transformation
events.
* Adds a {@link Transformer.Listener} to listen to the
export
events.
*
*
* @param listener A {@link Transformer.Listener}.
* @param listener A {@link Transformer.Listener}.
* @throws IllegalStateException If this method is called from the wrong thread.
* @throws IllegalStateException If this method is called from the wrong thread.
...
@@ -788,8 +788,8 @@ public final class Transformer {
...
@@ -788,8 +788,8 @@ public final class Transformer {
* Returns the current {@link ProgressState} and updates {@code progressHolder} with the current
* Returns the current {@link ProgressState} and updates {@code progressHolder} with the current
* progress if it is {@link #PROGRESS_STATE_AVAILABLE available}.
* progress if it is {@link #PROGRESS_STATE_AVAILABLE available}.
*
*
* <p>After a transformation {@linkplain Listener#on
TransformationCompleted(Composition,
* <p>After a transformation {@linkplain Listener#on
Completed(Composition, TransformationResult)
*
TransformationResult)
completes}, this method returns {@link #PROGRESS_STATE_NOT_STARTED}.
* completes}, this method returns {@link #PROGRESS_STATE_NOT_STARTED}.
*
*
* @param progressHolder A {@link ProgressHolder}, updated to hold the percentage progress if
* @param progressHolder A {@link ProgressHolder}, updated to hold the percentage progress if
* {@link #PROGRESS_STATE_AVAILABLE available}.
* {@link #PROGRESS_STATE_AVAILABLE available}.
...
@@ -835,22 +835,21 @@ public final class Transformer {
...
@@ -835,22 +835,21 @@ public final class Transformer {
}
}
@Override
@Override
public
void
on
Transformation
Completed
(
TransformationResult
transformationResult
)
{
public
void
onCompleted
(
TransformationResult
transformationResult
)
{
// TODO(b/213341814): Add event flags for Transformer events.
// TODO(b/213341814): Add event flags for Transformer events.
transformerInternal
=
null
;
transformerInternal
=
null
;
listeners
.
queueEvent
(
listeners
.
queueEvent
(
/* eventFlag= */
C
.
INDEX_UNSET
,
/* eventFlag= */
C
.
INDEX_UNSET
,
listener
->
listener
.
on
Transformation
Completed
(
composition
,
transformationResult
));
listener
->
listener
.
onCompleted
(
composition
,
transformationResult
));
listeners
.
flushEvents
();
listeners
.
flushEvents
();
}
}
@Override
@Override
public
void
onTransformationError
(
public
void
onError
(
TransformationResult
result
,
TransformationException
exception
)
{
TransformationResult
result
,
TransformationException
exception
)
{
transformerInternal
=
null
;
transformerInternal
=
null
;
listeners
.
queueEvent
(
listeners
.
queueEvent
(
/* eventFlag= */
C
.
INDEX_UNSET
,
/* eventFlag= */
C
.
INDEX_UNSET
,
listener
->
listener
.
on
Transformation
Error
(
composition
,
result
,
exception
));
listener
->
listener
.
onError
(
composition
,
result
,
exception
));
listeners
.
flushEvents
();
listeners
.
flushEvents
();
}
}
}
}
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerInternal.java
View file @
83074c0d
...
@@ -57,9 +57,9 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -57,9 +57,9 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
public
interface
Listener
{
public
interface
Listener
{
void
on
Transformation
Completed
(
TransformationResult
result
);
void
onCompleted
(
TransformationResult
result
);
void
on
Transformation
Error
(
TransformationResult
result
,
TransformationException
exception
);
void
onError
(
TransformationResult
result
,
TransformationException
exception
);
}
}
/**
/**
...
@@ -299,12 +299,11 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -299,12 +299,11 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
TransformationException
finalException
=
exception
;
TransformationException
finalException
=
exception
;
applicationHandler
.
post
(
applicationHandler
.
post
(
()
->
()
->
listener
.
on
Transformation
Error
(
listener
.
onError
(
transformationResultBuilder
.
setTransformationException
(
finalException
).
build
(),
transformationResultBuilder
.
setTransformationException
(
finalException
).
build
(),
finalException
));
finalException
));
}
else
{
}
else
{
applicationHandler
.
post
(
applicationHandler
.
post
(()
->
listener
.
onCompleted
(
transformationResultBuilder
.
build
()));
()
->
listener
.
onTransformationCompleted
(
transformationResultBuilder
.
build
()));
}
}
}
}
...
@@ -334,7 +333,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -334,7 +333,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
// AssetLoader.Listener and MuxerWrapper.Listener implementation.
// AssetLoader.Listener and MuxerWrapper.Listener implementation.
@Override
@Override
public
void
on
Transformation
Error
(
TransformationException
transformationException
)
{
public
void
onError
(
TransformationException
transformationException
)
{
internalHandler
internalHandler
.
obtainMessage
(
MSG_END
,
END_REASON_ERROR
,
/* unused */
0
,
transformationException
)
.
obtainMessage
(
MSG_END
,
END_REASON_ERROR
,
/* unused */
0
,
transformationException
)
.
sendToTarget
();
.
sendToTarget
();
...
@@ -350,7 +349,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -350,7 +349,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
@Override
@Override
public
void
onTrackCount
(
int
trackCount
)
{
public
void
onTrackCount
(
int
trackCount
)
{
if
(
trackCount
<=
0
)
{
if
(
trackCount
<=
0
)
{
on
Transformation
Error
(
onError
(
TransformationException
.
createForAssetLoader
(
TransformationException
.
createForAssetLoader
(
new
IllegalStateException
(
"AssetLoader instances must provide at least 1 track."
),
new
IllegalStateException
(
"AssetLoader instances must provide at least 1 track."
),
ERROR_CODE_FAILED_RUNTIME_CHECK
));
ERROR_CODE_FAILED_RUNTIME_CHECK
));
...
@@ -492,7 +491,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -492,7 +491,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
firstEditedMediaItem
.
effects
.
frameProcessorFactory
,
firstEditedMediaItem
.
effects
.
frameProcessorFactory
,
encoderFactory
,
encoderFactory
,
muxerWrapper
,
muxerWrapper
,
/* errorConsumer= */
this
::
on
Transformation
Error
,
/* errorConsumer= */
this
::
onError
,
fallbackListener
,
fallbackListener
,
debugViewProvider
);
debugViewProvider
);
}
else
{
}
else
{
...
...
library/transformer/src/test/java/com/google/android/exoplayer2/transformer/ExoPlayerAssetLoaderTest.java
View file @
83074c0d
...
@@ -85,7 +85,7 @@ public class ExoPlayerAssetLoaderTest {
...
@@ -85,7 +85,7 @@ public class ExoPlayerAssetLoaderTest {
}
}
@Override
@Override
public
void
on
Transformation
Error
(
TransformationException
e
)
{
public
void
onError
(
TransformationException
e
)
{
exceptionRef
.
set
(
e
);
exceptionRef
.
set
(
e
);
}
}
...
...
library/transformer/src/test/java/com/google/android/exoplayer2/transformer/TransformerEndToEndTest.java
View file @
83074c0d
...
@@ -392,10 +392,10 @@ public final class TransformerEndToEndTest {
...
@@ -392,10 +392,10 @@ public final class TransformerEndToEndTest {
transformer
.
startTransformation
(
mediaItem
,
outputPath
);
transformer
.
startTransformation
(
mediaItem
,
outputPath
);
TransformerTestRunner
.
runLooper
(
transformer
);
TransformerTestRunner
.
runLooper
(
transformer
);
verify
(
mockListener1
).
on
Transformation
Completed
(
compositionArgumentCaptor
.
capture
(),
any
());
verify
(
mockListener1
).
onCompleted
(
compositionArgumentCaptor
.
capture
(),
any
());
Composition
composition
=
compositionArgumentCaptor
.
getValue
();
Composition
composition
=
compositionArgumentCaptor
.
getValue
();
verify
(
mockListener2
).
on
Transformation
Completed
(
eq
(
composition
),
any
());
verify
(
mockListener2
).
onCompleted
(
eq
(
composition
),
any
());
verify
(
mockListener3
).
on
Transformation
Completed
(
eq
(
composition
),
any
());
verify
(
mockListener3
).
onCompleted
(
eq
(
composition
),
any
());
}
}
@Test
@Test
...
@@ -418,11 +418,10 @@ public final class TransformerEndToEndTest {
...
@@ -418,11 +418,10 @@ public final class TransformerEndToEndTest {
assertThrows
(
assertThrows
(
TransformationException
.
class
,
()
->
TransformerTestRunner
.
runLooper
(
transformer
));
TransformationException
.
class
,
()
->
TransformerTestRunner
.
runLooper
(
transformer
));
verify
(
mockListener1
)
verify
(
mockListener1
).
onError
(
compositionArgumentCaptor
.
capture
(),
any
(),
eq
(
exception
));
.
onTransformationError
(
compositionArgumentCaptor
.
capture
(),
any
(),
eq
(
exception
));
Composition
composition
=
compositionArgumentCaptor
.
getValue
();
Composition
composition
=
compositionArgumentCaptor
.
getValue
();
verify
(
mockListener2
).
on
Transformation
Error
(
eq
(
composition
),
any
(),
eq
(
exception
));
verify
(
mockListener2
).
onError
(
eq
(
composition
),
any
(),
eq
(
exception
));
verify
(
mockListener3
).
on
Transformation
Error
(
eq
(
composition
),
any
(),
eq
(
exception
));
verify
(
mockListener3
).
onError
(
eq
(
composition
),
any
(),
eq
(
exception
));
}
}
@Test
@Test
...
@@ -579,10 +578,9 @@ public final class TransformerEndToEndTest {
...
@@ -579,10 +578,9 @@ public final class TransformerEndToEndTest {
transformer2
.
startTransformation
(
mediaItem
,
outputPath
);
transformer2
.
startTransformation
(
mediaItem
,
outputPath
);
TransformerTestRunner
.
runLooper
(
transformer2
);
TransformerTestRunner
.
runLooper
(
transformer2
);
verify
(
mockListener1
).
onTransformationCompleted
(
compositionArgumentCaptor
.
capture
(),
any
());
verify
(
mockListener1
).
onCompleted
(
compositionArgumentCaptor
.
capture
(),
any
());
verify
(
mockListener2
,
never
()).
onTransformationCompleted
(
any
(
Composition
.
class
),
any
());
verify
(
mockListener2
,
never
()).
onCompleted
(
any
(
Composition
.
class
),
any
());
verify
(
mockListener3
)
verify
(
mockListener3
).
onCompleted
(
eq
(
compositionArgumentCaptor
.
getValue
()),
any
());
.
onTransformationCompleted
(
eq
(
compositionArgumentCaptor
.
getValue
()),
any
());
}
}
@Test
@Test
...
...
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