Home
last modified time | relevance | path

Searched refs:ashmem (Results 1 - 25 of 46) sorted by relevance

12

/foundation/ai/intelligent_voice_framework/services/intell_voice_engine/server/base/
H A Ddata_operation_callback.cpp38 INTELL_VOICE_LOG_INFO("clear ashmem"); in OnIntellVoiceDataOprEvent()
84 const sptr<Ashmem> &ashmem) in CreateArrayBufferFromAshmem()
86 if (ashmem == nullptr) { in CreateArrayBufferFromAshmem()
87 INTELL_VOICE_LOG_ERROR("ashmem is nullptr"); in CreateArrayBufferFromAshmem()
91 uint32_t size = static_cast<uint32_t>(ashmem->GetAshmemSize()); in CreateArrayBufferFromAshmem()
97 if (!ashmem->MapReadOnlyAshmem()) { in CreateArrayBufferFromAshmem()
98 INTELL_VOICE_LOG_ERROR("map ashmem failed"); in CreateArrayBufferFromAshmem()
102 const uint8_t *mem = static_cast<const uint8_t *>(ashmem->ReadFromAshmem(size, 0)); in CreateArrayBufferFromAshmem()
104 INTELL_VOICE_LOG_ERROR("read from ashmem failed"); in CreateArrayBufferFromAshmem()
124 sptr<Ashmem> ashmem in CreateAshmemFromArrayBuffer() local
83 CreateArrayBufferFromAshmem( const sptr<Ashmem> &ashmem) CreateArrayBufferFromAshmem() argument
[all...]
H A Dengine_util.cpp16 #include <ashmem.h>
138 void EngineUtil::WriteBufferFromAshmem(uint8_t *&buffer, uint32_t size, sptr<OHOS::Ashmem> ashmem) in WriteBufferFromAshmem() argument
140 if (!ashmem->MapReadOnlyAshmem()) { in WriteBufferFromAshmem()
141 INTELL_VOICE_LOG_ERROR("map ashmem failed"); in WriteBufferFromAshmem()
145 const uint8_t *tmpBuffer = static_cast<const uint8_t *>(ashmem->ReadFromAshmem(size, 0)); in WriteBufferFromAshmem()
147 INTELL_VOICE_LOG_ERROR("read from ashmem failed"); in WriteBufferFromAshmem()
168 sptr<Ashmem> ashmem; in ProcDspModel() local
169 adapter_->Read(type, ashmem); in ProcDspModel()
170 if (ashmem == nullptr) { in ProcDspModel()
171 INTELL_VOICE_LOG_ERROR("ashmem i in ProcDspModel()
[all...]
H A Ddata_operation_callback.h18 #include <ashmem.h>
37 std::unique_ptr<OHOS::IntellVoiceUtils::Uint8ArrayBuffer> CreateArrayBufferFromAshmem(const sptr<Ashmem> &ashmem);
H A Dengine_util.h21 #include <ashmem.h>
106 static void WriteBufferFromAshmem(uint8_t *&buffer, uint32_t size, sptr<OHOS::Ashmem> ashmem);
/foundation/distributeddatamgr/data_share/frameworks/native/common/src/
H A Ddatashare_template.cpp60 return std::move(node.ashmem); in MoveOutAshmem()
105 if (node.ashmem != nullptr) { in GetData()
106 node.ashmem->MapReadOnlyAshmem(); in GetData()
107 uint8_t *data = (uint8_t *)node.ashmem->ReadFromAshmem(node.ashmem->GetAshmemSize(), 0); in GetData()
111 return std::vector<uint8_t>(data, data + node.ashmem->GetAshmemSize()); in GetData()
119 void PublishedDataItem::SetAshmem(sptr<Ashmem> ashmem, bool isManaged) in SetAshmem() argument
121 AshmemNode node = { ashmem, isManaged }; in SetAshmem()
129 if (node->isManaged && node->ashmem != nullptr) { in Clear()
130 node->ashmem in Clear()
[all...]
H A Dshared_block.cpp16 #include <ashmem.h>
31 SharedBlock::SharedBlock(const std::string &name, sptr<Ashmem> ashmem, size_t size, bool readOnly) in SharedBlock() argument
32 : mName(name), ashmem_(ashmem), mSize(size), mReadOnly(readOnly), mHeader(nullptr) in SharedBlock()
42 LOG_DEBUG("SharedBlock: close ashmem"); in ~SharedBlock()
66 int SharedBlock::CreateSharedBlock(const std::string &name, size_t size, sptr<Ashmem> ashmem, in CreateSharedBlock() argument
69 outSharedBlock = new SharedBlock(name, ashmem, size, false); in CreateSharedBlock()
88 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(ashmemName.c_str(), size); in Create() local
89 if (ashmem == nullptr) { in Create()
94 bool ret = ashmem->MapReadAndWriteAshmem(); in Create()
97 ashmem in Create()
119 sptr<Ashmem> ashmem = parcel.ReadAshmem(); ReadMessageParcel() local
[all...]
/foundation/distributeddatamgr/relational_store/frameworks/native/appdatafwk/src/
H A Dshared_block.cpp18 #include <ashmem.h>
37 SharedBlock::SharedBlock(const std::string &name, sptr<Ashmem> ashmem, size_t size, bool readOnly) in SharedBlock() argument
38 : mName(name), ashmem_(ashmem), mSize(size), mReadOnly(readOnly), mHeader(nullptr) in SharedBlock()
61 int SharedBlock::CreateSharedBlock(const std::string &name, size_t size, sptr<Ashmem> ashmem, in CreateSharedBlock() argument
64 outSharedBlock = new SharedBlock(name, ashmem, size, false); in CreateSharedBlock()
85 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(ashmemName.c_str(), size); in Create() local
86 if (ashmem == nullptr) { in Create()
87 LOG_ERROR("failed to create ashmem errno %{public}d", errno); in Create()
91 bool ret = ashmem->MapReadAndWriteAshmem(); in Create()
94 ashmem in Create()
116 sptr<Ashmem> ashmem = parcel.ReadAshmem(); ReadMessageParcel() local
[all...]
/foundation/ai/intelligent_voice_framework/frameworks/native/
H A Dintell_voice_manager.cpp174 INTELL_VOICE_LOG_ERROR("failed to file data from ashmem"); in GetUploadFiles()
185 int32_t IntellVoiceManager::GetFileDataFromAshmem(sptr<Ashmem> ashmem, std::vector<uint8_t> &fileData) in GetFileDataFromAshmem() argument
187 if (ashmem == nullptr) { in GetFileDataFromAshmem()
188 INTELL_VOICE_LOG_ERROR("ashmem is nullptr"); in GetFileDataFromAshmem()
193 ashmem->UnmapAshmem(); in GetFileDataFromAshmem()
194 ashmem->CloseAshmem(); in GetFileDataFromAshmem()
197 uint32_t size = static_cast<uint32_t>(ashmem->GetAshmemSize()); in GetFileDataFromAshmem()
203 if (!ashmem->MapReadOnlyAshmem()) { in GetFileDataFromAshmem()
204 INTELL_VOICE_LOG_ERROR("map ashmem failed"); in GetFileDataFromAshmem()
208 const uint8_t *buffer = static_cast<const uint8_t *>(ashmem in GetFileDataFromAshmem()
[all...]
/foundation/bundlemanager/bundle_framework/interfaces/inner_api/appexecfwk_core/src/bundle_resource/
H A Dbundle_resource_host.cpp207 // The ashmem name must be unique. in WriteParcelableIntoAshmem()
208 sptr<Ashmem> ashmem = Ashmem::CreateAshmem( in WriteParcelableIntoAshmem() local
210 if (ashmem == nullptr) { in WriteParcelableIntoAshmem()
216 if (!ashmem->MapReadAndWriteAshmem()) { in WriteParcelableIntoAshmem()
220 // Write the size and content of each item to the ashmem. in WriteParcelableIntoAshmem()
222 if (!ashmem->WriteToAshmem(reinterpret_cast<uint8_t *>(tempParcel.GetData()), dataSize, offset)) { in WriteParcelableIntoAshmem()
224 ClearAshmem(ashmem); in WriteParcelableIntoAshmem()
228 if (!reply.WriteAshmem(ashmem)) { in WriteParcelableIntoAshmem()
229 ClearAshmem(ashmem); in WriteParcelableIntoAshmem()
230 APP_LOGE("Write ashmem t in WriteParcelableIntoAshmem()
[all...]
/foundation/ability/form_fwk/test/unittest/fms_form_ashmem_test/
H A Dmock_message_parcel.cpp145 bool MessageParcel::WriteAshmem(sptr<Ashmem> ashmem) in WriteAshmem() argument
155 sptr<Ashmem> ashmem = new (std::nothrow) Ashmem(fd, size); in ReadAshmem() local
156 return ashmem; in ReadAshmem()
/foundation/graphic/graphic_2d/rosen/modules/platform/ipc_core/
H A Dmessage_parcel.h24 #include <ashmem.h>
60 bool WriteAshmem(sptr<Ashmem> ashmem);
/foundation/arkui/ace_engine/frameworks/core/components/form/
H A Dsub_container.cpp18 #include "ashmem.h"
451 auto ashmem = Ashmem(newFd, byteLenArray[i]); in UpdateSharedImage() local
452 GetImageDataFromAshmem(picNameCopy, ashmem, pipelineCtx, byteLenArray[i]); in UpdateSharedImage()
453 ashmem.UnmapAshmem(); in UpdateSharedImage()
454 ashmem.CloseAshmem(); in UpdateSharedImage()
459 const std::string& picName, Ashmem& ashmem, const RefPtr<PipelineBase>& pipelineContext, int len) in GetImageDataFromAshmem()
461 bool ret = ashmem.MapReadOnlyAshmem(); in GetImageDataFromAshmem()
467 strerror(errno), picName.c_str(), len, ashmem.GetAshmemFd()); in GetImageDataFromAshmem()
470 const uint8_t* imageData = reinterpret_cast<const uint8_t*>(ashmem.ReadFromAshmem(len, 0)); in GetImageDataFromAshmem()
473 strerror(errno), picName.c_str(), len, ashmem in GetImageDataFromAshmem()
458 GetImageDataFromAshmem( const std::string& picName, Ashmem& ashmem, const RefPtr<PipelineBase>& pipelineContext, int len) GetImageDataFromAshmem() argument
[all...]
/foundation/communication/ipc/ipc/native/src/napi_common/include/
H A Dnapi_ashmem.h22 #include "ashmem.h"
34 explicit NAPIAshmem(sptr<Ashmem> &ashmem);
41 void SetAshmem(sptr<Ashmem> &ashmem) in SetAshmem() argument
43 ashmem_ = ashmem; in SetAshmem()
/foundation/communication/ipc/ipc/test/moduletest/native/common/
H A Dipc_core_module_test.cpp531 * @tc.desc: Test ashmem reads and writes.
550 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(ashmemName.c_str(), rawData10K); in HWTEST_F() local
551 ASSERT_TRUE(ashmem != nullptr); in HWTEST_F()
552 bool ret = ashmem->MapReadAndWriteAshmem(); in HWTEST_F()
554 ret = ashmem->WriteToAshmem(ashmemString.c_str(), strlen(ashmemString.c_str()), 0); in HWTEST_F()
558 std::u16string readStr = testService->TestAshmem(ashmem, strlen(ashmemString.c_str())); in HWTEST_F()
563 ashmem->UnmapAshmem(); in HWTEST_F()
564 ashmem->CloseAshmem(); in HWTEST_F()
670 sptr<Ashmem> ashmem = Ashmem::CreateAshmem(ashmemName.c_str(), 1024); in HWTEST_F() local
671 ASSERT_TRUE(ashmem ! in HWTEST_F()
[all...]
/foundation/communication/wifi/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_scan_sa/
H A Dwifi_scan_stub.cpp226 sptr<Ashmem> ashmem = Ashmem::CreateAshmem("scaninfo", ASH_MEM_SIZE); in SendScanInfo() local
227 if (ashmem == nullptr || !ashmem->MapReadAndWriteAshmem()) { in SendScanInfo()
229 if (ashmem != nullptr) { in SendScanInfo()
230 ashmem->UnmapAshmem(); in SendScanInfo()
231 ashmem->CloseAshmem(); in SendScanInfo()
278 ashmem->WriteToAshmem(reinterpret_cast<void*>(outParcel.GetData()), dataSize, offset); in SendScanInfo()
283 reply.WriteAshmem(ashmem); in SendScanInfo()
284 ashmem->UnmapAshmem(); in SendScanInfo()
285 ashmem in SendScanInfo()
[all...]
/foundation/communication/ipc/interfaces/innerkits/ipc_core/include/
H A Dmessage_parcel.h19 #include <ashmem.h>
147 * @param ashmem Indicates anonymous shared memory object to wrote.
151 bool WriteAshmem(sptr<Ashmem> ashmem);
/foundation/distributeddatamgr/data_share/frameworks/native/common/include/
H A Dshared_block.h22 #include <ashmem.h>
71 SharedBlock(const std::string &name, sptr<Ashmem> ashmem, size_t size, bool readOnly);
302 static int CreateSharedBlock(const std::string &name, size_t size, sptr<Ashmem> ashmem,
/foundation/ability/form_fwk/services/src/
H A Dform_cache_mgr.cpp161 HILOG_ERROR("Alloc ashmem failed"); in InnerGetImageData()
167 HILOG_ERROR("Write to ashmem failed"); in InnerGetImageData()
300 const std::string& picName, const sptr<Ashmem> &ashmem, int32_t len, std::vector<uint8_t> &value) in GetImageDataFromAshmem()
303 if (ashmem == nullptr) { in GetImageDataFromAshmem()
304 HILOG_ERROR("null ashmem when picName:%{public}s", picName.c_str()); in GetImageDataFromAshmem()
308 bool ret = ashmem->MapReadOnlyAshmem(); in GetImageDataFromAshmem()
315 ScopeGuard stateGuard([ashmem] { in GetImageDataFromAshmem()
316 if (ashmem) { in GetImageDataFromAshmem()
317 ashmem->UnmapAshmem(); in GetImageDataFromAshmem()
320 const uint8_t* imageData = reinterpret_cast<const uint8_t*>(ashmem in GetImageDataFromAshmem()
299 GetImageDataFromAshmem( const std::string& picName, const sptr<Ashmem> &ashmem, int32_t len, std::vector<uint8_t> &value) GetImageDataFromAshmem() argument
[all...]
/foundation/communication/ipc/ipc/native/src/jni/source/
H A Dohos_rpc_message_parcel.cpp18 #include <ashmem.h>
44 explicit AshmemSmartPointWrapper(const sptr<Ashmem> &ashmem) : ashmem_(ashmem) in AshmemSmartPointWrapper() argument
46 if (ashmem == nullptr) { in AshmemSmartPointWrapper()
47 ZLOGE(LABEL, "ashmem is null"); in AshmemSmartPointWrapper()
497 sptr<Ashmem> ashmem = Java_ohos_rpc_Ashmem_getSptrAshmem(env, object, id); in Java_ohos_rpc_MessageParcel_nativeWriteAshmem() local
498 if (ashmem == nullptr) { in Java_ohos_rpc_MessageParcel_nativeWriteAshmem()
499 ZLOGE(LABEL, "ashmem is null"); in Java_ohos_rpc_MessageParcel_nativeWriteAshmem()
503 bool result = nativeParcel->WriteAshmem(ashmem); in Java_ohos_rpc_MessageParcel_nativeWriteAshmem()
/foundation/communication/wifi/wifi/frameworks/native/src/
H A Dwifi_scan_proxy.cpp290 sptr<Ashmem> ashmem = reply.ReadAshmem();
291 if (ashmem == nullptr || !ashmem->MapReadAndWriteAshmem()) {
297 auto origin = ashmem->ReadFromAshmem(allSize[i], offset);
309 ashmem->UnmapAshmem();
310 ashmem->CloseAshmem();
/foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/service/data_share/
H A Ddata_share_types_util.cpp107 node.ashmem = parcel.ReadAshmem(); in Unmarshalling()
114 return parcel.WriteAshmem(node.ashmem); in Marshalling()
/foundation/distributeddatamgr/data_share/interfaces/inner_api/common/include/
H A Ddatashare_template.h89 sptr<Ashmem> ashmem; member
114 void SetAshmem(sptr<Ashmem> ashmem, bool isManaged = false);
/foundation/distributeddatamgr/relational_store/interfaces/inner_api/appdatafwk/include/
H A Dshared_block.h22 #include <ashmem.h>
76 /** Indicates that an ashmem error occurred in the operation of shared memory.*/
103 API_EXPORT SharedBlock(const std::string &name, sptr<Ashmem> ashmem, size_t size, bool readOnly);
377 static int CreateSharedBlock(const std::string &name, size_t size, sptr<Ashmem> ashmem,
/foundation/multimedia/camera_framework/services/deferred_processing_service/include/base/buffer_manager/
H A Dshared_buffer.h19 #include <ashmem.h>
/foundation/graphic/graphic_2d/rosen/modules/platform/utils/
H A Dashmem.h17 * @file ashmem.h
27 #include <linux/ashmem.h>
33 * @brief Create ashmem in kernel with specified name and size.
35 * @param name Name for identifying the ashmem in kernel.
36 * @param size Size of the ashmem region.
37 * @return File descriptor of the ashmem.
42 * @brief Set protection flag of specified ashmem region in kernel.
51 * @brief Get size of specified ashmem region in kernel.
54 * @return Size of ashmem.
62 * Including create, map an ashmem regio
[all...]

Completed in 12 milliseconds

12