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
ae91615a
authored
Feb 17, 2023
by
kimvde
Committed by
christosts
Feb 17, 2023
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Rename occurences of transform in demo app
PiperOrigin-RevId: 510384933
parent
a4ad85d2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
48 deletions
demos/transformer/src/main/java/com/google/android/exoplayer2/transformerdemo/ConfigurationActivity.java
demos/transformer/src/main/java/com/google/android/exoplayer2/transformerdemo/TransformerActivity.java
demos/transformer/src/main/res/layout/configuration_activity.xml
demos/transformer/src/main/res/values/strings.xml
demos/transformer/src/main/java/com/google/android/exoplayer2/transformerdemo/ConfigurationActivity.java
View file @
ae91615a
...
@@ -55,7 +55,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
...
@@ -55,7 +55,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import
org.checkerframework.checker.nullness.qual.RequiresNonNull
;
import
org.checkerframework.checker.nullness.qual.RequiresNonNull
;
/**
/**
* An {@link Activity} that sets the configuration to use for
transform
ing and playing media, using
* An {@link Activity} that sets the configuration to use for
export
ing and playing media, using
* {@link TransformerActivity}.
* {@link TransformerActivity}.
*/
*/
public
final
class
ConfigurationActivity
extends
AppCompatActivity
{
public
final
class
ConfigurationActivity
extends
AppCompatActivity
{
...
@@ -73,7 +73,7 @@ public final class ConfigurationActivity extends AppCompatActivity {
...
@@ -73,7 +73,7 @@ public final class ConfigurationActivity extends AppCompatActivity {
public
static
final
String
TRIM_END_MS
=
"trim_end_ms"
;
public
static
final
String
TRIM_END_MS
=
"trim_end_ms"
;
public
static
final
String
ENABLE_FALLBACK
=
"enable_fallback"
;
public
static
final
String
ENABLE_FALLBACK
=
"enable_fallback"
;
public
static
final
String
ENABLE_DEBUG_PREVIEW
=
"enable_debug_preview"
;
public
static
final
String
ENABLE_DEBUG_PREVIEW
=
"enable_debug_preview"
;
public
static
final
String
ABORT_SLOW_
TRANSFORMATION
=
"abort_slow_transformation
"
;
public
static
final
String
ABORT_SLOW_
EXPORT
=
"abort_slow_export
"
;
public
static
final
String
HDR_MODE
=
"hdr_mode"
;
public
static
final
String
HDR_MODE
=
"hdr_mode"
;
public
static
final
String
AUDIO_EFFECTS_SELECTIONS
=
"audio_effects_selections"
;
public
static
final
String
AUDIO_EFFECTS_SELECTIONS
=
"audio_effects_selections"
;
public
static
final
String
VIDEO_EFFECTS_SELECTIONS
=
"video_effects_selections"
;
public
static
final
String
VIDEO_EFFECTS_SELECTIONS
=
"video_effects_selections"
;
...
@@ -222,7 +222,7 @@ public final class ConfigurationActivity extends AppCompatActivity {
...
@@ -222,7 +222,7 @@ public final class ConfigurationActivity extends AppCompatActivity {
private
@MonotonicNonNull
CheckBox
trimCheckBox
;
private
@MonotonicNonNull
CheckBox
trimCheckBox
;
private
@MonotonicNonNull
CheckBox
enableFallbackCheckBox
;
private
@MonotonicNonNull
CheckBox
enableFallbackCheckBox
;
private
@MonotonicNonNull
CheckBox
enableDebugPreviewCheckBox
;
private
@MonotonicNonNull
CheckBox
enableDebugPreviewCheckBox
;
private
@MonotonicNonNull
CheckBox
abortSlow
Transformation
CheckBox
;
private
@MonotonicNonNull
CheckBox
abortSlow
Export
CheckBox
;
private
@MonotonicNonNull
Spinner
hdrModeSpinner
;
private
@MonotonicNonNull
Spinner
hdrModeSpinner
;
private
@MonotonicNonNull
Button
selectAudioEffectsButton
;
private
@MonotonicNonNull
Button
selectAudioEffectsButton
;
private
@MonotonicNonNull
Button
selectVideoEffectsButton
;
private
@MonotonicNonNull
Button
selectVideoEffectsButton
;
...
@@ -255,7 +255,7 @@ public final class ConfigurationActivity extends AppCompatActivity {
...
@@ -255,7 +255,7 @@ public final class ConfigurationActivity extends AppCompatActivity {
super
.
onCreate
(
savedInstanceState
);
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
configuration_activity
);
setContentView
(
R
.
layout
.
configuration_activity
);
findViewById
(
R
.
id
.
transform_button
).
setOnClickListener
(
this
::
startTransformation
);
findViewById
(
R
.
id
.
export_button
).
setOnClickListener
(
this
::
startExport
);
selectPresetFileButton
=
findViewById
(
R
.
id
.
select_preset_file_button
);
selectPresetFileButton
=
findViewById
(
R
.
id
.
select_preset_file_button
);
selectPresetFileButton
.
setOnClickListener
(
this
::
selectPresetFile
);
selectPresetFileButton
.
setOnClickListener
(
this
::
selectPresetFile
);
...
@@ -325,7 +325,7 @@ public final class ConfigurationActivity extends AppCompatActivity {
...
@@ -325,7 +325,7 @@ public final class ConfigurationActivity extends AppCompatActivity {
enableFallbackCheckBox
=
findViewById
(
R
.
id
.
enable_fallback_checkbox
);
enableFallbackCheckBox
=
findViewById
(
R
.
id
.
enable_fallback_checkbox
);
enableDebugPreviewCheckBox
=
findViewById
(
R
.
id
.
enable_debug_preview_checkbox
);
enableDebugPreviewCheckBox
=
findViewById
(
R
.
id
.
enable_debug_preview_checkbox
);
abortSlow
TransformationCheckBox
=
findViewById
(
R
.
id
.
abort_slow_transformation
_checkbox
);
abortSlow
ExportCheckBox
=
findViewById
(
R
.
id
.
abort_slow_export
_checkbox
);
ArrayAdapter
<
String
>
hdrModeAdapter
=
ArrayAdapter
<
String
>
hdrModeAdapter
=
new
ArrayAdapter
<>(
/* context= */
this
,
R
.
layout
.
spinner_item
);
new
ArrayAdapter
<>(
/* context= */
this
,
R
.
layout
.
spinner_item
);
...
@@ -394,12 +394,12 @@ public final class ConfigurationActivity extends AppCompatActivity {
...
@@ -394,12 +394,12 @@ public final class ConfigurationActivity extends AppCompatActivity {
"trimCheckBox"
,
"trimCheckBox"
,
"enableFallbackCheckBox"
,
"enableFallbackCheckBox"
,
"enableDebugPreviewCheckBox"
,
"enableDebugPreviewCheckBox"
,
"abortSlow
Transformation
CheckBox"
,
"abortSlow
Export
CheckBox"
,
"hdrModeSpinner"
,
"hdrModeSpinner"
,
"audioEffectsSelections"
,
"audioEffectsSelections"
,
"videoEffectsSelections"
"videoEffectsSelections"
})
})
private
void
start
Transformation
(
View
view
)
{
private
void
start
Export
(
View
view
)
{
Intent
transformerIntent
=
new
Intent
(
/* packageContext= */
this
,
TransformerActivity
.
class
);
Intent
transformerIntent
=
new
Intent
(
/* packageContext= */
this
,
TransformerActivity
.
class
);
Bundle
bundle
=
new
Bundle
();
Bundle
bundle
=
new
Bundle
();
bundle
.
putBoolean
(
SHOULD_REMOVE_AUDIO
,
removeAudioCheckbox
.
isChecked
());
bundle
.
putBoolean
(
SHOULD_REMOVE_AUDIO
,
removeAudioCheckbox
.
isChecked
());
...
@@ -435,7 +435,7 @@ public final class ConfigurationActivity extends AppCompatActivity {
...
@@ -435,7 +435,7 @@ public final class ConfigurationActivity extends AppCompatActivity {
}
}
bundle
.
putBoolean
(
ENABLE_FALLBACK
,
enableFallbackCheckBox
.
isChecked
());
bundle
.
putBoolean
(
ENABLE_FALLBACK
,
enableFallbackCheckBox
.
isChecked
());
bundle
.
putBoolean
(
ENABLE_DEBUG_PREVIEW
,
enableDebugPreviewCheckBox
.
isChecked
());
bundle
.
putBoolean
(
ENABLE_DEBUG_PREVIEW
,
enableDebugPreviewCheckBox
.
isChecked
());
bundle
.
putBoolean
(
ABORT_SLOW_
TRANSFORMATION
,
abortSlowTransformation
CheckBox
.
isChecked
());
bundle
.
putBoolean
(
ABORT_SLOW_
EXPORT
,
abortSlowExport
CheckBox
.
isChecked
());
String
selectedhdrMode
=
String
.
valueOf
(
hdrModeSpinner
.
getSelectedItem
());
String
selectedhdrMode
=
String
.
valueOf
(
hdrModeSpinner
.
getSelectedItem
());
bundle
.
putInt
(
HDR_MODE
,
checkNotNull
(
HDR_MODE_DESCRIPTIONS
.
get
(
selectedhdrMode
)));
bundle
.
putInt
(
HDR_MODE
,
checkNotNull
(
HDR_MODE_DESCRIPTIONS
.
get
(
selectedhdrMode
)));
bundle
.
putBooleanArray
(
AUDIO_EFFECTS_SELECTIONS
,
audioEffectsSelections
);
bundle
.
putBooleanArray
(
AUDIO_EFFECTS_SELECTIONS
,
audioEffectsSelections
);
...
...
demos/transformer/src/main/java/com/google/android/exoplayer2/transformerdemo/TransformerActivity.java
View file @
ae91615a
...
@@ -105,7 +105,7 @@ import java.util.concurrent.TimeUnit;
...
@@ -105,7 +105,7 @@ import java.util.concurrent.TimeUnit;
import
org.checkerframework.checker.nullness.qual.MonotonicNonNull
;
import
org.checkerframework.checker.nullness.qual.MonotonicNonNull
;
import
org.checkerframework.checker.nullness.qual.RequiresNonNull
;
import
org.checkerframework.checker.nullness.qual.RequiresNonNull
;
/** An {@link Activity} that
transform
s and plays media using {@link Transformer}. */
/** An {@link Activity} that
export
s and plays media using {@link Transformer}. */
public
final
class
TransformerActivity
extends
AppCompatActivity
{
public
final
class
TransformerActivity
extends
AppCompatActivity
{
private
static
final
String
TAG
=
"TransformerActivity"
;
private
static
final
String
TAG
=
"TransformerActivity"
;
...
@@ -119,7 +119,7 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -119,7 +119,7 @@ public final class TransformerActivity extends AppCompatActivity {
private
@MonotonicNonNull
TextView
informationTextView
;
private
@MonotonicNonNull
TextView
informationTextView
;
private
@MonotonicNonNull
ViewGroup
progressViewGroup
;
private
@MonotonicNonNull
ViewGroup
progressViewGroup
;
private
@MonotonicNonNull
LinearProgressIndicator
progressIndicator
;
private
@MonotonicNonNull
LinearProgressIndicator
progressIndicator
;
private
@MonotonicNonNull
Stopwatch
transformation
Stopwatch
;
private
@MonotonicNonNull
Stopwatch
export
Stopwatch
;
private
@MonotonicNonNull
AspectRatioFrameLayout
debugFrame
;
private
@MonotonicNonNull
AspectRatioFrameLayout
debugFrame
;
@Nullable
private
DebugTextViewHelper
debugTextViewHelper
;
@Nullable
private
DebugTextViewHelper
debugTextViewHelper
;
...
@@ -146,7 +146,7 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -146,7 +146,7 @@ public final class TransformerActivity extends AppCompatActivity {
displayInputButton
=
findViewById
(
R
.
id
.
display_input_button
);
displayInputButton
=
findViewById
(
R
.
id
.
display_input_button
);
displayInputButton
.
setOnClickListener
(
this
::
toggleInputVideoDisplay
);
displayInputButton
.
setOnClickListener
(
this
::
toggleInputVideoDisplay
);
transformation
Stopwatch
=
export
Stopwatch
=
Stopwatch
.
createUnstarted
(
Stopwatch
.
createUnstarted
(
new
Ticker
()
{
new
Ticker
()
{
@Override
@Override
...
@@ -162,7 +162,7 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -162,7 +162,7 @@ public final class TransformerActivity extends AppCompatActivity {
checkNotNull
(
progressIndicator
);
checkNotNull
(
progressIndicator
);
checkNotNull
(
informationTextView
);
checkNotNull
(
informationTextView
);
checkNotNull
(
transformation
Stopwatch
);
checkNotNull
(
export
Stopwatch
);
checkNotNull
(
inputCardView
);
checkNotNull
(
inputCardView
);
checkNotNull
(
inputTextView
);
checkNotNull
(
inputTextView
);
checkNotNull
(
inputImageView
);
checkNotNull
(
inputImageView
);
...
@@ -172,7 +172,7 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -172,7 +172,7 @@ public final class TransformerActivity extends AppCompatActivity {
checkNotNull
(
progressViewGroup
);
checkNotNull
(
progressViewGroup
);
checkNotNull
(
debugFrame
);
checkNotNull
(
debugFrame
);
checkNotNull
(
displayInputButton
);
checkNotNull
(
displayInputButton
);
start
Transformation
();
start
Export
();
inputPlayerView
.
onResume
();
inputPlayerView
.
onResume
();
outputPlayerView
.
onResume
();
outputPlayerView
.
onResume
();
...
@@ -185,9 +185,9 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -185,9 +185,9 @@ public final class TransformerActivity extends AppCompatActivity {
checkNotNull
(
transformer
).
cancel
();
checkNotNull
(
transformer
).
cancel
();
transformer
=
null
;
transformer
=
null
;
// The stop watch is reset after cancelling the
transformation, in case cancelling causes the
// The stop watch is reset after cancelling the
export, in case cancelling causes the stop watch
//
stop watch
to be stopped in a transformer callback.
// to be stopped in a transformer callback.
checkNotNull
(
transformation
Stopwatch
).
reset
();
checkNotNull
(
export
Stopwatch
).
reset
();
checkNotNull
(
inputPlayerView
).
onPause
();
checkNotNull
(
inputPlayerView
).
onPause
();
checkNotNull
(
outputPlayerView
).
onPause
();
checkNotNull
(
outputPlayerView
).
onPause
();
...
@@ -207,11 +207,11 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -207,11 +207,11 @@ public final class TransformerActivity extends AppCompatActivity {
"debugTextView"
,
"debugTextView"
,
"informationTextView"
,
"informationTextView"
,
"progressIndicator"
,
"progressIndicator"
,
"
transformation
Stopwatch"
,
"
export
Stopwatch"
,
"progressViewGroup"
,
"progressViewGroup"
,
"debugFrame"
,
"debugFrame"
,
})
})
private
void
start
Transformation
()
{
private
void
start
Export
()
{
requestReadVideoPermission
(
/* activity= */
this
);
requestReadVideoPermission
(
/* activity= */
this
);
Intent
intent
=
getIntent
();
Intent
intent
=
getIntent
();
...
@@ -227,7 +227,7 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -227,7 +227,7 @@ public final class TransformerActivity extends AppCompatActivity {
try
{
try
{
Transformer
transformer
=
createTransformer
(
bundle
,
filePath
);
Transformer
transformer
=
createTransformer
(
bundle
,
filePath
);
EditedMediaItem
editedMediaItem
=
createEditedMediaItem
(
mediaItem
,
bundle
);
EditedMediaItem
editedMediaItem
=
createEditedMediaItem
(
mediaItem
,
bundle
);
transformation
Stopwatch
.
start
();
export
Stopwatch
.
start
();
transformer
.
start
(
editedMediaItem
,
filePath
);
transformer
.
start
(
editedMediaItem
,
filePath
);
this
.
transformer
=
transformer
;
this
.
transformer
=
transformer
;
}
catch
(
PackageManager
.
NameNotFoundException
e
)
{
}
catch
(
PackageManager
.
NameNotFoundException
e
)
{
...
@@ -235,7 +235,7 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -235,7 +235,7 @@ public final class TransformerActivity extends AppCompatActivity {
}
}
inputCardView
.
setVisibility
(
View
.
GONE
);
inputCardView
.
setVisibility
(
View
.
GONE
);
outputPlayerView
.
setVisibility
(
View
.
GONE
);
outputPlayerView
.
setVisibility
(
View
.
GONE
);
informationTextView
.
setText
(
R
.
string
.
transformation
_started
);
informationTextView
.
setText
(
R
.
string
.
export
_started
);
progressViewGroup
.
setVisibility
(
View
.
VISIBLE
);
progressViewGroup
.
setVisibility
(
View
.
VISIBLE
);
Handler
mainHandler
=
new
Handler
(
getMainLooper
());
Handler
mainHandler
=
new
Handler
(
getMainLooper
());
ProgressHolder
progressHolder
=
new
ProgressHolder
();
ProgressHolder
progressHolder
=
new
ProgressHolder
();
...
@@ -247,9 +247,7 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -247,9 +247,7 @@ public final class TransformerActivity extends AppCompatActivity {
&&
transformer
.
getProgress
(
progressHolder
)
!=
PROGRESS_STATE_NOT_STARTED
)
{
&&
transformer
.
getProgress
(
progressHolder
)
!=
PROGRESS_STATE_NOT_STARTED
)
{
progressIndicator
.
setProgress
(
progressHolder
.
progress
);
progressIndicator
.
setProgress
(
progressHolder
.
progress
);
informationTextView
.
setText
(
informationTextView
.
setText
(
getString
(
getString
(
R
.
string
.
export_timer
,
exportStopwatch
.
elapsed
(
TimeUnit
.
SECONDS
)));
R
.
string
.
transformation_timer
,
transformationStopwatch
.
elapsed
(
TimeUnit
.
SECONDS
)));
mainHandler
.
postDelayed
(
/* r= */
this
,
/* delayMillis= */
500
);
mainHandler
.
postDelayed
(
/* r= */
this
,
/* delayMillis= */
500
);
}
}
}
}
...
@@ -283,7 +281,7 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -283,7 +281,7 @@ public final class TransformerActivity extends AppCompatActivity {
"displayInputButton"
,
"displayInputButton"
,
"debugTextView"
,
"debugTextView"
,
"informationTextView"
,
"informationTextView"
,
"
transformation
Stopwatch"
,
"
export
Stopwatch"
,
"progressViewGroup"
,
"progressViewGroup"
,
"debugFrame"
,
"debugFrame"
,
})
})
...
@@ -310,7 +308,7 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -310,7 +308,7 @@ public final class TransformerActivity extends AppCompatActivity {
.
setEnableFallback
(
bundle
.
getBoolean
(
ConfigurationActivity
.
ENABLE_FALLBACK
))
.
setEnableFallback
(
bundle
.
getBoolean
(
ConfigurationActivity
.
ENABLE_FALLBACK
))
.
build
());
.
build
());
if
(!
bundle
.
getBoolean
(
ConfigurationActivity
.
ABORT_SLOW_
TRANSFORMATION
))
{
if
(!
bundle
.
getBoolean
(
ConfigurationActivity
.
ABORT_SLOW_
EXPORT
))
{
transformerBuilder
.
setMuxerFactory
(
transformerBuilder
.
setMuxerFactory
(
new
DefaultMuxer
.
Factory
(
/* maxDelayBetweenSamplesMs= */
C
.
TIME_UNSET
));
new
DefaultMuxer
.
Factory
(
/* maxDelayBetweenSamplesMs= */
C
.
TIME_UNSET
));
}
}
...
@@ -345,10 +343,10 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -345,10 +343,10 @@ public final class TransformerActivity extends AppCompatActivity {
private
File
createExternalCacheFile
(
String
fileName
)
throws
IOException
{
private
File
createExternalCacheFile
(
String
fileName
)
throws
IOException
{
File
file
=
new
File
(
getExternalCacheDir
(),
fileName
);
File
file
=
new
File
(
getExternalCacheDir
(),
fileName
);
if
(
file
.
exists
()
&&
!
file
.
delete
())
{
if
(
file
.
exists
()
&&
!
file
.
delete
())
{
throw
new
IllegalStateException
(
"Could not delete the previous
transformer
output file"
);
throw
new
IllegalStateException
(
"Could not delete the previous
export
output file"
);
}
}
if
(!
file
.
createNewFile
())
{
if
(!
file
.
createNewFile
())
{
throw
new
IllegalStateException
(
"Could not create the
transformer
output file"
);
throw
new
IllegalStateException
(
"Could not create the
export
output file"
);
}
}
return
file
;
return
file
;
}
}
...
@@ -356,7 +354,7 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -356,7 +354,7 @@ public final class TransformerActivity extends AppCompatActivity {
@RequiresNonNull
({
@RequiresNonNull
({
"inputCardView"
,
"inputCardView"
,
"outputPlayerView"
,
"outputPlayerView"
,
"
transformation
Stopwatch"
,
"
export
Stopwatch"
,
"progressViewGroup"
,
"progressViewGroup"
,
})
})
private
EditedMediaItem
createEditedMediaItem
(
MediaItem
mediaItem
,
@Nullable
Bundle
bundle
)
private
EditedMediaItem
createEditedMediaItem
(
MediaItem
mediaItem
,
@Nullable
Bundle
bundle
)
...
@@ -619,13 +617,13 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -619,13 +617,13 @@ public final class TransformerActivity extends AppCompatActivity {
"informationTextView"
,
"informationTextView"
,
"progressViewGroup"
,
"progressViewGroup"
,
"debugFrame"
,
"debugFrame"
,
"
transformation
Stopwatch"
,
"
export
Stopwatch"
,
})
})
private
void
onError
(
ExportException
exportException
)
{
private
void
onError
(
ExportException
exportException
)
{
if
(
transformation
Stopwatch
.
isRunning
())
{
if
(
export
Stopwatch
.
isRunning
())
{
transformation
Stopwatch
.
stop
();
export
Stopwatch
.
stop
();
}
}
informationTextView
.
setText
(
R
.
string
.
transformation
_error
);
informationTextView
.
setText
(
R
.
string
.
export
_error
);
progressViewGroup
.
setVisibility
(
View
.
GONE
);
progressViewGroup
.
setVisibility
(
View
.
GONE
);
debugFrame
.
removeAllViews
();
debugFrame
.
removeAllViews
();
Toast
.
makeText
(
getApplicationContext
(),
"Export error: "
+
exportException
,
Toast
.
LENGTH_LONG
)
Toast
.
makeText
(
getApplicationContext
(),
"Export error: "
+
exportException
,
Toast
.
LENGTH_LONG
)
...
@@ -644,13 +642,12 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -644,13 +642,12 @@ public final class TransformerActivity extends AppCompatActivity {
"informationTextView"
,
"informationTextView"
,
"progressViewGroup"
,
"progressViewGroup"
,
"debugFrame"
,
"debugFrame"
,
"
transformation
Stopwatch"
,
"
export
Stopwatch"
,
})
})
private
void
onCompleted
(
String
filePath
,
MediaItem
inputMediaItem
)
{
private
void
onCompleted
(
String
filePath
,
MediaItem
inputMediaItem
)
{
transformation
Stopwatch
.
stop
();
export
Stopwatch
.
stop
();
informationTextView
.
setText
(
informationTextView
.
setText
(
getString
(
getString
(
R
.
string
.
export_completed
,
exportStopwatch
.
elapsed
(
TimeUnit
.
SECONDS
)));
R
.
string
.
transformation_completed
,
transformationStopwatch
.
elapsed
(
TimeUnit
.
SECONDS
)));
progressViewGroup
.
setVisibility
(
View
.
GONE
);
progressViewGroup
.
setVisibility
(
View
.
GONE
);
debugFrame
.
removeAllViews
();
debugFrame
.
removeAllViews
();
inputCardView
.
setVisibility
(
View
.
VISIBLE
);
inputCardView
.
setVisibility
(
View
.
VISIBLE
);
...
@@ -775,7 +772,7 @@ public final class TransformerActivity extends AppCompatActivity {
...
@@ -775,7 +772,7 @@ public final class TransformerActivity extends AppCompatActivity {
public
SurfaceView
getDebugPreviewSurfaceView
(
int
width
,
int
height
)
{
public
SurfaceView
getDebugPreviewSurfaceView
(
int
width
,
int
height
)
{
checkState
(
checkState
(
surfaceView
==
null
||
(
this
.
width
==
width
&&
this
.
height
==
height
),
surfaceView
==
null
||
(
this
.
width
==
width
&&
this
.
height
==
height
),
"Transformer should not change the output size mid-
transformation
."
);
"Transformer should not change the output size mid-
export
."
);
if
(
surfaceView
!=
null
)
{
if
(
surfaceView
!=
null
)
{
return
surfaceView
;
return
surfaceView
;
}
}
...
...
demos/transformer/src/main/res/layout/configuration_activity.xml
View file @
ae91615a
...
@@ -210,9 +210,9 @@
...
@@ -210,9 +210,9 @@
android:layout_weight=
"1"
>
android:layout_weight=
"1"
>
<TextView
<TextView
android:layout_gravity=
"center_vertical"
android:layout_gravity=
"center_vertical"
android:text=
"@string/abort_slow_
transformation
"
/>
android:text=
"@string/abort_slow_
export
"
/>
<CheckBox
<CheckBox
android:id=
"@+id/abort_slow_
transformation
_checkbox"
android:id=
"@+id/abort_slow_
export
_checkbox"
android:layout_gravity=
"end"
/>
android:layout_gravity=
"end"
/>
</TableRow>
</TableRow>
<TableRow
<TableRow
...
@@ -247,17 +247,17 @@
...
@@ -247,17 +247,17 @@
android:layout_marginStart=
"32dp"
android:layout_marginStart=
"32dp"
android:layout_marginEnd=
"32dp"
android:layout_marginEnd=
"32dp"
android:text=
"@string/select_video_effects"
android:text=
"@string/select_video_effects"
app:layout_constraintBottom_toTopOf=
"@+id/
transform
_button"
app:layout_constraintBottom_toTopOf=
"@+id/
export
_button"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
/>
app:layout_constraintStart_toStartOf=
"parent"
/>
<Button
<Button
android:id=
"@+id/
transform
_button"
android:id=
"@+id/
export
_button"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"28dp"
android:layout_marginBottom=
"28dp"
android:layout_marginStart=
"32dp"
android:layout_marginStart=
"32dp"
android:layout_marginEnd=
"32dp"
android:layout_marginEnd=
"32dp"
android:text=
"@string/
transform
"
android:text=
"@string/
export
"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
/>
app:layout_constraintStart_toStartOf=
"parent"
/>
...
...
demos/transformer/src/main/res/values/strings.xml
View file @
ae91615a
...
@@ -29,20 +29,20 @@
...
@@ -29,20 +29,20 @@
<string
name=
"rotate"
translatable=
"false"
>
Rotate video (degrees)
</string>
<string
name=
"rotate"
translatable=
"false"
>
Rotate video (degrees)
</string>
<string
name=
"enable_fallback"
translatable=
"false"
>
Enable fallback
</string>
<string
name=
"enable_fallback"
translatable=
"false"
>
Enable fallback
</string>
<string
name=
"enable_debug_preview"
translatable=
"false"
>
Enable debug preview
</string>
<string
name=
"enable_debug_preview"
translatable=
"false"
>
Enable debug preview
</string>
<string
name=
"abort_slow_
transformation"
translatable=
"false"
>
Abort slow transformation
</string>
<string
name=
"abort_slow_
export"
translatable=
"false"
>
Abort slow export
</string>
<string
name=
"trim"
translatable=
"false"
>
Trim
</string>
<string
name=
"trim"
translatable=
"false"
>
Trim
</string>
<string
name=
"hdr_mode"
translatable=
"false"
>
HDR mode
</string>
<string
name=
"hdr_mode"
translatable=
"false"
>
HDR mode
</string>
<string
name=
"select_audio_effects"
translatable=
"false"
>
Add audio effects
</string>
<string
name=
"select_audio_effects"
translatable=
"false"
>
Add audio effects
</string>
<string
name=
"select_video_effects"
translatable=
"false"
>
Add video effects
</string>
<string
name=
"select_video_effects"
translatable=
"false"
>
Add video effects
</string>
<string
name=
"periodic_vignette_options"
translatable=
"false"
>
Periodic vignette options
</string>
<string
name=
"periodic_vignette_options"
translatable=
"false"
>
Periodic vignette options
</string>
<string
name=
"no_media_pipe_error"
translatable=
"false"
>
Failed to load MediaPipeShaderProgram. Check the README for instructions.
</string>
<string
name=
"no_media_pipe_error"
translatable=
"false"
>
Failed to load MediaPipeShaderProgram. Check the README for instructions.
</string>
<string
name=
"
transform"
translatable=
"false"
>
Transform
</string>
<string
name=
"
export"
translatable=
"false"
>
Export
</string>
<string
name=
"debug_preview"
translatable=
"false"
>
Debug preview:
</string>
<string
name=
"debug_preview"
translatable=
"false"
>
Debug preview:
</string>
<string
name=
"debug_preview_not_available"
translatable=
"false"
>
No debug preview available.
</string>
<string
name=
"debug_preview_not_available"
translatable=
"false"
>
No debug preview available.
</string>
<string
name=
"
transformation_started"
translatable=
"false"
>
Transformation
started
</string>
<string
name=
"
export_started"
translatable=
"false"
>
Export
started
</string>
<string
name=
"
transformation_timer"
translatable=
"false"
>
Transformation
started %d seconds ago.
</string>
<string
name=
"
export_timer"
translatable=
"false"
>
Export
started %d seconds ago.
</string>
<string
name=
"
transformation_completed"
translatable=
"false"
>
Transformation
completed in %d seconds.
</string>
<string
name=
"
export_completed"
translatable=
"false"
>
Export
completed in %d seconds.
</string>
<string
name=
"
transformation_error"
translatable=
"false"
>
Transformation
error
</string>
<string
name=
"
export_error"
translatable=
"false"
>
Export
error
</string>
<string
name=
"trim_range"
>
Bounds in seconds
</string>
<string
name=
"trim_range"
>
Bounds in seconds
</string>
<string-array
name=
"color_filter_options"
>
<string-array
name=
"color_filter_options"
>
<item>
Grayscale
</item>
<item>
Grayscale
</item>
...
...
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