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


C++ CameraParameters::unflatten方法代码示例

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


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

示例1:

void
GonkCameraHardware::PullParameters(CameraParameters& aParams)
{
  if (!NS_WARN_IF(mClosing)) {
    const String8 s = mCamera->getParameters();
    aParams.unflatten(s);
  }
}
开发者ID:ShakoHo,项目名称:gecko-dev,代码行数:8,代码来源:GonkCameraHwMgr.cpp

示例2: s

void
TestGonkCameraHardware::PullParameters(CameraParameters& aParams)
{
  DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__);
  nsString as;
  nsresult rv = WaitWhileRunningOnMainThread(new PullParametersDelegate(this, &as));
  if (NS_WARN_IF(NS_FAILED(rv))) {
    as.Truncate();
  }

  String8 s(NS_LossyConvertUTF16toASCII(as).get());
  aParams.unflatten(s);
}
开发者ID:lgarner,项目名称:mozilla-central,代码行数:13,代码来源:TestGonkCameraHardware.cpp

示例3:

void
GonkCameraHardware::PullParameters(CameraParameters& aParams)
{
  const String8 s = mCamera->getParameters();
  aParams.unflatten(s);
}
开发者ID:JCROM-FxOS,项目名称:b2jc_gecko,代码行数:6,代码来源:GonkCameraHwMgr.cpp

示例4: camera_open

/*! 
 \return 0 on success, otherwise error code
*/
int camera_open(void)
{
	LOGE("%s",__FUNCTION__);

	CameraParameters	params;
	status_t		rtn;

	/* Open video device */
	#ifdef CAMERA_FOR_SCANNER
	//pCamera = CameraScanner::connect(0);
	

	
#ifdef CAMERA_FOR_SCANNER
	fd = open("/sys/devices/platform/image_sensor/currDrvIndex",O_RDWR);
    if(fd<0)
	{
		LOGE("Cannot open currDrvIndex\n");
		return -1;
	}
	int temp = 20002;
	write(fd,"20002",5);

	fd_scanner1 = open(SE955_CHANNEL_NAME, O_RDONLY);
 
#endif
	pCamera = Camera::connect(1);
	#else
	pCamera = CameraScanner::connect(ANDROID_CAMERA_ID);
	//pCamera = CameraScanner::connect(0);
	#endif
	if( pCamera == 0)
	{
		LOGE("Cannot connect to camera %d of: %i, %s\n", ANDROID_CAMERA_ID, errno, strerror(errno));
		return -errno;
	}

	LOGE("Camera %d \n", ANDROID_CAMERA_ID);
#ifdef CAMERA_FOR_SCANNER
pCamera->setListener(&scannerListener);	//enable data callback

#else

	pCamera->setScannerListener(&scannerListener);	//enable data callback
#endif

#ifdef VIDEO_SUBDEV 
	/* Open subdevice */
	video_subdev_handle = ::open(VIDEO_SUBDEV, O_RDWR);
	if (video_subdev_handle == -1) {
		LOGE("ERROR opening %s: %d\n", VIDEO_SUBDEV, errno);
		return -errno;
	}

	LOGE("Subdevice: %s, handle = %d\n", VIDEO_SUBDEV, video_subdev_handle);
#endif

	ImagerProps.width = 256; ImagerProps.height = 64;
#ifdef CAMERA_FOR_SCANNER
			//ImagerProps.width = 624;
			//ImagerProps.height = 474;
			ImagerProps.width = 640;
			ImagerProps.height = 480;
			ImagerProps.mount = 2;
			ImagerProps.i2c_addr_sensor = 0x48;
			ImagerProps.i2c_addr_psoc = 0x40;
			ImagerProps.i2c_addr_clock = 0x69;
#else

	if( 0 != camera_ioctl(HSM_GET_PROPERTIES, &ImagerProps) )
	{
		pCamera->disconnect();
		LOGE("HSM_GET_PROPERTIES error %d\n", errno);
		return -1;
	}
#endif

#ifdef CAMERA_FOR_SCANNER
#else

	LOGE("Image size = %dx%d\n", ImagerProps.width, ImagerProps.height);
#endif

	cbBufLength = ImagerProps.height * ImagerProps.width;

	params.unflatten(pCamera->getParameters());
	params.set("mtk-cam-mode", 1);
#if 0 //def CAMERA_FOR_SCANNER
#else
	params.set("scanner-mode", "on");
#endif
	params.setPreviewSize(ImagerProps.width, ImagerProps.height);
	//params.setPreviewFormat("yuv422i-yuyv"); // FIXME: "raw"
	//params.setPreviewFormat("yuv420sp"); // FIXME: "raw" 
	rtn = pCamera->setParameters(params.flatten());
	if( rtn != OK )
	{
//.........这里部分代码省略.........
开发者ID:gyzxc123,项目名称:libHsmKil,代码行数:101,代码来源:camera_device_acam.cpp


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