From 54c425a0e2951c0efa1c920bc2a1911a90baf1c6 Mon Sep 17 00:00:00 2001 From: zpf Date: Tue, 2 Sep 2025 13:24:46 +0800 Subject: [PATCH 1/4] =?UTF-8?q?lpp=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zpf --- .../lowpower_avsink/liblowpower_avsink.ndk.json | 8 ++++++++ multimedia/player_framework/lowpower_avsink_base.h | 9 ++++++++- multimedia/player_framework/lowpower_video_sink.h | 14 ++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json b/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json index 7e53713e491..c59da8e1a9a 100644 --- a/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json +++ b/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json @@ -9,6 +9,10 @@ }, { "first_introduced": "20", + "name": "OH_LowPowerAVSink_GetCapability" + }, + { + "first_introduced": "21", "name": "OH_LowPowerAudioSink_CreateByMime" }, { @@ -185,6 +189,10 @@ }, { "first_introduced": "20", + "name": "OH_LowPowerVideoSink_GetLatestPts" + }, + { + "first_introduced": "21", "name": "OH_LowPowerVideoSink_RegisterCallback" }, { diff --git a/multimedia/player_framework/lowpower_avsink_base.h b/multimedia/player_framework/lowpower_avsink_base.h index fbb65514be1..d94bc8f8ed5 100644 --- a/multimedia/player_framework/lowpower_avsink_base.h +++ b/multimedia/player_framework/lowpower_avsink_base.h @@ -53,6 +53,13 @@ extern "C" { */ typedef struct OH_AVSamplesBuffer OH_AVSamplesBuffer; +/** + * @brief Forward declaration of OH_LowPowerAVSink_Capability. + * + * @since 21 + */ +typedef struct OH_LowPowerAVSink_Capability OH_LowPowerAVSink_Capability; + /** * @brief Append one OH_AVBuffer data to framePacketBuffer instance. * @@ -82,4 +89,4 @@ int32_t OH_AVSamplesBuffer_GetRemainedCapacity(OH_AVSamplesBuffer *samplesBuffer #endif #endif // NATIVE_LOWPOWER_AVSINK_BASE_H -/** @} */ \ No newline at end of file +/** @} */ diff --git a/multimedia/player_framework/lowpower_video_sink.h b/multimedia/player_framework/lowpower_video_sink.h index 52c77f14c4a..3f91faa1459 100644 --- a/multimedia/player_framework/lowpower_video_sink.h +++ b/multimedia/player_framework/lowpower_video_sink.h @@ -341,6 +341,20 @@ OH_AVErrCode OH_LowPowerVideoSink_ReturnSamples(OH_LowPowerVideoSink* sink, OH_A */ OH_AVErrCode OH_LowPowerVideoSink_RegisterCallback(OH_LowPowerVideoSink* sink, OH_LowPowerVideoSinkCallback* callback); +/** + * @brief Get the latest presentation timestamp (PTS) from lowpower video sink. + * + * @param {OH_LowPowerVideoSink*} sink Pointer to an OH_LowPowerVideoSink instance. + * @param {int64_t*} pts Pointer to store the latest PTS value (in microseconds). + * @return Returns AV_ERR_OK if the timestamp is obtained successfully; + * otherwise, returns a specific error code as defined in {@link OH_AVErrCode}: + * {@link AV_ERR_INVALID_VAL} the sink is nullptr, or sink is invalid. + * {@link AV_ERR_SERVICE_DIED} media service is died. + * {@link AV_ERR_OPERATE_NOT_PERMIT} operation not permitted. + * @since 21 + */ +OH_AVErrCode OH_LowPowerVideoSink_GetLatestPts(OH_LowPowerVideoSink *sink, int64_t *pts); + /** * @brief Creates a lowpower video sink callback instance. * -- Gitee From f422487f0907c120932a3d28228fbb330fb74313 Mon Sep 17 00:00:00 2001 From: zpf Date: Tue, 2 Sep 2025 08:57:05 +0000 Subject: [PATCH 2/4] update multimedia/player_framework/lowpower_avsink_base.h. Signed-off-by: zpf --- multimedia/player_framework/lowpower_avsink_base.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/multimedia/player_framework/lowpower_avsink_base.h b/multimedia/player_framework/lowpower_avsink_base.h index d94bc8f8ed5..360bb88ff71 100644 --- a/multimedia/player_framework/lowpower_avsink_base.h +++ b/multimedia/player_framework/lowpower_avsink_base.h @@ -84,6 +84,19 @@ OH_AVErrCode OH_AVSamplesBuffer_AppendOneBuffer(OH_AVSamplesBuffer *samplesBuffe */ int32_t OH_AVSamplesBuffer_GetRemainedCapacity(OH_AVSamplesBuffer *samplesBuffer); +/** + * @brief Query the supported capabilities of a lowpower audio/video sink. + * + * This function queries and returns the capability set supported by the current + * lowpower audio/video sink, including but not limited to supported media formats, etc. + * + * @return {OH_LowPowerAVSink_Capability*} + * - A pointer to the capability structure if the sink supports capability queries and the query is successful. + * - nullptr if the sink does not support capability queries or the query fails. + * + * @since 21 + */ +OH_LowPowerAVSink_Capability *OH_LowPowerAVSink_GetCapability(); #ifdef __cplusplus } #endif -- Gitee From f9417d6a090dca3f8749c1f090a6820f0cba8c8b Mon Sep 17 00:00:00 2001 From: zpf Date: Tue, 2 Sep 2025 08:58:25 +0000 Subject: [PATCH 3/4] update multimedia/player_framework/lowpower_avsink_base.h. Signed-off-by: zpf --- multimedia/player_framework/lowpower_avsink_base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/player_framework/lowpower_avsink_base.h b/multimedia/player_framework/lowpower_avsink_base.h index 360bb88ff71..133b3b8af16 100644 --- a/multimedia/player_framework/lowpower_avsink_base.h +++ b/multimedia/player_framework/lowpower_avsink_base.h @@ -56,7 +56,7 @@ typedef struct OH_AVSamplesBuffer OH_AVSamplesBuffer; /** * @brief Forward declaration of OH_LowPowerAVSink_Capability. * - * @since 21 + * @since 20 */ typedef struct OH_LowPowerAVSink_Capability OH_LowPowerAVSink_Capability; -- Gitee From bc7833c2dc32b21b5889c88fda1006a46325a0c5 Mon Sep 17 00:00:00 2001 From: zpf Date: Tue, 2 Sep 2025 13:13:10 +0000 Subject: [PATCH 4/4] update multimedia/player_framework/lowpower_avsink_base.h. Signed-off-by: zpf --- multimedia/player_framework/lowpower_avsink_base.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/player_framework/lowpower_avsink_base.h b/multimedia/player_framework/lowpower_avsink_base.h index 133b3b8af16..4613a6a1f5e 100644 --- a/multimedia/player_framework/lowpower_avsink_base.h +++ b/multimedia/player_framework/lowpower_avsink_base.h @@ -87,13 +87,13 @@ int32_t OH_AVSamplesBuffer_GetRemainedCapacity(OH_AVSamplesBuffer *samplesBuffer /** * @brief Query the supported capabilities of a lowpower audio/video sink. * - * This function queries and returns the capability set supported by the current + * This function queries and returns the capability set supported by the current * lowpower audio/video sink, including but not limited to supported media formats, etc. * * @return {OH_LowPowerAVSink_Capability*} * - A pointer to the capability structure if the sink supports capability queries and the query is successful. * - nullptr if the sink does not support capability queries or the query fails. - * + * * @since 21 */ OH_LowPowerAVSink_Capability *OH_LowPowerAVSink_GetCapability(); -- Gitee