/ohos5.0/foundation/multimedia/player_framework/frameworks/js/system_sound_manager/src/ringtone_player/ |
H A D | ringtone_common_napi.cpp | 29 size_t bufLength = 0; in GetStringArgument() local 30 napi_status status = napi_get_value_string_utf8(env, value, nullptr, 0, &bufLength); in GetStringArgument() 31 if (status == napi_ok && bufLength > 0 && bufLength < PATH_MAX) { in GetStringArgument() 32 char *buffer = static_cast<char *>(malloc((bufLength + 1) * sizeof(char))); in GetStringArgument() 34 status = napi_get_value_string_utf8(env, value, buffer, bufLength + 1, &bufLength); in GetStringArgument()
|
/ohos5.0/foundation/multimedia/player_framework/frameworks/js/audio_haptic/src/ |
H A D | audio_haptic_common_napi.cpp | 73 size_t bufLength = 0; in GetStringArgument() local 74 napi_status status = napi_get_value_string_utf8(env, value, nullptr, 0, &bufLength); in GetStringArgument() 75 if (status == napi_ok && bufLength > 0 && bufLength < PATH_MAX) { in GetStringArgument() 76 char *buffer = static_cast<char *>(malloc((bufLength + 1) * sizeof(char))); in GetStringArgument() 78 status = napi_get_value_string_utf8(env, value, buffer, bufLength + 1, &bufLength); in GetStringArgument()
|
/ohos5.0/foundation/ability/dmsfwk_lite/source/ |
H A D | dmslite_parser.c | 49 static TlvErrorCode TlvBytesToLength(const uint8_t *bytesBuffer, uint16_t bufLength, in TlvBytesToLength() argument 57 for (uint8_t i = 0; i < bufLength; i++) { in TlvBytesToLength() 80 static TlvErrorCode TlvFillNode(const uint8_t *byteBuffer, uint16_t bufLength, in TlvFillNode() argument 83 if (bufLength <= TLV_TYPE_LEN) { in TlvFillNode() 84 HILOGE("[Bad bufLength %hu]", bufLength); in TlvFillNode() 96 TlvErrorCode errCode = TlvBytesToLength(lengthPartAddr, bufLength - curTlvNodeLen, in TlvFillNode() 107 if (curTlvNodeLen > bufLength) { in TlvFillNode() 165 TlvErrorCode TlvBytesToNode(const uint8_t *byteBuffer, uint16_t bufLength, TlvNode **tlv) in TlvBytesToNode() argument 172 if (bufLength <= (TLV_TYPE_LEN + 1)) { in TlvBytesToNode() 173 HILOGE("[Bad Length %hu]", bufLength); in TlvBytesToNode() [all …]
|
/ohos5.0/foundation/multimedia/audio_framework/services/audio_service/common/src/ |
H A D | format_converter.cpp | 24 …if (srcDesc.bufLength != dstDesc.bufLength / half || srcDesc.buffer == nullptr || dstDesc.buffer =… in S16MonoToS16Stereo() 29 size_t count = srcDesc.bufLength / sizeof(int16_t); in S16MonoToS16Stereo() 40 …if (dstDesc.bufLength != srcDesc.bufLength / half || srcDesc.buffer == nullptr || dstDesc.buffer =… in S16StereoToS16Mono() 45 size_t count = srcDesc.bufLength / half / sizeof(int16_t); in S16StereoToS16Mono()
|
H A D | volume_tools.cpp | 196 if (buffer.buffer == nullptr || buffer.bufLength % byteSizePerFrame != 0) { in Process() 201 size_t frameSize = buffer.bufLength / byteSizePerFrame; in Process() 263 AUDIO_ERR_LOG("invalid buffer, size is %{public}zu", buffer.bufLength); in CountU8Volume() 266 size_t frameSize = buffer.bufLength / byteSizePerFrame; in CountU8Volume() 307 AUDIO_ERR_LOG("invalid buffer, size is %{public}zu", buffer.bufLength); in CountS16Volume() 310 size_t frameSize = buffer.bufLength / byteSizePerFrame; in CountS16Volume() 351 AUDIO_ERR_LOG("invalid buffer, size is %{public}zu", buffer.bufLength); in CountS24Volume() 354 size_t frameSize = buffer.bufLength / byteSizePerFrame; in CountS24Volume() 401 size_t frameSize = buffer.bufLength / byteSizePerFrame; in CountS32Volume() 449 size_t frameSize = buffer.bufLength / byteSizePerFrame; in CountF32Volume() [all …]
|
/ohos5.0/foundation/arkui/ace_engine_lite/frameworks/common/memory/cache/test/unittest/common/ |
H A D | cache_manager_tdd_test.cpp | 164 size_t bufLength = CacheManager::GetInstance().GetCacheBufLength(CacheUser::USER_LOCALIZATION); variable 167 uint32_t tailMagicNumber = *reinterpret_cast<uint32_t *>(bufStartPos + bufLength); 193 size_t bufLength = CacheManager::GetInstance().GetCacheBufLength(CacheUser::USER_LOCALIZATION); variable 194 if (bufLength < MAGIC_NUMBER_LENGTH) { 203 size_t tailPos = bufLength - MAGIC_NUMBER_LENGTH; 236 size_t bufLength = CacheManager::GetInstance().GetCacheBufLength(CacheUser::USER_LOCALIZATION); variable 238 EXPECT_EQ(bufLength, 0);
|
/ohos5.0/foundation/ability/ability_lite/interfaces/kits/js/napi/ |
H A D | js_aafwk.cpp | 139 size_t bufLength = 0; in GetCharPointerArgument() local 143 status = napi_get_value_string_utf8(env, value, nullptr, 0, &bufLength); in GetCharPointerArgument() 144 if (status == napi_ok && bufLength > 0) { in GetCharPointerArgument() 146 result = (char *) malloc((bufLength + 1) * sizeof(char)); in GetCharPointerArgument() 148 status = napi_get_value_string_utf8(env, value, result, bufLength + 1, &bufLength); in GetCharPointerArgument()
|
/ohos5.0/foundation/multimedia/media_foundation/src/capi/ |
H A D | native_avformat.cpp | 192 uint32_t bufLength = str.size() > MAX_STRING_LENGTH ? MAX_STRING_LENGTH : str.size(); in OH_AVFormat_GetStringValue() local 194 format->outString_ = static_cast<char *>(malloc((bufLength + 1) * sizeof(char))); in OH_AVFormat_GetStringValue() 197 if (strcpy_s(format->outString_, bufLength + 1, str.c_str()) != EOK) { in OH_AVFormat_GetStringValue() 230 uint32_t bufLength = info.size() > MAX_DUMP_LENGTH ? MAX_DUMP_LENGTH : info.size(); in OH_AVFormat_DumpInfo() local 231 format->dumpInfo_ = static_cast<char *>(malloc((bufLength + 1) * sizeof(char))); in OH_AVFormat_DumpInfo() 233 if (strcpy_s(format->dumpInfo_, bufLength + 1, info.c_str()) != EOK) { in OH_AVFormat_DumpInfo()
|
/ohos5.0/foundation/multimedia/drm_framework/frameworks/js/drm_napi/ |
H A D | napi_param_utils.cpp | 66 size_t bufLength = 0; in GetStringArgument() local 67 napi_status status = napi_get_value_string_utf8(env, value, nullptr, 0, &bufLength); in GetStringArgument() 68 if (status == napi_ok && bufLength > 0 && bufLength < PATH_MAX) { in GetStringArgument() 69 strValue.reserve(bufLength + 1); in GetStringArgument() 70 strValue.resize(bufLength); in GetStringArgument() 71 status = napi_get_value_string_utf8(env, value, strValue.data(), bufLength + 1, &bufLength); in GetStringArgument()
|
/ohos5.0/foundation/multimedia/image_framework/frameworks/innerkitsimpl/accessor/src/ |
H A D | tiff_parser.cpp | 84 size_t TiffParser::FindTiffPos(const byte *dataBuf, size_t bufLength) in FindTiffPos() argument 87 if (dataBuf == nullptr || bufLength < TIFF_BYTEORDER_SIZE) { in FindTiffPos() 91 for (size_t i = 0; i < bufLength - TIFF_BYTEORDER_SIZE; i++) { in FindTiffPos()
|
/ohos5.0/foundation/multimedia/audio_framework/services/audio_service/server/src/ |
H A D | audio_endpoint.cpp | 1396 temp.bufLength = dupBufferSize_; in MixToDupStream() 1415 srcDataList[i].bufferDesc.bufLength != dstData.bufferDesc.bufLength || in ProcessData() 1478 convertedBuffer.bufLength); in HandleRendererDataParams() 1563 streamData.bufferDesc.bufLength); in GetAllReadyProcessData() 1591 dstStreamData.bufferDesc.bufLength); in ProcessToEndpointDataHandle() 1608 dstStreamData.bufferDesc.bufLength); in ProcessToEndpointDataHandle() 1614 dstStreamData.bufferDesc.bufLength); in ProcessToEndpointDataHandle() 1754 … memset_s(bufferReadDone.buffer, bufferReadDone.bufLength, 0, bufferReadDone.bufLength); in PrepareNextLoop() 1913 memset_s(static_cast<void *>(writeBuf.buffer), writeBuf.bufLength, 0, writeBuf.bufLength); in WriteToSpecialProcBuf() 1952 convertedBuffer.bufLength); in HandleCapturerDataParams() [all …]
|
H A D | pro_renderer_stream_impl.cpp | 373 bufferDesc.bufLength = sinkBuffer_[0].size(); in DequeueBuffer() 387 ConvertSrcToFloat(bufferDesc.buffer, bufferDesc.bufLength, volume); in EnqueueBuffer() 392 ConvertSrcToFloat(bufferDesc.buffer, bufferDesc.bufLength, volume); in EnqueueBuffer() 397 ConvertSrcToFloat(bufferDesc.buffer, bufferDesc.bufLength, volume); in EnqueueBuffer() 405 uint32_t frameLength = bufferDesc.bufLength / samplePerFrame; in EnqueueBuffer() 418 …buffer length:%{public}zu ,sink buffer length:%{public}zu,volume:%{public}f", bufferDesc.bufLength, in EnqueueBuffer() 420 totalBytesWritten_ += bufferDesc.bufLength; in EnqueueBuffer() 421 sinkBytesWritten_ += bufferDesc.bufLength; in EnqueueBuffer() 613 void ProRendererStreamImpl::ConvertSrcToFloat(uint8_t *buffer, size_t bufLength, float volume) in ConvertSrcToFloat() argument 620 … memcpy_s(resampleSrcBuffer.data(), resampleSrcBuffer.size() * samplePerFrame, buffer, bufLength); in ConvertSrcToFloat()
|
H A D | capturer_in_server.cpp | 229 ringCache_->Enqueue({srcBuffer.buffer, srcBuffer.bufLength}); in ReadData() 246 … memset_s(static_cast<void *>(dstBuffer.buffer), dstBuffer.bufLength, 0, dstBuffer.bufLength); in ReadData() 248 ringCache_->Dequeue({dstBuffer.buffer, dstBuffer.bufLength}); in ReadData() 250 … DumpFileUtil::WriteDumpFile(dumpS2C_, static_cast<void *>(dstBuffer.buffer), dstBuffer.bufLength); in ReadData() 252 static_cast<void *>(dstBuffer.buffer), dstBuffer.bufLength); in ReadData() 367 memset_s(bufferDesc.buffer, bufferDesc.bufLength, 0, bufferDesc.bufLength); in Flush()
|
/ohos5.0/base/customization/config_policy/frameworks/config_policy/src/ |
H A D | config_policy_utils.c | 432 char *GetOneCfgFileEx(const char *pathSuffix, char *buf, unsigned int bufLength, int followMode, co… in GetOneCfgFileEx() argument 434 if (pathSuffix == NULL || buf == NULL || bufLength < MAX_PATH_LEN) { in GetOneCfgFileEx() 451 … snprintf_s(buf, bufLength, bufLength - 1, "%s/%s/%s", dirs->paths[i - 1], result->segs[j - 1], in GetOneCfgFileEx() 461 … if (snprintf_s(buf, bufLength, bufLength - 1, "%s/%s", dirs->paths[i - 1], pathSuffix) > 0 && in GetOneCfgFileEx() 472 char *GetOneCfgFile(const char *pathSuffix, char *buf, unsigned int bufLength) in GetOneCfgFile() argument 474 return GetOneCfgFileEx(pathSuffix, buf, bufLength, FOLLOWX_MODE_DEFAULT, NULL); in GetOneCfgFile()
|
/ohos5.0/base/web/webview/ohos_interface/ohos_glue/ohos_adapter/bridge/webview/ |
H A D | ark_buffer_desc_adapter_wrapper.cpp | 44 void ArkBufferDescAdapterWrapper::SetBufLength(size_t bufLength) in SetBufLength() argument 46 ctocpp_->SetBufLength(bufLength); in SetBufLength()
|
/ohos5.0/base/web/webview/ohos_interface/ohos_glue/ohos_adapter/bridge/webcore/ |
H A D | ark_buffer_desc_adapter_impl.cpp | 42 void ArkBufferDescAdapterImpl::SetBufLength(size_t bufLength) in SetBufLength() argument 44 return real_->SetBufLength(bufLength); in SetBufLength()
|
/ohos5.0/foundation/distributedhardware/distributed_audio/services/audioclient/micclient/src/ |
H A D | dmic_client.cpp | 309 if (audioCapturer_->GetBufferDesc(bufDesc) != DH_SUCCESS || bufDesc.bufLength == 0) { in OnReadData() 316 if (audioData->Capacity() != bufDesc.bufLength) { in OnReadData() 318 uint64_t bufLength = static_cast<uint64_t>(bufDesc.bufLength); in OnReadData() local 320 ", bufLength: %{public}" PRIu64, capacity, bufLength); in OnReadData() 322 …if (memcpy_s(audioData->Data(), audioData->Capacity(), bufDesc.buffer, bufDesc.bufLength) != EOK) { in OnReadData()
|
/ohos5.0/base/customization/config_policy/interfaces/inner_api/include/ |
H A D | config_policy_utils.h | 83 char *GetOneCfgFileEx(const char *pathSuffix, char *buf, unsigned int bufLength, int followMode, co… 89 char *GetOneCfgFile(const char *pathSuffix, char *buf, unsigned int bufLength);
|
/ohos5.0/foundation/multimedia/audio_framework/services/audio_service/test/example/ |
H A D | audio_process_client_test.cpp | 217 … = memset_s(signalSoundBuffer.buffer, signalSoundBuffer.bufLength, 0, signalSoundBuffer.bufLength); in InitSignalBuffer() 259 int ret = memcpy_s(static_cast<void *>(bufDesc.buffer), bufDesc.bufLength, in HandleWriteLoopData() 260 static_cast<void *>(g_cacheBuffer.buffer), g_cacheBuffer.bufLength); in HandleWriteLoopData() 374 size_t cnt = fwrite(bufDesc.buffer, 1, bufDesc.bufLength, g_micPcmFile); in CaptureToFile() 375 CHECK_AND_RETURN_RET_LOG(cnt == bufDesc.bufLength, ERR_WRITE_FAILED, in CaptureToFile() 379 static_cast<void *>(bufDesc.buffer), bufDesc.bufLength); in CaptureToFile() 390 int64_t bt = RecordBeepTime(bufDesc.buffer, bufDesc.bufLength, isFirstCapture); in CaptureToFile() 426 fread(bufDesc.buffer, 1, bufDesc.bufLength, g_spkWavFile); in RenderFromFile() 431 int64_t bt = RecordBeepTime(bufDesc.buffer, bufDesc.bufLength, isFirstRender); in RenderFromFile() 454 if (ret != SUCCESS || bufDesc.buffer == nullptr || bufDesc.bufLength ==0) { in OnHandleData() [all …]
|
/ohos5.0/foundation/multimedia/media_foundation/tests/unittest/format/inner/ |
H A D | avformat_inner_mock.cpp | 120 uint32_t bufLength = info.size() > maxDumpLength ? maxDumpLength : info.size(); in DumpInfo() local 121 dumpInfo_ = static_cast<char *>(malloc((bufLength + 1) * sizeof(char))); in DumpInfo() 125 if (strcpy_s(dumpInfo_, bufLength + 1, info.c_str()) != 0) { in DumpInfo()
|
/ohos5.0/foundation/distributedhardware/distributed_audio/services/audiomanager/managersource/src/ |
H A D | daudio_echo_cannel_manager.cpp | 223 if (ret != 0 || bufDesc.buffer == nullptr || bufDesc.bufLength == 0) { in OnReadData() 227 DHLOGD("Get echo ref data. size: %{public}zu.", bufDesc.bufLength); in OnReadData() 228 std::shared_ptr<AudioData> audioData = std::make_shared<AudioData>(bufDesc.bufLength); in OnReadData() 229 if (audioData->Capacity() != bufDesc.bufLength) { in OnReadData() 231 audioData->Capacity(), bufDesc.bufLength); in OnReadData() 233 …if (memcpy_s(audioData->Data(), audioData->Capacity(), bufDesc.buffer, bufDesc.bufLength) != EOK) { in OnReadData()
|
/ohos5.0/foundation/multimedia/audio_framework/services/audio_service/client/src/ |
H A D | audio_process_in_client.cpp | 677 ret = memset_s(readbufDesc.buffer, readbufDesc.bufLength, 0, readbufDesc.bufLength); in ReadFromProcessClient() 696 bufDesc.bufLength = clientSpanSizeInByte_; in GetBufferDesc() 728 …if (srcDesc.bufLength != dstDesc.bufLength / half || srcDesc.buffer == nullptr || dstDesc.buffer =… in S16MonoToS16Stereo() 733 size_t count = srcDesc.bufLength / half; in S16MonoToS16Stereo() 744 …if (srcDesc.bufLength != dstDesc.bufLength || srcDesc.buffer == nullptr || dstDesc.buffer == nullp… in S32MonoToS16Stereo() 745 srcDesc.bufLength % quarter != 0) { in S32MonoToS16Stereo() 750 size_t count = srcDesc.bufLength / quarter; in S32MonoToS16Stereo() 766 …if (srcDesc.bufLength / half != dstDesc.bufLength || srcDesc.buffer == nullptr || dstDesc.buffer =… in S32StereoS16Stereo() 767 dstDesc.bufLength % half != 0) { in S32StereoS16Stereo() 772 size_t count = srcDesc.bufLength / half / half; in S32StereoS16Stereo() [all …]
|
/ohos5.0/foundation/multimedia/av_codec/test/unittest/common/common_mock/avformat/inner/ |
H A D | avformat_inner_mock.cpp | 130 uint32_t bufLength = info.size() > maxDumpLength ? maxDumpLength : info.size(); in DumpInfo() local 131 dumpInfo_ = static_cast<char *>(malloc((bufLength + 1) * sizeof(char))); in DumpInfo() 135 if (strcpy_s(dumpInfo_, bufLength + 1, info.c_str()) != 0) { in DumpInfo()
|
/ohos5.0/base/sensors/miscdevice/frameworks/js/napi/vibrator/src/ |
H A D | vibrator_napi_utils.cpp | 110 size_t bufLength = 0; in GetStringValue() local 111 ret = napi_get_value_string_utf8(env, value, nullptr, 0, &bufLength); in GetStringValue() 116 bufLength = bufLength > STRING_LENGTH_MAX ? STRING_LENGTH_MAX : bufLength; in GetStringValue() 119 ret = napi_get_value_string_utf8(env, value, str, bufLength + 1, &strLen); in GetStringValue()
|
/ohos5.0/foundation/arkui/ace_engine_lite/frameworks/src/core/modules/presets/ |
H A D | console_log_impl.cpp | 63 const uint16_t bufLength = LOG_BUFFER_SIZE; in LogNative() local 64 jerry_char_t substrBuf[bufLength] = {0}; in LogNative() 68 jerry_substring_to_char_buffer(strVal, substrPos, length, substrBuf, bufLength - 1); in LogNative()
|