Exemple #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;
}
Exemple #2
0
void CdrCamera::setContrast(int mode)
{
	db_error("setContrast");
	HerbCamera::Parameters params;

	mHC->getParameters(&params);
	//params.dump();
	mode = 25*mode;
	params.setContrastValue(mode);
#ifndef SENSOR_DEBUG
	mHC->setParameters(&params);
#endif
}