@Test public void getMaximumSizeForImageFormat() { Size maximumYUVSize = mSurfaceManager.getMaxOutputSize(LEGACY_CAMERA_ID, ImageFormat.YUV_420_888); assertEquals(mMaximumSize, maximumYUVSize); Size maximumJPEGSize = mSurfaceManager.getMaxOutputSize(LEGACY_CAMERA_ID, ImageFormat.JPEG); assertEquals(mMaximumSize, maximumJPEGSize); }
@Override public Size getMaxOutputSize(String cameraId, int imageFormat) { if (!mIsInitialized) { throw new IllegalStateException("CameraDeviceSurfaceManager is not initialized."); } SupportedSurfaceCombination supportedSurfaceCombination = mCameraSupportedSurfaceCombinationMap.get(cameraId); if (supportedSurfaceCombination == null) { throw new IllegalArgumentException( "Fail to find supported surface info - CameraId:" + cameraId); } return supportedSurfaceCombination.getMaxOutputSizeByFormat(imageFormat); }
Camera2DeviceSurfaceManager implements CameraDeviceSurfaceManager { @Override public Size getMaxOutputSize(String cameraId, int imageFormat) { if (!mIsInitialized) { throw new IllegalStateException("CameraDeviceSurfaceManager is not initialized."); } SupportedSurfaceCombination supportedSurfaceCombination = mCameraSupportedSurfaceCombinationMap.get(cameraId); if (supportedSurfaceCombination == null) { throw new IllegalArgumentException( "Fail to find supported surface info - CameraId:" + cameraId); } return supportedSurfaceCombination.getMaxOutputSizeByFormat(imageFormat); } }
Camera2DeviceSurfaceManager implements CameraDeviceSurfaceManager { @Override public Size getMaxOutputSize(String cameraId, int imageFormat) { if (!mIsInitialized) { throw new IllegalStateException("CameraDeviceSurfaceManager is not initialized."); } SupportedSurfaceCombination supportedSurfaceCombination = mCameraSupportedSurfaceCombinationMap.get(cameraId); if (supportedSurfaceCombination == null) { throw new IllegalArgumentException( "Fail to find supported surface info - CameraId:" + cameraId); } return supportedSurfaceCombination.getMaxOutputSizeByFormat(imageFormat); } Camera2DeviceSurfaceManager(Context context); @VisibleForTesting  Camera2DeviceSurfaceManager(Context context, CamcorderProfileHelper camcorderProfileHelper); }
Camera2DeviceSurfaceManager implements CameraDeviceSurfaceManager { @Override public Size getMaxOutputSize(String cameraId, int imageFormat) { if (!mIsInitialized) { throw new IllegalStateException("CameraDeviceSurfaceManager is not initialized."); } SupportedSurfaceCombination supportedSurfaceCombination = mCameraSupportedSurfaceCombinationMap.get(cameraId); if (supportedSurfaceCombination == null) { throw new IllegalArgumentException( "Fail to find supported surface info - CameraId:" + cameraId); } return supportedSurfaceCombination.getMaxOutputSizeByFormat(imageFormat); } Camera2DeviceSurfaceManager(Context context); @VisibleForTesting  Camera2DeviceSurfaceManager(Context context, CamcorderProfileHelper camcorderProfileHelper); @Override boolean checkSupported(
            String cameraId, List<SurfaceConfig> surfaceConfigList); @Override SurfaceConfig transformSurfaceConfig(String cameraId, int imageFormat, Size size); @Override Map<UseCase, Size> getSuggestedResolutions(
            String cameraId, List<UseCase> originalUseCases, List<UseCase> newUseCases); @Override Size getMaxOutputSize(String cameraId, int imageFormat); @Override Size getPreviewSize(); @Override boolean requiresCorrectedAspectRatio(@NonNull UseCaseConfig<?> useCaseConfig); @Nullable @Override Rational getCorrectedAspectRatio(@NonNull UseCaseConfig<?> useCaseConfig); }
Camera2DeviceSurfaceManager implements CameraDeviceSurfaceManager { @Override public Size getMaxOutputSize(String cameraId, int imageFormat) { if (!mIsInitialized) { throw new IllegalStateException("CameraDeviceSurfaceManager is not initialized."); } SupportedSurfaceCombination supportedSurfaceCombination = mCameraSupportedSurfaceCombinationMap.get(cameraId); if (supportedSurfaceCombination == null) { throw new IllegalArgumentException( "Fail to find supported surface info - CameraId:" + cameraId); } return supportedSurfaceCombination.getMaxOutputSizeByFormat(imageFormat); } Camera2DeviceSurfaceManager(Context context); @VisibleForTesting  Camera2DeviceSurfaceManager(Context context, CamcorderProfileHelper camcorderProfileHelper); @Override boolean checkSupported(
            String cameraId, List<SurfaceConfig> surfaceConfigList); @Override SurfaceConfig transformSurfaceConfig(String cameraId, int imageFormat, Size size); @Override Map<UseCase, Size> getSuggestedResolutions(
            String cameraId, List<UseCase> originalUseCases, List<UseCase> newUseCases); @Override Size getMaxOutputSize(String cameraId, int imageFormat); @Override Size getPreviewSize(); @Override boolean requiresCorrectedAspectRatio(@NonNull UseCaseConfig<?> useCaseConfig); @Nullable @Override Rational getCorrectedAspectRatio(@NonNull UseCaseConfig<?> useCaseConfig);  }