From fe0bc6f0bc7d440c3df889b5a433f59111190baa Mon Sep 17 00:00:00 2001 From: htt1997 Date: Mon, 17 Feb 2025 17:12:57 +0800 Subject: [PATCH 01/19] add batchinsert Signed-off-by: htt1997 --- .../include/oh_rdb_transaction.h | 30 +++++++ .../relational_store/include/oh_rdb_types.h | 83 +++++++++++++++++++ .../include/relational_store.h | 30 +++++++ .../include/relational_store_error_code.h | 7 ++ .../relational_store/libnative_rdb.ndk.json | 8 ++ 5 files changed, 158 insertions(+) create mode 100644 distributeddatamgr/relational_store/include/oh_rdb_types.h diff --git a/distributeddatamgr/relational_store/include/oh_rdb_transaction.h b/distributeddatamgr/relational_store/include/oh_rdb_transaction.h index e302f677d..7a13c9593 100644 --- a/distributeddatamgr/relational_store/include/oh_rdb_transaction.h +++ b/distributeddatamgr/relational_store/include/oh_rdb_transaction.h @@ -220,6 +220,36 @@ int OH_RdbTrans_Insert(OH_Rdb_Transaction *trans, const char *table, const OH_VB int OH_RdbTrans_BatchInsert(OH_Rdb_Transaction *trans, const char *table, const OH_Data_VBuckets *rows, int64_t *changes); +/** + * @brief Inserts a batch of data into the target table. + * + * @param trans Represents a pointer to an instance of OH_Rdb_Transaction. + * @param table Represents the target table. + * @param rows Represents the rows data to be inserted into the table. + * @param resolution Represents the resolution when conflict occurs. + * @param changes Represents the number of successful insertions. + * @return Returns the status code of the execution. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_ERROR} database common error. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. + * Returns {@link RDB_E_WAL_SIZE_OVER_LIMIT} the WAL file size over default limit. + * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. + * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. + * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. + * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. + * Returns {@link RDB_E_SQLITE_LOCKED} SQLite: A table in the database is locked. + * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. + * Returns {@link RDB_E_SQLITE_READONLY} SQLite: Attempt to write a readonly database. + * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. + * Returns {@link RDB_E_SQLITE_TOO_BIG} SQLite: TEXT or BLOB exceeds size limit. + * Returns {@link RDB_E_SQLITE_MISMATCH} SQLite: Data type mismatch. + * Returns {@link RDB_E_SQLITE_CONSTRAINT} SQLite: Abort due to constraint violation. + * @since 16 + */ +int OH_RdbTrans_BatchInsertWithConflictResolution(OH_Rdb_Transaction *trans, const char *table, + const OH_Data_VBuckets *rows, Rdb_Conflict_Resolution resolution, int64_t *changes); + /** * @brief Updates data in the database based on specified conditions. * diff --git a/distributeddatamgr/relational_store/include/oh_rdb_types.h b/distributeddatamgr/relational_store/include/oh_rdb_types.h new file mode 100644 index 000000000..0be2c259b --- /dev/null +++ b/distributeddatamgr/relational_store/include/oh_rdb_types.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup RDB + * @{ + * + * @brief The relational database (RDB) store manages data based on relational models. + * With the underlying SQLite database, the RDB store provides a complete mechanism for managing local databases. + * To satisfy different needs in complicated scenarios, the RDB store offers a series of APIs for performing operations + * such as adding, deleting, modifying, and querying data, and supports direct execution of SQL statements. + * + * @since 10 + */ + +/** + * @file oh_rdb_types.h + * + * @brief Provides type define related to the data value. + * + * @kit ArkData + * @library libnative_rdb_ndk.z.so + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * + * @since 16 + */ + +#ifndef OH_RDB_TYPES_H +#define OH_RDB_TYPES_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Describe the security area of the database. + * + * @since 16 + */ +typedef enum Rdb_Conflict_Resolution { + /** + * @brief Implements no operation when conflict occurs. + */ + RDB_CONFLICT_NONE = 1, + /** + * @brief Implements rollback operation when conflict occurs. + */ + RDB_CONFLICT_ROLLBACK, + /** + * @brief Implements abort operation when conflict occurs. + */ + RDB_CONFLICT_ABORT, + /** + * @brief Implements fail operation when conflict occurs. + */ + RDB_CONFLICT_FAIL, + /** + * @brief Implements ignore operation when conflict occurs. + */ + RDB_CONFLICT_IGNORE, + /** + * @brief Implements replace operation when conflict occurs. + */ + RDB_CONFLICT_REPLACE, +} Rdb_Conflict_Resolution; + +#ifdef __cplusplus +}; +#endif +#endif +/** @} */ \ No newline at end of file diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index 01149c1b4..8e8a4fabe 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -487,6 +487,36 @@ int OH_Rdb_DeleteStoreV2(const OH_Rdb_ConfigV2 *config); */ int OH_Rdb_Insert(OH_Rdb_Store *store, const char *table, OH_VBucket *valuesBucket); +/** + * @brief Inserts a batch of data into the target table. + * + * @param trans Represents a pointer to an instance of OH_Rdb_Transaction. + * @param table Represents the target table. + * @param rows Represents the rows data to be inserted into the table. + * @param resolution Represents the resolution when conflict occurs. + * @param changes Represents the number of successful insertions. + * @return Returns the status code of the execution. + * Returns {@link RDB_OK} if the execution is successful. + * Returns {@link RDB_E_ERROR} database common error. + * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. + * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. + * Returns {@link RDB_E_WAL_SIZE_OVER_LIMIT} the WAL file size over default limit. + * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. + * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. + * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. + * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. + * Returns {@link RDB_E_SQLITE_LOCKED} SQLite: A table in the database is locked. + * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. + * Returns {@link RDB_E_SQLITE_READONLY} SQLite: Attempt to write a readonly database. + * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. + * Returns {@link RDB_E_SQLITE_TOO_BIG} SQLite: TEXT or BLOB exceeds size limit. + * Returns {@link RDB_E_SQLITE_MISMATCH} SQLite: Data type mismatch. + * Returns {@link RDB_E_SQLITE_CONSTRAINT} SQLite: Abort due to constraint violation. + * @since 16 + */ +int OH_Rdb_BatchInsert(OH_Rdb_Transaction *trans, const char *table, + const OH_Data_VBuckets *rows, Rdb_Conflict_Resolution resolution, int64_t *changes); + /** * @brief Updates data in the database based on specified conditions. * diff --git a/distributeddatamgr/relational_store/include/relational_store_error_code.h b/distributeddatamgr/relational_store/include/relational_store_error_code.h index fb9a20805..64ec5db2a 100644 --- a/distributeddatamgr/relational_store/include/relational_store_error_code.h +++ b/distributeddatamgr/relational_store/include/relational_store_error_code.h @@ -413,6 +413,13 @@ typedef enum OH_Rdb_ErrCode { * @since 16 */ RDB_E_TYPE_MISMATCH = (E_BASE + 64), + + /** + * @brief Data value type is null. + * + * @since 16 + */ + RDB_E_SQLITE_CONSTRAINT = (E_BASE + 65), } OH_Rdb_ErrCode; #ifdef __cplusplus diff --git a/distributeddatamgr/relational_store/libnative_rdb.ndk.json b/distributeddatamgr/relational_store/libnative_rdb.ndk.json index 729444292..8d4ef570f 100644 --- a/distributeddatamgr/relational_store/libnative_rdb.ndk.json +++ b/distributeddatamgr/relational_store/libnative_rdb.ndk.json @@ -70,6 +70,10 @@ { "name":"OH_Rdb_Insert" }, + { + "first_introduced": "16", + "name":"OH_Rdb_BatchInsert" + }, { "name":"OH_Rdb_Update" }, @@ -467,6 +471,10 @@ "first_introduced": "16", "name":"OH_RdbTrans_BatchInsert" }, + { + "first_introduced": "16", + "name":"OH_RdbTrans_BatchInsertWithConflictResolution" + }, { "first_introduced": "16", "name":"OH_RdbTrans_Update" -- Gitee From 871261bf8a0c408662fc4516f7987704a6b83b5c Mon Sep 17 00:00:00 2001 From: htt1997 Date: Tue, 18 Feb 2025 10:20:31 +0800 Subject: [PATCH 02/19] update Signed-off-by: htt1997 --- .../include/oh_rdb_transaction.h | 32 ++----------------- .../include/relational_store.h | 4 +-- .../relational_store/libnative_rdb.ndk.json | 4 --- 3 files changed, 4 insertions(+), 36 deletions(-) diff --git a/distributeddatamgr/relational_store/include/oh_rdb_transaction.h b/distributeddatamgr/relational_store/include/oh_rdb_transaction.h index 7a13c9593..636e78e17 100644 --- a/distributeddatamgr/relational_store/include/oh_rdb_transaction.h +++ b/distributeddatamgr/relational_store/include/oh_rdb_transaction.h @@ -192,34 +192,6 @@ int OH_RdbTrans_Rollback(OH_Rdb_Transaction *trans); */ int OH_RdbTrans_Insert(OH_Rdb_Transaction *trans, const char *table, const OH_VBucket *row, int64_t *rowId); -/** - * @brief Inserts a batch of data into the target table. - * - * @param trans Represents a pointer to an instance of OH_Rdb_Transaction. - * @param table Represents the target table. - * @param rows Represents the rows data to be inserted into the table. - * @param changes Represents the number of successful insertions. - * @return Returns the status code of the execution. - * Returns {@link RDB_OK} if the execution is successful. - * Returns {@link RDB_E_ERROR} database common error. - * Returns {@link RDB_E_INVALID_ARGS} if invalid input parameter. - * Returns {@link RDB_E_ALREADY_CLOSED} database already closed. - * Returns {@link RDB_E_WAL_SIZE_OVER_LIMIT} the WAL file size over default limit. - * Returns {@link RDB_E_SQLITE_FULL} SQLite: The database is full. - * Returns {@link RDB_E_SQLITE_CORRUPT} database corrupted. - * Returns {@link RDB_E_SQLITE_PERM} SQLite: Access permission denied. - * Returns {@link RDB_E_SQLITE_BUSY} SQLite: The database file is locked. - * Returns {@link RDB_E_SQLITE_LOCKED} SQLite: A table in the database is locked. - * Returns {@link RDB_E_SQLITE_NOMEM} SQLite: The database is out of memory. - * Returns {@link RDB_E_SQLITE_READONLY} SQLite: Attempt to write a readonly database. - * Returns {@link RDB_E_SQLITE_IOERR} SQLite: Some kind of disk I/O error occurred. - * Returns {@link RDB_E_SQLITE_TOO_BIG} SQLite: TEXT or BLOB exceeds size limit. - * Returns {@link RDB_E_SQLITE_MISMATCH} SQLite: Data type mismatch. - * @since 16 - */ -int OH_RdbTrans_BatchInsert(OH_Rdb_Transaction *trans, const char *table, const OH_Data_VBuckets *rows, - int64_t *changes); - /** * @brief Inserts a batch of data into the target table. * @@ -247,8 +219,8 @@ int OH_RdbTrans_BatchInsert(OH_Rdb_Transaction *trans, const char *table, const * Returns {@link RDB_E_SQLITE_CONSTRAINT} SQLite: Abort due to constraint violation. * @since 16 */ -int OH_RdbTrans_BatchInsertWithConflictResolution(OH_Rdb_Transaction *trans, const char *table, - const OH_Data_VBuckets *rows, Rdb_Conflict_Resolution resolution, int64_t *changes); +int OH_RdbTrans_BatchInsert(OH_Rdb_Transaction *trans, const char *table, const OH_Data_VBuckets *rows, + Rdb_Conflict_Resolution resolution, int64_t *changes); /** * @brief Updates data in the database based on specified conditions. diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index 8e8a4fabe..71b692cc6 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -490,7 +490,7 @@ int OH_Rdb_Insert(OH_Rdb_Store *store, const char *table, OH_VBucket *valuesBuck /** * @brief Inserts a batch of data into the target table. * - * @param trans Represents a pointer to an instance of OH_Rdb_Transaction. + * @param store Represents a pointer to an {@link OH_Rdb_Store} instance. * @param table Represents the target table. * @param rows Represents the rows data to be inserted into the table. * @param resolution Represents the resolution when conflict occurs. @@ -514,7 +514,7 @@ int OH_Rdb_Insert(OH_Rdb_Store *store, const char *table, OH_VBucket *valuesBuck * Returns {@link RDB_E_SQLITE_CONSTRAINT} SQLite: Abort due to constraint violation. * @since 16 */ -int OH_Rdb_BatchInsert(OH_Rdb_Transaction *trans, const char *table, +int OH_Rdb_BatchInsert(OH_Rdb_Store *store, const char *table, const OH_Data_VBuckets *rows, Rdb_Conflict_Resolution resolution, int64_t *changes); /** diff --git a/distributeddatamgr/relational_store/libnative_rdb.ndk.json b/distributeddatamgr/relational_store/libnative_rdb.ndk.json index 8d4ef570f..afa900613 100644 --- a/distributeddatamgr/relational_store/libnative_rdb.ndk.json +++ b/distributeddatamgr/relational_store/libnative_rdb.ndk.json @@ -471,10 +471,6 @@ "first_introduced": "16", "name":"OH_RdbTrans_BatchInsert" }, - { - "first_introduced": "16", - "name":"OH_RdbTrans_BatchInsertWithConflictResolution" - }, { "first_introduced": "16", "name":"OH_RdbTrans_Update" -- Gitee From b582059a09805e8966234fa7edbe835dd7c1d5a6 Mon Sep 17 00:00:00 2001 From: htt1997 Date: Thu, 20 Feb 2025 20:38:10 +0800 Subject: [PATCH 03/19] fix Signed-off-by: htt1997 --- distributeddatamgr/relational_store/BUILD.gn | 2 ++ .../relational_store/include/oh_rdb_transaction.h | 1 + distributeddatamgr/relational_store/include/relational_store.h | 1 + .../relational_store/include/relational_store_error_code.h | 2 +- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/distributeddatamgr/relational_store/BUILD.gn b/distributeddatamgr/relational_store/BUILD.gn index 203e78f46..2e11e328a 100644 --- a/distributeddatamgr/relational_store/BUILD.gn +++ b/distributeddatamgr/relational_store/BUILD.gn @@ -21,6 +21,7 @@ ohos_ndk_headers("native_rdb_ndk_header") { "./include/oh_cursor.h", "./include/oh_predicates.h", "./include/oh_rdb_transaction.h", + "./include/oh_rdb_types.h", "./include/oh_value_object.h", "./include/oh_values_bucket.h", "./include/relational_store.h", @@ -52,6 +53,7 @@ ohos_ndk_library("libnative_rdb_ndk") { "$ndk_headers_out_dir/database/rdb/oh_cursor.h", "$ndk_headers_out_dir/database/rdb/oh_predicates.h", "$ndk_headers_out_dir/database/rdb/oh_rdb_transaction.h", + "$ndk_headers_out_dir/database/rdb/oh_rdb_types.h", "$ndk_headers_out_dir/database/rdb/oh_value_object.h", "$ndk_headers_out_dir/database/rdb/oh_values_bucket.h", "$ndk_headers_out_dir/database/rdb/relational_store.h", diff --git a/distributeddatamgr/relational_store/include/oh_rdb_transaction.h b/distributeddatamgr/relational_store/include/oh_rdb_transaction.h index 636e78e17..50dacd501 100644 --- a/distributeddatamgr/relational_store/include/oh_rdb_transaction.h +++ b/distributeddatamgr/relational_store/include/oh_rdb_transaction.h @@ -43,6 +43,7 @@ #include "database/rdb/oh_cursor.h" #include "database/rdb/oh_predicates.h" #include "database/rdb/oh_values_bucket.h" +#include "database/rdb/oh_rdb_types.h" #include "database/data/oh_data_values.h" #include "database/data/oh_data_values_buckets.h" diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index 71b692cc6..a6de7b086 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -44,6 +44,7 @@ #include "database/rdb/oh_value_object.h" #include "database/rdb/oh_values_bucket.h" #include "database/rdb/oh_rdb_transaction.h" +#include "database/rdb/oh_rdb_types.h" #ifdef __cplusplus extern "C" { diff --git a/distributeddatamgr/relational_store/include/relational_store_error_code.h b/distributeddatamgr/relational_store/include/relational_store_error_code.h index 64ec5db2a..f7e0b7988 100644 --- a/distributeddatamgr/relational_store/include/relational_store_error_code.h +++ b/distributeddatamgr/relational_store/include/relational_store_error_code.h @@ -415,7 +415,7 @@ typedef enum OH_Rdb_ErrCode { RDB_E_TYPE_MISMATCH = (E_BASE + 64), /** - * @brief Data value type is null. + * @brief Data violates constraints. * * @since 16 */ -- Gitee From aacf25f5aaf2a9925c20fb07ab29474f31bd3158 Mon Sep 17 00:00:00 2001 From: htt1997 Date: Fri, 21 Feb 2025 11:33:18 +0800 Subject: [PATCH 04/19] fix rename Signed-off-by: htt1997 --- .../relational_store/include/oh_rdb_transaction.h | 2 +- distributeddatamgr/relational_store/include/oh_rdb_types.h | 4 ++-- .../relational_store/include/relational_store.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/distributeddatamgr/relational_store/include/oh_rdb_transaction.h b/distributeddatamgr/relational_store/include/oh_rdb_transaction.h index 50dacd501..fef729867 100644 --- a/distributeddatamgr/relational_store/include/oh_rdb_transaction.h +++ b/distributeddatamgr/relational_store/include/oh_rdb_transaction.h @@ -221,7 +221,7 @@ int OH_RdbTrans_Insert(OH_Rdb_Transaction *trans, const char *table, const OH_VB * @since 16 */ int OH_RdbTrans_BatchInsert(OH_Rdb_Transaction *trans, const char *table, const OH_Data_VBuckets *rows, - Rdb_Conflict_Resolution resolution, int64_t *changes); + Rdb_ConflictResolution resolution, int64_t *changes); /** * @brief Updates data in the database based on specified conditions. diff --git a/distributeddatamgr/relational_store/include/oh_rdb_types.h b/distributeddatamgr/relational_store/include/oh_rdb_types.h index 0be2c259b..5080ae645 100644 --- a/distributeddatamgr/relational_store/include/oh_rdb_types.h +++ b/distributeddatamgr/relational_store/include/oh_rdb_types.h @@ -49,7 +49,7 @@ extern "C" { * * @since 16 */ -typedef enum Rdb_Conflict_Resolution { +typedef enum Rdb_ConflictResolution { /** * @brief Implements no operation when conflict occurs. */ @@ -74,7 +74,7 @@ typedef enum Rdb_Conflict_Resolution { * @brief Implements replace operation when conflict occurs. */ RDB_CONFLICT_REPLACE, -} Rdb_Conflict_Resolution; +} Rdb_ConflictResolution; #ifdef __cplusplus }; diff --git a/distributeddatamgr/relational_store/include/relational_store.h b/distributeddatamgr/relational_store/include/relational_store.h index a6de7b086..1974af547 100644 --- a/distributeddatamgr/relational_store/include/relational_store.h +++ b/distributeddatamgr/relational_store/include/relational_store.h @@ -516,7 +516,7 @@ int OH_Rdb_Insert(OH_Rdb_Store *store, const char *table, OH_VBucket *valuesBuck * @since 16 */ int OH_Rdb_BatchInsert(OH_Rdb_Store *store, const char *table, - const OH_Data_VBuckets *rows, Rdb_Conflict_Resolution resolution, int64_t *changes); + const OH_Data_VBuckets *rows, Rdb_ConflictResolution resolution, int64_t *changes); /** * @brief Updates data in the database based on specified conditions. -- Gitee From 5690469e2cb7803df881174008a51638aa274381 Mon Sep 17 00:00:00 2001 From: htt1997 Date: Sat, 22 Feb 2025 15:10:39 +0800 Subject: [PATCH 05/19] code check Signed-off-by: htt1997 --- distributeddatamgr/relational_store/BUILD.gn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distributeddatamgr/relational_store/BUILD.gn b/distributeddatamgr/relational_store/BUILD.gn index 2e11e328a..560c94d4d 100644 --- a/distributeddatamgr/relational_store/BUILD.gn +++ b/distributeddatamgr/relational_store/BUILD.gn @@ -59,4 +59,4 @@ ohos_ndk_library("libnative_rdb_ndk") { "$ndk_headers_out_dir/database/rdb/relational_store.h", "$ndk_headers_out_dir/database/rdb/relational_store_error_code.h", ] -} \ No newline at end of file +} -- Gitee From 67997334a83d53d0e43a83b047046f4e9da82724 Mon Sep 17 00:00:00 2001 From: ht Date: Sat, 22 Feb 2025 06:13:27 +0000 Subject: [PATCH 06/19] update Signed-off-by: ht --- .../relational_store/include/relational_store_error_code.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distributeddatamgr/relational_store/include/relational_store_error_code.h b/distributeddatamgr/relational_store/include/relational_store_error_code.h index f7e0b7988..64ec5db2a 100644 --- a/distributeddatamgr/relational_store/include/relational_store_error_code.h +++ b/distributeddatamgr/relational_store/include/relational_store_error_code.h @@ -415,7 +415,7 @@ typedef enum OH_Rdb_ErrCode { RDB_E_TYPE_MISMATCH = (E_BASE + 64), /** - * @brief Data violates constraints. + * @brief Data value type is null. * * @since 16 */ -- Gitee From 16e5d42421f86b791d886eee428828faadb75194 Mon Sep 17 00:00:00 2001 From: l00844999 Date: Fri, 7 Feb 2025 10:55:34 +0800 Subject: [PATCH 07/19] =?UTF-8?q?drawing=20=E8=A7=84=E8=8C=83=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20Signed-off-by:=20l00844999=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../native_drawing/drawing_gpu_context.h | 2 +- .../native_drawing/drawing_path_effect.h | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/drawing_gpu_context.h b/graphic/graphic_2d/native_drawing/drawing_gpu_context.h index 9bc3239bd..1949a5e72 100644 --- a/graphic/graphic_2d/native_drawing/drawing_gpu_context.h +++ b/graphic/graphic_2d/native_drawing/drawing_gpu_context.h @@ -76,7 +76,7 @@ OH_Drawing_GpuContext* OH_Drawing_GpuContextCreateFromGL(OH_Drawing_GpuContextOp * @since 16 * @version 1.0 */ -OH_Drawing_GpuContext* OH_Drawing_GpuContextCreate(); +OH_Drawing_GpuContext* OH_Drawing_GpuContextCreate(void); /** * @brief Destroys an OH_Drawing_GpuContext object and reclaims the memory occupied by the object. diff --git a/graphic/graphic_2d/native_drawing/drawing_path_effect.h b/graphic/graphic_2d/native_drawing/drawing_path_effect.h index 78c5d8f09..e89201d14 100644 --- a/graphic/graphic_2d/native_drawing/drawing_path_effect.h +++ b/graphic/graphic_2d/native_drawing/drawing_path_effect.h @@ -47,19 +47,19 @@ extern "C" { #endif /** - * @brief Enumerate path effect types. + * @brief Enumerate path dash style. * * @since 16 * @version 1.0 */ typedef enum { - /** Indicates that the path effect is a translation effect. */ - PATH_EFFECT_TRANSLATE, - /** Indicates that the path effect is a rotation effect. */ - PATH_EFFECT_ROTATE, - /** Indicates that the path effect is a morph effect. */ - PATH_EFFECT_MORPH, -} OH_Drawing_PathEffectType; + /** Indicates translation effect. */ + DRAWING_PATH_DASH_STYLE_TRANSLATE, + /** Indicates rotation effect. */ + DRAWING_PATH_DASH_STYLE_ROTATE, + /** Indicates morph effect. */ + DRAWING_PATH_DASH_STYLE_MORPH, +} OH_Drawing_PathDashStyle; /** * @brief Creates an OH_Drawing_PathEffect object that is a combination of paths, @@ -121,7 +121,7 @@ OH_Drawing_PathEffect* OH_Drawing_CreateDiscretePathEffect(float segLength, floa * @param path Indicates the pointer to an OH_Drawing_Path object. * @param advance Indicates the distance between the dashed segments. * @param phase Indicates the offset into intervals array. - * @param type Indicates the type of the path effect. + * @param type Indicates the type of the path dash effect. * @return Returns the pointer to the OH_Drawing_PathEffect object created. * If nullptr is returned, the creation fails. * The possible cause of the failure is advance and phase are zero or less. @@ -129,7 +129,7 @@ OH_Drawing_PathEffect* OH_Drawing_CreateDiscretePathEffect(float segLength, floa * @version 1.0 */ OH_Drawing_PathEffect* OH_Drawing_CreatePathDashEffect(const OH_Drawing_Path* path, float advance, float phase, - OH_Drawing_PathEffectType type); + OH_Drawing_PathDashStyle type); /** * @brief Creates an OH_Drawing_PathEffect object by overlaying two path effects. -- Gitee From b770cd1af297b11d532b5db4b36c54c096e70f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E5=90=8C=E8=BE=89?= Date: Sat, 22 Feb 2025 07:52:27 +0000 Subject: [PATCH 08/19] =?UTF-8?q?ndk=E9=94=99=E8=AF=AF=E7=A0=81=E8=A1=A5?= =?UTF-8?q?=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 彭同辉 --- multimedia/media_foundation/native_averrors.h | 5 +++++ multimedia/player_framework/avimage_generator.h | 5 ++++- multimedia/player_framework/avmetadata_extractor.h | 7 ++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/multimedia/media_foundation/native_averrors.h b/multimedia/media_foundation/native_averrors.h index 80cf8d292..98bb4fabb 100644 --- a/multimedia/media_foundation/native_averrors.h +++ b/multimedia/media_foundation/native_averrors.h @@ -94,6 +94,11 @@ typedef enum OH_AVErrCode { * @since 12 */ AV_ERR_INPUT_DATA_ERROR = 10, + /** + * @error unsupported format. + * @since 16 + */ + AV_ERR_UNSUPPORT_FORMAT = 11, /** * @error extend err start. */ diff --git a/multimedia/player_framework/avimage_generator.h b/multimedia/player_framework/avimage_generator.h index 0ae5a5b28..c008d3ca3 100644 --- a/multimedia/player_framework/avimage_generator.h +++ b/multimedia/player_framework/avimage_generator.h @@ -78,6 +78,8 @@ OH_AVImageGenerator* OH_AVImageGenerator_Create(void); * @return Function result code. * {@link AV_ERR_OK} if the execution is successful. * {@link AV_ERR_INPUT_DATA_ERROR} if input generator is nullptr or input param is invalid. + * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. + * {@link AV_ERR_NO_MEMORY}, denotes a failure in internal memory allocation. * @since 16 */ OH_AVErrCode OH_AVImageGenerator_SetFDSource(OH_AVImageGenerator* generator, @@ -98,6 +100,8 @@ OH_AVErrCode OH_AVImageGenerator_SetFDSource(OH_AVImageGenerator* generator, * {@link AV_ERR_OK} if the execution is successful. * {@link AV_ERR_INPUT_DATA_ERROR} if input generator is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. + * {@link AV_ERR_UNSUPPORT_FORMAT} if format is unsupported. + * {@link AV_ERR_NO_MEMORY}, denotes a failure in internal memory allocation. * @since 16 */ OH_AVErrCode OH_AVImageGenerator_FetchFrameByTime(OH_AVImageGenerator* generator, @@ -111,7 +115,6 @@ OH_AVErrCode OH_AVImageGenerator_FetchFrameByTime(OH_AVImageGenerator* generator * @return Function result code. * {@link AV_ERR_OK} if the execution is successful. * {@link AV_ERR_INPUT_DATA_ERROR} if input generator is nullptr or input param is invalid. - * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. * @since 16 */ OH_AVErrCode OH_AVImageGenerator_Release(OH_AVImageGenerator* generator); diff --git a/multimedia/player_framework/avmetadata_extractor.h b/multimedia/player_framework/avmetadata_extractor.h index b6d5bba33..cb27b00ee 100644 --- a/multimedia/player_framework/avmetadata_extractor.h +++ b/multimedia/player_framework/avmetadata_extractor.h @@ -80,6 +80,8 @@ OH_AVMetadataExtractor* OH_AVMetadataExtractor_Create(void); * @return Function result code. * {@link AV_ERR_OK} if the execution is successful. * {@link AV_ERR_INPUT_DATA_ERROR} if input extractor is nullptr or input param is invalid. + * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. + * {@link AV_ERR_NO_MEMORY}, denotes a failure in internal memory allocation. * @since 16 */ OH_AVErrCode OH_AVMetadataExtractor_SetFDSource(OH_AVMetadataExtractor* extractor, @@ -96,6 +98,8 @@ OH_AVErrCode OH_AVMetadataExtractor_SetFDSource(OH_AVMetadataExtractor* extracto * {@link AV_ERR_OK} if the execution is successful. * {@link AV_ERR_INPUT_DATA_ERROR} if input extractor is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. + * {@link AV_ERR_UNSUPPORT_FORMAT} if format is unsupported. + * {@link AV_ERR_NO_MEMORY}, denotes a failure in internal memory allocation. * @since 16 */ OH_AVErrCode OH_AVMetadataExtractor_FetchMetadata(OH_AVMetadataExtractor* extractor, OH_AVFormat* avMetadata); @@ -111,6 +115,8 @@ OH_AVErrCode OH_AVMetadataExtractor_FetchMetadata(OH_AVMetadataExtractor* extrac * {@link AV_ERR_OK} if the execution is successful. * {@link AV_ERR_INPUT_DATA_ERROR} if input extractor is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. + * {@link AV_ERR_UNSUPPORT_FORMAT} if format is unsupported. + * {@link AV_ERR_NO_MEMORY}, denotes a failure in internal memory allocation. * @since 16 */ OH_AVErrCode OH_AVMetadataExtractor_FetchAlbumCover(OH_AVMetadataExtractor* extractor, OH_PixelmapNative** pixelMap); @@ -123,7 +129,6 @@ OH_AVErrCode OH_AVMetadataExtractor_FetchAlbumCover(OH_AVMetadataExtractor* extr * @return Function result code. * {@link AV_ERR_OK} if the execution is successful. * {@link AV_ERR_INPUT_DATA_ERROR} if input extractor is nullptr or input param is invalid. - * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. * @since 16 */ OH_AVErrCode OH_AVMetadataExtractor_Release(OH_AVMetadataExtractor* extractor); -- Gitee From 18f5029f7674f9f168bd63c3baa30dc232297bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E5=90=8C=E8=BE=89?= Date: Sat, 22 Feb 2025 08:00:53 +0000 Subject: [PATCH 09/19] update multimedia/player_framework/avimage_generator.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 彭同辉 --- multimedia/player_framework/avimage_generator.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/player_framework/avimage_generator.h b/multimedia/player_framework/avimage_generator.h index c008d3ca3..ac57809ff 100644 --- a/multimedia/player_framework/avimage_generator.h +++ b/multimedia/player_framework/avimage_generator.h @@ -79,7 +79,7 @@ OH_AVImageGenerator* OH_AVImageGenerator_Create(void); * {@link AV_ERR_OK} if the execution is successful. * {@link AV_ERR_INPUT_DATA_ERROR} if input generator is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. - * {@link AV_ERR_NO_MEMORY}, denotes a failure in internal memory allocation. + * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. * @since 16 */ OH_AVErrCode OH_AVImageGenerator_SetFDSource(OH_AVImageGenerator* generator, @@ -101,7 +101,7 @@ OH_AVErrCode OH_AVImageGenerator_SetFDSource(OH_AVImageGenerator* generator, * {@link AV_ERR_INPUT_DATA_ERROR} if input generator is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. * {@link AV_ERR_UNSUPPORT_FORMAT} if format is unsupported. - * {@link AV_ERR_NO_MEMORY}, denotes a failure in internal memory allocation. + * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. * @since 16 */ OH_AVErrCode OH_AVImageGenerator_FetchFrameByTime(OH_AVImageGenerator* generator, -- Gitee From be0a4177d2bbc71aa3d3233de8e80997fb297640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E5=90=8C=E8=BE=89?= Date: Sat, 22 Feb 2025 08:03:40 +0000 Subject: [PATCH 10/19] update multimedia/player_framework/avmetadata_extractor.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 彭同辉 --- multimedia/player_framework/avmetadata_extractor.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multimedia/player_framework/avmetadata_extractor.h b/multimedia/player_framework/avmetadata_extractor.h index cb27b00ee..13c563122 100644 --- a/multimedia/player_framework/avmetadata_extractor.h +++ b/multimedia/player_framework/avmetadata_extractor.h @@ -81,7 +81,7 @@ OH_AVMetadataExtractor* OH_AVMetadataExtractor_Create(void); * {@link AV_ERR_OK} if the execution is successful. * {@link AV_ERR_INPUT_DATA_ERROR} if input extractor is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. - * {@link AV_ERR_NO_MEMORY}, denotes a failure in internal memory allocation. + * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. * @since 16 */ OH_AVErrCode OH_AVMetadataExtractor_SetFDSource(OH_AVMetadataExtractor* extractor, @@ -99,7 +99,7 @@ OH_AVErrCode OH_AVMetadataExtractor_SetFDSource(OH_AVMetadataExtractor* extracto * {@link AV_ERR_INPUT_DATA_ERROR} if input extractor is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. * {@link AV_ERR_UNSUPPORT_FORMAT} if format is unsupported. - * {@link AV_ERR_NO_MEMORY}, denotes a failure in internal memory allocation. + * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. * @since 16 */ OH_AVErrCode OH_AVMetadataExtractor_FetchMetadata(OH_AVMetadataExtractor* extractor, OH_AVFormat* avMetadata); @@ -116,7 +116,7 @@ OH_AVErrCode OH_AVMetadataExtractor_FetchMetadata(OH_AVMetadataExtractor* extrac * {@link AV_ERR_INPUT_DATA_ERROR} if input extractor is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. * {@link AV_ERR_UNSUPPORT_FORMAT} if format is unsupported. - * {@link AV_ERR_NO_MEMORY}, denotes a failure in internal memory allocation. + * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. * @since 16 */ OH_AVErrCode OH_AVMetadataExtractor_FetchAlbumCover(OH_AVMetadataExtractor* extractor, OH_PixelmapNative** pixelMap); -- Gitee From 4619badf9e415e514844cc20334778ae33e64234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E5=90=8C=E8=BE=89?= Date: Sat, 22 Feb 2025 08:14:16 +0000 Subject: [PATCH 11/19] update multimedia/player_framework/avmetadata_extractor.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 彭同辉 --- multimedia/player_framework/avmetadata_extractor.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multimedia/player_framework/avmetadata_extractor.h b/multimedia/player_framework/avmetadata_extractor.h index 13c563122..243f5e129 100644 --- a/multimedia/player_framework/avmetadata_extractor.h +++ b/multimedia/player_framework/avmetadata_extractor.h @@ -81,7 +81,7 @@ OH_AVMetadataExtractor* OH_AVMetadataExtractor_Create(void); * {@link AV_ERR_OK} if the execution is successful. * {@link AV_ERR_INPUT_DATA_ERROR} if input extractor is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. - * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. + * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. * @since 16 */ OH_AVErrCode OH_AVMetadataExtractor_SetFDSource(OH_AVMetadataExtractor* extractor, @@ -99,7 +99,7 @@ OH_AVErrCode OH_AVMetadataExtractor_SetFDSource(OH_AVMetadataExtractor* extracto * {@link AV_ERR_INPUT_DATA_ERROR} if input extractor is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. * {@link AV_ERR_UNSUPPORT_FORMAT} if format is unsupported. - * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. + * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. * @since 16 */ OH_AVErrCode OH_AVMetadataExtractor_FetchMetadata(OH_AVMetadataExtractor* extractor, OH_AVFormat* avMetadata); @@ -116,7 +116,7 @@ OH_AVErrCode OH_AVMetadataExtractor_FetchMetadata(OH_AVMetadataExtractor* extrac * {@link AV_ERR_INPUT_DATA_ERROR} if input extractor is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. * {@link AV_ERR_UNSUPPORT_FORMAT} if format is unsupported. - * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. + * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. * @since 16 */ OH_AVErrCode OH_AVMetadataExtractor_FetchAlbumCover(OH_AVMetadataExtractor* extractor, OH_PixelmapNative** pixelMap); -- Gitee From 6d6f37823b0ca1a9761e7ccb177eeb781c00daaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E5=90=8C=E8=BE=89?= Date: Sat, 22 Feb 2025 08:14:59 +0000 Subject: [PATCH 12/19] update multimedia/player_framework/avimage_generator.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 彭同辉 --- multimedia/player_framework/avimage_generator.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/player_framework/avimage_generator.h b/multimedia/player_framework/avimage_generator.h index ac57809ff..680c35af2 100644 --- a/multimedia/player_framework/avimage_generator.h +++ b/multimedia/player_framework/avimage_generator.h @@ -79,7 +79,7 @@ OH_AVImageGenerator* OH_AVImageGenerator_Create(void); * {@link AV_ERR_OK} if the execution is successful. * {@link AV_ERR_INPUT_DATA_ERROR} if input generator is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. - * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. + * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. * @since 16 */ OH_AVErrCode OH_AVImageGenerator_SetFDSource(OH_AVImageGenerator* generator, @@ -101,7 +101,7 @@ OH_AVErrCode OH_AVImageGenerator_SetFDSource(OH_AVImageGenerator* generator, * {@link AV_ERR_INPUT_DATA_ERROR} if input generator is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. * {@link AV_ERR_UNSUPPORT_FORMAT} if format is unsupported. - * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. + * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. * @since 16 */ OH_AVErrCode OH_AVImageGenerator_FetchFrameByTime(OH_AVImageGenerator* generator, -- Gitee From 469e58b88c637d61984093afeed7918a79caaec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E5=90=8C=E8=BE=89?= Date: Sat, 22 Feb 2025 09:20:31 +0000 Subject: [PATCH 13/19] update multimedia/media_foundation/native_averrors.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 彭同辉 --- multimedia/media_foundation/native_averrors.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/media_foundation/native_averrors.h b/multimedia/media_foundation/native_averrors.h index 98bb4fabb..2fedd0834 100644 --- a/multimedia/media_foundation/native_averrors.h +++ b/multimedia/media_foundation/native_averrors.h @@ -98,7 +98,7 @@ typedef enum OH_AVErrCode { * @error unsupported format. * @since 16 */ - AV_ERR_UNSUPPORT_FORMAT = 11, + AV_ERR_UNSUPPORTED_FORMAT = 11, /** * @error extend err start. */ -- Gitee From 019195bc7724e53b7df9fe405771fe4aea554683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E5=90=8C=E8=BE=89?= Date: Sat, 22 Feb 2025 09:22:16 +0000 Subject: [PATCH 14/19] update multimedia/player_framework/avimage_generator.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 彭同辉 --- multimedia/player_framework/avimage_generator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/player_framework/avimage_generator.h b/multimedia/player_framework/avimage_generator.h index 680c35af2..1cbf46bcf 100644 --- a/multimedia/player_framework/avimage_generator.h +++ b/multimedia/player_framework/avimage_generator.h @@ -100,7 +100,7 @@ OH_AVErrCode OH_AVImageGenerator_SetFDSource(OH_AVImageGenerator* generator, * {@link AV_ERR_OK} if the execution is successful. * {@link AV_ERR_INPUT_DATA_ERROR} if input generator is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. - * {@link AV_ERR_UNSUPPORT_FORMAT} if format is unsupported. + * {@link AV_ERR_UNSUPPORTED_FORMAT} if format is unsupported. * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. * @since 16 */ -- Gitee From 52aaa5863a3c90d448d19d88d9d2ae50d408ca00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E5=90=8C=E8=BE=89?= Date: Sat, 22 Feb 2025 09:23:18 +0000 Subject: [PATCH 15/19] update multimedia/player_framework/avmetadata_extractor.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 彭同辉 --- multimedia/player_framework/avmetadata_extractor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/player_framework/avmetadata_extractor.h b/multimedia/player_framework/avmetadata_extractor.h index 243f5e129..38f70846c 100644 --- a/multimedia/player_framework/avmetadata_extractor.h +++ b/multimedia/player_framework/avmetadata_extractor.h @@ -98,7 +98,7 @@ OH_AVErrCode OH_AVMetadataExtractor_SetFDSource(OH_AVMetadataExtractor* extracto * {@link AV_ERR_OK} if the execution is successful. * {@link AV_ERR_INPUT_DATA_ERROR} if input extractor is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. - * {@link AV_ERR_UNSUPPORT_FORMAT} if format is unsupported. + * {@link AV_ERR_UNSUPPORTED_FORMAT} if format is unsupported. * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. * @since 16 */ @@ -115,7 +115,7 @@ OH_AVErrCode OH_AVMetadataExtractor_FetchMetadata(OH_AVMetadataExtractor* extrac * {@link AV_ERR_OK} if the execution is successful. * {@link AV_ERR_INPUT_DATA_ERROR} if input extractor is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. - * {@link AV_ERR_UNSUPPORT_FORMAT} if format is unsupported. + * {@link AV_ERR_UNSUPPORTED_FORMAT} if format is unsupported. * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. * @since 16 */ -- Gitee From 01071659707c7cd47fb54a4987c6d0ca32bf8ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E5=90=8C=E8=BE=89?= Date: Mon, 24 Feb 2025 08:34:38 +0000 Subject: [PATCH 16/19] update multimedia/player_framework/avimage_generator.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 彭同辉 --- multimedia/player_framework/avimage_generator.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/multimedia/player_framework/avimage_generator.h b/multimedia/player_framework/avimage_generator.h index 1cbf46bcf..261202db7 100644 --- a/multimedia/player_framework/avimage_generator.h +++ b/multimedia/player_framework/avimage_generator.h @@ -77,7 +77,7 @@ OH_AVImageGenerator* OH_AVImageGenerator_Create(void); * @param size Indicates the size of media source. * @return Function result code. * {@link AV_ERR_OK} if the execution is successful. - * {@link AV_ERR_INPUT_DATA_ERROR} if input generator is nullptr or input param is invalid. + * {@link AV_ERR_INVALID_VAL} if input generator is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. * @since 16 @@ -98,7 +98,7 @@ OH_AVErrCode OH_AVImageGenerator_SetFDSource(OH_AVImageGenerator* generator, * @param pixelMap The fetched output image from the video source. For details, see {@link OH_PixelmapNative}. * @return Function result code. * {@link AV_ERR_OK} if the execution is successful. - * {@link AV_ERR_INPUT_DATA_ERROR} if input generator is nullptr or input param is invalid. + * {@link AV_ERR_INVALID_VAL} if input generator is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. * {@link AV_ERR_UNSUPPORTED_FORMAT} if format is unsupported. * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. @@ -114,7 +114,7 @@ OH_AVErrCode OH_AVImageGenerator_FetchFrameByTime(OH_AVImageGenerator* generator * @param generator Pointer to an OH_AVImageGenerator instance. * @return Function result code. * {@link AV_ERR_OK} if the execution is successful. - * {@link AV_ERR_INPUT_DATA_ERROR} if input generator is nullptr or input param is invalid. + * {@link AV_ERR_INVALID_VAL} if input generator is nullptr or input param is invalid. * @since 16 */ OH_AVErrCode OH_AVImageGenerator_Release(OH_AVImageGenerator* generator); -- Gitee From b197ac9795246489bbeed31aaeac89b4cde5469c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E5=90=8C=E8=BE=89?= Date: Mon, 24 Feb 2025 08:35:06 +0000 Subject: [PATCH 17/19] update multimedia/player_framework/avmetadata_extractor.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 彭同辉 --- multimedia/player_framework/avmetadata_extractor.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/multimedia/player_framework/avmetadata_extractor.h b/multimedia/player_framework/avmetadata_extractor.h index 38f70846c..cb54f5c89 100644 --- a/multimedia/player_framework/avmetadata_extractor.h +++ b/multimedia/player_framework/avmetadata_extractor.h @@ -79,7 +79,7 @@ OH_AVMetadataExtractor* OH_AVMetadataExtractor_Create(void); * @param size Indicates the size of media source. * @return Function result code. * {@link AV_ERR_OK} if the execution is successful. - * {@link AV_ERR_INPUT_DATA_ERROR} if input extractor is nullptr or input param is invalid. + * {@link AV_ERR_INVALID_VAL} if input extractor is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. * @since 16 @@ -96,7 +96,7 @@ OH_AVErrCode OH_AVMetadataExtractor_SetFDSource(OH_AVMetadataExtractor* extracto * @param avMetadata Pointer to an {@link OH_AVFormat} instance, its content contains the fetched metadata info. * @return Function result code. * {@link AV_ERR_OK} if the execution is successful. - * {@link AV_ERR_INPUT_DATA_ERROR} if input extractor is nullptr or input param is invalid. + * {@link AV_ERR_INVALID_VAL} if input extractor is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. * {@link AV_ERR_UNSUPPORTED_FORMAT} if format is unsupported. * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. @@ -113,7 +113,7 @@ OH_AVErrCode OH_AVMetadataExtractor_FetchMetadata(OH_AVMetadataExtractor* extrac * @param pixelMap The fetched album cover from the audio source. For details, see {@link OH_PixelmapNative}. * @return Function result code. * {@link AV_ERR_OK} if the execution is successful. - * {@link AV_ERR_INPUT_DATA_ERROR} if input extractor is nullptr or input param is invalid. + * {@link AV_ERR_INVALID_VAL} if input extractor is nullptr or input param is invalid. * {@link AV_ERR_OPERATE_NOT_PERMIT} if operation not allowed. * {@link AV_ERR_UNSUPPORTED_FORMAT} if format is unsupported. * {@link AV_ERR_NO_MEMORY} if internal memory allocation failed. @@ -128,7 +128,7 @@ OH_AVErrCode OH_AVMetadataExtractor_FetchAlbumCover(OH_AVMetadataExtractor* extr * @param extractor Pointer to an OH_AVMetadataExtractor instance. * @return Function result code. * {@link AV_ERR_OK} if the execution is successful. - * {@link AV_ERR_INPUT_DATA_ERROR} if input extractor is nullptr or input param is invalid. + * {@link AV_ERR_INVALID_VAL} if input extractor is nullptr or input param is invalid. * @since 16 */ OH_AVErrCode OH_AVMetadataExtractor_Release(OH_AVMetadataExtractor* extractor); -- Gitee From 5c8cf977117562131e2c1653c98eae53b113c8e4 Mon Sep 17 00:00:00 2001 From: dev-zut Date: Tue, 25 Feb 2025 21:27:38 +0800 Subject: [PATCH 18/19] =?UTF-8?q?=E6=96=B0=E5=A2=9EOH=5FDecodingOptions=5F?= =?UTF-8?q?GetCropAndScaleStrategy=EF=BC=8COH=5FDecodingOptions=5FSetCropA?= =?UTF-8?q?ndScaleStrategy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: sjanbs --- .../include/image/image_source_native.h | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/multimedia/image_framework/include/image/image_source_native.h b/multimedia/image_framework/include/image/image_source_native.h index 73deea802..a016a371f 100644 --- a/multimedia/image_framework/include/image/image_source_native.h +++ b/multimedia/image_framework/include/image/image_source_native.h @@ -118,6 +118,23 @@ typedef enum { IMAGE_ALLOCATOR_TYPE_SHARE_MEMORY = 2, } IMAGE_ALLOCATOR_TYPE; +/** + * @brief Type of allocator used to allocate memory of a PixelMap.. + * + * @since 15 + */ +typedef enum { + /* + * The system determines which memory to use to create the PixelMap. + */ + SCALE_FIRST = 1, + /* + * Use DMA buffer to create the PixelMap. + */ + CROP_FIRST = 2 +} CROP_SCALE_STRATEGY; + + /** * @brief Create a pointer for OH_ImageSource_Info struct. * @@ -207,6 +224,30 @@ Image_ErrorCode OH_DecodingOptions_GetPixelFormat(OH_DecodingOptions *options, Image_ErrorCode OH_DecodingOptions_SetPixelFormat(OH_DecodingOptions *options, int32_t pixelFormat); + +/** + * @brief Get pixelFormat number for OH_DecodingOptions struct. + * + * @param options The OH_DecodingOptions pointer will be operated. + * @param pixelFormat the number of image pixelFormat. + * @return Returns {@link Image_ErrorCode} + * @since 12 + */ +Image_ErrorCode OH_DecodingOptions_GetCropAndScaleStrategy(OH_DecodingOptions *options, + int32_t *cropAndScaleStrategy); + +/** + * @brief Set pixelFormat number for OH_DecodingOptions struct. + * + * @param options The OH_DecodingOptions pointer will be operated. + * @param pixelFormat the number of image pixelFormat. + * @return Returns {@link Image_ErrorCode} + * @since 12 + */ +Image_ErrorCode OH_DecodingOptions_SetCropAndScaleStrategy(OH_DecodingOptions *options, + int32_t cropAndScaleStrategy); + + /** * @brief Get index number for OH_DecodingOptions struct. * -- Gitee From 04668a9c51d72e65574927a72031abf4a819b7a6 Mon Sep 17 00:00:00 2001 From: dev-zut Date: Tue, 25 Feb 2025 21:27:38 +0800 Subject: [PATCH 19/19] =?UTF-8?q?=E6=96=B0=E5=A2=9EOH=5FDecodingOptions=5F?= =?UTF-8?q?GetCropAndScaleStrategy=EF=BC=8COH=5FDecodingOptions=5FSetCropA?= =?UTF-8?q?ndScaleStrategy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: sjanbs --- .../include/image/image_source_native.h | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/multimedia/image_framework/include/image/image_source_native.h b/multimedia/image_framework/include/image/image_source_native.h index a016a371f..9922b0e8c 100644 --- a/multimedia/image_framework/include/image/image_source_native.h +++ b/multimedia/image_framework/include/image/image_source_native.h @@ -119,17 +119,17 @@ typedef enum { } IMAGE_ALLOCATOR_TYPE; /** - * @brief Type of allocator used to allocate memory of a PixelMap.. + * @brief Confirm the enumeration type for decoding and scaling order of the region. * - * @since 15 + * @since 16 */ typedef enum { /* - * The system determines which memory to use to create the PixelMap. + * First scale, then crop. */ SCALE_FIRST = 1, /* - * Use DMA buffer to create the PixelMap. + * Perform region decoding first, then scaling. */ CROP_FIRST = 2 } CROP_SCALE_STRATEGY; @@ -226,28 +226,27 @@ Image_ErrorCode OH_DecodingOptions_SetPixelFormat(OH_DecodingOptions *options, /** - * @brief Get pixelFormat number for OH_DecodingOptions struct. + * @brief Get strategy number for OH_DecodingOptions struct. * - * @param options The OH_DecodingOptions pointer will be operated. - * @param pixelFormat the number of image pixelFormat. + * @param options The OH_DecodingOptions pointer will be operated. + * @param cropAndScaleStrategy the number of Scaling and cropping strategy. * @return Returns {@link Image_ErrorCode} - * @since 12 + * @since 16 */ Image_ErrorCode OH_DecodingOptions_GetCropAndScaleStrategy(OH_DecodingOptions *options, int32_t *cropAndScaleStrategy); /** - * @brief Set pixelFormat number for OH_DecodingOptions struct. + * @brief Set strategy number for OH_DecodingOptions struct. * - * @param options The OH_DecodingOptions pointer will be operated. - * @param pixelFormat the number of image pixelFormat. + * @param options The OH_DecodingOptions pointer will be operated. + * @param cropAndScaleStrategy the number of Scaling and cropping strategy. * @return Returns {@link Image_ErrorCode} - * @since 12 + * @since 16 */ Image_ErrorCode OH_DecodingOptions_SetCropAndScaleStrategy(OH_DecodingOptions *options, int32_t cropAndScaleStrategy); - /** * @brief Get index number for OH_DecodingOptions struct. * -- Gitee