Home | History | Annotate | Download | only in one
      1 /*
      2  * Copyright (C) 2014 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.camera.one;
     18 
     19 import android.os.Handler;
     20 
     21 import com.android.camera.FatalErrorHandler;
     22 import com.android.camera.SoundPlayer;
     23 import com.android.camera.async.MainThread;
     24 import com.android.camera.burst.BurstFacade;
     25 import com.android.camera.device.CameraId;
     26 import com.android.camera.one.OneCamera.OpenCallback;
     27 import com.android.camera.one.v2.photo.ImageRotationCalculator;
     28 
     29 /**
     30  * The camera manager is responsible for instantiating {@link OneCamera}
     31  * instances.
     32  */
     33 public interface OneCameraOpener {
     34     /**
     35      * Attempts to open the given camera with the provided parameters and
     36      * settings.
     37      * <p>
     38      * Exactly one call will always be made to a single method in the provided
     39      * {@link OpenCallback}.
     40      *
     41      * @param cameraId the specific camera to open.
     42      * @param captureSetting the related settings to configure the camera for
     43      *            capture.
     44      * @param handler the handler on which callback methods are invoked.
     45      * @param mainThread Main thread executor
     46      * @param imageRotationCalculator Image rotation calculator required for
     47      *            Camera Factory initialization
     48      * @param burstController the burst facade to configure
     49      * @param soundPlayer the sound player.
     50      * @param openCallback this listener is called when the camera was opened or
     51      *            when it failed to open.
     52      * @param fatalErrorHandler the fatal error handler to use for indicating
     53      *            fatal errors
     54      */
     55     public abstract void open(
     56             CameraId cameraId,
     57             OneCameraCaptureSetting captureSetting,
     58             Handler handler,
     59             MainThread mainThread,
     60             ImageRotationCalculator imageRotationCalculator,
     61             BurstFacade burstController,
     62             SoundPlayer soundPlayer,
     63             OpenCallback openCallback,
     64             FatalErrorHandler fatalErrorHandler);
     65 
     66 }
     67