android.media.ImageReader.OnImageAvailableListener Java Examples

The following examples show how to use android.media.ImageReader.OnImageAvailableListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CameraConnectionFragment.java    From next18-ai-in-motion with Apache License 2.0 5 votes vote down vote up
private CameraConnectionFragment(
    final ConnectionCallback connectionCallback,
    final OnImageAvailableListener imageListener,
    final int layout,
    final Size inputSize) {
  this.cameraConnectionCallback = connectionCallback;
  this.imageListener = imageListener;
  this.layout = layout;
  this.inputSize = inputSize;
}
 
Example #2
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
public static CameraConnectionFragment newInstance(
        final ConnectionCallback callback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    return new CameraConnectionFragment(callback, imageListener, layout, inputSize);
}
 
Example #3
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
private CameraConnectionFragment(
        final ConnectionCallback connectionCallback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    this.cameraConnectionCallback = connectionCallback;
    this.imageListener = imageListener;
    this.layout = layout;
    this.inputSize = inputSize;
}
 
Example #4
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
public static CameraConnectionFragment newInstance(
        final ConnectionCallback callback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    return new CameraConnectionFragment(callback, imageListener, layout, inputSize);
}
 
Example #5
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
private CameraConnectionFragment(
        final ConnectionCallback connectionCallback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    this.cameraConnectionCallback = connectionCallback;
    this.imageListener = imageListener;
    this.layout = layout;
    this.inputSize = inputSize;
}
 
Example #6
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
public static CameraConnectionFragment newInstance(
        final ConnectionCallback callback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    return new CameraConnectionFragment(callback, imageListener, layout, inputSize);
}
 
Example #7
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
private CameraConnectionFragment(
        final ConnectionCallback connectionCallback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    this.cameraConnectionCallback = connectionCallback;
    this.imageListener = imageListener;
    this.layout = layout;
    this.inputSize = inputSize;
}
 
Example #8
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
public static CameraConnectionFragment newInstance(
        final ConnectionCallback callback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    return new CameraConnectionFragment(callback, imageListener, layout, inputSize);
}
 
Example #9
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
private CameraConnectionFragment(
        final ConnectionCallback connectionCallback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    this.cameraConnectionCallback = connectionCallback;
    this.imageListener = imageListener;
    this.layout = layout;
    this.inputSize = inputSize;
}
 
Example #10
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
public static CameraConnectionFragment newInstance(
        final ConnectionCallback callback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    return new CameraConnectionFragment(callback, imageListener, layout, inputSize);
}
 
Example #11
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
private CameraConnectionFragment(
        final ConnectionCallback connectionCallback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    this.cameraConnectionCallback = connectionCallback;
    this.imageListener = imageListener;
    this.layout = layout;
    this.inputSize = inputSize;
}
 
Example #12
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
public static CameraConnectionFragment newInstance(
        final ConnectionCallback callback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize,
        CameraOpenListener openListener) {
    return new CameraConnectionFragment(callback, imageListener, layout, inputSize, openListener);
}
 
Example #13
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
public static CameraConnectionFragment newInstance(
        final ConnectionCallback callback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    return new CameraConnectionFragment(callback, imageListener, layout, inputSize);
}
 
Example #14
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
private CameraConnectionFragment(
        final ConnectionCallback connectionCallback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    this.cameraConnectionCallback = connectionCallback;
    this.imageListener = imageListener;
    this.layout = layout;
    this.inputSize = inputSize;
}
 
Example #15
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
public static CameraConnectionFragment newInstance(
        final ConnectionCallback callback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    return new CameraConnectionFragment(callback, imageListener, layout, inputSize);
}
 
Example #16
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
private CameraConnectionFragment(
        final ConnectionCallback connectionCallback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    this.cameraConnectionCallback = connectionCallback;
    this.imageListener = imageListener;
    this.layout = layout;
    this.inputSize = inputSize;
}
 
Example #17
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
public static CameraConnectionFragment newInstance(
        final ConnectionCallback callback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    return new CameraConnectionFragment(callback, imageListener, layout, inputSize);
}
 
Example #18
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
private CameraConnectionFragment(
        final ConnectionCallback connectionCallback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    this.cameraConnectionCallback = connectionCallback;
    this.imageListener = imageListener;
    this.layout = layout;
    this.inputSize = inputSize;
}
 
Example #19
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
public static CameraConnectionFragment newInstance(
        final ConnectionCallback callback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    return new CameraConnectionFragment(callback, imageListener, layout, inputSize);
}
 
Example #20
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 5 votes vote down vote up
private CameraConnectionFragment(
        final ConnectionCallback connectionCallback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize) {
    this.cameraConnectionCallback = connectionCallback;
    this.imageListener = imageListener;
    this.layout = layout;
    this.inputSize = inputSize;
}
 
Example #21
Source File: CameraConnectionFragment.java    From tensorflow-classifier-android with Apache License 2.0 5 votes vote down vote up
public static CameraConnectionFragment newInstance(
    final ConnectionCallback callback,
    final OnImageAvailableListener imageListener,
    final int layout,
    final Size inputSize) {
  return new CameraConnectionFragment(callback, imageListener, layout, inputSize);
}
 
Example #22
Source File: CameraConnectionFragment.java    From tensorflow-classifier-android with Apache License 2.0 5 votes vote down vote up
private CameraConnectionFragment(
    final ConnectionCallback connectionCallback,
    final OnImageAvailableListener imageListener,
    final int layout,
    final Size inputSize) {
  this.cameraConnectionCallback = connectionCallback;
  this.imageListener = imageListener;
  this.layout = layout;
  this.inputSize = inputSize;
}
 
Example #23
Source File: CameraConnectionFragment.java    From next18-ai-in-motion with Apache License 2.0 5 votes vote down vote up
public static CameraConnectionFragment newInstance(
    final ConnectionCallback callback,
    final OnImageAvailableListener imageListener,
    final int layout,
    final Size inputSize) {
  return new CameraConnectionFragment(callback, imageListener, layout, inputSize);
}
 
Example #24
Source File: CameraConnectionFragment.java    From android-yolo-v2 with Do What The F*ck You Want To Public License 4 votes vote down vote up
public void addImageAvailableListener(final OnImageAvailableListener imageListener) {
    this.imageListener = imageListener;
}
 
Example #25
Source File: CameraConnectionFragment.java    From fritz-examples with MIT License 4 votes vote down vote up
private CameraConnectionFragment(
        final ConnectionCallback connectionCallback,
        final OnImageAvailableListener imageListener,
        final int layout,
        final Size inputSize,
        CameraOpenListener listener) {
    this.cameraConnectionCallback = connectionCallback;
    this.imageListener = imageListener;
    this.layout = layout;
    this.inputSize = inputSize;
    this.openListener = listener;
    this.stateCallback =
            new CameraDevice.StateCallback() {
                @Override
                public void onOpened(final CameraDevice cd) {
                    // This method is called when the camera is opened.  We start camera preview here.
                    cameraOpenCloseLock.release();
                    cameraDevice = cd;
                    createCameraPreviewSession();
                    openListener.onCameraOpened();
                }

                @Override
                public void onDisconnected(final CameraDevice cd) {
                    cameraOpenCloseLock.release();
                    cd.close();
                    cameraDevice = null;
                }

                @Override
                public void onError(final CameraDevice cd, final int error) {
                    cameraOpenCloseLock.release();
                    cd.close();
                    cameraDevice = null;
                    final Activity activity = getActivity();
                    if (null != activity) {
                        activity.finish();
                    }
                }
            };
}