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

C++ LOGE_IF函数代码示例

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

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



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

示例1: out_standby_stream_locked

static int out_standby_stream_locked(struct astream_out *out)
{
    int ret = 0;
    int attempts = MAX_WRITE_COMPLETION_ATTEMPTS;

    if (out->standby || !out->data)
        return 0;

    out->standby = true;
    /* wait for write completion if needed */
    while (out->write_busy && attempts--) {
        ret = pthread_cond_timeout_np(&out->write_cond,
                                &out->lock,
                                BUF_WRITE_COMPLETION_TIMEOUT_MS);
        LOGE_IF(ret != 0, "out_standby_stream_locked() wait cond error %d", ret);
    }
    LOGE_IF(attempts == 0, "out_standby_stream_locked() a2dp_write() would not stop!!!");

    LOGV_IF(!out->bt_enabled, "Standby skip stop: enabled %d", out->bt_enabled);
    if (out->bt_enabled) {
        ret = a2dp_stop(out->data);
    }
    release_wake_lock(A2DP_WAKE_LOCK_NAME);

    return ret;
}
开发者ID:cmotc,项目名称:schs738c-external_bluetooth,代码行数:26,代码来源:android_audio_hw.c


示例2: OVASSERT

bool OverlayImpl<P0, P1, P2>::reconfigure(const utils::ReconfArgs& args)
{
   OVASSERT(mPipe0 && mPipe1 && mPipe2,
            "%s: Pipes are null p0=%p p1=%p p2=%p",
            __FUNCTION__, mPipe0, mPipe1, mPipe2);
   switch(args.reconf) {
   case utils::RECONFIG_ON:
   {
      LOGE_IF(DEBUG_OVERLAY, "%s reconfig is on", __FUNCTION__);
      // reconfig the buffers here
      utils::PlayInfo play;
      if(!mReconf.setupBuf(args, play)) {
         LOGE("%s failed to reconf setupargs", __FUNCTION__);
         return false;
      }

      // regular setXXX interface calls here
      utils::ReconfArgs reargs(args);
      reargs.play = play;
      utils::PipeArgs parg0(mPipe0->getArgs());
      parg0 = reargs;
      utils::PipeArgs parg1(mPipe1->getArgs());
      parg1 = reargs;
      utils::PipeArgs parg2(mPipe2->getArgs());
      parg2 = reargs;
      utils::PipeArgs pargs[utils::MAX_PIPES] = {parg0, parg1, parg2};
      if(!this->setSource(pargs)) {
         LOGE("%s failed to setCrop", __FUNCTION__);
         return false;
      }
      if(!this->setCrop(reargs.crop)) {
         LOGE("%s failed to setCrop", __FUNCTION__);
         return false;
      }
      if(!this->setPosition(reargs.pos)) {
         LOGE("%s failed to setPosition", __FUNCTION__);
         return false;
      }
      utils::Params param(utils::OVERLAY_TRANSFORM, reargs.orientation);
      if(!this->setParameter(param)) {
         LOGE("%s failed to setParameter", __FUNCTION__);
         return false;
      }
      if(!this->commit()){
         LOGE("%s failed to commit", __FUNCTION__);
         return false;
      }
      break;
   }
   case utils::RECONFIG_OFF:
      LOGE_IF(DEBUG_OVERLAY, "%s reconfig is off", __FUNCTION__);
      mReconf.reset();
      break;
   default:
      OVASSERT(false, "%s unknown reconfig state %d",
               __FUNCTION__, args.reconf);
      return false;
   }
   return true;
}
开发者ID:UIKit0,项目名称:hardware_qcom_display,代码行数:60,代码来源:overlayImpl_T.cpp


示例3: BASE

FramebufferNativeWindow::FramebufferNativeWindow() 
    : BASE(), fbDev(0), grDev(0), mUpdateOnDemand(false)
{
    hw_module_t const* module;
    if (hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module) == 0) {
        int stride;
        int err;
        err = framebuffer_open(module, &fbDev);
        LOGE_IF(err, "couldn't open framebuffer HAL (%s)", strerror(-err));
        
        err = gralloc_open(module, &grDev);
        LOGE_IF(err, "couldn't open gralloc HAL (%s)", strerror(-err));

        // bail out if we can't initialize the modules
        if (!fbDev || !grDev)
            return;
        
        mUpdateOnDemand = (fbDev->setUpdateRect != 0);
        
        // initialize the buffer FIFO
        mNumBuffers = 2;
        mNumFreeBuffers = 2;
        mBufferHead = mNumBuffers-1;
        buffers[0] = new NativeBuffer(
                fbDev->width, fbDev->height, fbDev->format, GRALLOC_USAGE_HW_FB);
        buffers[1] = new NativeBuffer(
                fbDev->width, fbDev->height, fbDev->format, GRALLOC_USAGE_HW_FB);
        
        err = grDev->alloc(grDev,
                fbDev->width, fbDev->height, fbDev->format, 
                GRALLOC_USAGE_HW_FB, &buffers[0]->handle, &buffers[0]->stride);

        LOGE_IF(err, "fb buffer 0 allocation failed w=%d, h=%d, err=%s",
                fbDev->width, fbDev->height, strerror(-err));

        err = grDev->alloc(grDev,
                fbDev->width, fbDev->height, fbDev->format, 
                GRALLOC_USAGE_HW_FB, &buffers[1]->handle, &buffers[1]->stride);

        LOGE_IF(err, "fb buffer 1 allocation failed w=%d, h=%d, err=%s",
                fbDev->width, fbDev->height, strerror(-err));

        const_cast<uint32_t&>(android_native_window_t::flags) = fbDev->flags; 
        const_cast<float&>(android_native_window_t::xdpi) = fbDev->xdpi;
        const_cast<float&>(android_native_window_t::ydpi) = fbDev->ydpi;
        const_cast<int&>(android_native_window_t::minSwapInterval) = 
            fbDev->minSwapInterval;
        const_cast<int&>(android_native_window_t::maxSwapInterval) = 
            fbDev->maxSwapInterval;
    } else {
        LOGE("Couldn't get gralloc module");
    }

    android_native_window_t::setSwapInterval = setSwapInterval;
    android_native_window_t::dequeueBuffer = dequeueBuffer;
    android_native_window_t::lockBuffer = lockBuffer;
    android_native_window_t::queueBuffer = queueBuffer;
    android_native_window_t::query = query;
    android_native_window_t::perform = perform;
}
开发者ID:Andproject,项目名称:platform_frameworks_base,代码行数:60,代码来源:FramebufferNativeWindow.cpp


示例4: _l

void SensorService::cleanupConnection(SensorEventConnection* c)
{
    Mutex::Autolock _l(mLock);
    const wp<SensorEventConnection> connection(c);
    size_t size = mActiveSensors.size();
    LOGD_IF(DEBUG_CONNECTIONS, "%d active sensors", size);
    for (size_t i=0 ; i<size ; ) {
        int handle = mActiveSensors.keyAt(i);
        if (c->hasSensor(handle)) {
            LOGD_IF(DEBUG_CONNECTIONS, "%i: disabling handle=0x%08x", i, handle);
            SensorInterface* sensor = mSensorMap.valueFor( handle );
            LOGE_IF(!sensor, "mSensorMap[handle=0x%08x] is null!", handle);
            if (sensor) {
                sensor->activate(c, false);
            }
        }
        SensorRecord* rec = mActiveSensors.valueAt(i);
        LOGE_IF(!rec, "mActiveSensors[%d] is null (handle=0x%08x)!", i, handle);
        LOGD_IF(DEBUG_CONNECTIONS,
                "removing connection %p for sensor[%d].handle=0x%08x",
                c, i, handle);

        if (rec && rec->removeConnection(connection)) {
            LOGD_IF(DEBUG_CONNECTIONS, "... and it was the last connection");
            mActiveSensors.removeItemsAt(i, 1);
            mActiveVirtualSensors.removeItem(handle);
            delete rec;
            size--;
        } else {
            i++;
        }
    }
    mActiveConnections.remove(connection);
}
开发者ID:28vicky,项目名称:platform_frameworks_base,代码行数:34,代码来源:SensorService.cpp


示例5: memset

void V4L2Camera::Uninit ()
{
    int ret;

    memset(&videoIn->buf,0,sizeof(videoIn->buf));
    videoIn->buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    videoIn->buf.memory = V4L2_MEMORY_MMAP;

    /* Dequeue everything */
    int DQcount = nQueued - nDequeued;

    for (int i = 0; i < DQcount-1; i++) {
        ret = ioctl(fd, VIDIOC_DQBUF, &videoIn->buf);
        LOGE_IF(ret < 0, "Uninit: VIDIOC_DQBUF Failed");
    }
    nQueued = 0;
    nDequeued = 0;

    /* Unmap buffers */
    for (int i = 0; i < NB_BUFFER; i++)
        if (videoIn->mem[i] != NULL) {
            ret = munmap(videoIn->mem[i], videoIn->buf.length);
            LOGE_IF(ret < 0, "Uninit: Unmap failed");
            videoIn->mem[i] = NULL;
        }

    if (videoIn->tmpBuffer)
        free(videoIn->tmpBuffer);
    videoIn->tmpBuffer = NULL;

}
开发者ID:codewalkerster,项目名称:android_device_toshiba_paz00-common,代码行数:31,代码来源:V4L2Camera.cpp


示例6: D

int sensors_poll_context_t::pollEvents(sensors_event_t* data, int count)
{
	D("Entered : count = %d", count);
    int nbEvents = 0;
    int n = 0;

    do {
        // see if we have some leftover from the last poll()
        for (int i=0 ; count && i<numSensorDrivers ; i++) {
            SensorBase* const sensor(mSensors[i]);
            if ((mPollFds[i].revents & POLLIN) || (sensor->hasPendingEvents())) {
                int nb = sensor->readEvents(data, count);	// num of evens received.
				D("nb = %d.", nb);
				#if defined(CALIBRATION_SUPPORT)
				if(i == mma)
				{
					data->acceleration.x -= gAccelCaliData[0] * ACCELERATION_RATIO_ANDROID_TO_HW;
					data->acceleration.y -= gAccelCaliData[1] * ACCELERATION_RATIO_ANDROID_TO_HW;
					data->acceleration.z -= gAccelCaliData[2] * ACCELERATION_RATIO_ANDROID_TO_HW;
				}
				#endif
                if (nb < count) {
                    // no more data for this sensor
                    mPollFds[i].revents = 0;
                }
                count -= nb;
                nbEvents += nb;
                data += nb;
				D("count = %d, nbEvents = %d, data = 0x%p.", count, nbEvents, data);
            }
        }

        if (count) {
            // we still have some room, so try to see if we can get
            // some events immediately or just wait if we don't have
            // anything to return
            n = poll(mPollFds, numFds, nbEvents ? 0 : -1);
            if (n<0) {
                LOGE("poll() failed (%s)", strerror(errno));
                return -errno;
            }
            if (mPollFds[wake].revents & POLLIN) {
                char msg;
                int result = read(mPollFds[wake].fd, &msg, 1);
                LOGE_IF(result<0, "error reading from wake pipe (%s)", strerror(errno));
                LOGE_IF(msg != WAKE_MESSAGE, "unknown message on wake queue (0x%02x)", int(msg));
                mPollFds[wake].revents = 0;
            }
        }
        // if we have events and space, go read them
		D("n =0x%x, count = 0x%x.", n, count);
    } while (n && count);

	D("to return : nbEvents = %d", nbEvents);
    return nbEvents;
}
开发者ID:JosephAtGMEMS,项目名称:Rochchip_RK31,代码行数:56,代码来源:nusensors.cpp


示例7: get_cblk

static volatile surface_flinger_cblk_t const * get_cblk()
{
    if (gServerCblk == 0) {
        sp<ISurfaceComposer> sm(getComposerService());
        Mutex::Autolock _l(gLock);
        if (gServerCblk == 0) {
            gServerCblkMemory = sm->getCblk();
            LOGE_IF(gServerCblkMemory==0, "Can't get server control block");
            gServerCblk = (surface_flinger_cblk_t *)gServerCblkMemory->getBase();
            LOGE_IF(gServerCblk==0, "Can't get server control block address");
        }
    }
    return gServerCblk;
}
开发者ID:Andproject,项目名称:platform_frameworks_base,代码行数:14,代码来源:SurfaceComposerClient.cpp


示例8: remote

void BpMemoryHeap::assertReallyMapped() const
{
    if (mHeapId == -1) {

        // remote call without mLock held, worse case scenario, we end up
        // calling transact() from multiple threads, but that's not a problem,
        // only mmap below must be in the critical section.
        
        Parcel data, reply;
        data.writeInterfaceToken(IMemoryHeap::getInterfaceDescriptor());
        status_t err = remote()->transact(HEAP_ID, data, &reply);
        int parcel_fd = reply.readFileDescriptor();
        ssize_t size = reply.readInt32();
        uint32_t flags = reply.readInt32();

        LOGE_IF(err, "binder=%p transaction failed fd=%d, size=%ld, err=%d (%s)",
                asBinder().get(), parcel_fd, size, err, strerror(-err));

        int fd = dup( parcel_fd );
        LOGE_IF(fd==-1, "cannot dup fd=%d, size=%ld, err=%d (%s)",
                parcel_fd, size, err, strerror(errno));

        int access = PROT_READ;
        if (!(flags & READ_ONLY)) {
            access |= PROT_WRITE;
        }

        Mutex::Autolock _l(mLock);
        if (mHeapId == -1) {
            mRealHeap = true;
            mBase = mmap(0, size, access, MAP_SHARED, fd, 0);
            if (mBase == MAP_FAILED) {
                LOGE("cannot map BpMemoryHeap (binder=%p), size=%ld, fd=%d (%s)",
                        asBinder().get(), size, fd, strerror(errno));
                close(fd);
            } else {
                if (flags & MAP_ONCE) {
                    //LOGD("pinning heap (binder=%p, size=%d, fd=%d",
                    //        asBinder().get(), size, fd);
                    pin_heap();
                }
                mSize = size;
                mFlags = flags;
                android_atomic_write(fd, &mHeapId);
            }
        }
    }
}
开发者ID:RealVNC,项目名称:AndroidFrameworksBase,代码行数:48,代码来源:IMemory.cpp


示例9: LOGD_IF

int CABL::Notify(uint32_t notification_type) {
    int32_t ret = 0;
    LOGD_IF(mDebug, "Starting %s ", __func__);
    pthread_mutex_lock(&mCABLLock);
    if (mHistStatus == 0 && (notification_type == NOTIFY_TYPE_BL_UPDATE || notification_type == NOTIFY_TYPE_UPDATE)) {
        uint32_t level = get_backlight_level();
        if (level <= mOEMParams.bl_min_level) {
            LOGE_IF(mDebug, "New BL level %d lower than min level %u,"
                    " Skip this update for calc",
                    level, mOEMParams.bl_min_level);
            if (mPrevNotify == NOTIFY_TYPE_SUSPEND)
                ret = -1;
            goto exit_early;
        }
        if (eStatus == CABL_OFF) {
            pthread_mutex_unlock(&mCABLLock);
            return ret;
        }
        LOGD_IF(mDebug, "Start notification received, start histogram");
        ret = startHistogram();
        if (0 == ret) {
            mHistStatus = 1;
            pthread_cond_signal(&mCABLCond);
        }
    } else if (mHistStatus == 1 &&
        (notification_type == NOTIFY_TYPE_SUSPEND ||
        notification_type == NOTIFY_TYPE_NO_UPDATE)) {
        LOGD_IF(mDebug, "Stop notification received, stop histogram");
        if(!stopHistogram(mHistStatus))
            mHistStatus = 0;
        if (notification_type == NOTIFY_TYPE_SUSPEND)
            abl_reset_history();

    }

    if (notification_type == NOTIFY_TYPE_BL_UPDATE) {
        if (mRefresher) {
            mRefresher->Control(1);
            LOGE_IF(mDebug, "Calling refresh()");
            mRefresher->Refresh(1, 16);
            mRefresher->Control(0);
        }
    }
exit_early:
    mPrevNotify = notification_type;
    pthread_mutex_unlock(&mCABLLock);
    return ret;
}
开发者ID:xingrz,项目名称:android_tools_leeco_msm8996,代码行数:48,代码来源:CABL.cpp


示例10: LOGV

int SecCamera::setFlashMode(const char* strFlashMode)
{
    _v4l2Params.flash_mode = _v4l2Cam->enumFlashMode(strFlashMode);

    LOGV("setting flash-mode set to %s...", strFlashMode);

    switch (_v4l2Params.flash_mode) {
    case FLASH_MODE_TORCH:
        return 0;

    case FLASH_MODE_ON:
    case FLASH_MODE_AUTO:
        break;

    case FLASH_MODE_OFF:
    default:
        break;
    }

    if (!_isPreviewOn)
        return 0;

    int ret = _v4l2Cam->setCtrl(V4L2_CID_CAMERA_FLASH_MODE,
                                _v4l2Params.flash_mode);

    LOGE_IF(0 > ret, "%s:Failed to set flash-mode, %s!! ret=%d",
            __func__, strFlashMode, ret);

    return 0 > ret ? -1 : 0;
}
开发者ID:suapapa,项目名称:android_vendor_insignal_hal_camera,代码行数:30,代码来源:SecCamera.cpp


示例11: LOGE_IF

void BootAnimation::onFirstRef() {
    status_t err = mSession->linkToComposerDeath(this);
    LOGE_IF(err, "linkToComposerDeath failed (%s) ", strerror(-err));
    if (err == NO_ERROR) {
        run("BootAnimation", PRIORITY_DISPLAY);
    }
}
开发者ID:AshutoshY,项目名称:ics4blade,代码行数:7,代码来源:BootAnimation.cpp


示例12: open

int SensorBase::open_device() {
    if (dev_fd<0 && dev_name) {
        dev_fd = open(dev_name, O_RDONLY);
        LOGE_IF(dev_fd<0, "Couldn't open %s (%s)", dev_name, strerror(errno));
    }
    return 0;
}
开发者ID:antibyte,项目名称:adamICS,代码行数:7,代码来源:SensorBase.cpp


示例13: LOGE

status_t QemuClient::doQuery(QemuQuery* query)
{
    /* Make sure that query has been successfuly constructed. */
    if (query->mQueryDeliveryStatus != NO_ERROR) {
        LOGE("%s: Query is invalid", __FUNCTION__);
        return query->mQueryDeliveryStatus;
    }

    LOGQ("Send query '%s'", query->mQuery);

    /* Send the query. */
    status_t res = sendMessage(query->mQuery, strlen(query->mQuery) + 1);
    if (res == NO_ERROR) {
        /* Read the response. */
        res = receiveMessage(reinterpret_cast<void**>(&query->mReplyBuffer),
                      &query->mReplySize);
        if (res == NO_ERROR) {
            LOGQ("Response to query '%s': Status = '%.2s', %d bytes in response",
                 query->mQuery, query->mReplyBuffer, query->mReplySize);
        } else {
            LOGE("%s Response to query '%s' has failed: %s",
                 __FUNCTION__, query->mQuery, strerror(res));
        }
    } else {
        LOGE("%s: Send query '%s' failed: %s",
             __FUNCTION__, query->mQuery, strerror(res));
    }

    /* Complete the query, and return its completion handling status. */
    const status_t res1 = query->completeQuery(res);
    LOGE_IF(res1 != NO_ERROR && res1 != res,
            "%s: Error %d in query '%s' completion",
            __FUNCTION__, res1, query->mQuery);
    return res1;
}
开发者ID:26597925,项目名称:mt36k_android_4.0.4,代码行数:35,代码来源:QemuClient.cpp


示例14: LightSensor

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

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

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

    int wakeFds[2];
    int result = pipe(wakeFds);
    LOGE_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:Fagyi,项目名称:hardware_msm7k,代码行数:28,代码来源:nusensors.cpp


示例15: gralloc_unregister_buffer

int gralloc_unregister_buffer(gralloc_module_t const* module,
			buffer_handle_t handle)
{
	DEBUG_ENTER();
	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;

	LOGE_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;
	}
	DEBUG_LEAVE();
	return 0;
}
开发者ID:chambejp,项目名称:device,代码行数:31,代码来源:mapper.cpp


示例16: MPLAYER_DBG

// establish binder interface to service
	const sp<IMediaPlayerService>& MPlayer::getMediaPlayerService()
	{
		MPLAYER_DBG();
//    Mutex::Autolock _l(sServiceLock);
		if (sMediaPlayerService.get() == 0) {
			sp<IServiceManager> sm = defaultServiceManager();
			sp<IBinder> binder;
			do {
				binder = sm->getService(String16("media.player"));
				if (binder != 0)
					break;
				LOGW("MediaPlayerService not published, waiting...");
				usleep(500000); // 0.5 s
			} while(true);
			
/*
  if (sDeathNotifier == NULL) {
  sDeathNotifier = new DeathNotifier();
  }
  MPLAYER_DBG();
  binder->linkToDeath(sDeathNotifier);
*/
			
			MPLAYER_DBG();
			sMediaPlayerService = interface_cast<IMediaPlayerService>(binder);
		}
		MPLAYER_DBG();
		LOGE_IF(sMediaPlayerService==0, "no MediaPlayerService!?");
		MPLAYER_DBG();
		return sMediaPlayerService;
	}
开发者ID:DanielGit,项目名称:Intrisit201202,代码行数:32,代码来源:MPlayer.cpp


示例17: ALOGV

// establish binder interface to MediaPlayerService
/*static*/const sp<IMediaPlayerService>&
IMediaDeathNotifier::getMediaPlayerService()
{
    ALOGV("getMediaPlayerService");
    Mutex::Autolock _l(sServiceLock);
    if (sMediaPlayerService.get() == 0) {
        sp<IServiceManager> sm = defaultServiceManager();
        sp<IBinder> binder;
        do {
            binder = sm->getService(String16("media.player"));
            if (binder != 0) {
                break;
             }
             ALOGW("Media player service not published, waiting...");
             usleep(500000); // 0.5 s
        } while(true);

        if (sDeathNotifier == NULL) {
        sDeathNotifier = new DeathNotifier();
    }
    binder->linkToDeath(sDeathNotifier);
    sMediaPlayerService = interface_cast<IMediaPlayerService>(binder);
    }
    LOGE_IF(sMediaPlayerService == 0, "no media player service!?");
    return sMediaPlayerService;
}
开发者ID:drod2169,项目名称:platform_frameworks_base,代码行数:27,代码来源:IMediaDeathNotifier.cpp


示例18: _l

// establish binder interface to AudioFlinger service
const sp<IAudioFlinger>& AudioSystem::get_audio_flinger()
{
    Mutex::Autolock _l(gLock);
    if (gAudioFlinger.get() == 0) {
        sp<IServiceManager> sm = defaultServiceManager();
        sp<IBinder> binder;
        do {
            binder = sm->getService(String16("media.audio_flinger"));
            if (binder != 0)
                break;
            LOGW("AudioFlinger not published, waiting...");
            usleep(500000); // 0.5 s
        } while(true);
        if (gAudioFlingerClient == NULL) {
            gAudioFlingerClient = new AudioFlingerClient();
        } else {
            if (gAudioErrorCallback) {
                gAudioErrorCallback(NO_ERROR);
            }
         }
        binder->linkToDeath(gAudioFlingerClient);
        gAudioFlinger = interface_cast<IAudioFlinger>(binder);
        gAudioFlinger->registerClient(gAudioFlingerClient);
    }
    LOGE_IF(gAudioFlinger==0, "no AudioFlinger!?");

    return gAudioFlinger;
}
开发者ID:eperep,项目名称:android_framework_base,代码行数:29,代码来源:AudioSystem.cpp


示例19: eglDestroyImageKHR

EGLBoolean eglDestroyImageKHR(EGLDisplay display, EGLImageKHR image)
{
   EGLBoolean ret = EGL_FALSE;

   LOGV("eglDestroyImageKHR - 1" );

   if( EGL_NO_IMAGE_KHR != image )
   {
      EGL_IMAGE_T *img = (EGL_IMAGE_T *)image;

      LOGV("eglDestroyImageKHR - 2" );

      //force a flush
      glFinish();

      //delete the KHR image
      ret = eglDestroyImageKHR_Int( display, img->v3d_egl_imagekhr );

      LOGE_IF( ret == EGL_FALSE, "eglSwapBuffers: eglDestroyImageKHR FAILED" );

      //dec the ref
      // ((native_buffer *)img->abuffer->handle)->decRef();
      img->abuffer->common.decRef(&img->abuffer->common);

      free( img );
   }

   return ret;
}
开发者ID:Arel123,项目名称:brcm_android_ICS_graphics_stack,代码行数:29,代码来源:brcm_egl.c


示例20: switch

int AccelSensor::enable(int32_t handle, int en)
{
    int what = -1;

    switch (handle) {
        case ID_A: what = Accelerometer; break;
    }

    if (uint32_t(what) >= numSensors)
        return -EINVAL;

    int newState  = en ? 1 : 0;
    int err = 0;

    if ((uint32_t(newState)<<what) != (mEnabled & (1<<what))) {
        uint32_t sensor_type;
       switch (what) {
            case Accelerometer: sensor_type = SENSOR_TYPE_ACCELEROMETER;  break;
        }
        short flags = newState;
        if (en)
            err = accel_enable_sensor(sensor_type);
        else
            err = accel_disable_sensor(sensor_type);

        LOGE_IF(err, "Could not change sensor state (%s)", strerror(-err));
        if (!err) {
            mEnabled &= ~(1<<what);
            mEnabled |= (uint32_t(flags)<<what);
        }
    }
    return err;
}
开发者ID:TooLogic,项目名称:android_device_softwinner,代码行数:33,代码来源:AccelSensor.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ LOGF函数代码示例发布时间:2022-05-30
下一篇:
C++ LOGE函数代码示例发布时间: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