From d5a0c000aa0a25c16cf4615bf11c947bd24e36da Mon Sep 17 00:00:00 2001 From: liyang Date: Mon, 27 May 2024 17:58:44 +0800 Subject: [PATCH] =?UTF-8?q?XTS=20=E8=A6=81=E6=B1=82=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E4=B8=8B=E6=8E=894.1=20release=20=E7=9A=84api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liyang --- .../avscreen_capture/BUILD.gn | 39 -- .../libnative_avscreen_capture.ndk.json | 13 - .../native_avscreen_capture.h | 191 --------- .../native_avscreen_capture_base.h | 394 ------------------ .../native_avscreen_capture_errors.h | 85 ---- 5 files changed, 722 deletions(-) delete mode 100644 multimedia/player_framework/avscreen_capture/BUILD.gn delete mode 100644 multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json delete mode 100644 multimedia/player_framework/native_avscreen_capture.h delete mode 100644 multimedia/player_framework/native_avscreen_capture_base.h delete mode 100644 multimedia/player_framework/native_avscreen_capture_errors.h diff --git a/multimedia/player_framework/avscreen_capture/BUILD.gn b/multimedia/player_framework/avscreen_capture/BUILD.gn deleted file mode 100644 index 35f4bdef9..000000000 --- a/multimedia/player_framework/avscreen_capture/BUILD.gn +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright (C) 2023 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build/ohos.gni") -import("//build/ohos/ndk/ndk.gni") -import("//foundation/multimedia/player_framework/config.gni") - -ohos_ndk_headers("native_avscreen_capture_header") { - dest_dir = "$ndk_headers_out_dir/multimedia/player_framework" - sources = [ - "$MEDIA_PLAYER_ROOT_DIR/interfaces/kits/c/native_avscreen_capture.h", - "$MEDIA_PLAYER_ROOT_DIR/interfaces/kits/c/native_avscreen_capture_base.h", - "$MEDIA_PLAYER_ROOT_DIR/interfaces/kits/c/native_avscreen_capture_errors.h", - ] -} - -ohos_ndk_library("libnative_avscreen_capture") { - ndk_description_file = "./libnative_avscreen_capture.ndk.json" - min_compact_version = "1" - output_name = "native_avscreen_capture" - output_extension = "so" - - system_capability = "SystemCapability.Multimedia.Media.AVScreenCapture" - system_capability_headers = [ - "multimedia/player_framework/native_avscreen_capture.h", - "multimedia/player_framework/native_avscreen_capture_base.h", - "multimedia/player_framework/native_avscreen_capture_errors.h", - ] -} diff --git a/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json b/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json deleted file mode 100644 index cf7bda8c5..000000000 --- a/multimedia/player_framework/avscreen_capture/libnative_avscreen_capture.ndk.json +++ /dev/null @@ -1,13 +0,0 @@ -[ - { "name": "OH_AVScreenCapture_Create" }, - { "name": "OH_AVScreenCapture_Init" }, - { "name": "OH_AVScreenCapture_StartScreenCapture" }, - { "name": "OH_AVScreenCapture_StopScreenCapture" }, - { "name": "OH_AVScreenCapture_AcquireAudioBuffer" }, - { "name": "OH_AVScreenCapture_AcquireVideoBuffer" }, - { "name": "OH_AVScreenCapture_ReleaseAudioBuffer" }, - { "name": "OH_AVScreenCapture_ReleaseVideoBuffer" }, - { "name": "OH_AVScreenCapture_SetCallback" }, - { "name": "OH_AVScreenCapture_Release" }, - { "name": "OH_AVScreenCapture_SetMicrophoneEnabled" } -] \ No newline at end of file diff --git a/multimedia/player_framework/native_avscreen_capture.h b/multimedia/player_framework/native_avscreen_capture.h deleted file mode 100644 index 22837a29d..000000000 --- a/multimedia/player_framework/native_avscreen_capture.h +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (C) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef NATIVE_AVSCREEN_CAPTURE_H -#define NATIVE_AVSCREEN_CAPTURE_H - -#include -#include -#include "native_avscreen_capture_errors.h" -#include "native_avscreen_capture_base.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Create a screen capture - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @return Returns a pointer to an OH_AVScreenCapture instance - * @since 10 - * @version 1.0 - */ -struct OH_AVScreenCapture *OH_AVScreenCapture_Create(void); - -/** - * @brief To init the screen capture, typically, you need to configure the description information of the audio - * and video, which can be extracted from the container. This interface must be called before StartAVScreenCapture - * called. - * @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, - * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} - * @since 10 - * @version 1.0 - */ -OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_Init(struct OH_AVScreenCapture *capture, - OH_AVScreenCaptureConfig config); - -/** - * @brief Start the av screen capture - * @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, - * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} - * @since 10 - * @version 1.0 - */ -OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StartScreenCapture(struct OH_AVScreenCapture *capture); - -/** - * @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, - * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} - * @since 10 - * @version 1.0 - */ -OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StopScreenCapture(struct OH_AVScreenCapture *capture); - -/** - * @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, - * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} - * @since 10 - * @version 1.0 - */ -OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StartScreenRecording(struct OH_AVScreenCapture *capture); - -/** - * @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, - * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} - * @since 10 - * @version 1.0 - */ -OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_StopScreenRecording(struct OH_AVScreenCapture *capture); - -/** - * @brief Acquire the audio buffer for the av screen capture - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @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, - * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} - * @since 10 - * @version 1.0 - */ -OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_AcquireAudioBuffer(struct OH_AVScreenCapture *capture, - OH_AudioBuffer **audiobuffer, OH_AudioCaptureSourceType type); - -/** - * @brief Acquire the video buffer for the av screen capture - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @param capture Pointer to an OH_AVScreenCapture instance - * @param fence A processing state of display buffer - * @param timestamp Information about the video buffer - * @param region Information about the video buffer - * @return Returns a pointer to an OH_NativeBuffer instance - * @since 10 - * @version 1.0 - */ -OH_NativeBuffer* OH_AVScreenCapture_AcquireVideoBuffer(struct OH_AVScreenCapture *capture, - int32_t *fence, int64_t *timestamp, struct OH_Rect *region); - -/** - * @brief Release the audio buffer for the av screen capture - * @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, - * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} - * @since 10 - * @version 1.0 - */ -OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ReleaseAudioBuffer(struct OH_AVScreenCapture *capture, - OH_AudioCaptureSourceType type); - -/** - * @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, - * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} - * @since 10 - * @version 1.0 - */ -OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ReleaseVideoBuffer(struct OH_AVScreenCapture *capture); - -/** - * @brief Set the callback function so that your application - * can respond to the events generated by the av screen capture. This interface must be called before Init is called. - * @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, - * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} - * @since 10 - * @version 1.0 - */ -OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetCallback(struct OH_AVScreenCapture *capture, - struct OH_AVScreenCaptureCallback callback); - -/** - * @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, - * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} - * @since 10 - * @version 1.0 - */ -OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_Release(struct OH_AVScreenCapture *capture); - -/** - * @brief Controls the switch of the microphone, which is turned on by default - * @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, - * otherwise returns a specific error code, refer to {@link OH_AVSCREEN_CAPTURE_ErrCode} - * @since 10 - * @version 1.0 - */ -OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_SetMicrophoneEnabled(struct OH_AVScreenCapture *capture, - bool isMicrophone); - -#ifdef __cplusplus -} -#endif - -#endif // NATIVE_AVSCREEN_CAPTURE_H \ No newline at end of file diff --git a/multimedia/player_framework/native_avscreen_capture_base.h b/multimedia/player_framework/native_avscreen_capture_base.h deleted file mode 100644 index 97b27e3f1..000000000 --- a/multimedia/player_framework/native_avscreen_capture_base.h +++ /dev/null @@ -1,394 +0,0 @@ -/* - * Copyright (C) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef NATIVE_AVSCREEN_CAPTURE_BASE_H -#define NATIVE_AVSCREEN_CAPTURE_BASE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Nativebuffer of avscreeencapture that from graphics. - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef struct OH_NativeBuffer OH_NativeBuffer; - -/** - * @brief Initialization of avscreeencapture - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef struct OH_AVScreenCapture OH_AVScreenCapture; - -/** - * @brief Enumerates screen capture mode. - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef enum OH_CaptureMode { - /* capture home screen */ - OH_CAPTURE_HOME_SCREEN = 0, - /* capture a specified screen */ - OH_CAPTURE_SPECIFIED_SCREEN = 1, - /* capture a specified window */ - OH_CAPTURE_SPECIFIED_WINDOW = 2, - OH_CAPTURE_INVAILD = -1 -} OH_CaptureMode; - -/** - * @brief Enumerates audio cap source type. - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef enum OH_AudioCaptureSourceType { - /* Invalid audio source */ - OH_SOURCE_INVALID = -1, - /* Default audio source */ - OH_SOURCE_DEFAULT = 0, - /* Microphone */ - OH_MIC = 1, - /* inner all PlayBack */ - OH_ALL_PLAYBACK = 2, - /* inner app PlayBack */ - OH_APP_PLAYBACK = 3, -} OH_AudioCaptureSourceType; - -/** - * @brief Enumerates audio codec formats. - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef enum OH_AudioCodecFormat { - /* Default format */ - OH_AUDIO_DEFAULT = 0, - /* Advanced Audio Coding Low Complexity (AAC-LC) */ - OH_AAC_LC = 3, - /* Invalid value */ - OH_AUDIO_CODEC_FORMAT_BUTT, -} OH_AudioCodecFormat; - -/** - * @brief Enumerates video codec formats. - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef enum OH_VideoCodecFormat { - /* Default format */ - OH_VIDEO_DEFAULT = 0, - /* H.264 */ - OH_H264 = 2, - /* H.265/HEVC */ - OH_H265 = 4, - /* MPEG4 */ - OH_MPEG4 = 6, - /* VP8 */ - OH_VP8 = 8, - /* VP9 */ - OH_VP9 = 10, - /* Invalid format */ - OH_VIDEO_CODEC_FORMAT_BUTT, -} OH_VideoCodecFormat; - -/** - * @brief Enumerates screen capture data type. - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef enum OH_DataType { - /* YUV/RGBA/PCM, etc. original stream */ - OH_ORIGINAL_STREAM = 0, - /* h264/AAC, etc. encoded stream */ - OH_ENCODED_STREAM = 1, - /* mp4 file */ - OH_CAPTURE_FILE = 2, - OH_INVAILD = -1 -} OH_DataType; - -/** - * @brief Enumerates video source types. - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef enum OH_VideoSourceType { - /* Unsupported App Usage. */ - /* YUV video data provided through graphic */ - OH_VIDEO_SOURCE_SURFACE_YUV = 0, - /* Raw encoded data provided through graphic */ - OH_VIDEO_SOURCE_SURFACE_ES, - /* RGBA video data provided through graphic */ - OH_VIDEO_SOURCE_SURFACE_RGBA, - /* Invalid value */ - OH_VIDEO_SOURCE_BUTT -} OH_VideoSourceType; - -/** - * @brief Enumerates the container format types. - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef enum OH_ContainerFormatType { - /* Audio format type -- m4a */ - CFT_MPEG_4A = 0, - /* Video format type -- mp4 */ - CFT_MPEG_4 = 1 -} OH_ContainerFormatType; - -/** - * @brief Audio capture info struct - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef struct OH_AudioCaptureInfo { - /* Audio capture sample rate info */ - int32_t audioSampleRate; - /* Audio capture channel info */ - int32_t audioChannels; - /* Audio capture source type */ - OH_AudioCaptureSourceType audioSource; -} OH_AudioCaptureInfo; - -/** - * @brief Audio encoder info - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef struct OH_AudioEncInfo { - /* Audio encoder bitrate */ - int32_t audioBitrate; - /* Audio codec format */ - OH_AudioCodecFormat audioCodecformat; -} OH_AudioEncInfo; - -/** - * @brief The audio info of avscreeencapture - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef struct OH_AudioInfo { - /* Audio capture info of microphone */ - OH_AudioCaptureInfo micCapInfo; - /* Audio capture info of inner */ - OH_AudioCaptureInfo innerCapInfo; - /* Audio encoder info, no need to set, while dataType = OH_ORIGINAL_STREAM */ - OH_AudioEncInfo audioEncInfo; -} OH_AudioInfo; - -/** - * @brief Video capture info - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef struct OH_VideoCaptureInfo { - /* Display id, should be set while captureMode = CAPTURE_SPECIFIED_SCREEN */ - uint64_t displayId; - /* The ids of mission, should be set while captureMode = CAPTURE_SPECIFIED_WINDOW */ - int32_t *missionIDs; - /* Mission ids length, should be set while captureMode = CAPTURE_SPECIFIED_WINDOW */ - int32_t missionIDsLen; - /* Video frame width of avscreeencapture */ - int32_t videoFrameWidth; - /* Video frame height of avscreeencapture */ - int32_t videoFrameHeight; - /* Video source type of avscreeencapture */ - OH_VideoSourceType videoSource; -} OH_VideoCaptureInfo; - -/** - * @brief Videoc encoder info - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef struct OH_VideoEncInfo { - /* Video encoder format */ - OH_VideoCodecFormat videoCodec; - /* Video encoder bitrate */ - int32_t videoBitrate; - /* Video encoder frame rate */ - int32_t videoFrameRate; -} OH_VideoEncInfo; - -/** - * @brief Video info - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef struct OH_VideoInfo { - /* Video capture info */ - OH_VideoCaptureInfo videoCapInfo; - /* Video encoder info */ - OH_VideoEncInfo videoEncInfo; -} OH_VideoInfo; - -/** - * @brief Recorder file info - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef struct OH_RecorderInfo { - /* Recorder file url */ - char *url; - /* Recorder file url length */ - uint32_t urlLen; - /* Recorder file format */ - OH_ContainerFormatType fileFormat; -} OH_RecorderInfo; - -/** - * @brief AV screeen capture config info - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef struct OH_AVScreenCaptureConfig { - OH_CaptureMode captureMode; - OH_DataType dataType; - OH_AudioInfo audioInfo; - OH_VideoInfo videoInfo; - /* should be set, while dataType = OH_CAPTURE_FILE */ - OH_RecorderInfo recorderInfo; -} OH_AVScreenCaptureConfig; - -/** - * @brief When an error occurs in the running of the OH_AVScreenCapture instance, the function pointer will be called - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @param capture Pointer to an OH_AVScreenCapture instance - * @param errorCode specific error code - * - * @since 10 - * @version 1.0 - */ -typedef void (*OH_AVScreenCaptureOnError)(OH_AVScreenCapture *capture, int32_t errorCode); - -/** - * @brief When audio buffer is available during the operation of OH_AVScreenCapture, the function pointer will - * be called. - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @param capture Pointer to an OH_AVScreenCapture instance - * @param isReady Information describing whether audio buffer is available - * @param type Information describing the audio source type - * - * @since 10 - * @version 1.0 - */ -typedef void (*OH_AVScreenCaptureOnAudioBufferAvailable)(OH_AVScreenCapture *capture, bool isReady, - OH_AudioCaptureSourceType type); - -/** - * @brief When video buffer is available during the operation of OH_AVScreenCapture, the function pointer will - * be called. - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @param capture Pointer to an OH_AVScreenCapture instance - * @param isReady Information describing whether video buffer is available - * - * @since 10 - * @version 1.0 - */ -typedef void (*OH_AVScreenCaptureOnVideoBufferAvailable)(OH_AVScreenCapture *capture, bool isReady); - -/** - * @brief A collection of all callback function pointers in OH_AVScreenCapture. Register an instance of this - * structure to the OH_AVScreenCapture instance, and process the information reported through the callback to ensure the - * normal operation of OH_AVScreenCapture. - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @param onError Monitor OH_AVScreenCapture operation errors, refer to {@link OH_AVScreenCaptureOnError} - * @param onAudioBufferAvailable Monitor audio buffer, refer to {@link OH_AVScreenCaptureOnAudioBufferAvailable} - * @param onVideoBufferAvailable Monitor video buffer, refer to {@link OH_AVScreenCaptureOnVideoBufferAvailable} - * - * @since 10 - * @version 1.0 - */ -typedef struct OH_AVScreenCaptureCallback { - OH_AVScreenCaptureOnError onError; - OH_AVScreenCaptureOnAudioBufferAvailable onAudioBufferAvailable; - OH_AVScreenCaptureOnVideoBufferAvailable onVideoBufferAvailable; -} OH_AVScreenCaptureCallback; - -/** - * @brief avscreeencapture rect info - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef struct OH_Rect { - /* X-coordinate of screen recording */ - int32_t x; - /* y-coordinate of screen recording */ - int32_t y; - /* Width of screen recording */ - int32_t width; - /* Height of screen recording */ - int32_t height; -} OH_Rect; - - -/** - * @brief Audiobuffer struct info - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * - * @since 10 - * @version 1.0 - */ -typedef struct OH_AudioBuffer { - /* Audio buffer memory block */ - uint8_t *buf; - /* Audio buffer memory block size */ - int32_t size; - /* Audio buffer timestamp info */ - int64_t timestamp; - /* Audio capture source type */ - OH_AudioCaptureSourceType type; -} OH_AudioBuffer; - -#ifdef __cplusplus -} -#endif - -#endif // NATIVE_AVSCREEN_CAPTURE_BASE_H \ No newline at end of file diff --git a/multimedia/player_framework/native_avscreen_capture_errors.h b/multimedia/player_framework/native_avscreen_capture_errors.h deleted file mode 100644 index d202659f0..000000000 --- a/multimedia/player_framework/native_avscreen_capture_errors.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2023 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef NATIVE_AVSCREEN_CAPTURE_ERRORS_H -#define NATIVE_AVSCREEN_CAPTURE_ERRORS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief Screen capture error code - * @syscap SystemCapability.Multimedia.Media.AVScreenCapture - * @since 10 - * @version 1.0 - */ - -typedef enum OH_AVSCREEN_CAPTURE_ErrCode { - /** - * basic error mask for screen recording. - */ - AV_SCREEN_CAPTURE_ERR_BASE = 0, - /** - * the operation completed successfully. - */ - AV_SCREEN_CAPTURE_ERR_OK = AV_SCREEN_CAPTURE_ERR_BASE, - /** - * no memory. - */ - AV_SCREEN_CAPTURE_ERR_NO_MEMORY = AV_SCREEN_CAPTURE_ERR_BASE + 1, - /** - * opertation not be permitted. - */ - AV_SCREEN_CAPTURE_ERR_OPERATE_NOT_PERMIT = AV_SCREEN_CAPTURE_ERR_BASE + 2, - /** - * invalid argument. - */ - AV_SCREEN_CAPTURE_ERR_INVALID_VAL = AV_SCREEN_CAPTURE_ERR_BASE + 3, - /** - * IO error. - */ - AV_SCREEN_CAPTURE_ERR_IO = AV_SCREEN_CAPTURE_ERR_BASE + 4, - /** - * network timeout. - */ - AV_SCREEN_CAPTURE_ERR_TIMEOUT = AV_SCREEN_CAPTURE_ERR_BASE + 5, - /** - * unknown error. - */ - AV_SCREEN_CAPTURE_ERR_UNKNOWN = AV_SCREEN_CAPTURE_ERR_BASE + 6, - /** - * media service died. - */ - AV_SCREEN_CAPTURE_ERR_SERVICE_DIED = AV_SCREEN_CAPTURE_ERR_BASE + 7, - /** - * the state is not support this operation. - */ - AV_SCREEN_CAPTURE_ERR_INVALID_STATE = AV_SCREEN_CAPTURE_ERR_BASE + 8, - /** - * unsupport interface. - */ - AV_SCREEN_CAPTURE_ERR_UNSUPPORT = AV_SCREEN_CAPTURE_ERR_BASE + 9, - /** - * extend err start. - */ - AV_SCREEN_CAPTURE_ERR_EXTEND_START = AV_SCREEN_CAPTURE_ERR_BASE + 100, -} OH_AVSCREEN_CAPTURE_ErrCode; - -#ifdef __cplusplus -} -#endif - -#endif // NATIVE_AVSCREEN_CAPTURE_ERRORS_H \ No newline at end of file -- Gitee