diff --git a/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json b/multimedia/player_framework/lowpower_avsink/liblowpower_avsink.ndk.json index 7e53713e491574d739dd5d83c218d7ebb6cf50de..c59da8e1a9a353156ccc383991a63284dff3b206 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 fbb65514be1bc0084a98b97e3e490048d9582549..4613a6a1f5efa66cc20fe7b86f2a6c0ccbc19d59 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 20 + */ +typedef struct OH_LowPowerAVSink_Capability OH_LowPowerAVSink_Capability; + /** * @brief Append one OH_AVBuffer data to framePacketBuffer instance. * @@ -77,9 +84,22 @@ 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 #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 52c77f14c4a3e9056c69c96720b405f143ecd6fc..3f91faa145973b9e0684db6173170d93121f5a2f 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. *