本文整理汇总了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);
}
}
示例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);
}
示例3:
void
GonkCameraHardware::PullParameters(CameraParameters& aParams)
{
const String8 s = mCamera->getParameters();
aParams.unflatten(s);
}
示例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 )
{
//.........这里部分代码省略.........