From c83870f3555d56baf3f5eca80c6fb03026067f51 Mon Sep 17 00:00:00 2001 From: liyang Date: Sat, 9 Mar 2024 09:42:44 +0800 Subject: [PATCH 1/2] Add Screen Capture In Call Observer Functions Signed-off-by: liyang --- .../libnative_avscreen_capture.ndk.json | 3 +- .../native_avscreen_capture.h | 34 +++++++++++++------ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json b/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json index cf7bda8c551..fdb62f34b00 100644 --- a/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json +++ b/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json @@ -9,5 +9,6 @@ { "name": "OH_AVScreenCapture_ReleaseVideoBuffer" }, { "name": "OH_AVScreenCapture_SetCallback" }, { "name": "OH_AVScreenCapture_Release" }, - { "name": "OH_AVScreenCapture_SetMicrophoneEnabled" } + { "name": "OH_AVScreenCapture_SetMicrophoneEnabled" }, + { "name": "OH_AVScreenCapture_SetScreenCanvasRotation" } ] \ No newline at end of file diff --git a/multimedia/player_framework/native_avscreen_capture.h b/multimedia/player_framework/native_avscreen_capture.h index 22837a29dac..6a2b1ad198b 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -41,7 +41,7 @@ struct OH_AVScreenCapture *OH_AVScreenCapture_Create(void); * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance * @param config Information describing the audio and video config - * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -54,7 +54,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_Init(struct OH_AVScreenCapture *c * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance * @param type Information describing the data type of the capture - * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -65,7 +65,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StartScreenCapture(struct OH_AVSc * @brief Stop the av screen capture * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance - * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -76,7 +76,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StopScreenCapture(struct OH_AVScr * @brief Start av screen record use to start save screen record file. * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance - * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -87,7 +87,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StartScreenRecording(struct OH_AV * @brief Start av screen record use to stop save screen record file. * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance - * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -100,7 +100,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StopScreenRecording(struct OH_AVS * @param capture Pointer to an OH_AVScreenCapture instance * @param audiobuffer Information describing the audio buffer of the capture * @param type Information describing the audio source type - * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -127,7 +127,7 @@ OH_NativeBuffer* OH_AVScreenCapture_AcquireVideoBuffer(struct OH_AVScreenCapture * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance * @param type Information describing the audio source type - * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -139,7 +139,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ReleaseAudioBuffer(struct OH_AVSc * @brief Release the video buffer for the av screen capture * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance - * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -152,7 +152,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ReleaseVideoBuffer(struct OH_AVSc * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance * @param callback A collection of all callback functions, see {@link OH_AVScreenCaptureCallback} - * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -164,7 +164,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetCallback(struct OH_AVScreenCap * @brief Release the av screen capture * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance - * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -176,7 +176,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_Release(struct OH_AVScreenCapture * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance * @param isMicrophone The switch of the microphone - * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -184,6 +184,18 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_Release(struct OH_AVScreenCapture OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetMicrophoneEnabled(struct OH_AVScreenCapture *capture, bool isMicrophone); +/** + * @brief Controls the Rotation of the Screen, which is no rotate by default + * @syscap SystemCapability.Multimedia.Media.AVScreenCapture + * @param capture Pointer to an OH_AVScreenCapture instance + * @param canvasRotation Rotate The screen or not + * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, + * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} + * @since 12 + * @version 1.0 + */ +OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetScreenCanvasRotation(struct OH_AVScreenCapture *capture, + bool canvasRotation); #ifdef __cplusplus } #endif -- Gitee From a68d83c7721763b8c93c8cdab3e8865faf127e11 Mon Sep 17 00:00:00 2001 From: liyang Date: Sat, 9 Mar 2024 11:30:32 +0800 Subject: [PATCH 2/2] Add Screen Capture In Call Observer Functions Signed-off-by: liyang --- .../native_avscreen_capture.h | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/multimedia/player_framework/native_avscreen_capture.h b/multimedia/player_framework/native_avscreen_capture.h index 6a2b1ad198b..bc4cc029801 100644 --- a/multimedia/player_framework/native_avscreen_capture.h +++ b/multimedia/player_framework/native_avscreen_capture.h @@ -41,7 +41,7 @@ struct OH_AVScreenCapture *OH_AVScreenCapture_Create(void); * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance * @param config Information describing the audio and video config - * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -54,7 +54,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_Init(struct OH_AVScreenCapture *c * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance * @param type Information describing the data type of the capture - * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -65,7 +65,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StartScreenCapture(struct OH_AVSc * @brief Stop the av screen capture * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance - * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -76,7 +76,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StopScreenCapture(struct OH_AVScr * @brief Start av screen record use to start save screen record file. * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance - * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -87,7 +87,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StartScreenRecording(struct OH_AV * @brief Start av screen record use to stop save screen record file. * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance - * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -100,7 +100,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StopScreenRecording(struct OH_AVS * @param capture Pointer to an OH_AVScreenCapture instance * @param audiobuffer Information describing the audio buffer of the capture * @param type Information describing the audio source type - * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -127,7 +127,7 @@ OH_NativeBuffer* OH_AVScreenCapture_AcquireVideoBuffer(struct OH_AVScreenCapture * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance * @param type Information describing the audio source type - * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -139,7 +139,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ReleaseAudioBuffer(struct OH_AVSc * @brief Release the video buffer for the av screen capture * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance - * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -152,7 +152,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ReleaseVideoBuffer(struct OH_AVSc * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance * @param callback A collection of all callback functions, see {@link OH_AVScreenCaptureCallback} - * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -164,7 +164,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetCallback(struct OH_AVScreenCap * @brief Release the av screen capture * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance - * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 @@ -176,7 +176,7 @@ OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_Release(struct OH_AVScreenCapture * @syscap SystemCapability.Multimedia.Media.AVScreenCapture * @param capture Pointer to an OH_AVScreenCapture instance * @param isMicrophone The switch of the microphone - * @return Returns AV_SCREEN_CAPTURE_ERR_OK if the execution is successful, + * @return Returns AVSCREEN_CAPTURE_ERR_OK if the execution is successful, * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} * @since 10 * @version 1.0 -- Gitee