@Test(expected = IllegalArgumentException.class) public void captureStageExceedMaxCaptureStage_setCaptureBundleThrowsException() { ProcessingImageReader processingImageReader = new ProcessingImageReader(100, 100, ImageFormat.YUV_420_888, 2, mMainHandler, mCaptureBundle, mock(CaptureProcessor.class)); processingImageReader.setCaptureBundle( CaptureBundles.createCaptureBundle(mCaptureStage1, mCaptureStage2, mCaptureStage3)); }
public void setCaptureBundle(@NonNull CaptureBundle captureBundle) { synchronized (mLock) { if (captureBundle.getCaptureStages() != null) { if (mInputImageReader.getMaxImages() < captureBundle.getCaptureStages().size()) { throw new IllegalArgumentException( "CaptureBundle is lager than InputImageReader."); } mCaptureIdList.clear(); for (CaptureStage captureStage : captureBundle.getCaptureStages()) { if (captureStage != null) { mCaptureIdList.add(captureStage.getId()); } } } mSettableImageProxyBundle = new SettableImageProxyBundle(mCaptureIdList); setupSettableImageProxyBundleCallbacks(); } }
ProcessingImageReader implements ImageReaderProxy { public void setCaptureBundle(@NonNull CaptureBundle captureBundle) { synchronized (mLock) { if (captureBundle.getCaptureStages() != null) { if (mInputImageReader.getMaxImages() < captureBundle.getCaptureStages().size()) { throw new IllegalArgumentException( "CaptureBundle is lager than InputImageReader."); } mCaptureIdList.clear(); for (CaptureStage captureStage : captureBundle.getCaptureStages()) { if (captureStage != null) { mCaptureIdList.add(captureStage.getId()); } } } mSettableImageProxyBundle = new SettableImageProxyBundle(mCaptureIdList); setupSettableImageProxyBundleCallbacks(); } } }
ProcessingImageReader implements ImageReaderProxy { public void setCaptureBundle(@NonNull CaptureBundle captureBundle) { synchronized (mLock) { if (captureBundle.getCaptureStages() != null) { if (mInputImageReader.getMaxImages() < captureBundle.getCaptureStages().size()) { throw new IllegalArgumentException( "CaptureBundle is lager than InputImageReader."); } mCaptureIdList.clear(); for (CaptureStage captureStage : captureBundle.getCaptureStages()) { if (captureStage != null) { mCaptureIdList.add(captureStage.getId()); } } } mSettableImageProxyBundle = new SettableImageProxyBundle(mCaptureIdList); setupSettableImageProxyBundleCallbacks(); } } ProcessingImageReader(int width, int height, int format, int maxImages,
            @Nullable Handler handler,
            @NonNull CaptureBundle captureBundle, @NonNull CaptureProcessor captureProcessor);   ProcessingImageReader(ImageReaderProxy imageReader, @Nullable Handler handler,
            @NonNull CaptureBundle captureBundle,
            @NonNull CaptureProcessor captureProcessor); }
ProcessingImageReader implements ImageReaderProxy { public void setCaptureBundle(@NonNull CaptureBundle captureBundle) { synchronized (mLock) { if (captureBundle.getCaptureStages() != null) { if (mInputImageReader.getMaxImages() < captureBundle.getCaptureStages().size()) { throw new IllegalArgumentException( "CaptureBundle is lager than InputImageReader."); } mCaptureIdList.clear(); for (CaptureStage captureStage : captureBundle.getCaptureStages()) { if (captureStage != null) { mCaptureIdList.add(captureStage.getId()); } } } mSettableImageProxyBundle = new SettableImageProxyBundle(mCaptureIdList); setupSettableImageProxyBundleCallbacks(); } } ProcessingImageReader(int width, int height, int format, int maxImages,
            @Nullable Handler handler,
            @NonNull CaptureBundle captureBundle, @NonNull CaptureProcessor captureProcessor);   ProcessingImageReader(ImageReaderProxy imageReader, @Nullable Handler handler,
            @NonNull CaptureBundle captureBundle,
            @NonNull CaptureProcessor captureProcessor); @Override @Nullable ImageProxy acquireLatestImage(); @Override @Nullable ImageProxy acquireNextImage(); @Override void close(); @Override int getHeight(); @Override int getWidth(); @Override int getImageFormat(); @Override int getMaxImages(); @Override Surface getSurface(); @Override void setOnImageAvailableListener(
            @Nullable final ImageReaderProxy.OnImageAvailableListener listener,
            @Nullable Handler handler); void setCaptureBundle(@NonNull CaptureBundle captureBundle); }
ProcessingImageReader implements ImageReaderProxy { public void setCaptureBundle(@NonNull CaptureBundle captureBundle) { synchronized (mLock) { if (captureBundle.getCaptureStages() != null) { if (mInputImageReader.getMaxImages() < captureBundle.getCaptureStages().size()) { throw new IllegalArgumentException( "CaptureBundle is lager than InputImageReader."); } mCaptureIdList.clear(); for (CaptureStage captureStage : captureBundle.getCaptureStages()) { if (captureStage != null) { mCaptureIdList.add(captureStage.getId()); } } } mSettableImageProxyBundle = new SettableImageProxyBundle(mCaptureIdList); setupSettableImageProxyBundleCallbacks(); } } ProcessingImageReader(int width, int height, int format, int maxImages,
            @Nullable Handler handler,
            @NonNull CaptureBundle captureBundle, @NonNull CaptureProcessor captureProcessor);   ProcessingImageReader(ImageReaderProxy imageReader, @Nullable Handler handler,
            @NonNull CaptureBundle captureBundle,
            @NonNull CaptureProcessor captureProcessor); @Override @Nullable ImageProxy acquireLatestImage(); @Override @Nullable ImageProxy acquireNextImage(); @Override void close(); @Override int getHeight(); @Override int getWidth(); @Override int getImageFormat(); @Override int getMaxImages(); @Override Surface getSurface(); @Override void setOnImageAvailableListener(
            @Nullable final ImageReaderProxy.OnImageAvailableListener listener,
            @Nullable Handler handler); void setCaptureBundle(@NonNull CaptureBundle captureBundle);  }