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
13
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
28f0ee78
Commit
28f0ee78
authored
6 years ago
by
Duncan McNamara
Committed by
Geoffrey Métais
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Benchmark: remove screenshot border
Signed-off-by:
Geoffrey Métais
<
geoffrey.metais@gmail.com
>
parent
1fc0340a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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
+7
-14
7 additions, 14 deletions
...c/org/videolan/vlc/gui/video/benchmark/BenchActivity.java
with
7 additions
and
14 deletions
vlc-android/src/org/videolan/vlc/gui/video/benchmark/BenchActivity.java
+
7
−
14
View file @
28f0ee78
...
...
@@ -27,7 +27,6 @@ import android.content.pm.ActivityInfo;
import
android.content.pm.PackageManager
;
import
android.graphics.Bitmap
;
import
android.graphics.PixelFormat
;
import
android.graphics.Point
;
import
android.hardware.display.VirtualDisplay
;
import
android.media.Image
;
import
android.media.ImageReader
;
...
...
@@ -50,7 +49,7 @@ import java.io.File;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.nio.
Byte
Buffer
;
import
java.nio.Buffer
;
import
java.util.List
;
/**
...
...
@@ -274,12 +273,10 @@ public class BenchActivity extends ShallowVideoPlayer {
mSetup
=
true
;
if
(
mIsScreenshot
)
{
mService
.
pause
();
Point
size
=
new
Point
();
getWindowManager
().
getDefaultDisplay
().
getSize
(
size
);
mWidth
=
size
.
x
;
mHeight
=
size
.
y
;
DisplayMetrics
metrics
=
new
DisplayMetrics
();
getWindowManager
().
getDefaultDisplay
().
getMetrics
(
metrics
);
getWindowManager
().
getDefaultDisplay
().
getRealMetrics
(
metrics
);
mWidth
=
metrics
.
widthPixels
;
mHeight
=
metrics
.
heightPixels
;
mDensity
=
metrics
.
densityDpi
;
mProjectionManager
=
(
MediaProjectionManager
)
getSystemService
(
MEDIA_PROJECTION_SERVICE
);
...
...
@@ -298,7 +295,6 @@ public class BenchActivity extends ShallowVideoPlayer {
if
(
mIsScreenshot
&&
mSetup
&&
mScreenshotNumber
<
mTimestamp
.
size
()
&&
mSeeking
)
{
mSeeking
=
false
;
mImageReader
=
ImageReader
.
newInstance
(
mWidth
,
mHeight
,
PixelFormat
.
RGBA_8888
,
2
);
mVirtualDisplay
=
mMediaProjection
.
createVirtualDisplay
(
"testScreenshot"
,
mWidth
,
mHeight
,
mDensity
,
VIRTUAL_DISPLAY_FLAGS
,
...
...
@@ -500,7 +496,7 @@ public class BenchActivity extends ShallowVideoPlayer {
}
if
(
image
!=
null
)
{
Image
.
Plane
[]
planes
=
image
.
getPlanes
();
Byte
Buffer
buffer
=
planes
[
0
].
getBuffer
();
Buffer
buffer
=
planes
[
0
].
getBuffer
()
.
rewind
()
;
int
pixelStride
=
planes
[
0
].
getPixelStride
();
int
rowStride
=
planes
[
0
].
getRowStride
();
int
rowPadding
=
rowStride
-
pixelStride
*
mWidth
;
...
...
@@ -509,7 +505,6 @@ public class BenchActivity extends ShallowVideoPlayer {
Bitmap
.
Config
.
ARGB_8888
);
if
(
bitmap
!=
null
)
{
bitmap
.
copyPixelsFromBuffer
(
buffer
);
File
folder
=
new
File
(
screenshotDir
);
if
(!
folder
.
exists
())
{
...
...
@@ -517,9 +512,7 @@ public class BenchActivity extends ShallowVideoPlayer {
errorFinish
(
"Failed to create screenshot directory"
);
}
}
//File imageFile = new File(getExternalFilesDir(null), "Screenshot_" + sScreenshotNumber + ".jpg");
File
imageFile
=
new
File
(
folder
.
getAbsolutePath
()
+
File
.
separator
+
"Screenshot_"
+
mScreenshotNumber
+
".jpg"
);
File
imageFile
=
new
File
(
folder
.
getAbsolutePath
()
+
File
.
separator
+
"Screenshot_"
+
mScreenshotNumber
+
".png"
);
mScreenshotNumber
+=
1
;
try
{
outputStream
=
new
FileOutputStream
(
imageFile
);
...
...
@@ -527,7 +520,7 @@ public class BenchActivity extends ShallowVideoPlayer {
Log
.
e
(
TAG
,
"Failed to create outputStream"
);
}
if
(
outputStream
!=
null
)
{
bitmap
.
compress
(
Bitmap
.
CompressFormat
.
JPE
G
,
100
,
outputStream
);
bitmap
.
compress
(
Bitmap
.
CompressFormat
.
PN
G
,
100
,
outputStream
);
}
bitmap
.
recycle
();
...
...
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