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
26fdb3e0
authored
Mar 28, 2023
by
kimvde
Committed by
Tianyi Feng
Mar 30, 2023
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add error code for muxer timeout
PiperOrigin-RevId: 519965132
parent
782f19ed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/ExportException.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/MuxerWrapper.java
library/transformer/src/test/java/com/google/android/exoplayer2/transformer/MediaItemExportTest.java
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/ExportException.java
View file @
26fdb3e0
...
...
@@ -67,6 +67,7 @@ public final class ExportException extends Exception {
ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED
,
ERROR_CODE_AUDIO_PROCESSING_FAILED
,
ERROR_CODE_MUXING_FAILED
,
ERROR_CODE_MUXING_TIMEOUT
,
})
public
@interface
ErrorCode
{}
...
...
@@ -161,6 +162,12 @@ public final class ExportException extends Exception {
/** Caused by a failure while muxing media samples. */
public
static
final
int
ERROR_CODE_MUXING_FAILED
=
7001
;
/**
* Caused by a timeout while muxing media samples.
*
* @see Muxer#getMaxDelayBetweenSamplesMs()
*/
public
static
final
int
ERROR_CODE_MUXING_TIMEOUT
=
7002
;
/* package */
static
final
ImmutableBiMap
<
String
,
@ErrorCode
Integer
>
NAME_TO_ERROR_CODE
=
new
ImmutableBiMap
.
Builder
<
String
,
@ErrorCode
Integer
>()
...
...
@@ -183,6 +190,7 @@ public final class ExportException extends Exception {
.
put
(
"ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED"
,
ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED
)
.
put
(
"ERROR_CODE_AUDIO_PROCESSING_FAILED"
,
ERROR_CODE_AUDIO_PROCESSING_FAILED
)
.
put
(
"ERROR_CODE_MUXING_FAILED"
,
ERROR_CODE_MUXING_FAILED
)
.
put
(
"ERROR_CODE_MUXING_TIMEOUT"
,
ERROR_CODE_MUXING_TIMEOUT
)
.
buildOrThrow
();
/** Returns the name of a given {@code errorCode}. */
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/MuxerWrapper.java
View file @
26fdb3e0
...
...
@@ -301,7 +301,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
"No output sample written in the last "
+
maxDelayBetweenSamplesMs
+
" milliseconds. Aborting transformation."
),
ExportException
.
ERROR_CODE_MUXING_
FAILED
));
ExportException
.
ERROR_CODE_MUXING_
TIMEOUT
));
},
maxDelayBetweenSamplesMs
,
MILLISECONDS
);
...
...
library/transformer/src/test/java/com/google/android/exoplayer2/transformer/MediaItemExportTest.java
View file @
26fdb3e0
...
...
@@ -821,7 +821,7 @@ public final class MediaItemExportTest {
ExportException
exception
=
assertThrows
(
ExportException
.
class
,
()
->
TransformerTestRunner
.
runLooper
(
transformer
));
assertThat
(
exception
).
hasCauseThat
().
isInstanceOf
(
IllegalStateException
.
class
);
assertThat
(
exception
.
errorCode
).
isEqualTo
(
ExportException
.
ERROR_CODE_MUXING_
FAILED
);
assertThat
(
exception
.
errorCode
).
isEqualTo
(
ExportException
.
ERROR_CODE_MUXING_
TIMEOUT
);
}
@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