• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ disableMsgType函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中disableMsgType函数的典型用法代码示例。如果您正苦于以下问题:C++ disableMsgType函数的具体用法?C++ disableMsgType怎么用?C++ disableMsgType使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: LOG1

// stop preview mode
void CameraClient::stopPreview() {
    LOG1("stopPreview (pid %d)", getCallingPid());
#ifdef QCOM_HARDWARE
    disableMsgType(CAMERA_MSG_PREVIEW_METADATA);
#endif
    Mutex::Autolock lock(mLock);
    if (checkPidAndHardware() != NO_ERROR) return;

#ifdef OMAP_ENHANCEMENT
    // According to framework documentation, preview needs
    // to be started for image capture. This will make sure
    // that image capture related messages get disabled if
    // not done already in their respective handlers.
    // If these messages come when in the midddle of
    // stopping preview we will deadlock the system in
    // lockIfMessageWanted().
    disableMsgType(CAMERA_MSG_POSTVIEW_FRAME);
#endif

    disableMsgType(CAMERA_MSG_PREVIEW_FRAME);
#ifdef QCOM_HARDWARE
    //Disable picture related message types
    ALOGI("stopPreview: Disable picture related messages");
    int picMsgType = 0;
    picMsgType = (CAMERA_MSG_SHUTTER |
                  CAMERA_MSG_POSTVIEW_FRAME |
                  CAMERA_MSG_RAW_IMAGE |
                  CAMERA_MSG_RAW_IMAGE_NOTIFY |
                  CAMERA_MSG_COMPRESSED_IMAGE);
    disableMsgType(picMsgType);
#endif
    mHardware->stopPreview();

    mPreviewBuffer.clear();
}
开发者ID:InsomniaROM,项目名称:android_frameworks_av,代码行数:36,代码来源:CameraClient.cpp


示例2: LOG1

status_t CameraClient::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) {
    LOG1("sendCommand (pid %d)", getCallingPid());
    int orientation;
    Mutex::Autolock lock(mLock);
    status_t result = checkPidAndHardware();
    if (result != NO_ERROR) return result;

    if (cmd == CAMERA_CMD_SET_DISPLAY_ORIENTATION) {
        // Mirror the preview if the camera is front-facing.
        orientation = getOrientation(arg1, mCameraFacing == CAMERA_FACING_FRONT);
        if (orientation == -1) return BAD_VALUE;

        if (mOrientation != orientation) {
            mOrientation = orientation;
            if (mPreviewWindow != 0) {
                native_window_set_buffers_transform(mPreviewWindow.get(),
                        mOrientation);
            }
        }
        return OK;
    } else if (cmd == CAMERA_CMD_ENABLE_SHUTTER_SOUND) {
        switch (arg1) {
            case 0:
                return enableShutterSound(false);
            case 1:
                return enableShutterSound(true);
            default:
                return BAD_VALUE;
        }
        return OK;
    } else if (cmd == CAMERA_CMD_PLAY_RECORDING_SOUND) {
        mCameraService->playSound(CameraService::SOUND_RECORDING);
    } else if (cmd == CAMERA_CMD_SET_VIDEO_BUFFER_COUNT) {
        // Silently ignore this command
        return INVALID_OPERATION;
    } else if (cmd == CAMERA_CMD_PING) {
        // If mHardware is 0, checkPidAndHardware will return error.
        return OK;
#ifdef QCOM_HARDWARE
    } else if (cmd == CAMERA_CMD_HISTOGRAM_ON) {
        enableMsgType(CAMERA_MSG_STATS_DATA);
    } else if (cmd == CAMERA_CMD_HISTOGRAM_OFF) {
        disableMsgType(CAMERA_MSG_STATS_DATA);
    } else if (cmd == CAMERA_CMD_METADATA_ON) {
        enableMsgType(CAMERA_MSG_META_DATA);
    } else if (cmd == CAMERA_CMD_METADATA_OFF) {
        disableMsgType(CAMERA_MSG_META_DATA);
    } else if ( cmd == CAMERA_CMD_LONGSHOT_ON ) {
        mLongshotEnabled = true;
    } else if ( cmd == CAMERA_CMD_LONGSHOT_OFF ) {
        mLongshotEnabled = false;
        disableMsgType(CAMERA_MSG_SHUTTER);
        disableMsgType(CAMERA_MSG_COMPRESSED_IMAGE);
#endif
    }

    return mHardware->sendCommand(cmd, arg1, arg2);
}
开发者ID:DaniBen,项目名称:frameworks_av,代码行数:58,代码来源:CameraClient.cpp


示例3: LOG1

status_t CameraService::Client::sendCommand(int32_t cmd, int32_t arg1, int32_t arg2) {
    LOG1("sendCommand (pid %d)", getCallingPid());
    int orientation;
    Mutex::Autolock lock(mLock);
    status_t result = checkPidAndHardware();
    if (result != NO_ERROR) return result;

    if (cmd == CAMERA_CMD_SET_DISPLAY_ORIENTATION) {
        // Mirror the preview if the camera is front-facing.
        orientation = getOrientation(arg1, mCameraFacing == CAMERA_FACING_FRONT);
        if (orientation == -1) return BAD_VALUE;

        if (mOrientation != orientation) {
            mOrientation = orientation;
            if (mPreviewWindow != 0) {
                native_window_set_buffers_transform(mPreviewWindow.get(),
                        mOrientation);
            }
        }
        return OK;
    } else if (cmd == CAMERA_CMD_ENABLE_SHUTTER_SOUND) {
        switch (arg1) {
            case 0:
                enableShutterSound(false);
                break;
            case 1:
                enableShutterSound(true);
                break;
            default:
                return BAD_VALUE;
        }
        return OK;
    } else if (cmd == CAMERA_CMD_PLAY_RECORDING_SOUND) {
        mCameraService->playSound(SOUND_RECORDING);
    }
    else if (cmd == CAMERA_CMD_HISTOGRAM_ON ) {
        enableMsgType(CAMERA_MSG_STATS_DATA);
    }
    else if (cmd ==  CAMERA_CMD_HISTOGRAM_OFF) {
        disableMsgType(CAMERA_MSG_STATS_DATA);
    } else if (cmd ==   CAMERA_CMD_START_FACE_DETECTION) {
      mFaceDetection = true;
      enableMsgType(CAMERA_MSG_PREVIEW_METADATA);
    } else if (cmd ==   CAMERA_CMD_STOP_FACE_DETECTION) {
      mFaceDetection = false;
      disableMsgType(CAMERA_MSG_PREVIEW_METADATA);
    }


    return mHardware->sendCommand(cmd, arg1, arg2);
}
开发者ID:manpham,项目名称:frameworks_base,代码行数:51,代码来源:CameraService.cpp


示例4: disableMsgType

// snapshot taken callback
void CameraClient::handleShutter(void) {
    if (mPlayShutterSound) {
        mCameraService->playSound(CameraService::SOUND_SHUTTER);
    }

    sp<ICameraClient> c = mRemoteCallback;
    if (c != 0) {
//!++
#if 1
#else
        mLock.unlock();
#endif
//!--
        c->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0);
        if (!lockIfMessageWanted(CAMERA_MSG_SHUTTER)) return;
    }
    disableMsgType(CAMERA_MSG_SHUTTER);

//!++
#if 1
#else
    mLock.unlock();
#endif
//!--
}
开发者ID:lbule,项目名称:android_frameworks_av-cm-12.1-mtk,代码行数:26,代码来源:CameraClient.cpp


示例5: LOG2

// preview callback - frame buffer update
void CameraClient::handlePreviewData(int32_t msgType,
                                              const sp<IMemory>& mem,
                                              camera_frame_metadata_t *metadata) {
    ssize_t offset;
    size_t size;
    sp<IMemoryHeap> heap = mem->getMemory(&offset, &size);

    // local copy of the callback flags
    int flags = mPreviewCallbackFlag;

    // is callback enabled?
    if (!(flags & CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK)) {
        // If the enable bit is off, the copy-out and one-shot bits are ignored
        LOG2("frame callback is disabled");
//!++
#if 1
#else
        mLock.unlock();
#endif
//!--
        return;
    }

    // hold a strong pointer to the client
    sp<ICameraClient> c = mRemoteCallback;

    // clear callback flags if no client or one-shot mode
    if (c == 0 || (mPreviewCallbackFlag & CAMERA_FRAME_CALLBACK_FLAG_ONE_SHOT_MASK)) {
        LOG2("Disable preview callback");
        mPreviewCallbackFlag &= ~(CAMERA_FRAME_CALLBACK_FLAG_ONE_SHOT_MASK |
                                  CAMERA_FRAME_CALLBACK_FLAG_COPY_OUT_MASK |
                                  CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK);
        disableMsgType(CAMERA_MSG_PREVIEW_FRAME);
    }

    if (c != 0) {
        // Is the received frame copied out or not?
        if (flags & CAMERA_FRAME_CALLBACK_FLAG_COPY_OUT_MASK) {
            LOG2("frame is copied");
            copyFrameAndPostCopiedFrame(msgType, c, heap, offset, size, metadata);
        } else {
            LOG2("frame is forwarded");
//!++
#if 1
#else
            mLock.unlock();
#endif
//!--
            c->dataCallback(msgType, mem, metadata);
        }
    } else {
//!++
#if 1
#else
        mLock.unlock();
#endif
//!--
    }
}
开发者ID:lbule,项目名称:android_frameworks_av-cm-12.1-mtk,代码行数:60,代码来源:CameraClient.cpp


示例6: disableMsgType

// snapshot taken callback
// "size" is the width and height of yuv picture for registerBuffer.
// If it is NULL, use the picture size from parameters.
void CameraService::Client::handleShutter(image_rect_type *size
#ifdef BOARD_USE_CAF_LIBCAMERA
    , bool playShutterSoundOnly
#endif
) {

#ifdef BOARD_USE_CAF_LIBCAMERA
    if(playShutterSoundOnly) {
#endif
    mCameraService->playSound(SOUND_SHUTTER);
#ifdef BOARD_USE_CAF_LIBCAMERA
    sp<ICameraClient> c = mCameraClient;
    if (c != 0) {
        mLock.unlock();
        c->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0);
    }
    return;
    }
#endif

    // Screen goes black after the buffer is unregistered.
    if (mSurface != 0 && !mUseOverlay) {
        mSurface->unregisterBuffers();
    }

    sp<ICameraClient> c = mCameraClient;
    if (c != 0) {
        mLock.unlock();
        c->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0);
        if (!lockIfMessageWanted(CAMERA_MSG_SHUTTER)) return;
    }
    disableMsgType(CAMERA_MSG_SHUTTER);

    // It takes some time before yuvPicture callback to be called.
    // Register the buffer for raw image here to reduce latency.
    if (mSurface != 0 && !mUseOverlay) {
        int w, h;
        CameraParameters params(mHardware->getParameters());
        if (size == NULL) {
            params.getPictureSize(&w, &h);
        } else {
            w = size->width;
            h = size->height;
            w &= ~1;
            h &= ~1;
            LOG1("Snapshot image width=%d, height=%d", w, h);
        }
        // FIXME: don't use hardcoded format constants here
        ISurface::BufferHeap buffers(w, h, w, h,
            HAL_PIXEL_FORMAT_YCrCb_420_SP, mOrientation, 0,
            mHardware->getRawHeap());

        mSurface->registerBuffers(buffers);
        IPCThreadState::self()->flushCommands();
    }

    mLock.unlock();
}
开发者ID:matt4542,项目名称:frameworks_base,代码行数:61,代码来源:CameraService.cpp


示例7: disableMsgType

// picture callback - postview image ready
void CameraService::Client::handlePostview(const sp<IMemory>& mem) {
    disableMsgType(CAMERA_MSG_POSTVIEW_FRAME);

    sp<ICameraClient> c = mCameraClient;
    mLock.unlock();
    if (c != 0) {
        c->dataCallback(CAMERA_MSG_POSTVIEW_FRAME, mem, NULL);
    }
}
开发者ID:28vicky,项目名称:platform_frameworks_base,代码行数:10,代码来源:CameraService.cpp


示例8: LOG1

// stop recording mode
void CameraService::Client::stopRecording() {
    LOG1("stopRecording (pid %d)", getCallingPid());
    Mutex::Autolock lock(mLock);
    if (checkPidAndHardware() != NO_ERROR) return;

    mCameraService->playSound(SOUND_RECORDING);
    disableMsgType(CAMERA_MSG_VIDEO_FRAME);
    mHardware->stopRecording();

    mPreviewBuffer.clear();
}
开发者ID:28vicky,项目名称:platform_frameworks_base,代码行数:12,代码来源:CameraService.cpp


示例9: LOG2

		// preview callback - frame buffer update
		void CameraService::Client::handlePreviewData(const sp<IMemory>& mem) {
			ssize_t offset;
			size_t size;
			sp<IMemoryHeap> heap = mem->getMemory(&offset, &size);
			
			if (!mUseOverlay) {
				if (mSurface != 0) {
					mSurface->postBuffer(offset);
				}
			}
			
			// local copy of the callback flags
			int flags = mPreviewCallbackFlag;
			
			// is callback enabled?
			if (!(flags & FRAME_CALLBACK_FLAG_ENABLE_MASK)) {
				// If the enable bit is off, the copy-out and one-shot bits are ignored
				LOG2("frame callback is disabled");
				mLock.unlock();
				return;
			}
			
			// hold a strong pointer to the client
			sp<ICameraClient> c = mCameraClient;
			
			// clear callback flags if no client or one-shot mode
			if (c == 0 || (mPreviewCallbackFlag & FRAME_CALLBACK_FLAG_ONE_SHOT_MASK)) {
				LOG2("Disable preview callback");
				mPreviewCallbackFlag &= ~(FRAME_CALLBACK_FLAG_ONE_SHOT_MASK |
										  FRAME_CALLBACK_FLAG_COPY_OUT_MASK |
										  FRAME_CALLBACK_FLAG_ENABLE_MASK);
				if (mUseOverlay) {
					disableMsgType(CAMERA_MSG_PREVIEW_FRAME);
				}
			}
			
			if (c != 0) {
				// Is the received frame copied out or not?
				if (flags & FRAME_CALLBACK_FLAG_COPY_OUT_MASK) {
					LOG2("frame is copied");
					copyFrameAndPostCopiedFrame(c, heap, offset, size);
				} else {
					LOG2("frame is forwarded");
					mLock.unlock();
					c->dataCallback(CAMERA_MSG_PREVIEW_FRAME, mem);
				}
			} else {
				mLock.unlock();
			}
		}
开发者ID:HyperDroid,项目名称:android_frameworks_base_deprecated,代码行数:51,代码来源:CameraService.cpp


示例10: getCallingPid

void CameraClient::disconnect() {
    int callingPid = getCallingPid();
    LOG1("disconnect E (pid %d)", callingPid);
    Mutex::Autolock lock(mLock);

    // Allow both client and the media server to disconnect at all times
    if (callingPid != mClientPid && callingPid != mServicePid) {
        ALOGW("different client - don't disconnect");
        return;
    }

    if (mClientPid <= 0) {
        LOG1("camera is unlocked (mClientPid = %d), don't tear down hardware", mClientPid);
        return;
    }

    // Make sure disconnect() is done once and once only, whether it is called
    // from the user directly, or called by the destructor.
    if (mHardware == 0) return;

    LOG1("hardware teardown");
    // Before destroying mHardware, we must make sure it's in the
    // idle state.
    // Turn off all messages.
    disableMsgType(CAMERA_MSG_ALL_MSGS);
    mHardware->stopPreview();
    mHardware->cancelPicture();
    // Release the hardware resources.
    mHardware->release();

    // Release the held ANativeWindow resources.
    if (mPreviewWindow != 0) {
#ifdef QCOM_HARDWARE
#ifndef NO_UPDATE_PREVIEW
        mHardware->setPreviewWindow(0);
#endif
#endif
        disconnectWindow(mPreviewWindow);
        mPreviewWindow = 0;
#ifndef QCOM_HARDWARE
        mHardware->setPreviewWindow(mPreviewWindow);
#endif
    }
    mHardware.clear();

    CameraService::Client::disconnect();

    LOG1("disconnect X (pid %d)", callingPid);
}
开发者ID:InsomniaROM,项目名称:android_frameworks_av,代码行数:49,代码来源:CameraClient.cpp


示例11: getCallingPid

	void CameraService::Client::disconnect() {
		int callingPid = getCallingPid();
		LOG1("disconnect E (pid %d)", callingPid);
		Mutex::Autolock lock(mLock);
		
		if (checkPid() != NO_ERROR) {
			LOGW("different client - don't disconnect");
			return;
		}
		
		if (mClientPid <= 0) {
			LOG1("camera is unlocked (mClientPid = %d), don't tear down hardware", mClientPid);
			return;
		}
		
		// Make sure disconnect() is done once and once only, whether it is called
		// from the user directly, or called by the destructor.
		if (mHardware == 0) return;
		
		LOG1("hardware teardown");
		// Before destroying mHardware, we must make sure it's in the
		// idle state.
		// Turn off all messages.
		disableMsgType(CAMERA_MSG_ALL_MSGS);
		mHardware->stopPreview();
		mHardware->cancelPicture();
		// Release the hardware resources.
		mHardware->release();
		// Release the held overlay resources.
		if (mUseOverlay) {
#ifdef USE_OVERLAY_FORMAT_YCbCr_420_SP
			/* Release previous overlay handle */
			if (mOverlay != NULL) {
				mOverlay->destroy();
			}
#endif
			mOverlayRef = 0;
		}
		mHardware.clear();
		
		mCameraService->removeClient(mCameraClient);
		mCameraService->setCameraFree(mCameraId);
		
		LOG1("disconnect X (pid %d)", callingPid);
	}
开发者ID:HyperDroid,项目名称:android_frameworks_base_deprecated,代码行数:45,代码来源:CameraService.cpp


示例12: disableMsgType

		// picture callback - raw image ready
		void CameraService::Client::handleRawPicture(const sp<IMemory>& mem) {
			disableMsgType(CAMERA_MSG_RAW_IMAGE);
			
			ssize_t offset;
			size_t size;
			sp<IMemoryHeap> heap = mem->getMemory(&offset, &size);
			
			// Put the YUV version of the snapshot in the preview display.
			if (mSurface != 0 && !mUseOverlay) {
				mSurface->postBuffer(offset);
			}
			
			sp<ICameraClient> c = mCameraClient;
			mLock.unlock();
			if (c != 0) {
				c->dataCallback(CAMERA_MSG_RAW_IMAGE, mem);
			}
		}
开发者ID:HyperDroid,项目名称:android_frameworks_base_deprecated,代码行数:19,代码来源:CameraService.cpp


示例13: LOG1

		// stop preview mode
		void CameraService::Client::stopPreview() {
			LOG1("stopPreview (pid %d)", getCallingPid());
			Mutex::Autolock lock(mLock);
			if (checkPidAndHardware() != NO_ERROR) return;
			
			disableMsgType(CAMERA_MSG_PREVIEW_FRAME);
			mHardware->stopPreview();
			
			if (mSurface != 0 && !mUseOverlay) {
				mSurface->unregisterBuffers();
#ifdef USE_OVERLAY_FORMAT_YCbCr_420_SP
			} else {
				mOverlayW = 0;
				mOverlayH = 0;
#endif
			}
			
			mPreviewBuffer.clear();
		}
开发者ID:HyperDroid,项目名称:android_frameworks_base_deprecated,代码行数:20,代码来源:CameraService.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ disableSaveButtons函数代码示例发布时间:2022-05-30
下一篇:
C++ disableApplyButton函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap