fix for #1954 (typos)
This commit is contained in:
parent
b82b4a640d
commit
e3fc405393
@ -52,7 +52,7 @@ public abstract class SampleCvViewBase extends SurfaceView implements SurfaceHol
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setupCamera(int width, int height) {
|
public void setupCamera(int width, int height) {
|
||||||
Log.i(TAG, "setupCamera");
|
Log.i(TAG, "setupCamera("+width+", "+height+")");
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (mCamera != null && mCamera.isOpened()) {
|
if (mCamera != null && mCamera.isOpened()) {
|
||||||
List<Size> sizes = mCamera.getSupportedPreviewSizes();
|
List<Size> sizes = mCamera.getSupportedPreviewSizes();
|
||||||
|
@ -54,7 +54,7 @@ public abstract class SampleCvViewBase extends SurfaceView implements SurfaceHol
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setupCamera(int width, int height) {
|
public void setupCamera(int width, int height) {
|
||||||
Log.i(TAG, "setupCamera");
|
Log.i(TAG, "setupCamera("+width+", "+height+")");
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (mCamera != null && mCamera.isOpened()) {
|
if (mCamera != null && mCamera.isOpened()) {
|
||||||
List<Size> sizes = mCamera.getSupportedPreviewSizes();
|
List<Size> sizes = mCamera.getSupportedPreviewSizes();
|
||||||
|
@ -62,8 +62,8 @@ class Sample0View extends SampleViewBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPreviewStared(int previewWidth, int previewHeight) {
|
protected void onPreviewStarted(int previewWidth, int previewHeight) {
|
||||||
Log.i(TAG, "onPreviewStared("+previewWidth+", "+previewHeight+")");
|
Log.i(TAG, "onPreviewStarted("+previewWidth+", "+previewHeight+")");
|
||||||
/* Create a bitmap that will be used through to calculate the image to */
|
/* Create a bitmap that will be used through to calculate the image to */
|
||||||
mBitmap = Bitmap.createBitmap(previewWidth, previewHeight, Bitmap.Config.ARGB_8888);
|
mBitmap = Bitmap.createBitmap(previewWidth, previewHeight, Bitmap.Config.ARGB_8888);
|
||||||
mRGBA = new int[previewWidth * previewHeight];
|
mRGBA = new int[previewWidth * previewHeight];
|
||||||
|
@ -132,7 +132,7 @@ public abstract class SampleViewBase extends SurfaceView implements SurfaceHolde
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Notify that the preview is about to be started and deliver preview size */
|
/* Notify that the preview is about to be started and deliver preview size */
|
||||||
onPreviewStared(params.getPreviewSize().width, params.getPreviewSize().height);
|
onPreviewStarted(params.getPreviewSize().width, params.getPreviewSize().height);
|
||||||
|
|
||||||
/* Now we can start a preview */
|
/* Now we can start a preview */
|
||||||
mCamera.startPreview();
|
mCamera.startPreview();
|
||||||
@ -159,17 +159,17 @@ public abstract class SampleViewBase extends SurfaceView implements SurfaceHolde
|
|||||||
protected abstract Bitmap processFrame(byte[] data);
|
protected abstract Bitmap processFrame(byte[] data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called when the preview process is beeing started. It is called before the first frame delivered and processFrame is called
|
* This method is called when the preview process is being started. It is called before the first frame delivered and processFrame is called
|
||||||
* It is called with the width and height parameters of the preview process. It can be used to prepare the data needed during the frame processing.
|
* It is called with the width and height parameters of the preview process. It can be used to prepare the data needed during the frame processing.
|
||||||
* @param previewWidth - the width of the preview frames that will be delivered via processFrame
|
* @param previewWidth - the width of the preview frames that will be delivered via processFrame
|
||||||
* @param previewHeight - the height of the preview frames that will be delivered via processFrame
|
* @param previewHeight - the height of the preview frames that will be delivered via processFrame
|
||||||
*/
|
*/
|
||||||
protected abstract void onPreviewStared(int previewWidtd, int previewHeight);
|
protected abstract void onPreviewStarted(int previewWidtd, int previewHeight);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called when preview is stopped. When this method is called the preview stopped and all the processing of frames already completed.
|
* This method is called when preview is stopped. When this method is called the preview stopped and all the processing of frames already completed.
|
||||||
* If the Bitmap object returned via processFrame is cached - it is a good time to recycle it.
|
* If the Bitmap object returned via processFrame is cached - it is a good time to recycle it.
|
||||||
* Any other resourcses used during the preview can be released.
|
* Any other resources used during the preview can be released.
|
||||||
*/
|
*/
|
||||||
protected abstract void onPreviewStopped();
|
protected abstract void onPreviewStopped();
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ class Sample1View extends SampleViewBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPreviewStared(int previewWidth, int previewHeight) {
|
protected void onPreviewStarted(int previewWidth, int previewHeight) {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
// initialize Mats before usage
|
// initialize Mats before usage
|
||||||
mYuv = new Mat(getFrameHeight() + getFrameHeight() / 2, getFrameWidth(), CvType.CV_8UC1);
|
mYuv = new Mat(getFrameHeight() + getFrameHeight() / 2, getFrameWidth(), CvType.CV_8UC1);
|
||||||
|
@ -131,7 +131,7 @@ public abstract class SampleViewBase extends SurfaceView implements SurfaceHolde
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Notify that the preview is about to be started and deliver preview size */
|
/* Notify that the preview is about to be started and deliver preview size */
|
||||||
onPreviewStared(params.getPreviewSize().width, params.getPreviewSize().height);
|
onPreviewStarted(params.getPreviewSize().width, params.getPreviewSize().height);
|
||||||
|
|
||||||
/* Now we can start a preview */
|
/* Now we can start a preview */
|
||||||
mCamera.startPreview();
|
mCamera.startPreview();
|
||||||
@ -158,17 +158,17 @@ public abstract class SampleViewBase extends SurfaceView implements SurfaceHolde
|
|||||||
protected abstract Bitmap processFrame(byte[] data);
|
protected abstract Bitmap processFrame(byte[] data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called when the preview process is beeing started. It is called before the first frame delivered and processFrame is called
|
* This method is called when the preview process is being started. It is called before the first frame delivered and processFrame is called
|
||||||
* It is called with the width and height parameters of the preview process. It can be used to prepare the data needed during the frame processing.
|
* It is called with the width and height parameters of the preview process. It can be used to prepare the data needed during the frame processing.
|
||||||
* @param previewWidth - the width of the preview frames that will be delivered via processFrame
|
* @param previewWidth - the width of the preview frames that will be delivered via processFrame
|
||||||
* @param previewHeight - the height of the preview frames that will be delivered via processFrame
|
* @param previewHeight - the height of the preview frames that will be delivered via processFrame
|
||||||
*/
|
*/
|
||||||
protected abstract void onPreviewStared(int previewWidtd, int previewHeight);
|
protected abstract void onPreviewStarted(int previewWidtd, int previewHeight);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called when preview is stopped. When this method is called the preview stopped and all the processing of frames already completed.
|
* This method is called when preview is stopped. When this method is called the preview stopped and all the processing of frames already completed.
|
||||||
* If the Bitmap object returned via processFrame is cached - it is a good time to recycle it.
|
* If the Bitmap object returned via processFrame is cached - it is a good time to recycle it.
|
||||||
* Any other resourcses used during the preview can be released.
|
* Any other resources used during the preview can be released.
|
||||||
*/
|
*/
|
||||||
protected abstract void onPreviewStopped();
|
protected abstract void onPreviewStopped();
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ public abstract class SampleCvViewBase extends SurfaceView implements SurfaceHol
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setupCamera(int width, int height) {
|
public void setupCamera(int width, int height) {
|
||||||
Log.i(TAG, "setupCamera");
|
Log.i(TAG, "setupCamera("+width+", "+height+")");
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (mCamera != null && mCamera.isOpened()) {
|
if (mCamera != null && mCamera.isOpened()) {
|
||||||
List<Size> sizes = mCamera.getSupportedPreviewSizes();
|
List<Size> sizes = mCamera.getSupportedPreviewSizes();
|
||||||
|
@ -14,7 +14,7 @@ class Sample3View extends SampleViewBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPreviewStared(int previewWidtd, int previewHeight) {
|
protected void onPreviewStarted(int previewWidtd, int previewHeight) {
|
||||||
mFrameSize = previewWidtd * previewHeight;
|
mFrameSize = previewWidtd * previewHeight;
|
||||||
mRGBA = new int[mFrameSize];
|
mRGBA = new int[mFrameSize];
|
||||||
mBitmap = Bitmap.createBitmap(previewWidtd, previewHeight, Bitmap.Config.ARGB_8888);
|
mBitmap = Bitmap.createBitmap(previewWidtd, previewHeight, Bitmap.Config.ARGB_8888);
|
||||||
|
@ -130,7 +130,7 @@ public abstract class SampleViewBase extends SurfaceView implements SurfaceHolde
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Notify that the preview is about to be started and deliver preview size */
|
/* Notify that the preview is about to be started and deliver preview size */
|
||||||
onPreviewStared(params.getPreviewSize().width, params.getPreviewSize().height);
|
onPreviewStarted(params.getPreviewSize().width, params.getPreviewSize().height);
|
||||||
|
|
||||||
/* Now we can start a preview */
|
/* Now we can start a preview */
|
||||||
mCamera.startPreview();
|
mCamera.startPreview();
|
||||||
@ -158,17 +158,17 @@ public abstract class SampleViewBase extends SurfaceView implements SurfaceHolde
|
|||||||
protected abstract Bitmap processFrame(byte[] data);
|
protected abstract Bitmap processFrame(byte[] data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called when the preview process is beeing started. It is called before the first frame delivered and processFrame is called
|
* This method is called when the preview process is being started. It is called before the first frame delivered and processFrame is called
|
||||||
* It is called with the width and height parameters of the preview process. It can be used to prepare the data needed during the frame processing.
|
* It is called with the width and height parameters of the preview process. It can be used to prepare the data needed during the frame processing.
|
||||||
* @param previewWidth - the width of the preview frames that will be delivered via processFrame
|
* @param previewWidth - the width of the preview frames that will be delivered via processFrame
|
||||||
* @param previewHeight - the height of the preview frames that will be delivered via processFrame
|
* @param previewHeight - the height of the preview frames that will be delivered via processFrame
|
||||||
*/
|
*/
|
||||||
protected abstract void onPreviewStared(int previewWidtd, int previewHeight);
|
protected abstract void onPreviewStarted(int previewWidtd, int previewHeight);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called when preview is stopped. When this method is called the preview stopped and all the processing of frames already completed.
|
* This method is called when preview is stopped. When this method is called the preview stopped and all the processing of frames already completed.
|
||||||
* If the Bitmap object returned via processFrame is cached - it is a good time to recycle it.
|
* If the Bitmap object returned via processFrame is cached - it is a good time to recycle it.
|
||||||
* Any other resourcses used during the preview can be released.
|
* Any other resources used during the preview can be released.
|
||||||
*/
|
*/
|
||||||
protected abstract void onPreviewStopped();
|
protected abstract void onPreviewStopped();
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ class Sample4View extends SampleViewBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPreviewStared(int previewWidtd, int previewHeight) {
|
protected void onPreviewStarted(int previewWidtd, int previewHeight) {
|
||||||
// initialize Mats before usage
|
// initialize Mats before usage
|
||||||
mYuv = new Mat(getFrameHeight() + getFrameHeight() / 2, getFrameWidth(), CvType.CV_8UC1);
|
mYuv = new Mat(getFrameHeight() + getFrameHeight() / 2, getFrameWidth(), CvType.CV_8UC1);
|
||||||
mGraySubmat = mYuv.submat(0, getFrameHeight(), 0, getFrameWidth());
|
mGraySubmat = mYuv.submat(0, getFrameHeight(), 0, getFrameWidth());
|
||||||
|
@ -130,7 +130,7 @@ public abstract class SampleViewBase extends SurfaceView implements SurfaceHolde
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Notify that the preview is about to be started and deliver preview size */
|
/* Notify that the preview is about to be started and deliver preview size */
|
||||||
onPreviewStared(params.getPreviewSize().width, params.getPreviewSize().height);
|
onPreviewStarted(params.getPreviewSize().width, params.getPreviewSize().height);
|
||||||
|
|
||||||
/* Now we can start a preview */
|
/* Now we can start a preview */
|
||||||
mCamera.startPreview();
|
mCamera.startPreview();
|
||||||
@ -159,17 +159,17 @@ public abstract class SampleViewBase extends SurfaceView implements SurfaceHolde
|
|||||||
protected abstract Bitmap processFrame(byte[] data);
|
protected abstract Bitmap processFrame(byte[] data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called when the preview process is beeing started. It is called before the first frame delivered and processFrame is called
|
* This method is called when the preview process is being started. It is called before the first frame delivered and processFrame is called
|
||||||
* It is called with the width and height parameters of the preview process. It can be used to prepare the data needed during the frame processing.
|
* It is called with the width and height parameters of the preview process. It can be used to prepare the data needed during the frame processing.
|
||||||
* @param previewWidth - the width of the preview frames that will be delivered via processFrame
|
* @param previewWidth - the width of the preview frames that will be delivered via processFrame
|
||||||
* @param previewHeight - the height of the preview frames that will be delivered via processFrame
|
* @param previewHeight - the height of the preview frames that will be delivered via processFrame
|
||||||
*/
|
*/
|
||||||
protected abstract void onPreviewStared(int previewWidtd, int previewHeight);
|
protected abstract void onPreviewStarted(int previewWidtd, int previewHeight);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called when preview is stopped. When this method is called the preview stopped and all the processing of frames already completed.
|
* This method is called when preview is stopped. When this method is called the preview stopped and all the processing of frames already completed.
|
||||||
* If the Bitmap object returned via processFrame is cached - it is a good time to recycle it.
|
* If the Bitmap object returned via processFrame is cached - it is a good time to recycle it.
|
||||||
* Any other resourcses used during the preview can be released.
|
* Any other resources used during the preview can be released.
|
||||||
*/
|
*/
|
||||||
protected abstract void onPreviewStopped();
|
protected abstract void onPreviewStopped();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user