本文整理汇总了C++中android::sp::size方法的典型用法代码示例。如果您正苦于以下问题:C++ sp::size方法的具体用法?C++ sp::size怎么用?C++ sp::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android::sp
的用法示例。
在下文中一共展示了sp::size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: postData
void CameraControl::postData(
int32_t msg_type,
const android::sp<android::IMemory>& data,
camera_frame_metadata_t* metadata)
{
REPORT_FUNCTION();
if (!listener)
return;
switch (msg_type) {
case CAMERA_MSG_RAW_IMAGE:
if (listener->on_data_raw_image_cb)
listener->on_data_raw_image_cb(data->pointer(), data->size(), listener->context);
break;
case CAMERA_MSG_COMPRESSED_IMAGE:
if (listener->on_data_compressed_image_cb)
listener->on_data_compressed_image_cb(data->pointer(), data->size(), listener->context);
break;
default:
break;
}
camera->releaseRecordingFrame(data);
}
示例2: postData
void postData(int32_t msgType, const android::sp<android::IMemory>& dataPtr,
camera_frame_metadata_t *metadata)
{
int32_t dataMsgType = msgType & ~CAMERA_MSG_PREVIEW_METADATA;
DroidMediaData mem;
switch (dataMsgType) {
case CAMERA_MSG_RAW_IMAGE:
mem.size = dataPtr->size();
mem.data = dataPtr->pointer();
if (m_cam->m_cb.raw_image_cb) {
m_cam->m_cb.raw_image_cb(m_cam->m_cb_data, &mem);
}
break;
case CAMERA_MSG_COMPRESSED_IMAGE:
mem.size = dataPtr->size();
mem.data = dataPtr->pointer();
if (m_cam->m_cb.compressed_image_cb) {
m_cam->m_cb.compressed_image_cb(m_cam->m_cb_data, &mem);
}
break;
case CAMERA_MSG_POSTVIEW_FRAME:
mem.size = dataPtr->size();
mem.data = dataPtr->pointer();
if (m_cam->m_cb.postview_frame_cb) {
m_cam->m_cb.postview_frame_cb(m_cam->m_cb_data, &mem);
}
break;
case CAMERA_MSG_RAW_IMAGE_NOTIFY:
if (m_cam->m_cb.raw_image_notify_cb) {
m_cam->m_cb.raw_image_notify_cb(m_cam->m_cb_data);
}
break;
case CAMERA_MSG_PREVIEW_FRAME:
mem.size = dataPtr->size();
mem.data = dataPtr->pointer();
if (m_cam->m_cb.preview_frame_cb) {
m_cam->m_cb.preview_frame_cb(m_cam->m_cb_data, &mem);
}
break;
case 0:
// Nothing
break;
default:
ALOGW("unknown postData message 0x%x", dataMsgType);
break;
}
if (metadata && (msgType & CAMERA_MSG_PREVIEW_METADATA)
&& m_cam->m_cb.preview_metadata_cb) {
sendPreviewMetadata(metadata);
}
}