Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
531
Issue boards
Milestones
Wiki
Code
Merge requests
12
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
b6141063
Commit
b6141063
authored
6 years ago
by
Duncan McNamara
Committed by
Geoffrey Métais
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Benchmark: cleanup intent extra handling
Signed-off-by:
Geoffrey Métais
<
geoffrey.metais@gmail.com
>
parent
7303f598
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vlc-android/src/org/videolan/vlc/gui/video/benchmark/BenchActivity.java
+28
-18
28 additions, 18 deletions
...c/org/videolan/vlc/gui/video/benchmark/BenchActivity.java
with
28 additions
and
18 deletions
vlc-android/src/org/videolan/vlc/gui/video/benchmark/BenchActivity.java
+
28
−
18
View file @
b6141063
...
...
@@ -71,11 +71,14 @@ import java.util.List;
public
class
BenchActivity
extends
ShallowVideoPlayer
{
private
static
final
String
SCREENSHOTS
=
"org.videolan.vlc.gui.video.benchmark.ACTION_SCREENSHOTS"
;
private
static
final
String
PLAYBACK
=
"org.videolan.vlc.gui.video.benchmark.ACTION_PLAYBACK"
;
private
static
final
String
EXTRA_TIMESTAMPS
=
"extra_benchmark_timestamps"
;
private
static
final
String
EXTRA_ACTION_QUALITY
=
"extra_benchmark_action_quality"
;
private
static
final
String
EXTRA_ACTION_PLAYBACK
=
"extra_benchmark_action_playback"
;
private
static
final
String
EXTRA_SCREENSHOT_DIR
=
"extra_benchmark_screenshot_dir"
;
private
static
final
String
EXTRA_ACTION
=
"extra_benchmark_action"
;
private
static
final
String
EXTRA_HARDWARE
=
"extra_benchmark_disable_hardware"
;
public
static
final
String
EXTRA_BENCHMARK
=
"extra_benchmark"
;
private
static
final
String
TIMESTAMPS
=
"org.videolan.vlc.gui.video.benchmark.TIMESTAMPS"
;
private
static
final
String
INTENT_SCREENSHOT_DIR
=
"SCREENSHOT_DIR"
;
private
static
final
String
TAG
=
"VLCBenchmark"
;
private
static
final
int
REQUEST_SCREENSHOT
=
666
;
...
...
@@ -179,38 +182,44 @@ public class BenchActivity extends ShallowVideoPlayer {
StartActivityOnCrash
.
setUp
(
this
);
Intent
intent
=
getIntent
();
/* Enabling hardware mode if necessary*/
/* Stops the hardware decoder falling back to software */
if
(!
intent
.
hasExtra
(
"disable_hardware"
))
{
mIsHardware
=
true
;
}
mIsHardware
=
!
intent
.
getBooleanExtra
(
EXTRA_HARDWARE
,
true
);
mIsBenchmark
=
true
;
if
(!
intent
.
hasExtra
(
INTENT_SCREENSHOT_DIR
))
{
errorFinish
(
"Failed to get screenshot directory location"
);
}
screenshotDir
=
intent
.
getStringExtra
(
INTENT_SCREENSHOT_DIR
);
super
.
onCreate
(
savedInstanceState
);
/* Determining the benchmark mode */
switch
(
intent
.
getAction
())
{
case
PLAYBACK:
if
(!
intent
.
hasExtra
(
EXTRA_ACTION
))
{
errorFinish
(
"Missing action intent extra"
);
return
;
}
switch
(
intent
.
getStringExtra
(
EXTRA_ACTION
))
{
case
EXTRA_ACTION_PLAYBACK:
break
;
case
SCREENSHOTS:
mIsScreenshot
=
intent
.
hasExtra
(
TIMESTAMPS
);
case
EXTRA_ACTION_QUALITY:
if
(!
intent
.
hasExtra
(
EXTRA_SCREENSHOT_DIR
))
{
errorFinish
(
"Failed to get screenshot directory location"
);
return
;
}
screenshotDir
=
intent
.
getStringExtra
(
EXTRA_SCREENSHOT_DIR
);
mIsScreenshot
=
intent
.
hasExtra
(
EXTRA_TIMESTAMPS
);
if
(!
mIsScreenshot
)
{
errorFinish
(
"Missing screenshots timestamps"
);
return
;
}
if
(
intent
.
getSerializableExtra
(
TIMESTAMPS
)
instanceof
List
)
{
mTimestamp
=
(
List
<
Long
>)
intent
.
getSerializableExtra
(
TIMESTAMPS
);
if
(
intent
.
getSerializableExtra
(
EXTRA_
TIMESTAMPS
)
instanceof
List
)
{
mTimestamp
=
(
List
<
Long
>)
intent
.
getSerializableExtra
(
EXTRA_
TIMESTAMPS
);
}
else
{
errorFinish
(
"Failed to get timestamps"
);
return
;
}
/* Deactivates secondary displays */
mEnableCloneMode
=
true
;
mDisplayManager
.
release
();
break
;
}
// blocking display in landscape orientation
...
...
@@ -413,6 +422,7 @@ public class BenchActivity extends ShallowVideoPlayer {
* @param resultString error description for display in VLCBenchmark
*/
private
void
errorFinish
(
String
resultString
)
{
Log
.
e
(
TAG
,
"errorFinish: "
+
resultString
);
Intent
sendIntent
=
new
Intent
();
sendIntent
.
putExtra
(
"Error"
,
resultString
);
setResult
(
RESULT_FAILED
,
sendIntent
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment