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
35ae6b44
authored
Mar 21, 2023
by
tofunmi
Committed by
Tianyi Feng
Mar 30, 2023
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Log export errors that occur after export completes
PiperOrigin-RevId: 518281002
parent
aa186085
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
demos/transformer/src/main/java/com/google/android/exoplayer2/transformerdemo/TransformerActivity.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
demos/transformer/src/main/java/com/google/android/exoplayer2/transformerdemo/TransformerActivity.java
View file @
35ae6b44
...
@@ -628,9 +628,7 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -628,9 +628,7 @@ public final class TransformerActivity extends AppCompatActivity {
"exportStopwatch"
,
"exportStopwatch"
,
})
})
private
void
onError
(
ExportException
exportException
)
{
private
void
onError
(
ExportException
exportException
)
{
if
(
exportStopwatch
.
isRunning
())
{
exportStopwatch
.
stop
();
exportStopwatch
.
stop
();
}
informationTextView
.
setText
(
R
.
string
.
export_error
);
informationTextView
.
setText
(
R
.
string
.
export_error
);
progressViewGroup
.
setVisibility
(
View
.
GONE
);
progressViewGroup
.
setVisibility
(
View
.
GONE
);
debugFrame
.
removeAllViews
();
debugFrame
.
removeAllViews
();
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/Transformer.java
View file @
35ae6b44
...
@@ -416,7 +416,12 @@ public final class Transformer {
...
@@ -416,7 +416,12 @@ public final class Transformer {
}
}
}
}
/** A listener for the export events. */
/**
* A listener for the export events.
*
* <p>If the export is not cancelled, either {@link #onError} or {@link #onCompleted} will be
* called once for each export.
*/
public
interface
Listener
{
public
interface
Listener
{
/**
/**
...
...
library/transformer/src/main/java/com/google/android/exoplayer2/transformer/TransformerInternal.java
View file @
35ae6b44
...
@@ -34,6 +34,7 @@ import android.content.Context;
...
@@ -34,6 +34,7 @@ import android.content.Context;
import
android.os.HandlerThread
;
import
android.os.HandlerThread
;
import
android.os.Looper
;
import
android.os.Looper
;
import
android.os.Message
;
import
android.os.Message
;
import
android.util.Log
;
import
androidx.annotation.IntDef
;
import
androidx.annotation.IntDef
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.C
;
...
@@ -90,6 +91,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -90,6 +91,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
private
static
final
int
MSG_END
=
3
;
private
static
final
int
MSG_END
=
3
;
private
static
final
int
MSG_UPDATE_PROGRESS
=
4
;
private
static
final
int
MSG_UPDATE_PROGRESS
=
4
;
private
static
final
String
TAG
=
"TransformerInternal"
;
private
static
final
int
DRAIN_PIPELINES_DELAY_MS
=
10
;
private
static
final
int
DRAIN_PIPELINES_DELAY_MS
=
10
;
private
final
Context
context
;
private
final
Context
context
;
...
@@ -322,6 +324,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -322,6 +324,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
boolean
forCancellation
=
endReason
==
END_REASON_CANCELLED
;
boolean
forCancellation
=
endReason
==
END_REASON_CANCELLED
;
@Nullable
ExportException
releaseExportException
=
null
;
@Nullable
ExportException
releaseExportException
=
null
;
boolean
releasedPreviously
=
released
;
if
(!
released
)
{
if
(!
released
)
{
released
=
true
;
released
=
true
;
for
(
int
i
=
0
;
i
<
sequenceAssetLoaders
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
sequenceAssetLoaders
.
size
();
i
++)
{
...
@@ -378,12 +381,19 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -378,12 +381,19 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
}
}
if
(
exception
!=
null
)
{
if
(
exception
!=
null
)
{
if
(
releasedPreviously
)
{
Log
.
e
(
TAG
,
"Export error after export ended: "
,
exception
);
return
;
}
ExportException
finalException
=
exception
;
ExportException
finalException
=
exception
;
applicationHandler
.
post
(
applicationHandler
.
post
(
()
->
()
->
listener
.
onError
(
listener
.
onError
(
exportResultBuilder
.
setExportException
(
finalException
).
build
(),
finalException
));
exportResultBuilder
.
setExportException
(
finalException
).
build
(),
finalException
));
}
else
{
}
else
{
if
(
releasedPreviously
)
{
return
;
}
applicationHandler
.
post
(()
->
listener
.
onCompleted
(
exportResultBuilder
.
build
()));
applicationHandler
.
post
(()
->
listener
.
onCompleted
(
exportResultBuilder
.
build
()));
}
}
}
}
...
...
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