本文整理汇总了C++中sp::getBase方法的典型用法代码示例。如果您正苦于以下问题:C++ sp::getBase方法的具体用法?C++ sp::getBase怎么用?C++ sp::getBase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sp
的用法示例。
在下文中一共展示了sp::getBase方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getBufferMemPointer
unsigned int * getBufferMemPointer(int index)
{
sp<IAndroidShm> shm = getAndroidShmService();
if (shm == NULL) {
printf("The EneaBufferServer is not published\n");
return (unsigned int *)-1; /* return an errorcode... */
} else {
receiverMemBase = shm->getBuffer(index);
if(receiverMemBase != NULL)
return (unsigned int *) receiverMemBase->getBase();
else
return (unsigned int*)-1;
}
}
示例2: MemoryHeapBase
MemoryHeapPmem::MemoryHeapPmem(const sp<MemoryHeapBase>& pmemHeap,
uint32_t flags)
: MemoryHeapBase()
{
char const * const device = pmemHeap->getDevice();
#ifdef HAVE_ANDROID_OS
if (device) {
int fd = open(device, O_RDWR | (flags & NO_CACHING ? O_SYNC : 0));
ALOGE_IF(fd<0, "couldn't open %s (%s)", device, strerror(errno));
if (fd >= 0) {
int err = ioctl(fd, PMEM_CONNECT, pmemHeap->heapID());
if (err < 0) {
ALOGE("PMEM_CONNECT failed (%s), mFD=%d, sub-fd=%d",
strerror(errno), fd, pmemHeap->heapID());
close(fd);
} else {
// everything went well...
mParentHeap = pmemHeap;
MemoryHeapBase::init(fd,
pmemHeap->getBase(),
pmemHeap->getSize(),
pmemHeap->getFlags() | flags,
device);
}
}
}
#else
mParentHeap = pmemHeap;
MemoryHeapBase::init(
dup(pmemHeap->heapID()),
pmemHeap->getBase(),
pmemHeap->getSize(),
pmemHeap->getFlags() | flags,
device);
#endif
}
示例3:
extern "C" void const * screencap_getdata() {
if (!update(&width, &height, &format, req_width, req_height)) return heap->getBase();
return 0;
}