Exemplo n.º 1
0
int CdrCamera::initCamera(unsigned int width, unsigned int height, unsigned int preview_sz_w, unsigned int preview_sz_h)
{
	HerbCamera::Parameters params;
	v4l2_queryctrl ctrl;
	if (!mHC) {
		return -1;
	}
	mHC->getParameters(&params);
	//params.dump();
	params.setPreviewSize(preview_sz_w, preview_sz_h); //isp small size
	params.setVideoSize(width, height);	//real sensor size
	ALOGD("(f:%s, l:%d) setPreviewSize[%dx%d], VideoSize[%dx%d]", __FUNCTION__, __LINE__, preview_sz_w, preview_sz_h, width, height);
	params.setPreviewFrameRate(FRONT_CAM_FRAMERATE);
	params.setPreviewFlip(mPreviewFlip);
    params.setPictureMode(CameraParameters::AWEXTEND_PICTURE_MODE_FAST);
    params.setPictureSizeMode(CameraParameters::AWEXTEND_PICTURE_SIZE_MODE::UseParameterPictureSize);
#ifndef SENSOR_DEBUG
	if(mId == CAM_CSI) {
		params.setContrastValue(ctrl.default_value);
		params.setBrightnessValue(ctrl.default_value);
		params.setSaturationValue(ctrl.default_value);
		params.setHueValue(ctrl.default_value);
	}
#endif
	mHC->setParameters(&params);
	mHC->setPreviewDisplay(mHlay);
	mCD->setBottom();
	mHC->setErrorCallback(this);
	return 0;
}
Exemplo n.º 2
0
void CdrCamera::setPictureSizeMode(int mode)
{ 
	HerbCamera::Parameters params;
	mHC->getParameters(&params);
	params.setPictureSizeMode(mode);
	mHC->setParameters(&params);

}