当前位置: 首页>>代码示例>>Java>>正文


Java CameraUtil.setGpsParameters方法代码示例

本文整理汇总了Java中com.android.camera.util.CameraUtil.setGpsParameters方法的典型用法代码示例。如果您正苦于以下问题:Java CameraUtil.setGpsParameters方法的具体用法?Java CameraUtil.setGpsParameters怎么用?Java CameraUtil.setGpsParameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.android.camera.util.CameraUtil的用法示例。


在下文中一共展示了CameraUtil.setGpsParameters方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: takeASnapshot

import com.android.camera.util.CameraUtil; //导入方法依赖的package包/类
private void takeASnapshot() {
    // Only take snapshots if video snapshot is supported by device
    if(!mCameraCapabilities.supports(CameraCapabilities.Feature.VIDEO_SNAPSHOT)) {
        Log.w(TAG, "Cannot take a video snapshot - not supported by hardware");
        return;
    }
    if (!mIsVideoCaptureIntent) {
        if (!mMediaRecorderRecording || mPaused || mSnapshotInProgress
                || !mAppController.isShutterEnabled() || mCameraDevice == null) {
            return;
        }

        Location loc = mLocationManager.getCurrentLocation();
        CameraUtil.setGpsParameters(mCameraSettings, loc);
        mCameraDevice.applySettings(mCameraSettings);

        Log.i(TAG, "Video snapshot start");
        mCameraDevice.takePicture(mHandler,
                null, null, null, new JpegPictureCallback(loc));
        showVideoSnapshotUI(true);
        mSnapshotInProgress = true;
    }
}
 
开发者ID:jameliu,项目名称:Camera2,代码行数:24,代码来源:VideoModule.java

示例2: takeASnapshot

import com.android.camera.util.CameraUtil; //导入方法依赖的package包/类
private void takeASnapshot() {
    // Only take snapshots if video snapshot is supported by device
    if (CameraUtil.isVideoSnapshotSupported(mParameters) && !mIsVideoCaptureIntent) {
        if (!mMediaRecorderRecording || mPaused || mSnapshotInProgress) {
            return;
        }
        MediaSaveService s = mActivity.getMediaSaveService();
        if (s == null || s.isQueueFull()) {
            return;
        }

        // Set rotation and gps data.
        int rotation = CameraUtil.getJpegRotation(mCameraId, mOrientation);
        mParameters.setRotation(rotation);
        Location loc = mLocationManager.getCurrentLocation();
        CameraUtil.setGpsParameters(mParameters, loc);
        mCameraDevice.setParameters(mParameters);

        Log.v(TAG, "Video snapshot start");
        mCameraDevice.takePicture(mHandler,
                null, null, null, new JpegPictureCallback(loc));
        showVideoSnapshotUI(true);
        mSnapshotInProgress = true;
        UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,
                UsageStatistics.ACTION_CAPTURE_DONE, "VideoSnapshot");
    }
}
 
开发者ID:asm-products,项目名称:nexus-camera,代码行数:28,代码来源:VideoModule.java

示例3: capture

import com.android.camera.util.CameraUtil; //导入方法依赖的package包/类
@Override
public boolean capture() {
    Log.i(TAG, "capture");
    // If we are already in the middle of taking a snapshot or the image
    // save request is full then ignore.
    if (mCameraDevice == null || mCameraState == SNAPSHOT_IN_PROGRESS
            || mCameraState == SWITCHING_CAMERA) {
        return false;
    }
    setCameraState(SNAPSHOT_IN_PROGRESS);

    mCaptureStartTime = System.currentTimeMillis();

    mPostViewPictureCallbackTime = 0;
    mJpegImageData = null;

    final boolean animateBefore = (mSceneMode == CameraCapabilities.SceneMode.HDR);

    if (animateBefore) {
        animateAfterShutter();
    }

    Location loc = mActivity.getLocationManager().getCurrentLocation();
    CameraUtil.setGpsParameters(mCameraSettings, loc);
    mCameraDevice.applySettings(mCameraSettings);

    // Set JPEG orientation. Even if screen UI is locked in portrait, camera orientation should
    // still match device orientation (e.g., users should always get landscape photos while
    // capturing by putting device in landscape.)
    int orientation = mActivity.isAutoRotateScreen() ? mDisplayRotation : mOrientation;
    Characteristics info = mActivity.getCameraProvider().getCharacteristics(mCameraId);
    mJpegRotation = info.getJpegOrientation(orientation);
    mCameraDevice.setJpegOrientation(mJpegRotation);

    Log.v(TAG, "capture orientation (screen:device:used:jpeg) " +
            mDisplayRotation + ":" + mOrientation + ":" +
            orientation + ":" + mJpegRotation);

    mCameraDevice.takePicture(mHandler,
            new ShutterCallback(!animateBefore),
            mRawPictureCallback, mPostViewPictureCallback,
            new JpegPictureCallback(loc));

    mNamedImages.nameNewImage(mCaptureStartTime);

    mFaceDetectionStarted = false;
    return true;
}
 
开发者ID:jameliu,项目名称:Camera2,代码行数:49,代码来源:PhotoModule.java

示例4: capture

import com.android.camera.util.CameraUtil; //导入方法依赖的package包/类
@Override
public boolean capture() {
    // If we are already in the middle of taking a snapshot or the image save request
    // is full then ignore.
    if (mCameraDevice == null || mCameraState == SNAPSHOT_IN_PROGRESS
            || mCameraState == SWITCHING_CAMERA
            || mActivity.getMediaSaveService().isQueueFull()) {
        return false;
    }
    mCaptureStartTime = System.currentTimeMillis();
    mPostViewPictureCallbackTime = 0;
    mJpegImageData = null;

    final boolean animateBefore = (mSceneMode == CameraUtil.SCENE_MODE_HDR);

    if (animateBefore) {
        animateAfterShutter();
    }

    // Set rotation and gps data.
    int orientation;
    // We need to be consistent with the framework orientation (i.e. the
    // orientation of the UI.) when the auto-rotate screen setting is on.
    if (mActivity.isAutoRotateScreen()) {
        orientation = (360 - mDisplayRotation) % 360;
    } else {
        orientation = mOrientation;
    }
    mJpegRotation = CameraUtil.getJpegRotation(mCameraId, orientation);
    mParameters.setRotation(mJpegRotation);
    Location loc = mLocationManager.getCurrentLocation();
    CameraUtil.setGpsParameters(mParameters, loc);
    mCameraDevice.setParameters(mParameters);

    // We don't want user to press the button again while taking a
    // multi-second HDR photo.
    mUI.enableShutter(false);
    mCameraDevice.takePicture(mHandler,
            new ShutterCallback(!animateBefore),
            mRawPictureCallback, mPostViewPictureCallback,
            new JpegPictureCallback(loc));

    mNamedImages.nameNewImage(mCaptureStartTime);

    mFaceDetectionStarted = false;
    setCameraState(SNAPSHOT_IN_PROGRESS);
    UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,
            UsageStatistics.ACTION_CAPTURE_DONE, "Photo");
    return true;
}
 
开发者ID:asm-products,项目名称:nexus-camera,代码行数:51,代码来源:PhotoModule.java


注:本文中的com.android.camera.util.CameraUtil.setGpsParameters方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。