CameraManager

openCameraForUid

(cameraId, callback, executor, USE_CALLING_UID);

openCameraDeviceUserAsync

characteristics = getCameraCharacteristics(cameraId);

ICameraService cameraService =

CameraManagerGlobal.get().getCameraService();

compose epic...

 android.hardware.camera2.impl.CameraDeviceImpl deviceImpl =

          new android.hardware.camera2.impl.CameraDeviceImpl(

            cameraId,

            callback,

            executor,

            characteristics,

            mContext.getApplicationInfo().targetSdkVersion);

ICameraDeviceCallbacks callbacks = deviceImpl.getCallbacks();

  public CameraDeviceCallbacks getCallbacks() {

    return mCallbacks;

  }

mCallbacks = new CameraDeviceCallbacks();

 public class CameraDeviceCallbacks extends ICameraDeviceCallbacks.Stub {


}

 ICameraService cameraService = CameraManagerGlobal.get().getCameraService();

 cameraUser = cameraService.connectDevice(callbacks, cameraId,

              mContext.getOpPackageName(), uid);

compose epic...

compose epic...

ICameraService cameraService = CameraManagerGlobal.get().getCameraService();

CameraManagerGlobal

 CameraManagerGlobal get(){

 return gCameraManager;

}

gCameraManager= new CameraManagerGlobal();

class CameraManagerGlobal extends ICameraServiceListener.Stub

public ICameraService getCameraService()

connectCameraServiceLocked

IBinder cameraServiceBinder =

ServiceManager.getService("media.camera");

ICameraService cameraService =

ICameraService.Stub.asInterface(cameraServiceBinder);

CameraMetadataNative.setupGlobalVendorTagDescriptor();

cameraStatuses = cameraService.addListener(this);

        for (CameraStatus c : cameraStatuses) {

          onStatusChangedLocked(c.status, c.cameraId);

        }

compose epic...

ICameraService cameraService = ICameraService.Stub.asInterface(cameraServiceBinder);

CameraMetadataNative

setupGlobalVendorTagDescriptor

nativeSetupGlobalVendorTagDescriptor

调用了JNI nativer 函数....

compose epic...

compose epic...

openCamera

openCamera

2019-03-11 15:44:06 0 57
这里是评论

相关推荐