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


C++ ALOGE_IF函数代码示例

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


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

示例1: gralloc_unregister_buffer

int gralloc_unregister_buffer(gralloc_module_t const* module,
        buffer_handle_t handle)
{
    if (private_handle_t::validate(handle) < 0)
        return -EINVAL;

    /*
     * If the buffer has been mapped during a lock operation, it's time
     * to un-map it. It's an error to be here with a locked buffer.
     * NOTE: the framebuffer is handled differently and is never unmapped.
     */

    private_handle_t* hnd = (private_handle_t*)handle;
    
    ALOGE_IF(hnd->lockState & private_handle_t::LOCK_STATE_READ_MASK,
            "[unregister] handle %p still locked (state=%08x)",
            hnd, hnd->lockState);

    // never unmap buffers that were created in this process
    if (hnd->pid != getpid()) {
        if (hnd->lockState & private_handle_t::LOCK_STATE_MAPPED) {
            gralloc_unmap(module, handle);
        }
        hnd->base = 0;
        hnd->lockState  = 0;
        hnd->writeOwner = 0;
    }
    return 0;
}
开发者ID:DESHONOR,项目名称:hardware_qcom_msm7k,代码行数:29,代码来源:mapper.cpp

示例2: ALOGW_IF

status_t StreamOutHalHidl::write(const void *buffer, size_t bytes, size_t *written) {
    if (mStream == 0) return NO_INIT;
    *written = 0;

    if (bytes == 0 && !mDataMQ) {
        // Can't determine the size for the MQ buffer. Wait for a non-empty write request.
        ALOGW_IF(mCallback.unsafe_get(), "First call to async write with 0 bytes");
        return OK;
    }

    status_t status;
    if (!mDataMQ && (status = prepareForWriting(bytes)) != OK) {
        return status;
    }

    return callWriterThread(
            WriteCommand::WRITE, "write", static_cast<const uint8_t*>(buffer), bytes,
            [&] (const WriteStatus& writeStatus) {
                *written = writeStatus.reply.written;
                // Diagnostics of the cause of b/35813113.
                ALOGE_IF(*written > bytes,
                        "hal reports more bytes written than asked for: %lld > %lld",
                        (long long)*written, (long long)bytes);
            });
}
开发者ID:freak97,项目名称:frameworks_av,代码行数:25,代码来源:StreamHalHidl.cpp

示例3: Hwmsen

sensors_poll_context_t::sensors_poll_context_t()
{
    mSensors[hwmsen] = new Hwmsen();
    mPollFds[hwmsen].fd = mSensors[hwmsen]->getFd();
    mPollFds[hwmsen].events = POLLIN;
    mPollFds[hwmsen].revents = 0;

	mSensors[accel] = new AccelerationSensor();
    mPollFds[accel].fd = mSensors[accel]->getFd();
    mPollFds[accel].events = POLLIN;
    mPollFds[accel].revents = 0;

	mSensors[magnetic] = new MagneticSensor();
    mPollFds[magnetic].fd = mSensors[magnetic]->getFd();
    mPollFds[magnetic].events = POLLIN;
    mPollFds[magnetic].revents = 0;

    int wakeFds[2];
    int result = pipe(wakeFds);
    ALOGE_IF(result<0, "error creating wake pipe (%s)", strerror(errno));
    fcntl(wakeFds[0], F_SETFL, O_NONBLOCK);
    fcntl(wakeFds[1], F_SETFL, O_NONBLOCK);
    mWritePipeFd = wakeFds[1];

    mPollFds[wake].fd = wakeFds[0];
    mPollFds[wake].events = POLLIN;
    mPollFds[wake].revents = 0;
}
开发者ID:PixNDom,项目名称:android_hardware_mediatek,代码行数:28,代码来源:nusensors.cpp

示例4: open

int SensorBase::open_fifo_device(){
	if (fifo_fd < 0 && fifo_name) {
        fifo_fd = open(fifo_name, O_RDONLY);
        ALOGE_IF(fifo_fd < 0, "Couldn't  open %s (%s)", fifo_name, strerror(errno));
    }
	return 0;
}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_hardware_imx,代码行数:7,代码来源:SensorBase.cpp

示例5: mlock

void TimeInterpolator::seek(int64_t media_time)
{
    Mutex::Autolock mlock(m_mutex);
    ALOGV("TimeInterpolator::seek(media_time=%lld)", media_time);

    if (m_state == STOPPED || m_state == PAUSED) {
        m_pos0 = media_time;
        m_read = media_time;
        m_queued = 0;
        m_t0 = get_system_usecs();
        m_Tf = 0;
        m_last = media_time;
        m_now_last = 0;
    } else {
        ALOGE_IF(m_state != ROLLING, "TimeInterpolator logic error: "
                "state is not rolling in seek()");
        m_read = media_time;
        m_pos0 = m_read - m_latency;
        m_queued = 0;
        m_t0 = get_system_usecs();
        m_Tf = 1.0;
        m_last = m_pos0;
        m_now_last = 0;
    }
}
开发者ID:qqedfr,项目名称:kitkat-2,代码行数:25,代码来源:TimeInterpolator.cpp

示例6: ALOGD

int sensors_poll_context_t::activate(int handle, int enabled) 
{
	ALOGD( "activate handle =%d, enable = %d",handle, enabled );
	int err=0;
	
	int index = handleToDriver(handle);

	//
	if(ID_ORIENTATION == handle)
	{
	     //ALOGD( "fwq1111" );
		((AccelerationSensor*)(mSensors[accel]))->enableNoHALDataAcc(enabled);
		((Hwmsen*)(mSensors[hwmsen]))->enableNoHALDataAcc(enabled);
	}
	
	if(NULL != mSensors[index] && index >0 )
	{
	   ALOGD( "use new sensor index=%d, mSensors[index](%x)", index, mSensors[index]);
	   err =  mSensors[index]->enable(handle, enabled);
	}
	
	if(err || index<0 )
	{
  		ALOGD("use old sensor err(%d),index(%d) go to old hwmsen\n",err,index);
		// notify to hwmsen sensor to support old architecture
		err =  mSensors[hwmsen]->enable(handle, enabled);
	}
	
    if (enabled && !err) {
        const char wakeMessage(WAKE_MESSAGE);
        int result = write(mWritePipeFd, &wakeMessage, 1);
        ALOGE_IF(result<0, "error sending wake message (%s)", strerror(errno));
    }
    return err;
}
开发者ID:PixNDom,项目名称:android_hardware_mediatek,代码行数:35,代码来源:nusensors.cpp

示例7: open

int Kxtf9Sensor::setDelay(int32_t handle, int64_t ns)
{
    int err = 0;

    if (mEnabled) {
        if (ns < 0)
            return -EINVAL;

        unsigned long delay = ns / 1000000;

        // ok we need to set our enabled state
        int fd = open(KXTF9_DELAY_FILE, O_WRONLY);
        if(fd >= 0) {
            char buffer[20];
            int bytes = sprintf(buffer, "%d\n", delay);
            err = write(fd, buffer, bytes);
            err = err < 0 ? -errno : 0;
        } else {
            err = -errno;
        }

        ALOGE_IF(err < 0, "Error setting delay of kxtf9 accelerometer (%s)", strerror(-err));
    }

    return err;
}
开发者ID:priyanob,项目名称:bowser_hd_7,代码行数:26,代码来源:Kxtf9.cpp

示例8: teardownWfd

static void teardownWfd(hwc_context_t* ctx) {
    // Teardown WFD display
    ALOGD_IF(UEVENT_DEBUG,"Received HDMI connection request when WFD is "
            "active");
    {
        Locker::Autolock _l(ctx->mDrawLock);
        clear(ctx, HWC_DISPLAY_VIRTUAL);
        ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].connected = false;
        ctx->dpyAttr[HWC_DISPLAY_VIRTUAL].isActive = false;
    }

    ctx->mVirtualDisplay->teardown();

    /* Need to send hotplug only when connected WFD in proprietary path */
    if(ctx->mVirtualonExtActive) {
        ALOGE_IF(UEVENT_DEBUG,"%s: Sending EXTERNAL OFFLINE"
                "hotplug event for wfd display", __FUNCTION__);
        ctx->proc->hotplug(ctx->proc, HWC_DISPLAY_EXTERNAL,
                EXTERNAL_OFFLINE);
        {
            Locker::Autolock _l(ctx->mDrawLock);
            ctx->mVirtualonExtActive = false;
        }
    }

    ctx->mWfdSyncLock.lock();
    ALOGD_IF(HWC_WFDDISPSYNC_LOG,
            "%s: Waiting for wfd-teardown to be signalled",__FUNCTION__);
    ctx->mWfdSyncLock.wait();
    ALOGD_IF(HWC_WFDDISPSYNC_LOG,
            "%s: Teardown signalled. Completed waiting in uevent thread",
            __FUNCTION__);
    ctx->mWfdSyncLock.unlock();
}
开发者ID:Dm47021,项目名称:android_hardware_qcom,代码行数:34,代码来源:hwc_uevents.cpp

示例9: KionixSensor

sensors_poll_context_t::sensors_poll_context_t()
{
    mSensors[accel_kxtj9] = new KionixSensor();
    mPollFds[accel_kxtj9].fd = mSensors[accel_kxtj9]->getFd();
    mPollFds[accel_kxtj9].events = POLLIN;
    mPollFds[accel_kxtj9].revents = 0;
    
    mSensors[light_cm3212] = new LightSensor();
    mPollFds[light_cm3212].fd = mSensors[light_cm3212]->getFd();
    mPollFds[light_cm3212].events = POLLIN;
    mPollFds[light_cm3212].revents = 0;

    mSensors[compass_ami30x] = new AmiSensor();
    mPollFds[compass_ami30x].fd = mSensors[compass_ami30x]->getFd();
    mPollFds[compass_ami30x].events = POLLIN;
    mPollFds[compass_ami30x].revents = 0;
	
    mSensors[accel_dmard06] = new Dmard06Sensor();
    mPollFds[accel_dmard06].fd = mSensors[accel_dmard06]->getFd();
    mPollFds[accel_dmard06].events = POLLIN;
    mPollFds[accel_dmard06].revents = 0;
    int wakeFds[2];
    int result = pipe(wakeFds);
    ALOGE_IF(result<0, "error creating wake pipe (%s)", strerror(errno));
    fcntl(wakeFds[0], F_SETFL, O_NONBLOCK);
    fcntl(wakeFds[1], F_SETFL, O_NONBLOCK);
    mWritePipeFd = wakeFds[1];

    mPollFds[wake].fd = wakeFds[0];
    mPollFds[wake].events = POLLIN;
    mPollFds[wake].revents = 0;
}
开发者ID:SandPox,项目名称:android_hardware_nufront,代码行数:32,代码来源:nusensors.cpp

示例10: gralloc_free_pmem

int gralloc_free_pmem(alloc_device_t* dev,
        struct hwmem_gralloc_buf_handle_t* hnd)
{
    if (hnd->flags & PRIV_FLAGS_FRAMEBUFFER) {
        // free this buffer
        struct hwmem_gralloc_module_t* m = (struct hwmem_gralloc_module_t*)
                dev->common.module;
        const size_t bufferSize = m->finfo.line_length * m->info.yres;
        int index = (hnd->base_addr - m->framebuffer->base_addr) / bufferSize;
        m->bufferMask &= ~(1<<index);
    } else {
#if HAVE_ANDROID_OS
        if (hnd->flags & PRIV_FLAGS_USES_PMEM) {
            if (hnd->fd >= 0) {
                struct pmem_region sub = { hnd->offset, hnd->size };
                int err = ioctl(hnd->fd, PMEM_UNMAP, &sub);
                ALOGE_IF(err<0, "PMEM_UNMAP failed (%s), "
                        "fd=%d, sub.offset=%i, sub.size=%i",
                        strerror(errno), hnd->fd, hnd->offset, hnd->size);
            }
        }
#endif // HAVE_ANDROID_OS
        terminateBuffer(NULL, hnd); /* NULL is ok here as the parameter is not used by terminateBuffer */
    }

    close(hnd->fd);
    free(hnd);
    return 0;
}
开发者ID:Agontuk,项目名称:android_hardware_ste-sony,代码行数:29,代码来源:hwmem_gralloc_pmem.c

示例11: terminateBuffer

static int terminateBuffer(gralloc_module_t const* module,
        struct hwmem_gralloc_buf_handle_t* hnd)
{
    /*
     * If the buffer has been mapped during a lock operation, it's time
     * to un-map it. It's an error to be here with a locked buffer.
     */

    ALOGE_IF(hnd->lockState & LOCK_STATE_READ_MASK,
            "[terminate] handle %p still locked (state=%08x)",
            hnd, hnd->lockState);

    if (hnd->lockState & LOCK_STATE_MAPPED) {
        // this buffer was mapped, unmap it now
        if ((hnd->flags & PRIV_FLAGS_USES_PMEM) &&
            (hnd->pid == getpid())) {
            // ... unless it's a "master" pmem buffer, that is a buffer
            // mapped in the process it's been allocated.
            // (see gralloc_alloc_buffer())
        } else {
            gralloc_unmap(module, hnd);
        }
    }

    return 0;
}
开发者ID:Agontuk,项目名称:android_hardware_ste-sony,代码行数:26,代码来源:hwmem_gralloc_pmem.c

示例12: terminateBuffer

int terminateBuffer(gralloc_module_t const* module,
        private_handle_t* hnd)
{
    /*
     * If the buffer has been mapped during a lock operation, it's time
     * to un-map it. It's an error to be here with a locked buffer.
     */

    ALOGE_IF(hnd->lockState & private_handle_t::LOCK_STATE_READ_MASK,
            "[terminate] handle %p still locked (state=%08x)",
            hnd, hnd->lockState);

    if (hnd->lockState & private_handle_t::LOCK_STATE_MAPPED) {
        // this buffer was mapped, unmap it now
        if (hnd->flags & (private_handle_t::PRIV_FLAGS_USES_PMEM |
                          private_handle_t::PRIV_FLAGS_USES_PMEM_ADSP |
                          private_handle_t::PRIV_FLAGS_USES_ASHMEM)) {
            if (hnd->pid != getpid()) {
                // ... unless it's a "master" pmem buffer, that is a buffer
                // mapped in the process it's been allocated.
                // (see gralloc_alloc_buffer())
                gralloc_unmap(module, hnd);
            }
        } else {
            LOGE("terminateBuffer: unmapping a non pmem/ashmem buffer flags = 0x%x", hnd->flags);
            gralloc_unmap(module, hnd);
        }
    }

    return 0;
}
开发者ID:DESHONOR,项目名称:hardware_qcom_msm7k,代码行数:31,代码来源:mapper.cpp

示例13: mAllocMod

GraphicBufferMapper::GraphicBufferMapper()
    : mAllocMod(0)
{
    hw_module_t const* module;
    int err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module);
    ALOGE_IF(err, "FATAL: can't find the %s module", GRALLOC_HARDWARE_MODULE_ID);
    if (err == 0) {
        mAllocMod = (gralloc_module_t const *)module;
    }

    // [MTK] {{{
    // 20120918: gralloc extra device for internal purpose
    mExtraDev = NULL;
    if (err == 0) {
        gralloc_extra_open(module, &mExtraDev);
    }

    char value[PROPERTY_VALUE_MAX];
    property_get("debug.gbuf.callstack", value, "0");
    mIsDumpCallStack = atoi(value);
    if (true == mIsDumpCallStack) {
        XLOGI("!!! dump GraphicBufferMapper callstack for pid:%d !!!", getpid());
    }
    // [MTK] }}}
}
开发者ID:Proshivalskiy,项目名称:MT6582_kernel_source,代码行数:25,代码来源:GraphicBufferMapper.cpp

示例14: Lsm303dlhGSensor

sensors_poll_context_t::sensors_poll_context_t()
{
    mSensors[lsm303dlh_acc] = new Lsm303dlhGSensor();
    mPollFds[lsm303dlh_acc].fd = mSensors[lsm303dlh_acc]->getFd();
    mPollFds[lsm303dlh_acc].events = POLLIN;
    mPollFds[lsm303dlh_acc].revents = 0;

    mSensors[lsm303dlh_mag] = new Lsm303dlhMagSensor();
    mPollFds[lsm303dlh_mag].fd = mSensors[lsm303dlh_mag]->getFd();
    mPollFds[lsm303dlh_mag].events = POLLIN;
    mPollFds[lsm303dlh_mag].revents = 0;

    mSensors[isl29023_als] = new LightSensor();
    mPollFds[isl29023_als].fd = mSensors[isl29023_als]->getFd();
    mPollFds[isl29023_als].events = POLLIN;
    mPollFds[isl29023_als].revents = 0;

    mSensors[mpu3050] = new MPLSensor();
    mPollFds[mpu3050].fd = mSensors[mpu3050]->getFd();
    mPollFds[mpu3050].events = POLLIN;
    mPollFds[mpu3050].revents = 0;

    int wakeFds[2];
    int result = pipe(wakeFds);
    ALOGE_IF(result<0, "error creating wake pipe (%s)", strerror(errno));
    fcntl(wakeFds[0], F_SETFL, O_NONBLOCK);
    fcntl(wakeFds[1], F_SETFL, O_NONBLOCK);
    mWritePipeFd = wakeFds[1];

    mPollFds[wake].fd = wakeFds[0];
    mPollFds[wake].events = POLLIN;
    mPollFds[wake].revents = 0;
}
开发者ID:jshafer817,项目名称:cm11_device_hp_tenderloin34,代码行数:33,代码来源:nusensors.cpp

示例15: ALOGE_IF

bool GenericPipe::init()
{
    ALOGE_IF(DEBUG_OVERLAY, "GenericPipe init");
    mRotDownscaleOpt = false;

    int fbNum = Overlay::getFbForDpy(mDpy);
    if( fbNum < 0 ) {
        ALOGE("%s: Invalid FB for the display: %d",__FUNCTION__, mDpy);
        return false;
    }

    ALOGD_IF(DEBUG_OVERLAY,"%s: mFbNum:%d",__FUNCTION__, fbNum);


    if(!mCtrlData.ctrl.init(fbNum)) {
        ALOGE("GenericPipe failed to init ctrl");
        return false;
    }

    if(!mCtrlData.data.init(fbNum)) {
        ALOGE("GenericPipe failed to init data");
        return false;
    }

    return true;
}
开发者ID:ProtoDroidDevs,项目名称:android_hardware_qcom_display-caf,代码行数:26,代码来源:overlayGenPipe.cpp


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