Refactor sample - #9
Conversation
|
In last commit the opportunity to disable OEP was created (to disable OEP set mIsOEPEnabled = false;) |
| (image0,image1, image2, width, height) -> { | ||
| List<byte[]> planes = Arrays.asList(image0, image1, image2); | ||
| renderer.drawImage(planes, width, height); | ||
| (offscreenEffectPlayerImage) -> { |
There was a problem hiding this comment.
the name of variable is better to shorten to 'oepImage'
| int inputOrientation, | ||
| boolean isRequiredMirroring, | ||
| int outputOrientation, | ||
| int imageFormat) { |
There was a problem hiding this comment.
What does this variable mean ? input/output ?
If this is an output image format, then it's better to name it that 'outputImageFormat'
| int inputOrientation, | ||
| boolean isRequiredMirroring, | ||
| int outputOrientation, | ||
| int imageFormat); |
| public boolean requireMirroring; | ||
| } No newline at end of file | ||
|
|
||
| public int getWidth() { return mWidth; } |
| OffscreenEffectPlayerImage() { | ||
| mImageInfo = new ImageInfo(); | ||
|
|
||
| OffscreenEffectPlayerImage(ImageProxy imageProxy) { |
There was a problem hiding this comment.
The OffscreenEffectPlayerImage should not depends on ImageProxy. Remove it
There was a problem hiding this comment.
Add a method that returns OffscreenEffectPlayerImage from ImageProxy, to the class in which it is used
| public ByteBuffer mImageFirst = null; | ||
| public ByteBuffer mImageSecond = null; | ||
| } | ||
| OffscreenEffectPlayerImage(byte[] rgbPlane, int width, int height) { |
There was a problem hiding this comment.
OffscreenEffectPlayerImage(final byte[] rgbPlane, final int rgbPlaneStride, final int width, final int height)
| final private ByteBuffer mPlane0; | ||
| final private ByteBuffer mPlane1; | ||
| final private ByteBuffer mPlane2; | ||
|
|
There was a problem hiding this comment.
add the variable:
final private mNumberOfPlanes;
| mPixelFormat = 0; | ||
| } | ||
|
|
||
| OffscreenEffectPlayerImage(byte[] yPlane, byte[] uvPlane, int width, int height) { |
There was a problem hiding this comment.
change to:
OffscreenEffectPlayerImage(final byte[] yPlane, final int yPlaneStride, final byte[] uvPlane, final int uvPlaneStride, final int width, final int height)
There was a problem hiding this comment.
this constructor will create an Image with nv12 format
| } | ||
|
|
||
| public ByteBuffer getPlane(int planeNumber) { | ||
| switch (planeNumber) { |
There was a problem hiding this comment.
if (planeNumber >= 0 && planeNumber < mNumberOfPlanes ) {
swich-case for planes 0, 1, 2: ...
} else { throw new ... }
| oep.processImageAsync(mImage); | ||
| int rotation = getRotation(MainActivity.this); | ||
| int imageFormat = mImageFormat.ordinal(); | ||
| OffscreenEffectPlayerImage image = new OffscreenEffectPlayerImage(proxy); |
There was a problem hiding this comment.
for example:
OffscreenEffectPlayerImage image = wrapToOffscreenEffectPlayerImage(proxy);
No description provided.