赞
踩
一、应用程序
1.Camera应用使用的参数对象
frameworks/base/core/java/android/hardware/Camera.java- public class Parameters {
-
- }
2.使用
Camera拍照预览:
packages/apps/Camera/src/com/android/camera/CameraModule.java
- mInitialParams = mCameraDevice.getParameters();
- mInitialParams.getSupportedPreviewSizes();
- mInitialParams.setPreviewSize(maxSize.width,maxSize.height);
Camera拍照:
- mInitialParams.setPictureSize(maxSize.width,maxSize.height);
- mCameraDevice.setParameters(mInitialParams);
Camera录像预览:
packages/apps/Camera/src/com/android/camera/VideoModule.java
- InitialParams = vCameraDevice.getParameters();
- vInitialParams.getSupportedVideoSizes();
- mParameters.setPreviewSize();
- vCameraDevice.setParameters(mParameters);
二、MediaRecorder
1.CameraSource使用的参数对象frameworks/av/camera/CameraParameters.cpp
- void CameraParameters::getVideoSize(int *width, int *height) const{
-
- }
2.使用
frameworks/av/media/libstagefright/CameraSource.cpp
- status_t CameraSource::checkVideoSize(
- const CameraParameters& params,
- int32_t width, int32_t height) {
- params.getVideoSize(&frameWidthActual, &frameHeightActual);
- if (frameWidthActual != width || frameHeightActual != height) {
- ALOGE("Failed to set video frame size to %dx%d. " "The actual video size is %dx%d ", width, height, frameWidthActual, frameHeightActual);
- }
- }
三、CameraHAL
1.CameraHAL使用的参数对象
frameworks/av/camera/CameraParameters.cpp2.使用
hardware/amlogic/camera/CameraHal.cpp
- int CameraHal::setParameters(const CameraParameters& params){
- //add by tank for CameraSource video recorder
- mParameters.setVideoSize(w,h);
- //end tan 2013-12-3
- // Handle RECORDING_HINT to Set/Reset Video Mode Parameters
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。