@Test public void transformSurfaceConfigWithYUVAnalysisSize() { SurfaceConfig surfaceConfig = mSurfaceManager.transformSurfaceConfig( LEGACY_CAMERA_ID, ImageFormat.YUV_420_888, mAnalysisSize); SurfaceConfig expectedSurfaceConfig = SurfaceConfig.create(ConfigType.YUV, ConfigSize.ANALYSIS); assertEquals(expectedSurfaceConfig, surfaceConfig); }
@Override public SurfaceConfig transformSurfaceConfig(String cameraId, int imageFormat, Size size) { SurfaceConfig surfaceConfig = null; if (!mIsInitialized) { throw new IllegalStateException("Camera2DeviceSurfaceManager is not initialized."); } SupportedSurfaceCombination supportedSurfaceCombination = mCameraSupportedSurfaceCombinationMap.get(cameraId); if (supportedSurfaceCombination != null) { surfaceConfig = supportedSurfaceCombination.transformSurfaceConfig(imageFormat, size); } return surfaceConfig; }
Camera2DeviceSurfaceManager implements CameraDeviceSurfaceManager { @Override public SurfaceConfig transformSurfaceConfig(String cameraId, int imageFormat, Size size) { SurfaceConfig surfaceConfig = null; if (!mIsInitialized) { throw new IllegalStateException("Camera2DeviceSurfaceManager is not initialized."); } SupportedSurfaceCombination supportedSurfaceCombination = mCameraSupportedSurfaceCombinationMap.get(cameraId); if (supportedSurfaceCombination != null) { surfaceConfig = supportedSurfaceCombination.transformSurfaceConfig(imageFormat, size); } return surfaceConfig; } }
Camera2DeviceSurfaceManager implements CameraDeviceSurfaceManager { @Override public SurfaceConfig transformSurfaceConfig(String cameraId, int imageFormat, Size size) { SurfaceConfig surfaceConfig = null; if (!mIsInitialized) { throw new IllegalStateException("Camera2DeviceSurfaceManager is not initialized."); } SupportedSurfaceCombination supportedSurfaceCombination = mCameraSupportedSurfaceCombinationMap.get(cameraId); if (supportedSurfaceCombination != null) { surfaceConfig = supportedSurfaceCombination.transformSurfaceConfig(imageFormat, size); } return surfaceConfig; } Camera2DeviceSurfaceManager(Context context); @VisibleForTesting  Camera2DeviceSurfaceManager(Context context, CamcorderProfileHelper camcorderProfileHelper); }
Camera2DeviceSurfaceManager implements CameraDeviceSurfaceManager { @Override public SurfaceConfig transformSurfaceConfig(String cameraId, int imageFormat, Size size) { SurfaceConfig surfaceConfig = null; if (!mIsInitialized) { throw new IllegalStateException("Camera2DeviceSurfaceManager is not initialized."); } SupportedSurfaceCombination supportedSurfaceCombination = mCameraSupportedSurfaceCombinationMap.get(cameraId); if (supportedSurfaceCombination != null) { surfaceConfig = supportedSurfaceCombination.transformSurfaceConfig(imageFormat, size); } return surfaceConfig; } 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 SurfaceConfig transformSurfaceConfig(String cameraId, int imageFormat, Size size) { SurfaceConfig surfaceConfig = null; if (!mIsInitialized) { throw new IllegalStateException("Camera2DeviceSurfaceManager is not initialized."); } SupportedSurfaceCombination supportedSurfaceCombination = mCameraSupportedSurfaceCombinationMap.get(cameraId); if (supportedSurfaceCombination != null) { surfaceConfig = supportedSurfaceCombination.transformSurfaceConfig(imageFormat, size); } return surfaceConfig; } 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);  }