本文整理汇总了C++中sp::disconnect方法的典型用法代码示例。如果您正苦于以下问题:C++ sp::disconnect方法的具体用法?C++ sp::disconnect怎么用?C++ sp::disconnect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sp
的用法示例。
在下文中一共展示了sp::disconnect方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: closeCameraConnect
void CameraHandler::closeCameraConnect()
{
if (camera == NULL)
{
LOGI("... camera is already NULL");
return;
}
camera->stopPreview();
camera->disconnect();
camera.clear();
camera = NULL;
// ATTENTION!!!!!!!!!!!!!!!!!!!!!!!!!!
// When we set
// camera=NULL
// above, the pointed instance of android::Camera object is destructed,
// since this member `camera' has type android::sp<Camera> (android smart pointer template class),
// and this is the only pointer to it.
//
// BUT this instance of CameraHandler is set as a listener for that android::Camera object
// (see the function CameraHandler::initCameraConnect above),
// so this instance of CameraHandler is pointed from that android::Camera object as
// sp<CameraListener> mListener
// and there is no other android smart pointers to this.
//
// It means, when that instance of the android::Camera object is destructed,
// it calls destructor for this CameraHandler instance too.
//
// So, this line `camera=NULL' causes to the call `delete this'
// (see destructor of the template class android::sp)
//
// So, we must not call `delete this' after the line, since it just has been called indeed
}
示例2: com_mediatek_effect_FaceBeautyEffect_release
void com_mediatek_effect_FaceBeautyEffect_release(JNIEnv* env, jobject thiz)
{
MY_LOGI("[%s]", __func__);
if (g_effectClientFB != 0)
{
MY_LOGD("disconnect");
g_effectClientFB->disconnect();
return;
}
}
示例3: capture_cleanup
/**
* Clean up and stop camera module
*/
int CaptureCommand::capture_cleanup() {
if (mHardwareActive) {
mCamera->stopPreview();
mLooper->stop();
// Close camera
if (NULL != mCamera.get()) {
mCamera->disconnect();
mCamera.clear();
}
}
mHardwareActive = false;
notifyCameraEvent("stopped");
return 0;
}
示例4: camera_deinit
/*!
*/
void camera_deinit(void)
{
LOGE("%s into",__FUNCTION__);
#ifdef VIDEO_SUBDEV
if( video_subdev_handle != INVALID_HANDLE )
{
::close (video_subdev_handle);
video_subdev_handle = INVALID_HANDLE;
}
#endif
/* Release camera */
if( pCamera != 0 )
{
camera_streamoff();
LOGE("Disconnect Camera");
pCamera->disconnect();
pCamera = NULL;
}
if( pBuffers )
{
free(pBuffers);
pBuffers = NULL;
nNumBuffers = 0;
}
pthread_mutex_destroy(&accessQueue);
#ifdef CAMERA_FOR_SCANNER
int temp = 20001;
if(fd>=0)write(fd,"20001",5);
close(fd);
close(fd_scanner1);
#endif
LOGE("%s exit",__FUNCTION__);
}
示例5:
~AfterConnect() {
c->disconnect();
c.clear();
cc.clear();
cs.clear();
}
示例6: 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 )
{
//.........这里部分代码省略.........
示例7: LOGD
JNIEXPORT void JNICALL Java_com_mediatek_ut_SurfaceFlingerTest_disconnect(JNIEnv /**_env*/, jobject /*_this*/, jint id) {
LOGD("disconnect");
utProc->disconnect(id);
LOGI("disconnect, id=%d, utProc=%p", id, utProc.get());
}