目录

native_audio_debugging_manager.h

Overview

The file declares the APIs related to an audio debugging manager. The APIs in this file are used to obtain the audio debugging manager instance and provide audio runtime debugging capabilities, including snapshot information retrieval.

File to include: <ohaudio/native_audio_debugging_manager.h>

Library: libohaudio.so

System capability: SystemCapability.Multimedia.Audio.Core

Since: 26.0.0

Related module: OHAudio

Summary

[h2]Structs

Name typedef Keyword Description
OH_AudioDebuggingManager OH_AudioDebuggingManager Declares an audio debugging manager, which is used for audio runtime debugging, including features such as retrieving snapshot information.

[h2]Functions

Function Description

[h2]OH_AudioManager_GetAudioDebuggingManager()

OH_AudioCommon_Result OH_AudioManager_GetAudioDebuggingManager(OH_AudioDebuggingManager **manager)

Description

Obtains an audio debugging manager instance (singleton).

Since: 26.0.0

Parameters

Name Description
OH_AudioDebuggingManager **manager Output parameter, which is used to receive the OH_AudioDebuggingManager instance.

Returns

Type Description
OH_AudioCommon_Result
  • AUDIOCOMMON_RESULT_SUCCESS: The function is executed successfully.
  • AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM: The manager parameter is nullptr.

[h2]OH_AudioDebuggingManager_PrintAppInfo()

OH_AudioCommon_Result OH_AudioDebuggingManager_PrintAppInfo(OH_AudioDebuggingManager *manager, int32_t fd)

Description

Prints the snapshot information of all audio modules in the current process.

The content and format of the snapshot information may change across versions. It is intended for manual debugging reference only, and you are advised not to build functional logic based on the snapshot information.

Since: 26.0.0

Parameters

Name Description
OH_AudioDebuggingManager *manager Audio debugging manager instance obtained through OH_AudioManager_GetAudioDebuggingManager.
int32_t fd File descriptor. If fd is less than 0 or is not writable, the snapshot information is output to the runtime log. Otherwise, it is output to the file pointed to by fd.

Returns

Type Description
OH_AudioCommon_Result
  • AUDIOCOMMON_RESULT_SUCCESS: The function is executed successfully.
  • AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM: The manager parameter is nullptr.

[h2]OH_AudioDebuggingManager_PrintRendererInfo()

OH_AudioCommon_Result OH_AudioDebuggingManager_PrintRendererInfo(OH_AudioDebuggingManager *manager, OH_AudioRenderer *renderer, int32_t fd)

Description

Prints the snapshot information of a specified audio player instance.

The content and format of the snapshot information may change across versions. It is intended for manual debugging reference only, and you are advised not to build functional logic based on the snapshot information.

Since: 26.0.0

Parameters

Name Description
OH_AudioDebuggingManager *manager Audio debugging manager instance obtained through OH_AudioManager_GetAudioDebuggingManager.
OH_AudioRenderer *renderer Pointer to the target audio player instance, which is used to print snapshot information.
int32_t fd File descriptor. If fd is less than 0 or is not writable, the snapshot information is output to the runtime log. Otherwise, it is output to the file pointed to by fd.

Returns

Type Description
OH_AudioCommon_Result
  • AUDIOCOMMON_RESULT_SUCCESS: The function is executed successfully.
  • AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM: The manager or renderer parameter is nullptr.

[h2]OH_AudioDebuggingManager_PrintCapturerInfo()

OH_AudioCommon_Result OH_AudioDebuggingManager_PrintCapturerInfo(OH_AudioDebuggingManager *manager, OH_AudioCapturer *capturer, int32_t fd)

Description

Prints the snapshot information of a specified audio recorder instance.

The content and format of the snapshot information may change across versions. It is intended for manual debugging reference only, and you are advised not to build functional logic based on the snapshot information.

Since: 26.0.0

Parameters

Name Description
OH_AudioDebuggingManager *manager Audio debugging manager instance obtained through OH_AudioManager_GetAudioDebuggingManager.
OH_AudioCapturer *capturer Pointer to the target audio recorder instance, which is used to print snapshot information.
int32_t fd File descriptor. If fd is less than 0 or is not writable, the snapshot information is output to the runtime log. Otherwise, it is output to the file pointed to by fd.

Returns

Type Description
OH_AudioCommon_Result
  • AUDIOCOMMON_RESULT_SUCCESS: The function is executed successfully.
  • AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM: The manager or capturer parameter is nullptr.

[h2]OH_AudioDebuggingManager_PrintSessionInfo()

OH_AudioCommon_Result OH_AudioDebuggingManager_PrintSessionInfo(OH_AudioDebuggingManager *manager, OH_AudioSessionManager *session, int32_t fd)

Description

Prints the snapshot information of a specified session manager instance.

The content and format of the snapshot information may change across versions. It is intended for manual debugging reference only, and you are advised not to build functional logic based on the snapshot information.

Since: 26.0.0

Parameters

Name Description
OH_AudioDebuggingManager *manager Audio debugging manager instance obtained through OH_AudioManager_GetAudioDebuggingManager.
OH_AudioSessionManager *session Pointer to the target session manager instance, which is used to print snapshot information.
int32_t fd File descriptor. If fd is less than 0 or is not writable, the snapshot information is output to the runtime log. Otherwise, it is output to the file pointed to by fd.

Returns

Type Description
OH_AudioCommon_Result
  • AUDIOCOMMON_RESULT_SUCCESS: The function is executed successfully.
  • AUDIOCOMMON_RESULT_ERROR_INVALID_PARAM: The manager or session parameter is nullptr.