diff --git a/multimedia/audio_framework/BUILD.gn b/multimedia/audio_framework/BUILD.gn index 3445ac0be4c355fcf0121ff84df60005c348be2b..2928db509db5251165c9c65048b5454fa02acd8c 100644 --- a/multimedia/audio_framework/BUILD.gn +++ b/multimedia/audio_framework/BUILD.gn @@ -19,6 +19,7 @@ ohos_ndk_headers("ohaudio_header") { sources = [ "audio_capturer/native_audiocapturer.h", "audio_manager/native_audio_routing_manager.h", + "audio_manager/native_audio_session_manager.h", "audio_renderer/native_audiorenderer.h", "common/native_audio_common.h", "common/native_audio_device_base.h", @@ -40,5 +41,6 @@ ohos_ndk_library("libohaudio_ndk") { "ohaudio/native_audio_routing_manager.h", "ohaudio/native_audio_common.h", "ohaudio/native_audio_device_base.h", + "ohaudio/native_audio_session_manager.h", ] } diff --git a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json index 74292f25c062fd9bf13a5a538eaf70aded15c384..589823ef39cbe49747cc11bc69b4e20a3751516e 100644 --- a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json +++ b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json @@ -59,10 +59,6 @@ "first_introduced": "11", "name": "OH_AVCODEC_MIMETYPE_AUDIO_G711MU" }, - { - "first_introduced": "12", - "name": "OH_AVCODEC_MIMETYPE_AUDIO_LBVC" - }, { "first_introduced": "12", "name": "OH_AVCODEC_MIMETYPE_AUDIO_APE" @@ -387,6 +383,14 @@ "first_introduced": "12", "name": "OH_MD_KEY_START_TIME" }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_TRACK_START_TIME" + }, + { + "first_introduced": "12", + "name": "OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE" + }, { "first_introduced": "10", "name": "OH_AVCodec_GetCapability" diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index bde35e6ec1002c377d5ab42a1e3c45186bdafea2..51d7d5a976db097a280504d1f66e7123233d9701 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -312,14 +312,6 @@ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_OPUS; */ extern const char *OH_AVCODEC_MIMETYPE_AUDIO_G711MU; -/** - * @brief Enumerates the mime type of audio low bitrate voice codec. - * - * @syscap SystemCapability.Multimedia.Media.CodecBase - * @since 12 - */ -extern const char *OH_AVCODEC_MIMETYPE_AUDIO_LBVC; - /** * @brief Enumerates the mime type of audio ape codec. * @@ -940,6 +932,28 @@ extern const char *OH_MD_KEY_VIDEO_SAR; * @since 12 */ extern const char *OH_MD_KEY_START_TIME; +/** + * @brief Key for start time of track, value type is int64_t. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +extern const char *OH_MD_KEY_TRACK_START_TIME; +/** + * @brief Key for setting the output color space of video decoder. The value type is int32_t. + * The supported value is {@link OH_COLORSPACE_BT709_LIMIT}, see {@link OH_NativeBuffer_ColorSpace}. It is used in + * {@link OH_VideoDecoder_Configure}. If the color space conversion capability is supported and this key is configured, + * the video decoder will automatically transcode an HDR Vivid video to an SDR video with color space BT709. + * If color space conversion capability is not supported, {@link OH_VideoDecoder_Configure} returns + * {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION}. + * If the input video is not an HDR vivid video, an error {@link AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION} will + * be reported by callback function {@link OH_AVCodecOnError}. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 12 + */ +extern const char *OH_MD_KEY_VIDEO_DECODER_OUTPUT_COLOR_SPACE; + /** * @brief Key for setting the output color space of video decoder. The value type is int32_t. * The supported value is {@link OH_COLORSPACE_BT709_LIMIT}, see {@link OH_NativeBuffer_ColorSpace}. It is used in diff --git a/multimedia/media_foundation/native_averrors.h b/multimedia/media_foundation/native_averrors.h index 0a2a54d6077c0d7a9fa039d135f71c30dff49d18..edecfa2a89f3f673d09682def19034e2082bacb9 100644 --- a/multimedia/media_foundation/native_averrors.h +++ b/multimedia/media_foundation/native_averrors.h @@ -78,6 +78,11 @@ typedef enum OH_AVErrCode { * @error unsupport interface. */ AV_ERR_UNSUPPORT = 9, + /** + * @error input data error. + * @since 12 + */ + AV_ERR_INPUT_DATA_ERROR = 10, /** * @error extend err start. */ diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 1e6c0dd85afc42c31ebb31b98521aa37e26ba92c..f55c4f32a67a5521a95beef73eec49288f31b3f9 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -1187,7 +1187,7 @@ Input_Result OH_Input_AddInputEventInterceptor(Input_InterceptorEventCallback *c * @syscap SystemCapability.MultimodalInput.Input.Core * @since 12 */ -Input_Result OH_Input_RemoveKeyEventInterceptor(); +Input_Result OH_Input_RemoveKeyEventInterceptor(void); /** * @brief Removes an interceptor for input events, including mouse, touch, and axis events. @@ -1200,7 +1200,7 @@ Input_Result OH_Input_RemoveKeyEventInterceptor(); * @syscap SystemCapability.MultimodalInput.Input.Core * @since 12 */ -Input_Result OH_Input_RemoveInputEventInterceptor(); +Input_Result OH_Input_RemoveInputEventInterceptor(void); #ifdef __cplusplus } #endif diff --git a/resourceschedule/ffrt/c/task.h b/resourceschedule/ffrt/c/task.h index 066493f9e5037cbdcd107bcac908814e290def55..b789fdc74ddf5d5bbea7b4770eb6aa022f49e939 100644 --- a/resourceschedule/ffrt/c/task.h +++ b/resourceschedule/ffrt/c/task.h @@ -141,6 +141,26 @@ FFRT_C_API void ffrt_task_attr_set_queue_priority(ffrt_task_attr_t* attr, ffrt_q */ FFRT_C_API ffrt_queue_priority_t ffrt_task_attr_get_queue_priority(const ffrt_task_attr_t* attr); +/** + * @brief Sets the task stack size. + * + * @param attr Indicates a pointer to the task attribute. + * @param size Indicates the task stack size, unit is byte. + * @since 12 + * @version 1.0 + */ +FFRT_C_API void ffrt_task_attr_set_stack_size(ffrt_task_attr_t* attr, uint64_t size); + +/** + * @brief Obtains the task stack size. + * + * @param attr Indicates a pointer to the task attribute. + * @return Returns the task stack size, unit is byte. + * @since 12 + * @version 1.0 + */ +FFRT_C_API uint64_t ffrt_task_attr_get_stack_size(const ffrt_task_attr_t* attr); + /** * @brief Updates the QoS of this task. * @@ -209,6 +229,26 @@ FFRT_C_API void ffrt_submit_base(ffrt_function_header_t* f, const ffrt_deps_t* i FFRT_C_API ffrt_task_handle_t ffrt_submit_h_base(ffrt_function_header_t* f, const ffrt_deps_t* in_deps, const ffrt_deps_t* out_deps, const ffrt_task_attr_t* attr); +/** + * @brief increase reference count of task handle. + * + * @param handle Indicates a task handle. + * @return return the task handle original reference count. + * @since 12 + * @version 1.0 + */ +FFRT_C_API uint32_t ffrt_task_handle_inc_ref(ffrt_task_handle_t handle); + +/** + * @brief decrease reference count of task handle. + * + * @param handle Indicates a task handle. + * @return return the task handle original reference count. + * @since 12 + * @version 1.0 + */ +FFRT_C_API uint32_t ffrt_task_handle_dec_ref(ffrt_task_handle_t handle); + /** * @brief Destroys a task handle. * diff --git a/resourceschedule/ffrt/ffrt.ndk.json b/resourceschedule/ffrt/ffrt.ndk.json index 397494c376f4eb8a719db45e52077c41112d5b48..ed52dcc3b03aee71a62e96ba20a22688eb244ed2 100644 --- a/resourceschedule/ffrt/ffrt.ndk.json +++ b/resourceschedule/ffrt/ffrt.ndk.json @@ -50,11 +50,27 @@ { "name": "ffrt_task_attr_get_qos" }, { "name": "ffrt_task_attr_set_delay" }, { "name": "ffrt_task_attr_get_delay" }, + { + "first_introduced": "12", + "name": "ffrt_task_attr_set_stack_size" + }, + { + "first_introduced": "12", + "name": "ffrt_task_attr_get_stack_size" + }, { "name": "ffrt_this_task_update_qos" }, { "name": "ffrt_this_task_get_id" }, { "name": "ffrt_alloc_auto_managed_function_storage_base" }, { "name": "ffrt_submit_base" }, { "name": "ffrt_submit_h_base" }, + { + "first_introduced": "12", + "name": "ffrt_task_handle_inc_ref" + }, + { + "first_introduced": "12", + "name": "ffrt_task_handle_dec_ref" + }, { "name": "ffrt_task_handle_destroy" }, { "name": "ffrt_wait_deps" }, { "name": "ffrt_wait" }, diff --git a/web/webview/interfaces/native/arkweb_error_code.h b/web/webview/interfaces/native/arkweb_error_code.h index 2162e368c31c62481d7f18c1564b135855f68f50..0ebf021f9585c514b541cd95dbd37ded3d8eade4 100644 --- a/web/webview/interfaces/native/arkweb_error_code.h +++ b/web/webview/interfaces/native/arkweb_error_code.h @@ -33,6 +33,12 @@ #define ARKWEB_ERROR_CODE_H typedef enum ArkWeb_ErrorCode { +/** @error Success. */ +ARKWEB_SUCCESS = 0, + +/** @error Init error. */ +ARKWEB_INIT_ERROR = 17100001, + /** @error Unknown error. */ ARKWEB_ERROR_UNKNOWN = 17100100, diff --git a/web/webview/interfaces/native/arkweb_interface.h b/web/webview/interfaces/native/arkweb_interface.h index d0b1fa45a2e2235f1540b04a1d22a68dc4c92ee1..7b60c5bcb567246ef4f40282b85110c0c8d83540 100644 --- a/web/webview/interfaces/native/arkweb_interface.h +++ b/web/webview/interfaces/native/arkweb_interface.h @@ -59,6 +59,10 @@ typedef enum { ARKWEB_NATIVE_COMPONENT, /** API type related to ArkWeb controller. */ ARKWEB_NATIVE_CONTROLLER, + /** API type related to ArkWeb WebMessagePort. */ + ARKWEB_NATIVE_WEB_MESSAGE_PORT, + /** API type related to ArkWeb WebMessage. */ + ARKWEB_NATIVE_WEB_MESSAGE, } ArkWeb_NativeAPIVariantKind; /* diff --git a/web/webview/interfaces/native/arkweb_type.h b/web/webview/interfaces/native/arkweb_type.h index c63cfc26fceb0393796199b8ca5dd84ee86e7501..2a1d56d6456421b96936d7909a672df18fc87cc9 100644 --- a/web/webview/interfaces/native/arkweb_type.h +++ b/web/webview/interfaces/native/arkweb_type.h @@ -36,6 +36,8 @@ #include #include +#include "arkweb_error_code.h" + #ifdef __cplusplus extern "C" { #endif @@ -52,6 +54,27 @@ typedef struct { size_t size; } ArkWeb_JavaScriptBridgeData; +/** + * @brief Defines the data type carried in a ArkWeb_WebMessage. + * + * @since 12 + */ +typedef enum ArkWeb_WebMessageType { + /** Represent error data */ + ARKWEB_NONE = 0, + /** The data carried in the ArkWeb_WebMessage is string. */ + ARKWEB_STRING, + /** The data carried in the ArkWeb_WebMessage is buffer(uint8_t). */ + ARKWEB_BUFFER +} ArkWeb_WebMessageType; + +/** + * @brief Defines the ArkWeb_WebMessage. + * + * @since 12 + */ +typedef struct ArkWeb_WebMessage* ArkWeb_WebMessagePtr; + /** * @brief Defines the javascript callback of the native ArkWeb. * @@ -75,6 +98,26 @@ typedef void (*ArkWeb_OnJavaScriptProxyCallback)( */ typedef void (*ArkWeb_OnComponentCallback)(const char* webTag, void* userData); +/** + * @brief Defines the ArkWeb_WebMessagePort that represent a HTML5 message port. + * + * @since 12 + */ +typedef struct ArkWeb_WebMessagePort* ArkWeb_WebMessagePortPtr; + +/** + * @brief Defines the callback to receive message from HTML. + * + * @param webTag The name of the web component. + * @param port The ArkWeb_WebMessagePort for registering the ArkWeb_OnMessageEventHandler. + * @param message The received ArkWeb_WebMessage. + * @param userData The data set by user. + * + * @since 12 + */ +typedef void (*ArkWeb_OnMessageEventHandler)( + const char* webTag, const ArkWeb_WebMessagePortPtr port, const ArkWeb_WebMessagePtr message, void* userData); + /** * @brief Defines the javascript object. * @@ -121,6 +164,9 @@ typedef struct { /** * @brief Defines the controller API for native ArkWeb. + * Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check + * whether the function structure has a corresponding function pointer to avoid crash + * caused by mismatch between the SDK and the device ROM. * * @since 12 */ @@ -137,6 +183,37 @@ typedef struct { void (*refresh)(const char* webTag); /** Register the JavaScript object and async method list. */ void (*registerAsyncJavaScriptProxy)(const char* webTag, const ArkWeb_ProxyObject* proxyObject); + /** + * @brief Creates a message channel to communicate with HTML and returns + * the message ports representing the message channel endpoints. + * + * @param webTag The name of the web component. + * @param size The quantity of message ports. + */ + ArkWeb_WebMessagePortPtr* (*createWebMessagePorts)(const char* webTag, size_t* size); + + /** + * @brief Destroy message ports. + * + * @param ports Address of the message ports array pointer. + * @param size The quantity of message ports. + */ + void (*destroyWebMessagePorts)(ArkWeb_WebMessagePortPtr** ports, size_t size); + + /** + * @brief Post message ports to main frame. + * + * @param webTag The name of the web component. + * @param name Name of the message to be sent. + * @param size The quantity of message ports. + * @param url Indicates the URI for receiving the message. + * @return Post web message result code. + * {@link ARKWEB_SUCCESS} post web message success. + * {@link ARKWEB_INVALID_PARAM} the parameter verification fails. + * {@link ARKWEB_INIT_ERROR} no web associated with this webTag. + */ + ArkWeb_ErrorCode (*postWebMessage)( + const char* webTag, const char* name, ArkWeb_WebMessagePortPtr* webMessagePorts, size_t size, const char* url); } ArkWeb_ControllerAPI; /** @@ -157,6 +234,105 @@ typedef struct { void (*onDestroy)(const char* webTag, ArkWeb_OnComponentCallback callback, void* userData); } ArkWeb_ComponentAPI; +/** + * @brief Defines the web message API for native ArkWeb. + * Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check + * whether the function structure has a corresponding function pointer to avoid crash + * caused by mismatch between the SDK and the device ROM. + * + * @since 12 + */ +typedef struct { + /** The ArkWeb_WebMessagePortAPI struct size. */ + size_t size; + /** + * @brief Post message to HTML. + * + * @param webMessagePort The ArkWeb_WebMessagePort. + * @param webTag The name of the web component. + * @param webMessage The ArkWeb_WebMessage to send. + * @return Post message result code. + * {@link ARKWEB_SUCCESS} post message success. + * {@link ARKWEB_INVALID_PARAM} the parameter verification fails. + * {@link ARKWEB_INIT_ERROR} no web associated with this webTag. + */ + ArkWeb_ErrorCode (*postMessage)( + const ArkWeb_WebMessagePortPtr webMessagePort, const char* webTag, const ArkWeb_WebMessagePtr webMessage); + /** + * @brief Close the message port. + * + * @param webMessagePort The ArkWeb_WebMessagePort. + * @param webTag The name of the web component. + */ + void (*close)(const ArkWeb_WebMessagePortPtr webMessagePort, const char* webTag); + /** + * @brief Set a callback to receive message from HTML. + * + * @param webMessagePort The ArkWeb_WebMessagePort. + * @param webTag The name of the web component. + * @param messageEventHandler The handler to receive message from HTML. + * @param userData The data set by user. + */ + void (*setMessageEventHandler)(const ArkWeb_WebMessagePortPtr webMessagePort, const char* webTag, + ArkWeb_OnMessageEventHandler messageEventHandler, void* userData); +} ArkWeb_WebMessagePortAPI; + +/** + * @brief Defines the web message data API for native ArkWeb. + * Before invoking an API, you are advised to use ARKWEB_MEMBER_MISSING to check + * whether the function structure has a corresponding function pointer to avoid crash + * caused by mismatch between the SDK and the device ROM. + * + * @since 12 + */ +typedef struct { + /** The ArkWeb_WebMessageAPI struct size. */ + size_t size; + /** + * @brief Used to create a ArkWeb_WebMessage. + * + * @return The created ArkWeb_WebMessage, destroy it through + * destroyWebMessage after it is no longer used. + */ + ArkWeb_WebMessagePtr (*createWebMessage)(); + /** + * @brief Used to destroy a ArkWeb_WebMessage. + * + * @param webMessage The ArkWeb_WebMessage to destroy. + */ + void (*destroyWebMessage)(ArkWeb_WebMessagePtr* webMessage); + /** + * @brief Set the type of ArkWeb_WebMessage. + * + * @param webMessage The ArkWeb_WebMessage. + * @param type The type of ArkWeb_WebMessage. + */ + void (*setType)(ArkWeb_WebMessagePtr webMessage, ArkWeb_WebMessageType type); + /** + * @brief Get the type of ArkWeb_WebMessage. + * + * @param webMessage The ArkWeb_WebMessage. + * @return The type of ArkWeb_WebMessage. + */ + ArkWeb_WebMessageType (*getType)(ArkWeb_WebMessagePtr webMessage); + /** + * @brief Set the data of ArkWeb_WebMessage. + * + * @param webMessage The ArkWeb_WebMessage. + * @param data The data of ArkWeb_WebMessage. + * @param dataLength The length of data. + */ + void (*setData)(ArkWeb_WebMessagePtr webMessage, void* data, size_t dataLength); + /** + * @brief Get the data of ArkWeb_WebMessage. + * + * @param webMessage The ArkWeb_WebMessage. + * @param dataLength The length of data. + * @return The data of ArkWeb_WebMessage. + */ + void* (*getData)(ArkWeb_WebMessagePtr webMessage, size_t* dataLength); +} ArkWeb_WebMessageAPI; + /** * @brief Check whether the member variables of the current struct exist. * @@ -173,6 +349,6 @@ typedef struct { #define ARKWEB_MEMBER_MISSING(s, f) (!ARKWEB_MEMBER_EXISTS(s, f) || !((s)->f)) #ifdef __cplusplus -}; +} #endif #endif // ARKWEB_TYPE_H \ No newline at end of file