From 72d3c6e789becce2ee46d351220e5fed3e0bbbb9 Mon Sep 17 00:00:00 2001 From: anqi Date: Wed, 24 May 2023 08:20:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81audio=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=93=E6=9E=84=EF=BC=8C=E9=81=97=E7=95=99=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E6=B8=85=E7=90=86=20Signed-off-by:=20anqi=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BUILD.gn | 8 +- bundle.json | 1 + framework/common/same_process_ipc_guard.h | 3 +- framework/common/tlv_object.h | 10 +- framework/common/tlv_util.h | 64 ++++++ framework/common/udmf_types_util.cpp | 35 +++ framework/common/udmf_types_util.h | 5 + .../innerkitsimpl/common/unified_key.cpp | 2 - .../data/application_defined_record.cpp | 2 - framework/innerkitsimpl/data/audio.cpp | 29 +++ framework/innerkitsimpl/data/unified_data.cpp | 6 +- .../test/fuzztest/udmfclient_fuzzer/BUILD.gn | 151 ++++++------- .../udmfclient_fuzzer/udmf_client_fuzzer.h | 2 +- .../innerkitsimpl/test/unittest/BUILD.gn | 14 +- .../test/unittest/udmf_client_test.cpp | 213 ++++++++++-------- .../data/application_defined_record_napi.cpp | 11 +- framework/jskitsimpl/data/audio_napi.cpp | 71 ++++++ framework/jskitsimpl/data/file_napi.cpp | 3 +- framework/jskitsimpl/data/folder_napi.cpp | 3 +- framework/jskitsimpl/data/html_napi.cpp | 3 +- framework/jskitsimpl/data/image_napi.cpp | 3 +- framework/jskitsimpl/data/link_napi.cpp | 3 +- framework/jskitsimpl/data/plain_text_napi.cpp | 5 +- framework/jskitsimpl/data/summary_napi.cpp | 1 - .../data/system_defined_appitem_napi.cpp | 5 +- .../data/system_defined_form_napi.cpp | 5 +- .../data/system_defined_pixelmap_napi.cpp | 1 - .../data/system_defined_record_napi.cpp | 1 - framework/jskitsimpl/data/text_napi.cpp | 1 - framework/jskitsimpl/data/udmf_napi.cpp | 4 - .../jskitsimpl/data/unified_data_napi.cpp | 38 +++- .../jskitsimpl/data/unified_record_napi.cpp | 2 - framework/jskitsimpl/data/video_napi.cpp | 5 +- framework/manager/data_manager.cpp | 3 +- framework/manager/data_manager.h | 2 +- framework/manager/lifecycle/clean_after_get.h | 2 +- .../manager/lifecycle/clean_on_startup.h | 2 +- .../manager/lifecycle/clean_on_timeout.h | 3 +- .../manager/lifecycle/lifecycle_manager.h | 2 +- .../manager/lifecycle/lifecycle_policy.h | 2 +- .../manager/preprocess/preprocess_utils.cpp | 2 +- .../manager/preprocess/preprocess_utils.h | 2 +- framework/manager/store/runtime_store.h | 2 +- framework/manager/store/store.h | 2 +- framework/manager/store/store_cache.h | 2 +- framework/service/udmf_service.h | 4 + framework/service/udmf_service_proxy.cpp | 20 +- interfaces/innerkits/BUILD.gn | 19 +- interfaces/innerkits/common/error_code.h | 2 +- interfaces/innerkits/common/unified_meta.h | 3 +- interfaces/innerkits/common/unified_types.h | 20 +- interfaces/innerkits/data/audio.h | 31 +++ interfaces/innerkits/data/html.h | 2 +- interfaces/innerkits/data/image.h | 2 +- interfaces/innerkits/data/link.h | 2 +- interfaces/innerkits/data/plain_text.h | 2 +- .../innerkits/data/system_defined_appitem.h | 2 +- .../innerkits/data/system_defined_form.h | 2 +- .../innerkits/data/system_defined_pixelmap.h | 2 +- .../innerkits/data/system_defined_record.h | 2 +- interfaces/innerkits/data/text.h | 2 +- interfaces/innerkits/data/unified_data.h | 4 +- interfaces/innerkits/data/unified_record.h | 3 +- interfaces/innerkits/data/video.h | 2 +- interfaces/jskits/BUILD.gn | 42 ++-- interfaces/jskits/common/napi_error_utils.h | 1 - interfaces/jskits/common/napi_queue.h | 2 +- interfaces/jskits/data/audio_napi.h | 41 ++++ interfaces/jskits/data/html_napi.h | 2 +- interfaces/jskits/data/image_napi.h | 2 +- interfaces/jskits/data/link_napi.h | 2 +- interfaces/jskits/data/plain_text_napi.h | 2 +- interfaces/jskits/data/summary_napi.h | 2 +- .../jskits/data/system_defined_appitem_napi.h | 2 +- .../jskits/data/system_defined_form_napi.h | 2 +- .../data/system_defined_pixelmap_napi.h | 2 +- .../jskits/data/system_defined_record_napi.h | 2 +- interfaces/jskits/data/text_napi.h | 2 +- interfaces/jskits/data/udmf_napi.h | 2 +- interfaces/jskits/data/unified_data_napi.h | 2 +- interfaces/jskits/data/unified_record_napi.h | 2 +- interfaces/jskits/data/video_napi.h | 2 +- interfaces/jskits/module/udmf_napi_module.cpp | 5 +- service/BUILD.gn | 12 +- service/src/udmf_service_impl.cpp | 2 - service/src/udmf_service_stub.cpp | 21 +- udmf.gni | 21 +- 87 files changed, 681 insertions(+), 356 deletions(-) create mode 100644 framework/innerkitsimpl/data/audio.cpp create mode 100644 framework/jskitsimpl/data/audio_napi.cpp create mode 100644 interfaces/innerkits/data/audio.h create mode 100644 interfaces/jskits/data/audio_napi.h diff --git a/BUILD.gn b/BUILD.gn index 24f06bb..0cf8476 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -17,8 +17,8 @@ group("udmf_packages") { if (is_standard_system) { deps = [ "interfaces/innerkits:udmf_client", - "interfaces/jskits:udmf_napi", "interfaces/jskits:udmf_data_napi", + "interfaces/jskits:udmf_napi", "service:udmf_server", ] } @@ -27,7 +27,5 @@ group("udmf_packages") { group("fuzztest") { testonly = true deps = [] - deps += [ - "framework/innerkitsimpl/test/fuzztest/udmfclient_fuzzer:fuzztest", - ] -} \ No newline at end of file + deps += [ "framework/innerkitsimpl/test/fuzztest/udmfclient_fuzzer:fuzztest" ] +} diff --git a/bundle.json b/bundle.json index 76fc3c4..924774a 100644 --- a/bundle.json +++ b/bundle.json @@ -78,6 +78,7 @@ "header": { "header_files": [ "application_defined_record.h", + "audio.h", "file.h", "folder.h", "html.h", diff --git a/framework/common/same_process_ipc_guard.h b/framework/common/same_process_ipc_guard.h index eb2c32c..02ecb47 100644 --- a/framework/common/same_process_ipc_guard.h +++ b/framework/common/same_process_ipc_guard.h @@ -37,8 +37,7 @@ public: private: std::string identity; }; - } // namespace UDMF } // namespace OHOS -#endif //UDMF_SAMEPROCESSIPCGUARD_H \ No newline at end of file +#endif // UDMF_SAMEPROCESSIPCGUARD_H \ No newline at end of file diff --git a/framework/common/tlv_object.h b/framework/common/tlv_object.h index 6d42d34..80f2b71 100755 --- a/framework/common/tlv_object.h +++ b/framework/common/tlv_object.h @@ -179,7 +179,7 @@ public: template bool ReadBasic(T &value) { - TLVHead head{}; + TLVHead head {}; if (!ReadHead(head)) { return false; } @@ -218,7 +218,7 @@ public: bool ReadString(std::string &value) { - TLVHead head{}; + TLVHead head {}; if (!ReadHead(head)) { return false; } @@ -250,7 +250,7 @@ public: bool ReadVector(std::vector &value) { - TLVHead head{}; + TLVHead head {}; if (!ReadHead(head)) { return false; } @@ -320,7 +320,7 @@ public: bool ReadVariant(UDVariant &value) { - TLVHead head{}; + TLVHead head {}; if (!ReadHead(head)) { return false; } @@ -408,7 +408,7 @@ public: bool ReadMap(UDDetails &value) { - TLVHead head{}; + TLVHead head {}; if (!ReadHead(head)) { return false; } diff --git a/framework/common/tlv_util.h b/framework/common/tlv_util.h index 1f90001..e256c86 100755 --- a/framework/common/tlv_util.h +++ b/framework/common/tlv_util.h @@ -19,6 +19,7 @@ #include #include "application_defined_record.h" +#include "audio.h" #include "file.h" #include "folder.h" #include "html.h" @@ -140,6 +141,20 @@ bool CountBufferSize(const std::shared_ptr &input, TLVObject &dat data.Count(file->GetDetails()); break; } + case UDType::AUDIO: { + auto audio = static_cast