From 439490ea3a11901ddc45c3a042cd5dcb4a0877f7 Mon Sep 17 00:00:00 2001 From: rchdlee Date: Mon, 29 Apr 2024 20:27:59 +0800 Subject: [PATCH 01/30] add vpe c api Signed-off-by: rchdlee --- multimedia/video_processing_engine/BUILD.gn | 38 +++ .../image_processing.h | 178 +++++++++++ .../image_processing_types.h | 135 +++++++++ .../libvideo_processing_engine.ndk.json | 118 ++++++++ .../video_processing.h | 278 ++++++++++++++++++ .../video_processing_types.h | 206 +++++++++++++ 6 files changed, 953 insertions(+) create mode 100644 multimedia/video_processing_engine/BUILD.gn create mode 100644 multimedia/video_processing_engine/image_processing.h create mode 100644 multimedia/video_processing_engine/image_processing_types.h create mode 100644 multimedia/video_processing_engine/libvideo_processing_engine.ndk.json create mode 100644 multimedia/video_processing_engine/video_processing.h create mode 100644 multimedia/video_processing_engine/video_processing_types.h diff --git a/multimedia/video_processing_engine/BUILD.gn b/multimedia/video_processing_engine/BUILD.gn new file mode 100644 index 00000000000..6224f39fa34 --- /dev/null +++ b/multimedia/video_processing_engine/BUILD.gn @@ -0,0 +1,38 @@ +# Copyright (c) 2024 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") + +ohos_ndk_headers("video_processing_engine_ndk_headers") { + dest_dir = "$ndk_headers_out_dir/multimedia/video_processing_engine" + sources = [ + "./image_processing_types.h", + "./image_processing.h", + "./video_processing_types.h", + "./video_processing.h" + ] +} + +ohos_ndk_library("libvideo_processing_engine_ndk") { + ndk_description_file = "./video_processing_engine.ndk.json" + output_name = "video_processing_engine" + output_extension = "so" + min_compact_version = "12" + system_capability = "SystemCapability.Multimedia.VideoProcessingEngine" + system_capability_headers = [ + "multimedia/video_processing_engine/image_processing_types.h" + "multimedia/video_processing_engine/image_processing.h" + "multimedia/video_processing_engine/video_processing_types.h" + "multimedia/video_processing_engine/video_processing.h" + ] +} \ No newline at end of file diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h new file mode 100644 index 00000000000..0ffa94e70c8 --- /dev/null +++ b/multimedia/video_processing_engine/image_processing.h @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * @addtogroup ImageProcessing + * @{ + * + * @brief Provide image processing including colorspace conversion and metadata generation. + * + * @since 12 + */ + +/** + * @file image_processing.h + * + * @brief Declare image processing functions. + * + * Provides SDR content processing for images, including color space conversion and metadata generation. + * + * @library libvideo_processing_engine.so + * @syscap SystemCapability.Multimedia.VideoProcessingEngine + * @since + */ + +#ifndef VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_H +#define VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_H + +#include + +#include "pixelmap_native.h" +#include "image_processing_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Initialize global environment for image processing. + * + * This function is optional. \n + * Typically, this function is called once when the host process is started to initialize the global environment for + * image processing, which can reduce the time of {@link OH_ImageProcessing_Create}. \n + * To deinitialize global environment, call {@link OH_ImageProcessing_DeinitializeEnvironment}. + * + * @return {@link IMAGE_PROCESSING_SUCCESS} if initialization is successful. \n + * {@link IMAGE_PROCESSING_ERROR_INITIALIZE_FAILED} if initialization is failed. + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_InitializeEnvironment(); + +/** + * @brief Deinitialize global environment for image processing. + * + * This function is required if {@link OH_ImageProcessing_InitializeEnvironment} is called. Typically, this + * function is called when the host process is about to exit to deinitialize the global environment, which is + * initialized by calling {@link OH_ImageProcessing_InitializeEnvironment}. \n + * If there is some image processing instance existing, this function should not be called. \n + * If the {@link OH_ImageProcessing_InitializeEnvironment} is not called, this function should not be called. + * + * @return {@link IMAGE_PROCESSING_SUCCESS} if deinitialization is successful. \n + * {@link IMAGE_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if some image processing instance is not destroyed or + * {@link OH_ImageProcessing_InitializeEnvironment} is not called. \n + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_DeinitializeEnvironment(); + +/** + * @brief Query whether the image color space conversion is supported. + * + * @param sourceImageInformation is input image color space information pointer. + * @param destinationImageInformation is output image color space information pointer. + * @return true if the color space conversion is supported. \n + * false if the the color space conversion is unsupported. + * @since 12 + */ +bool OH_ImageProcessing_IsColorSpaceConversionSupported( + const ImageProcessing_ColorSpaceInformation* sourceImageInformation, + const ImageProcessing_ColorSpaceInformation* destinationImageInformation); + +/** + * @brief Query whether the image composition is supported. + * + * @param sourceImageInformation Input image color space information pointer. + * @param sourceGainmapInformation Input gainmap color space information pointer. + * @param destinationImageInformation Output image color space information pointer. + * @return true if the image composition is supported. \n + * false if the image composition is unsupported. + * @since 12 + */ +bool OH_ImageProcessing_IsCompositionSupported( + const ImageProcessing_ColorSpaceInformation* sourceImageInformation, + const ImageProcessing_ColorSpaceInformation* sourceGainmapInformation, + const ImageProcessing_ColorSpaceInformation* destinationImageInformation); + +/** + * @brief Query whether the image decomposition is supported. + * + * @param sourceImageInformation Input image color space information pointer. + * @param destinationImageInformation Output image color space information pointer. + * @param destinationGainmapInformation Output gainmap information pointer. + * @return true if the image decomposition is supported. \n + * false if the image decomposition is unsupported. + * @since 12 + */ +bool OH_ImageProcessing_IsDecompositionSupported( + const ImageProcessing_ColorSpaceInformation* sourceImageInformation, + const ImageProcessing_ColorSpaceInformation* destinationImageInformation, + const ImageProcessing_ColorSpaceInformation* destinationGainmapInformation); + +/** + * @brief Create an image processing instance. + * + * @param instance Output parameter. The *instance points to a new image processing object. The *instance must be null + * before passed in. + * @param type Use IMAGE_PROCESSING_TYPE_XXX to specify the processing type. The processing type of the instance can not + * be changed. + * @return {@link IMAGE_PROCESSING_SUCCESS} if creating an image processing successfully. \n + * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the type is not supported. For example, if metadata + * generation is not supported by vendor, it returns unsupported processing. \n + * {@link IMAGE_PROCESSING_ERROR_CREATE_FAILED} if failed to create an image processing. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or *instance is not null. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if type is invalid. \n + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_Create(OH_ImageProcessing** instance, int type); + +/** + * @brief Destroy the image processing instance. + * + * @param instance An image processing instance pointer. It is recommended setting the instance pointer to null after + * the instance is destroyed. + * @return {@link IMAGE_PROCESSING_SUCCESS} if the instance is destroyed successfully. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_Destroy(OH_ImageProcessing* instance); + +/** + * @brief Process image. + * + * The processing type is specified when creating the instance. + * For color space conversion, it includes the conversion between single-layer images, composition from dual-layer HDR + * images to single-layer HDR images, and decomposition from single-layer image to dual-layer HDR image. + * + * @param instance An image processing instance pointer. + * @param sourceImage Input image pointer. + * @param destinationImage Output image pointer. + * @return {@link IMAGE_PROCESSING_SUCCESS} if processing image is successful. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the image is null. \n + * {@link IMAGE_PROCESSING_ERRORCODE_INVALID_VALUE} if some property of image is invalid. For example, the color space + * of the image is unsupported. \n + * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the processing is not supported. \n + * {@link IMAGE_PROCESSING_ERROR_PROCESS_FAILED} if processing error occurs. \n + * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_Process(OH_ImageProcessing* instance, OH_PixelmapNative* sourceImage, + OH_PixelmapNative* destinationImage); + +#ifdef __cplusplus +} +#endif + +#endif // VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_H +/** @} */ \ No newline at end of file diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h new file mode 100644 index 00000000000..c1ccf8af77a --- /dev/null +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * @addtogroup ImageProcessing + * @{ + * + * @brief Provide image processing including colorspace conversion and metadata generation. + * + * @since 12 + */ + +/** + * @file image_processing_type.h + * + * @brief Type definitions for image processing. + * + * @library libvideo_processing_engine.so + * @syscap SystemCapability.Multimedia.VideoProcessingEngine + * @since 12 + */ + +#ifndef VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_TYPES_H +#define VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_TYPES_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Define the object for image processing. + * + * Define a null pointer of OH_ImageProcessing and call {@link OH_ImageProcessing_Create} to create an image processing + * instance. The pointer should be null before creating instance. + * User can create multiple image processing instances for different processing types. + * + * @since 12 + */ +struct OH_ImageProcessing; +typedef struct OH_ImageProcessing OH_ImageProcessing; + +/** + * @brief Used to create an image processing instance for colorspace conversion. + * + * Color space conversion includes the conversion between dual-layer HDR images and single-layer HDR images, + * as well as the color space conversion of SDR images, and the conversion of SDR images to HDR images. Some + * capabilities are supported by vendor. Use {@link OH_ImageProcessing_IsColorSpaceConversionSupported} to query if + * the conversion is supported between single-layer images. Use {@link OH_ImageProcessing_IsCompositionSupported} to + * query if the composition is supported from dual-layer HDR image to single-layer HDR image. Use + * {@link OH_ImageProcessing_IsDecompositionSupported} to query if the decomposition is supported for single-layer image + * to dual-layer HDR image. + * + * @see OH_ImageProcessing_Create + * @since 12 + */ +const int IMAGE_PROCESSING_TYPE_COLORSPACE_CONVERSION = 0x1; + +/** + * @brief Used to create an image processing instance for metadata generation. + * + * Generate HDR Vivid metadata for single-layer image. The capability is supported by vendor. If the capability is not + * supported, {@link OH_ImageProcessing_Create} returns {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING}. + * + * @see OH_ImageProcessing_Create + * @since 12 + */ +const int IMAGE_PROCESSING_TYPE_METADATA_GENERATION = 0x2; + +/** + * @brief The color space information is used for color space conversion capability query. + * + * @see OH_ImageProcessing_IsColorSpaceConversionSupported + * @see OH_ImageProcessing_IsCompositionSupported + * @see OH_ImageProcessing_IsDecompositionSupported + * @since 12 + */ +typedef struct ImageProcessing_ColorSpaceInformation { + /** define metadata type */ + int metadataType; + /** define color space, {@link enum OH_NativeBuffer_ColorSpace} */ + int colorSpace; + /** define pixel format, {@link enum OH_NativeBuffer_Format} */ + int pixelFormat; +} ImageProcessing_ColorSpaceInformation; + +/** + * @brief Image processing error code. + * + * All error types returned in image processing for quick localization of analysis problems. + * + * @since 12 + */ +typedef enum ImageProcessing_ErrorCode { + /** Operation is successful */ + IMAGE_PROCESSING_SUCCESS, + /** Some unknown error occurred */ + IMAGE_PROCESSING_ERROR_UNKNOWN, + /** Initialize global environment for image processing failed */ + IMAGE_PROCESSING_ERROR_INITIALIZE_FAILED, + /** Create image processing instance failed */ + IMAGE_PROCESSING_ERROR_CREATE_FAILED, + /** Process image failed */ + IMAGE_PROCESSING_ERROR_PROCESS_FAILED, + /** Processing is not supported */ + IMAGE_PROCESSING_ERRORCODE_UNSUPPORTED_PROCESSING, + /** Operation is not permitted */ + IMAGE_PROCESSING_ERROR_OPERATION_NOT_PERMITTED, + /** Out of memory */ + IMAGE_PROCESSING_ERROR_NO_MEMORY, + /** Image processing instance is invalid */ + IMAGE_PROCESSING_ERROR_INVALID_INSTANCE, + /** Parameter is invalid */ + IMAGE_PROCESSING_ERROR_INVALID_PARAMETER, + /** Value is invalid. */ + IMAGE_PROCESSING_ERROR_INVALID_VALUE +} ImageProcessing_ErrorCode; + +#ifdef __cplusplus +} +#endif + +#endif // VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_TYPES_H +/** @} */ \ No newline at end of file diff --git a/multimedia/video_processing_engine/libvideo_processing_engine.ndk.json b/multimedia/video_processing_engine/libvideo_processing_engine.ndk.json new file mode 100644 index 00000000000..62ef22daff7 --- /dev/null +++ b/multimedia/video_processing_engine/libvideo_processing_engine.ndk.json @@ -0,0 +1,118 @@ +[ + { + "first_introduced": "12", + "name": "OH_ImageProcessing_InitializeEnvironment" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_DeinitializeEnvironment" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_IsColorSpaceConversionSupported" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_IsCompositionSupported" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_IsDecompositionSupported" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_Create" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_Process" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_InitializeEnvironment" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_DeinitializeEnvironment" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_IsColorSpaceConversionSupported" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_Create" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_RegisterCallback" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_SetSurface" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_GetSurface" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_Start" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_Stop" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_RenderOutputBuffer" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessingCallback_Create" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessingCallback_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessingCallback_BindOnError" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessingCallback_BindOnState" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessingCallback_BindOnNewOutputBuffer" + }, + { + "first_introduced": "12", + "name": "IMAGE_PROCESSING_TYPE_COLORSPACE_CONVERSION", + "type": "variable" + }, + { + "first_introduced": "12", + "name": "IMAGE_PROCESSING_TYPE_METADATA_GENERATION", + "type": "variable" + }, + { + "first_introduced": "12", + "name": "VIDEO_PROCESSING_TYPE_COLORSPACE_CONVERSION", + "type": "variable" + }, + { + "first_introduced": "12", + "name": "VIDEO_PROCESSING_TYPE_METADATA_GENERATION", + "type": "variable" + } +] diff --git a/multimedia/video_processing_engine/video_processing.h b/multimedia/video_processing_engine/video_processing.h new file mode 100644 index 00000000000..72d3725ed7a --- /dev/null +++ b/multimedia/video_processing_engine/video_processing.h @@ -0,0 +1,278 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * @addtogroup VideoProcessing + * @{ + * + * @brief Provide video processing including color space conversion and metadata generation. + * + * @since 12 + */ + +/** + * @file video_processing.h + * + * @brief Declare video processing functions. + * + * @library libvideo_processing_engine.so + * @syscap SystemCapability.Multimedia.VideoProcessingEngine + * @since 12 + */ + +#ifndef VIDEO_PROCESSING_ENGINE_C_API_VIDEO_PROCESSING_H +#define VIDEO_PROCESSING_ENGINE_C_API_VIDEO_PROCESSING_H + +#include +#include "native_window/external_window.h" +#include "video_processing_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Initialize global environment for video processing. + * + * This function is optional. \n + * Typically, this function is called once when the host process is started to initialize the global environment for + * video processing, which can reduce the time of {@link OH_VideoProcessing_Create}. \n + * To deinitialize global environment, call {@link OH_VideoProcessing_DeinitializeEnvironment}. + * + * @return {@link VIDEO_PROCESSING_SUCCESS} if initialization is successful. \n + * {@link VIDEO_PROCESSING_ERROR_INITIALIZE_FAILED} if initialization is failed. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_InitializeEnvironment(); + +/** + * @brief Deinitialize global environment for video processing. + * + * This function is required if {@link OH_VideoProcessing_InitializeEnvironment} is called. Typically, this + * function is called when the host process is about to exit to deinitialize the global environment, which is + * initialized by calling {@link OH_VideoProcessing_InitializeEnvironment}. \n + * If there is some video processing instance existing, this function should not be called. \n + * If the {@link OH_VideoProcessing_InitializeEnvironment} is not called, this function should not be called. + * + * @return {@link VIDEO_PROCESSING_SUCCESS} if deinitialization is successful. \n + * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if some video processing instance is not destroyed or + * {@link OH_VideoProcessing_InitializeEnvironment} is not called. \n + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_DeinitializeEnvironment(); + +/** + * @brief Query if the video color space conversion is supported. + * + * @param sourceVideoInformation Source video color space information. + * @param destinationVideoInformation Destination video color space information. + * @return true if the video color space conversion is supported. \n + * false if the video color space conversion is not supported. + * @since 12 + */ +bool OH_VideoProcessing_IsColorSpaceConversionSupported( + const VideoProcessing_ColorSpaceInformation* sourceVideoInformation, + const VideoProcessing_ColorSpaceInformation* destinationVideoInformation); + +/** + * @brief Create a video processing instance. + * + * @param instance Output parameter. The *instance points to a new video processing object. The *instance must be null + * before passed in. + * @param type Use VIDEO_PROCESSING_TYPE_XXX to specify the processing type. The processing type of the instance can not + * be changed. + * @return {@link VIDEO_PROCESSING_SUCCESS} if creating a video processing instance successfully. \n + * {@link VIDEO_PROCESSING_ERROR_CREATE_FAILED} if failed to create a video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or *instance is not null. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if type is invalid. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_Create(OH_VideoProcessing** instance, int type); + +/** + * @brief Destroy the video processing instance. + * + * Stop the instance before destroying it. see {@link OH_VideoProcessing_Stop}. \n + * + * @param instance The video processing instance pointer to be destroyed. It is recommended setting the instance pointer + * to null after the instance is destroyed. + * @return {@link VIDEO_PROCESSING_SUCCESS} if the instance is destroyed successfully . \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if the instance is still running. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_Destroy(OH_VideoProcessing* instance); + +/** + * @brief Register callback object. + * + * Register the callback object before starting video processing. + * + * @param instance A video processing instance pointer. + * @param callback Callback pointer to be registered. + * @param userData User's custom data pointer. + * @return {@link VIDEO_PROCESSING_SUCCESS} if callback is registered successfully. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if callback is null. \n + * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if video processing instance is running. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_RegisterCallback(OH_VideoProcessing* instance, + const VideoProcessing_Callback* callback, void* userData); + +/** + * @brief Set the output surface for video processing. + * + * Set the output surface before starting video processing. + * + * @param instance A video processing instance pointer. + * @param window The output surface pointer. + * @return {@link VIDEO_PROCESSING_SUCCESS} if setting output surface successfully. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if window is null. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_SetSurface(OH_VideoProcessing* instance, const OHNativeWindow* window); + +/** + * @brief Create an input surface. + * + * Create the input surface before starting video processing. + * Call {@link OH_NativeWindow_DestroyNativeWindow} to destroy the input surface. + * + * @param instance A video processing instance pointer. + * @param window The input surface pointer. For example, it is the output surface of a video decoder. + * @return {@link VIDEO_PROCESSING_SUCCESS} if operation is successful. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if window is null or *window is not null. \n + * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if creating surface failed, input surface is already created + * or video processing instance is running. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_GetSurface(OH_VideoProcessing* instance, OHNativeWindow** window); + +/** + * @brief Start video processing. + * + * After successfully calling this function, the {@link VIDEO_PROCESSING_STATE_RUNNING} is reported by callback function + * {@link OH_VideoProcessingCallback_OnState}. + * + * @param instance A video processing instance pointer. + * @return {@link VIDEO_PROCESSING_SUCCESS} if the operation is successful. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if output surface is not set, input surface is not created or + * instance is already running. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_Start(OH_VideoProcessing* instance); + +/** + * @brief Stop video processing. + * + * After all the cached buffers before this function is called are processed, the + * {@link VIDEO_PROCESSING_STATE_STOPPED} is reported by callback function {@link OH_VideoProcessing_OnState}. + * + * @param instance A video processing instance pointer. + * @return {@link VIDEO_PROCESSING_SUCCESS} if the operation is successful. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if instance is already stopped. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_Stop(OH_VideoProcessing* instance); + +/** + * @brief Send the output buffer out. + * + * If the callback function {@link OH_VideoProcessingCallback_OnNewOutputBuffer} is set, the buffer's index is reported + * to user by the callback function when an output buffer is ready. + * + * @param instance A video processing instance pointer. + * @param index The output buffer's index. + * @return {@link VIDEO_PROCESSING_SUCCESS} if the operation is successful. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if index is invalid. \n + * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if callback {@link OH_VideoProcessing_OnNewOutputBuffer} is + * not set or instance is stopped. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_RenderOutputBuffer(OH_VideoProcessing* instance, uint32_t index); + +/** + * @brief Create a video processing callback object. + * + * @param callback Output parameter. The *callback points to a new callback object. The *callback should be null before + * creating the callback object. + * @return {@link VIDEO_PROCESSING_SUCCESS} if callback object is created successfully. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if callback is null or *callback is not null. \n + * {@link VIDEO_PROCESSING_ERROR_NO_MEMORY} if out of memory. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessingCallback_Create(VideoProcessing_Callback** callback); + +/** + * @brief Destroy the callback object. + * + * The callback object can be destroyed after it is registered to video processing instance. + * + * @param callback The callback object pointer. It is recommended setting the callback pointer to null after the + * callback object is destroyed. + * @return {@link VIDEO_PROCESSING_SUCCESS} if callback is successfully destroyed. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if callback is null. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessingCallback_Destroy(VideoProcessing_Callback* callback); + +/** + * @brief Bind the {@link OH_VideoProcessingCallback_OnError} callback function to callback object. + * + * @param callback A callback object pointer. + * @param onError The callback function. + * @return {@link VIDEO_PROCESSING_SUCCESS} if the function is bound to callback object successfully. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if the callback is null or onError is null. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessingCallback_BindOnError(VideoProcessing_Callback* callback, + OH_VideoProcessingCallback_OnError onError); + +/** + * @brief Bind the {@link OH_VideoProcessingCallback_OnState} callback function to callback object. + * + * @param callback A callback object pointer. + * @param onState The callback function. + * @return {@link VIDEO_PROCESSING_SUCCESS} if the function is bound to callback object successfully. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if the callback is null or onState is null. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessingCallback_BindOnState(VideoProcessing_Callback* callback, + OH_VideoProcessingCallback_OnState onState); + +/** + * @brief Bind the {@link OH_VideoProcessingCallback_OnNewOutputBuffer} callback function to callback object. + * + * @param callback A callback object pointer. + * @param onNewOutputBuffer The callback function. + * @return {@link VIDEO_PROCESSING_SUCCESS} if the function is bound to callback object successfully. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if the callback is null. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessingCallback_BindOnNewOutputBuffer(VideoProcessing_Callback* callback, + OH_VideoProcessingCallback_OnNewOutputBuffer onNewOutputBuffer); + +#ifdef __cplusplus +} +#endif + +#endif // VIDEO_PROCESSING_ENGINE_C_API_VIDEO_PROCESSING_H +/** @} */ \ No newline at end of file diff --git a/multimedia/video_processing_engine/video_processing_types.h b/multimedia/video_processing_engine/video_processing_types.h new file mode 100644 index 00000000000..ca7d5813c46 --- /dev/null +++ b/multimedia/video_processing_engine/video_processing_types.h @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * @addtogroup VideoProcessing + * @{ + * + * @brief Provide video processing including color space conversion and metadata generation. + * + * @since 12 + */ + +/** + * @file video_processing_types.h + * + * @brief Type definitions for video processing. + * + * @library libvideo_processing_engine.so + * @syscap SystemCapability.Multimedia.VideoProcessingEngine + * @since 12 + */ + +#ifndef VIDEO_PROCESSING_ENGINE_C_API_VIDEO_PROCESSING_TYPES_H +#define VIDEO_PROCESSING_ENGINE_C_API_VIDEO_PROCESSING_TYPES_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Define the video processing object. + * + * Define a null pointer of OH_VideoProcessing and call {@link OH_VideoProcessing_Create} to create a video processing + * instance. The pointer should be null before creating instance. + * User can create multiple video processing instances for different processing types. + * + * @since 12 + */ +struct OH_VideoProcessing; +typedef struct OH_VideoProcessing OH_VideoProcessing; + +/** + * @brief Used to create a video processing instance for color space conversion. + * + * Some capabilities are supported by vendor. Use {@link OH_VideoProcessing_IsColorSpaceConversionSupported} to query if + * the conversion is supported. + * + * @see OH_VideoProcessing_Create + * @since 12 + */ +const int VIDEO_PROCESSING_TYPE_COLORSPACE_CONVERSION = 0x10000; + +/** + * @brief Used to create a video processing instance for metadata generation. + * + * Generate HDR vivid metadata for video. The capability is supported by vendor. If the capability is not supported, + * {@link OH_VideoProcessing_Create} returns {@link VIDEO_PROCESSING_ERROR_UNSUPPORTED_PROCESSING}. + * + * @see OH_VideoProcessing_Create + * @since 12 + */ +const int VIDEO_PROCESSING_TYPE_METADATA_GENERATION = 0x20000; + +/** + * @brief Video color space information structure of querying if video color space conversion is supported. + * + * @see OH_VideoProcessing_IsColorSpaceConversionSupported + * @since 12 + */ +typedef struct VideoProcessing_ColorSpaceInformation { + /** The metadata type of the video */ + int metadataType; + /** The color space type of the video, see {@link enum OH_NativeBuffer_ColorSpace} */ + int colorSpace; + /** The pixel format of the video, see {@link enum OH_NativeBuffer_Format} */ + int pixelFormat; +} VideoProcessing_ColorSpaceInformation; + +/** + * @brief Video processing error codes. + * + * @since 12 + */ +typedef enum VideoProcessing_ErrorCode { + /** Operation is successful */ + VIDEO_PROCESSING_SUCCESS, + /** Some unknown error occurred */ + VIDEO_PROCESSING_ERROR_UNKNOWN, + /** Initializing global environment for video processing failed */ + VIDEO_PROCESSING_ERROR_INITIALIZE_FAILED, + /** Create video processing instance failed */ + VIDEO_PROCESSING_ERROR_CREATE_FAILED, + /** Process video failed */ + VIDEO_PROCESSING_ERROR_PROCESS_FAILED, + /** The processing is not supported */ + VIDEO_PROCESSING_ERROR_UNSUPPORTED_PROCESSING, + /** Operation is not permitted */ + VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED, + /** Out of memory */ + VIDEO_PROCESSING_ERROR_NO_MEMORY, + /** Video processing instance is invalid */ + VIDEO_PROCESSING_ERROR_INVALID_INSTANCE, + /** Parameter is invalid. */ + VIDEO_PROCESSING_ERROR_INVALID_PARAMETER, + /** Value is invalid */ + VIDEO_PROCESSING_ERROR_INVALID_VALUE +} VideoProcessing_ErrorCode; + +/** + * @brief Video processing states. + * + * The state is reported to user by callback function {@link OH_VideoProcessing_OnState}. + * + * @since 12 + */ +typedef enum VideoProcessing_State { + /** Video processing is running */ + VIDEO_PROCESSING_STATE_RUNNING, + /** Video processing is stopped */ + VIDEO_PROCESSING_STATE_STOPPED +} VideoProcessing_State; + +/** + * @brief Video processing asynchronous callback object type. + * + * Define a null pointer of VideoProcessing_Callback and call {@link OH_VideoProcessingCallback_Create} to create a + * callback object. The pointer should be null before creating the callback object. + * Register the callback to a video processing instance by calling {@link OH_VideoProcessing_RegisterCallback}. + * + * @since 12 + */ +struct VideoProcessing_Callback; +typedef struct VideoProcessing_Callback VideoProcessing_Callback; + +/** + * @brief The callback function pointer definition for reporting error during video processing. + * + * Errors: \n + * {@link VIDEO_PROCESSING_ERROR_UNSUPPORTED_PROCESSING}, the processing is not supported. For example, the + * color space conversion according to the source and destination videos' properties is not supported. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_VALUE}, some property of the video is invalid. For example, the color space of + * the video is invalid. \n + * {@link VIDEO_PROCESSING_ERROR_NO_MEMORY}, out of memory. \n + * {@link VIDEO_PROCESSING_ERROR_PROCESS_FAILED}, some processing error occurs. \n + * For more errors, see {@link VideoProcessing_ErrorCode}. + * + * @param instance The video processing instance. + * @param error Error code reporting to user. + * @param userData User's custom data. + * @since 12 + */ +typedef void (*OH_VideoProcessingCallback_OnError)(OH_VideoProcessing* instance, VideoProcessing_ErrorCode error, + void* userData); + +/** + * @brief The callback function pointer definition for reporting video processing state. + * + * The state will be {@link VIDEO_PROCESSING_STATE_RUNNING} after {@link OH_VideoProcessing_Start} is called + * successfully. + * The state will be {@link VIDEO_PROCESSING_STATE_STOPPED} after all the buffers cached before + * {@link OH_VideoProcessing_Stop} is called are processed. + * + * @param instance The video processing instance. + * @param state see {@link VideoProcessing_State}. + * @param userData User's custom data. + * @since 12 + */ +typedef void (*OH_VideoProcessingCallback_OnState)(OH_VideoProcessing* instance, VideoProcessing_State state, + void* userData); + +/** + * @brief The callback function pointer definition for reporting a new output buffer is filled with processed data. + * + * Every new output buffer's index will report to user once the buffer is filled with processed data. Then call + * {@link OH_VideoProcessing_RenderOutputBuffer} with the buffer's index to send the output buffer out. + * If this function is not registered, the output buffer is sent out as soon as the buffer is filled with processed + * data without reporting. + * + * @param instance The video processing instance. + * @param index The index of the new output buffer. + * @param userData The user's custom data. + * @since 12 + */ +typedef void (*OH_VideoProcessingCallback_OnNewOutputBuffer)(OH_VideoProcessing* instance, uint32_t index, + void* userData); + +#ifdef __cplusplus +} +#endif + +#endif // VIDEO_PROCESSING_ENGINE_C_API_VIDEO_PROCESSING_TYPES_H +/** @} */ \ No newline at end of file -- Gitee From 072e7252eb094f4cadb82f8a3befaf93d84a480c Mon Sep 17 00:00:00 2001 From: rchdlee Date: Mon, 29 Apr 2024 21:05:09 +0800 Subject: [PATCH 02/30] update code style Signed-off-by: rchdlee --- multimedia/video_processing_engine/BUILD.gn | 14 +++++----- .../image_processing_types.h | 10 +++++++ .../video_processing_types.h | 26 ++++++++++++++++--- 3 files changed, 40 insertions(+), 10 deletions(-) diff --git a/multimedia/video_processing_engine/BUILD.gn b/multimedia/video_processing_engine/BUILD.gn index 6224f39fa34..7e9ae7b81f6 100644 --- a/multimedia/video_processing_engine/BUILD.gn +++ b/multimedia/video_processing_engine/BUILD.gn @@ -16,10 +16,10 @@ import("//build/ohos.gni") ohos_ndk_headers("video_processing_engine_ndk_headers") { dest_dir = "$ndk_headers_out_dir/multimedia/video_processing_engine" sources = [ - "./image_processing_types.h", "./image_processing.h", + "./image_processing_types.h", + "./video_processing.h", "./video_processing_types.h", - "./video_processing.h" ] } @@ -30,9 +30,9 @@ ohos_ndk_library("libvideo_processing_engine_ndk") { min_compact_version = "12" system_capability = "SystemCapability.Multimedia.VideoProcessingEngine" system_capability_headers = [ - "multimedia/video_processing_engine/image_processing_types.h" - "multimedia/video_processing_engine/image_processing.h" - "multimedia/video_processing_engine/video_processing_types.h" - "multimedia/video_processing_engine/video_processing.h" + "multimedia/video_processing_engine/image_processing_types.h", + "multimedia/video_processing_engine/image_processing.h", + "multimedia/video_processing_engine/video_processing_types.h", + "multimedia/video_processing_engine/video_processing.h", ] -} \ No newline at end of file +} diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index c1ccf8af77a..b0a338d3adc 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -49,6 +49,16 @@ extern "C" { * @since 12 */ struct OH_ImageProcessing; + +/** + * @brief Define the object for image processing. + * + * Define a null pointer of OH_ImageProcessing and call {@link OH_ImageProcessing_Create} to create an image processing + * instance. The pointer should be null before creating instance. + * User can create multiple image processing instances for different processing types. + * + * @since 12 + */ typedef struct OH_ImageProcessing OH_ImageProcessing; /** diff --git a/multimedia/video_processing_engine/video_processing_types.h b/multimedia/video_processing_engine/video_processing_types.h index ca7d5813c46..01053dfdaef 100644 --- a/multimedia/video_processing_engine/video_processing_types.h +++ b/multimedia/video_processing_engine/video_processing_types.h @@ -51,6 +51,16 @@ extern "C" { * @since 12 */ struct OH_VideoProcessing; + +/** + * @brief Define the video processing object. + * + * Define a null pointer of OH_VideoProcessing and call {@link OH_VideoProcessing_Create} to create a video processing + * instance. The pointer should be null before creating instance. + * User can create multiple video processing instances for different processing types. + * + * @since 12 + */ typedef struct OH_VideoProcessing OH_VideoProcessing; /** @@ -144,6 +154,16 @@ typedef enum VideoProcessing_State { * @since 12 */ struct VideoProcessing_Callback; + +/** + * @brief Video processing asynchronous callback object type. + * + * Define a null pointer of VideoProcessing_Callback and call {@link OH_VideoProcessingCallback_Create} to create a + * callback object. The pointer should be null before creating the callback object. + * Register the callback to a video processing instance by calling {@link OH_VideoProcessing_RegisterCallback}. + * + * @since 12 + */ typedef struct VideoProcessing_Callback VideoProcessing_Callback; /** @@ -164,7 +184,7 @@ typedef struct VideoProcessing_Callback VideoProcessing_Callback; * @since 12 */ typedef void (*OH_VideoProcessingCallback_OnError)(OH_VideoProcessing* instance, VideoProcessing_ErrorCode error, - void* userData); + void* userData); /** * @brief The callback function pointer definition for reporting video processing state. @@ -180,7 +200,7 @@ typedef void (*OH_VideoProcessingCallback_OnError)(OH_VideoProcessing* instance, * @since 12 */ typedef void (*OH_VideoProcessingCallback_OnState)(OH_VideoProcessing* instance, VideoProcessing_State state, - void* userData); + void* userData); /** * @brief The callback function pointer definition for reporting a new output buffer is filled with processed data. @@ -196,7 +216,7 @@ typedef void (*OH_VideoProcessingCallback_OnState)(OH_VideoProcessing* instance, * @since 12 */ typedef void (*OH_VideoProcessingCallback_OnNewOutputBuffer)(OH_VideoProcessing* instance, uint32_t index, - void* userData); + void* userData); #ifdef __cplusplus } -- Gitee From b301b35e9cf5b9cea3578cc1cecd118ff256e229 Mon Sep 17 00:00:00 2001 From: rchdlee Date: Mon, 29 Apr 2024 21:07:10 +0800 Subject: [PATCH 03/30] update description Signed-off-by: rchdlee --- multimedia/video_processing_engine/image_processing_types.h | 2 -- multimedia/video_processing_engine/video_processing_types.h | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index b0a338d3adc..7c7cbc01be4 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -108,8 +108,6 @@ typedef struct ImageProcessing_ColorSpaceInformation { /** * @brief Image processing error code. * - * All error types returned in image processing for quick localization of analysis problems. - * * @since 12 */ typedef enum ImageProcessing_ErrorCode { diff --git a/multimedia/video_processing_engine/video_processing_types.h b/multimedia/video_processing_engine/video_processing_types.h index 01053dfdaef..56053dcf8b2 100644 --- a/multimedia/video_processing_engine/video_processing_types.h +++ b/multimedia/video_processing_engine/video_processing_types.h @@ -101,7 +101,7 @@ typedef struct VideoProcessing_ColorSpaceInformation { } VideoProcessing_ColorSpaceInformation; /** - * @brief Video processing error codes. + * @brief Video processing error code. * * @since 12 */ -- Gitee From f1452e5db968c972cbfe5d936a0edcfcf49d68eb Mon Sep 17 00:00:00 2001 From: rchdlee Date: Tue, 30 Apr 2024 10:41:09 +0800 Subject: [PATCH 04/30] update docs Signed-off-by: rchdlee --- .../image_processing.h | 22 +++++++++---------- .../image_processing_types.h | 10 ++++----- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h index 0ffa94e70c8..573919cc2ae 100644 --- a/multimedia/video_processing_engine/image_processing.h +++ b/multimedia/video_processing_engine/image_processing.h @@ -17,7 +17,7 @@ * @addtogroup ImageProcessing * @{ * - * @brief Provide image processing including colorspace conversion and metadata generation. + * @brief Provide image processing including color space conversion and metadata generation. * * @since 12 */ @@ -39,7 +39,7 @@ #include -#include "pixelmap_native.h" +#include "image_framework/include/image/pixelmap_native.h" #include "image_processing_types.h" #ifdef __cplusplus @@ -79,10 +79,10 @@ ImageProcessing_ErrorCode OH_ImageProcessing_DeinitializeEnvironment(); /** * @brief Query whether the image color space conversion is supported. * - * @param sourceImageInformation is input image color space information pointer. - * @param destinationImageInformation is output image color space information pointer. - * @return true if the color space conversion is supported. \n - * false if the the color space conversion is unsupported. + * @param sourceImageInformation Input image color space information pointer. + * @param destinationImageInformation Output image color space information pointer. + * @return true if the color space conversion is supported. \n + * false if the the color space conversion is unsupported. * @since 12 */ bool OH_ImageProcessing_IsColorSpaceConversionSupported( @@ -95,8 +95,8 @@ bool OH_ImageProcessing_IsColorSpaceConversionSupported( * @param sourceImageInformation Input image color space information pointer. * @param sourceGainmapInformation Input gainmap color space information pointer. * @param destinationImageInformation Output image color space information pointer. - * @return true if the image composition is supported. \n - * false if the image composition is unsupported. + * @return true if the image composition is supported. \n + * false if the image composition is unsupported. * @since 12 */ bool OH_ImageProcessing_IsCompositionSupported( @@ -110,8 +110,8 @@ bool OH_ImageProcessing_IsCompositionSupported( * @param sourceImageInformation Input image color space information pointer. * @param destinationImageInformation Output image color space information pointer. * @param destinationGainmapInformation Output gainmap information pointer. - * @return true if the image decomposition is supported. \n - * false if the image decomposition is unsupported. + * @return true if the image decomposition is supported. \n + * false if the image decomposition is unsupported. * @since 12 */ bool OH_ImageProcessing_IsDecompositionSupported( @@ -160,7 +160,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Destroy(OH_ImageProcessing* instanc * @return {@link IMAGE_PROCESSING_SUCCESS} if processing image is successful. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the image is null. \n - * {@link IMAGE_PROCESSING_ERRORCODE_INVALID_VALUE} if some property of image is invalid. For example, the color space + * {@link IMAGE_PROCESSING_ERROR_INVALID_VALUE} if some property of image is invalid. For example, the color space * of the image is unsupported. \n * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the processing is not supported. \n * {@link IMAGE_PROCESSING_ERROR_PROCESS_FAILED} if processing error occurs. \n diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index 7c7cbc01be4..3c0e41e8c17 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -17,7 +17,7 @@ * @addtogroup ImageProcessing * @{ * - * @brief Provide image processing including colorspace conversion and metadata generation. + * @brief Provide image processing including color space conversion and metadata generation. * * @since 12 */ @@ -62,15 +62,15 @@ struct OH_ImageProcessing; typedef struct OH_ImageProcessing OH_ImageProcessing; /** - * @brief Used to create an image processing instance for colorspace conversion. + * @brief Used to create an image processing instance for color space conversion. * * Color space conversion includes the conversion between dual-layer HDR images and single-layer HDR images, * as well as the color space conversion of SDR images, and the conversion of SDR images to HDR images. Some * capabilities are supported by vendor. Use {@link OH_ImageProcessing_IsColorSpaceConversionSupported} to query if * the conversion is supported between single-layer images. Use {@link OH_ImageProcessing_IsCompositionSupported} to * query if the composition is supported from dual-layer HDR image to single-layer HDR image. Use - * {@link OH_ImageProcessing_IsDecompositionSupported} to query if the decomposition is supported for single-layer image - * to dual-layer HDR image. + * {@link OH_ImageProcessing_IsDecompositionSupported} to query if the decomposition is supported from single-layer + * image to dual-layer HDR image. * * @see OH_ImageProcessing_Create * @since 12 @@ -122,7 +122,7 @@ typedef enum ImageProcessing_ErrorCode { /** Process image failed */ IMAGE_PROCESSING_ERROR_PROCESS_FAILED, /** Processing is not supported */ - IMAGE_PROCESSING_ERRORCODE_UNSUPPORTED_PROCESSING, + IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING, /** Operation is not permitted */ IMAGE_PROCESSING_ERROR_OPERATION_NOT_PERMITTED, /** Out of memory */ -- Gitee From c5a4602871722971842d8ea5ff525fbcad0c04fb Mon Sep 17 00:00:00 2001 From: rchdlee Date: Tue, 30 Apr 2024 11:22:25 +0800 Subject: [PATCH 05/30] update doc Signed-off-by: rchdlee --- multimedia/video_processing_engine/image_processing_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index 3c0e41e8c17..561b196d9c8 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -23,7 +23,7 @@ */ /** - * @file image_processing_type.h + * @file image_processing_types.h * * @brief Type definitions for image processing. * -- Gitee From 1a176f7630ce696290562e6a4cc02bbcb6715d2b Mon Sep 17 00:00:00 2001 From: rchdlee Date: Tue, 30 Apr 2024 15:45:59 +0800 Subject: [PATCH 06/30] fix review issues Signed-off-by: rchdlee --- multimedia/video_processing_engine/BUILD.gn | 28 +++++++++--- .../image_processing.h | 5 +-- .../image_processing_types.h | 24 +++++----- .../libimage_processing.ndk.json | 44 +++++++++++++++++++ ....ndk.json => libvideo_processing.ndk.json} | 42 ------------------ .../video_processing.h | 3 +- .../video_processing_types.h | 22 ++++------ 7 files changed, 89 insertions(+), 79 deletions(-) create mode 100644 multimedia/video_processing_engine/libimage_processing.ndk.json rename multimedia/video_processing_engine/{libvideo_processing_engine.ndk.json => libvideo_processing.ndk.json} (63%) diff --git a/multimedia/video_processing_engine/BUILD.gn b/multimedia/video_processing_engine/BUILD.gn index 7e9ae7b81f6..f746ec798cb 100644 --- a/multimedia/video_processing_engine/BUILD.gn +++ b/multimedia/video_processing_engine/BUILD.gn @@ -13,25 +13,41 @@ import("//build/ohos.gni") -ohos_ndk_headers("video_processing_engine_ndk_headers") { +ohos_ndk_headers("image_processing_ndk_headers") { dest_dir = "$ndk_headers_out_dir/multimedia/video_processing_engine" sources = [ "./image_processing.h", "./image_processing_types.h", - "./video_processing.h", - "./video_processing_types.h", ] } -ohos_ndk_library("libvideo_processing_engine_ndk") { - ndk_description_file = "./video_processing_engine.ndk.json" - output_name = "video_processing_engine" +ohos_ndk_library("libimage_processing_ndk") { + ndk_description_file = "./libimage_processing.ndk.json" + output_name = "image_processing" output_extension = "so" min_compact_version = "12" system_capability = "SystemCapability.Multimedia.VideoProcessingEngine" system_capability_headers = [ "multimedia/video_processing_engine/image_processing_types.h", "multimedia/video_processing_engine/image_processing.h", + ] +} + +ohos_ndk_headers("video_processing_ndk_headers") { + dest_dir = "$ndk_headers_out_dir/multimedia/video_processing_engine" + sources = [ + "./video_processing.h", + "./video_processing_types.h", + ] +} + +ohos_ndk_library("libvideo_processing_ndk") { + ndk_description_file = "./libvideo_processing.ndk.json" + output_name = "video_processing" + output_extension = "so" + min_compact_version = "12" + system_capability = "SystemCapability.Multimedia.VideoProcessingEngine" + system_capability_headers = [ "multimedia/video_processing_engine/video_processing_types.h", "multimedia/video_processing_engine/video_processing.h", ] diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h index 573919cc2ae..276a691795b 100644 --- a/multimedia/video_processing_engine/image_processing.h +++ b/multimedia/video_processing_engine/image_processing.h @@ -29,7 +29,7 @@ * * Provides SDR content processing for images, including color space conversion and metadata generation. * - * @library libvideo_processing_engine.so + * @library libimage_processing.so * @syscap SystemCapability.Multimedia.VideoProcessingEngine * @since */ @@ -39,7 +39,6 @@ #include -#include "image_framework/include/image/pixelmap_native.h" #include "image_processing_types.h" #ifdef __cplusplus @@ -134,7 +133,7 @@ bool OH_ImageProcessing_IsDecompositionSupported( * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if type is invalid. \n * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_Create(OH_ImageProcessing** instance, int type); +ImageProcessing_ErrorCode OH_ImageProcessing_Create(OH_ImageProcessing** instance, int32_t type); /** * @brief Destroy the image processing instance. diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index 561b196d9c8..2c95ee41563 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -27,7 +27,7 @@ * * @brief Type definitions for image processing. * - * @library libvideo_processing_engine.so + * @library libimage_processing.so * @syscap SystemCapability.Multimedia.VideoProcessingEngine * @since 12 */ @@ -35,6 +35,8 @@ #ifndef VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_TYPES_H #define VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_TYPES_H +#include + #ifdef __cplusplus extern "C" { #endif @@ -48,18 +50,14 @@ extern "C" { * * @since 12 */ -struct OH_ImageProcessing; +typedef struct OH_ImageProcessing OH_ImageProcessing; /** - * @brief Define the object for image processing. - * - * Define a null pointer of OH_ImageProcessing and call {@link OH_ImageProcessing_Create} to create an image processing - * instance. The pointer should be null before creating instance. - * User can create multiple image processing instances for different processing types. + * @brief Forward declaration of OH_PixelmapNative. * * @since 12 */ -typedef struct OH_ImageProcessing OH_ImageProcessing; +typedef struct OH_PixelmapNative OH_PixelmapNative; /** * @brief Used to create an image processing instance for color space conversion. @@ -75,7 +73,7 @@ typedef struct OH_ImageProcessing OH_ImageProcessing; * @see OH_ImageProcessing_Create * @since 12 */ -const int IMAGE_PROCESSING_TYPE_COLORSPACE_CONVERSION = 0x1; +extern const int32_t IMAGE_PROCESSING_TYPE_COLORSPACE_CONVERSION; /** * @brief Used to create an image processing instance for metadata generation. @@ -86,7 +84,7 @@ const int IMAGE_PROCESSING_TYPE_COLORSPACE_CONVERSION = 0x1; * @see OH_ImageProcessing_Create * @since 12 */ -const int IMAGE_PROCESSING_TYPE_METADATA_GENERATION = 0x2; +extern const int32_t IMAGE_PROCESSING_TYPE_METADATA_GENERATION; /** * @brief The color space information is used for color space conversion capability query. @@ -98,11 +96,11 @@ const int IMAGE_PROCESSING_TYPE_METADATA_GENERATION = 0x2; */ typedef struct ImageProcessing_ColorSpaceInformation { /** define metadata type */ - int metadataType; + int32_t metadataType; /** define color space, {@link enum OH_NativeBuffer_ColorSpace} */ - int colorSpace; + int32_t colorSpace; /** define pixel format, {@link enum OH_NativeBuffer_Format} */ - int pixelFormat; + int32_t pixelFormat; } ImageProcessing_ColorSpaceInformation; /** diff --git a/multimedia/video_processing_engine/libimage_processing.ndk.json b/multimedia/video_processing_engine/libimage_processing.ndk.json new file mode 100644 index 00000000000..c398c297633 --- /dev/null +++ b/multimedia/video_processing_engine/libimage_processing.ndk.json @@ -0,0 +1,44 @@ +[ + { + "first_introduced": "12", + "name": "OH_ImageProcessing_InitializeEnvironment" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_DeinitializeEnvironment" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_IsColorSpaceConversionSupported" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_IsCompositionSupported" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_IsDecompositionSupported" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_Create" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_Destroy" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_Process" + }, + { + "first_introduced": "12", + "name": "IMAGE_PROCESSING_TYPE_COLORSPACE_CONVERSION", + "type": "variable" + }, + { + "first_introduced": "12", + "name": "IMAGE_PROCESSING_TYPE_METADATA_GENERATION", + "type": "variable" + } +] diff --git a/multimedia/video_processing_engine/libvideo_processing_engine.ndk.json b/multimedia/video_processing_engine/libvideo_processing.ndk.json similarity index 63% rename from multimedia/video_processing_engine/libvideo_processing_engine.ndk.json rename to multimedia/video_processing_engine/libvideo_processing.ndk.json index 62ef22daff7..3a0433448ed 100644 --- a/multimedia/video_processing_engine/libvideo_processing_engine.ndk.json +++ b/multimedia/video_processing_engine/libvideo_processing.ndk.json @@ -1,36 +1,4 @@ [ - { - "first_introduced": "12", - "name": "OH_ImageProcessing_InitializeEnvironment" - }, - { - "first_introduced": "12", - "name": "OH_ImageProcessing_DeinitializeEnvironment" - }, - { - "first_introduced": "12", - "name": "OH_ImageProcessing_IsColorSpaceConversionSupported" - }, - { - "first_introduced": "12", - "name": "OH_ImageProcessing_IsCompositionSupported" - }, - { - "first_introduced": "12", - "name": "OH_ImageProcessing_IsDecompositionSupported" - }, - { - "first_introduced": "12", - "name": "OH_ImageProcessing_Create" - }, - { - "first_introduced": "12", - "name": "OH_ImageProcessing_Destroy" - }, - { - "first_introduced": "12", - "name": "OH_ImageProcessing_Process" - }, { "first_introduced": "12", "name": "OH_VideoProcessing_InitializeEnvironment" @@ -95,16 +63,6 @@ "first_introduced": "12", "name": "OH_VideoProcessingCallback_BindOnNewOutputBuffer" }, - { - "first_introduced": "12", - "name": "IMAGE_PROCESSING_TYPE_COLORSPACE_CONVERSION", - "type": "variable" - }, - { - "first_introduced": "12", - "name": "IMAGE_PROCESSING_TYPE_METADATA_GENERATION", - "type": "variable" - }, { "first_introduced": "12", "name": "VIDEO_PROCESSING_TYPE_COLORSPACE_CONVERSION", diff --git a/multimedia/video_processing_engine/video_processing.h b/multimedia/video_processing_engine/video_processing.h index 72d3725ed7a..2716fa857ef 100644 --- a/multimedia/video_processing_engine/video_processing.h +++ b/multimedia/video_processing_engine/video_processing.h @@ -27,7 +27,7 @@ * * @brief Declare video processing functions. * - * @library libvideo_processing_engine.so + * @library libvideo_processing.so * @syscap SystemCapability.Multimedia.VideoProcessingEngine * @since 12 */ @@ -36,7 +36,6 @@ #define VIDEO_PROCESSING_ENGINE_C_API_VIDEO_PROCESSING_H #include -#include "native_window/external_window.h" #include "video_processing_types.h" #ifdef __cplusplus diff --git a/multimedia/video_processing_engine/video_processing_types.h b/multimedia/video_processing_engine/video_processing_types.h index 56053dcf8b2..c297fbd65bf 100644 --- a/multimedia/video_processing_engine/video_processing_types.h +++ b/multimedia/video_processing_engine/video_processing_types.h @@ -27,7 +27,7 @@ * * @brief Type definitions for video processing. * - * @library libvideo_processing_engine.so + * @library libvideo_processing.so * @syscap SystemCapability.Multimedia.VideoProcessingEngine * @since 12 */ @@ -50,18 +50,14 @@ extern "C" { * * @since 12 */ -struct OH_VideoProcessing; +typedef struct OH_VideoProcessing OH_VideoProcessing; /** - * @brief Define the video processing object. - * - * Define a null pointer of OH_VideoProcessing and call {@link OH_VideoProcessing_Create} to create a video processing - * instance. The pointer should be null before creating instance. - * User can create multiple video processing instances for different processing types. + * @brief Forward declaration of NativeWindow. * * @since 12 */ -typedef struct OH_VideoProcessing OH_VideoProcessing; +typedef struct NativeWindow OHNativeWindow; /** * @brief Used to create a video processing instance for color space conversion. @@ -72,7 +68,7 @@ typedef struct OH_VideoProcessing OH_VideoProcessing; * @see OH_VideoProcessing_Create * @since 12 */ -const int VIDEO_PROCESSING_TYPE_COLORSPACE_CONVERSION = 0x10000; +extern const int32_t VIDEO_PROCESSING_TYPE_COLORSPACE_CONVERSION; /** * @brief Used to create a video processing instance for metadata generation. @@ -83,7 +79,7 @@ const int VIDEO_PROCESSING_TYPE_COLORSPACE_CONVERSION = 0x10000; * @see OH_VideoProcessing_Create * @since 12 */ -const int VIDEO_PROCESSING_TYPE_METADATA_GENERATION = 0x20000; +extern const int32_t VIDEO_PROCESSING_TYPE_METADATA_GENERATION; /** * @brief Video color space information structure of querying if video color space conversion is supported. @@ -93,11 +89,11 @@ const int VIDEO_PROCESSING_TYPE_METADATA_GENERATION = 0x20000; */ typedef struct VideoProcessing_ColorSpaceInformation { /** The metadata type of the video */ - int metadataType; + int32_t metadataType; /** The color space type of the video, see {@link enum OH_NativeBuffer_ColorSpace} */ - int colorSpace; + int32_t colorSpace; /** The pixel format of the video, see {@link enum OH_NativeBuffer_Format} */ - int pixelFormat; + int32_t pixelFormat; } VideoProcessing_ColorSpaceInformation; /** -- Gitee From a23fc564bc37bc8635c3b0f6476f86aa4ac1ba8e Mon Sep 17 00:00:00 2001 From: rchdlee Date: Mon, 6 May 2024 09:00:09 +0800 Subject: [PATCH 07/30] update doc Signed-off-by: rchdlee --- multimedia/video_processing_engine/video_processing.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/multimedia/video_processing_engine/video_processing.h b/multimedia/video_processing_engine/video_processing.h index 2716fa857ef..d03f44f001a 100644 --- a/multimedia/video_processing_engine/video_processing.h +++ b/multimedia/video_processing_engine/video_processing.h @@ -163,7 +163,7 @@ VideoProcessing_ErrorCode OH_VideoProcessing_SetSurface(OH_VideoProcessing* inst VideoProcessing_ErrorCode OH_VideoProcessing_GetSurface(OH_VideoProcessing* instance, OHNativeWindow** window); /** - * @brief Start video processing. + * @brief Start video processing instance. * * After successfully calling this function, the {@link VIDEO_PROCESSING_STATE_RUNNING} is reported by callback function * {@link OH_VideoProcessingCallback_OnState}. @@ -178,10 +178,10 @@ VideoProcessing_ErrorCode OH_VideoProcessing_GetSurface(OH_VideoProcessing* inst VideoProcessing_ErrorCode OH_VideoProcessing_Start(OH_VideoProcessing* instance); /** - * @brief Stop video processing. + * @brief To stop video processing instance. * - * After all the cached buffers before this function is called are processed, the - * {@link VIDEO_PROCESSING_STATE_STOPPED} is reported by callback function {@link OH_VideoProcessing_OnState}. + * After the video processing instance is stopped successfully, the state {@link VIDEO_PROCESSING_STATE_STOPPED} is + * reported by callback function {@link OH_VideoProcessing_OnState}. * * @param instance A video processing instance pointer. * @return {@link VIDEO_PROCESSING_SUCCESS} if the operation is successful. \n -- Gitee From eb54390f59880ef966b1070b01bee60b9055156c Mon Sep 17 00:00:00 2001 From: rchdlee Date: Mon, 6 May 2024 09:01:14 +0800 Subject: [PATCH 08/30] update doc Signed-off-by: rchdlee --- multimedia/video_processing_engine/video_processing.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/video_processing_engine/video_processing.h b/multimedia/video_processing_engine/video_processing.h index d03f44f001a..413058d3ceb 100644 --- a/multimedia/video_processing_engine/video_processing.h +++ b/multimedia/video_processing_engine/video_processing.h @@ -165,8 +165,8 @@ VideoProcessing_ErrorCode OH_VideoProcessing_GetSurface(OH_VideoProcessing* inst /** * @brief Start video processing instance. * - * After successfully calling this function, the {@link VIDEO_PROCESSING_STATE_RUNNING} is reported by callback function - * {@link OH_VideoProcessingCallback_OnState}. + * After successfully calling this function, the state {@link VIDEO_PROCESSING_STATE_RUNNING} is reported by callback + * function {@link OH_VideoProcessingCallback_OnState}. * * @param instance A video processing instance pointer. * @return {@link VIDEO_PROCESSING_SUCCESS} if the operation is successful. \n -- Gitee From a75bfa623ef6a55daa1be62d84723b0d9adb6b3d Mon Sep 17 00:00:00 2001 From: rchdlee Date: Mon, 6 May 2024 18:31:35 +0800 Subject: [PATCH 09/30] update interface Signed-off-by: rchdlee --- .../video_processing_engine/video_processing_types.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/multimedia/video_processing_engine/video_processing_types.h b/multimedia/video_processing_engine/video_processing_types.h index c297fbd65bf..37e23dc3cd3 100644 --- a/multimedia/video_processing_engine/video_processing_types.h +++ b/multimedia/video_processing_engine/video_processing_types.h @@ -140,17 +140,6 @@ typedef enum VideoProcessing_State { VIDEO_PROCESSING_STATE_STOPPED } VideoProcessing_State; -/** - * @brief Video processing asynchronous callback object type. - * - * Define a null pointer of VideoProcessing_Callback and call {@link OH_VideoProcessingCallback_Create} to create a - * callback object. The pointer should be null before creating the callback object. - * Register the callback to a video processing instance by calling {@link OH_VideoProcessing_RegisterCallback}. - * - * @since 12 - */ -struct VideoProcessing_Callback; - /** * @brief Video processing asynchronous callback object type. * -- Gitee From 5eaf602205e08ced5588b2ca663df81c09aec154 Mon Sep 17 00:00:00 2001 From: rchdlee Date: Tue, 7 May 2024 13:53:55 +0800 Subject: [PATCH 10/30] update interfaces Signed-off-by: rchdlee --- .../image_processing.h | 32 +++++++++---------- .../image_processing_types.h | 6 ++-- .../libimage_processing.ndk.json | 2 +- .../libvideo_processing.ndk.json | 2 +- .../video_processing.h | 8 ++--- .../video_processing_types.h | 6 ++-- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h index 276a691795b..8a2f73c9acc 100644 --- a/multimedia/video_processing_engine/image_processing.h +++ b/multimedia/video_processing_engine/image_processing.h @@ -78,45 +78,45 @@ ImageProcessing_ErrorCode OH_ImageProcessing_DeinitializeEnvironment(); /** * @brief Query whether the image color space conversion is supported. * - * @param sourceImageInformation Input image color space information pointer. - * @param destinationImageInformation Output image color space information pointer. + * @param sourceImageInfo Input image color space information pointer. + * @param destinationImageInfo Output image color space information pointer. * @return true if the color space conversion is supported. \n * false if the the color space conversion is unsupported. * @since 12 */ bool OH_ImageProcessing_IsColorSpaceConversionSupported( - const ImageProcessing_ColorSpaceInformation* sourceImageInformation, - const ImageProcessing_ColorSpaceInformation* destinationImageInformation); + const ImageProcessing_ColorSpaceInfo* sourceImageInfo, + const ImageProcessing_ColorSpaceInfo* destinationImageInfo); /** * @brief Query whether the image composition is supported. * - * @param sourceImageInformation Input image color space information pointer. - * @param sourceGainmapInformation Input gainmap color space information pointer. - * @param destinationImageInformation Output image color space information pointer. + * @param sourceImageInfo Input image color space information pointer. + * @param sourceGainmapInfo Input gainmap color space information pointer. + * @param destinationImageInfo Output image color space information pointer. * @return true if the image composition is supported. \n * false if the image composition is unsupported. * @since 12 */ bool OH_ImageProcessing_IsCompositionSupported( - const ImageProcessing_ColorSpaceInformation* sourceImageInformation, - const ImageProcessing_ColorSpaceInformation* sourceGainmapInformation, - const ImageProcessing_ColorSpaceInformation* destinationImageInformation); + const ImageProcessing_ColorSpaceInfo* sourceImageInfo, + const ImageProcessing_ColorSpaceInfo* sourceGainmapInfo, + const ImageProcessing_ColorSpaceInfo* destinationImageInfo); /** * @brief Query whether the image decomposition is supported. * - * @param sourceImageInformation Input image color space information pointer. - * @param destinationImageInformation Output image color space information pointer. - * @param destinationGainmapInformation Output gainmap information pointer. + * @param sourceImageInfo Input image color space information pointer. + * @param destinationImageInfo Output image color space information pointer. + * @param destinationGainmapInfo Output gainmap information pointer. * @return true if the image decomposition is supported. \n * false if the image decomposition is unsupported. * @since 12 */ bool OH_ImageProcessing_IsDecompositionSupported( - const ImageProcessing_ColorSpaceInformation* sourceImageInformation, - const ImageProcessing_ColorSpaceInformation* destinationImageInformation, - const ImageProcessing_ColorSpaceInformation* destinationGainmapInformation); + const ImageProcessing_ColorSpaceInfo* sourceImageInfo, + const ImageProcessing_ColorSpaceInfo* destinationImageInfo, + const ImageProcessing_ColorSpaceInfo* destinationGainmapInfo); /** * @brief Create an image processing instance. diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index 2c95ee41563..eebca881ea5 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -73,7 +73,7 @@ typedef struct OH_PixelmapNative OH_PixelmapNative; * @see OH_ImageProcessing_Create * @since 12 */ -extern const int32_t IMAGE_PROCESSING_TYPE_COLORSPACE_CONVERSION; +extern const int32_t IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION; /** * @brief Used to create an image processing instance for metadata generation. @@ -94,14 +94,14 @@ extern const int32_t IMAGE_PROCESSING_TYPE_METADATA_GENERATION; * @see OH_ImageProcessing_IsDecompositionSupported * @since 12 */ -typedef struct ImageProcessing_ColorSpaceInformation { +typedef struct ImageProcessing_ColorSpaceInfo { /** define metadata type */ int32_t metadataType; /** define color space, {@link enum OH_NativeBuffer_ColorSpace} */ int32_t colorSpace; /** define pixel format, {@link enum OH_NativeBuffer_Format} */ int32_t pixelFormat; -} ImageProcessing_ColorSpaceInformation; +} ImageProcessing_ColorSpaceInfo; /** * @brief Image processing error code. diff --git a/multimedia/video_processing_engine/libimage_processing.ndk.json b/multimedia/video_processing_engine/libimage_processing.ndk.json index c398c297633..caba0f39565 100644 --- a/multimedia/video_processing_engine/libimage_processing.ndk.json +++ b/multimedia/video_processing_engine/libimage_processing.ndk.json @@ -33,7 +33,7 @@ }, { "first_introduced": "12", - "name": "IMAGE_PROCESSING_TYPE_COLORSPACE_CONVERSION", + "name": "IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION", "type": "variable" }, { diff --git a/multimedia/video_processing_engine/libvideo_processing.ndk.json b/multimedia/video_processing_engine/libvideo_processing.ndk.json index 3a0433448ed..9f9d6480195 100644 --- a/multimedia/video_processing_engine/libvideo_processing.ndk.json +++ b/multimedia/video_processing_engine/libvideo_processing.ndk.json @@ -65,7 +65,7 @@ }, { "first_introduced": "12", - "name": "VIDEO_PROCESSING_TYPE_COLORSPACE_CONVERSION", + "name": "VIDEO_PROCESSING_TYPE_COLOR_SPACE_CONVERSION", "type": "variable" }, { diff --git a/multimedia/video_processing_engine/video_processing.h b/multimedia/video_processing_engine/video_processing.h index 413058d3ceb..6aa7887af05 100644 --- a/multimedia/video_processing_engine/video_processing.h +++ b/multimedia/video_processing_engine/video_processing.h @@ -75,15 +75,15 @@ VideoProcessing_ErrorCode OH_VideoProcessing_DeinitializeEnvironment(); /** * @brief Query if the video color space conversion is supported. * - * @param sourceVideoInformation Source video color space information. - * @param destinationVideoInformation Destination video color space information. + * @param sourceVideoInfo Source video color space information. + * @param destinationVideoInfo Destination video color space information. * @return true if the video color space conversion is supported. \n * false if the video color space conversion is not supported. * @since 12 */ bool OH_VideoProcessing_IsColorSpaceConversionSupported( - const VideoProcessing_ColorSpaceInformation* sourceVideoInformation, - const VideoProcessing_ColorSpaceInformation* destinationVideoInformation); + const VideoProcessing_ColorSpaceInfo* sourceVideoInfo, + const VideoProcessing_ColorSpaceInfo* destinationVideoInfo); /** * @brief Create a video processing instance. diff --git a/multimedia/video_processing_engine/video_processing_types.h b/multimedia/video_processing_engine/video_processing_types.h index 37e23dc3cd3..0e9e2d3ceb9 100644 --- a/multimedia/video_processing_engine/video_processing_types.h +++ b/multimedia/video_processing_engine/video_processing_types.h @@ -68,7 +68,7 @@ typedef struct NativeWindow OHNativeWindow; * @see OH_VideoProcessing_Create * @since 12 */ -extern const int32_t VIDEO_PROCESSING_TYPE_COLORSPACE_CONVERSION; +extern const int32_t VIDEO_PROCESSING_TYPE_COLOR_SPACE_CONVERSION; /** * @brief Used to create a video processing instance for metadata generation. @@ -87,14 +87,14 @@ extern const int32_t VIDEO_PROCESSING_TYPE_METADATA_GENERATION; * @see OH_VideoProcessing_IsColorSpaceConversionSupported * @since 12 */ -typedef struct VideoProcessing_ColorSpaceInformation { +typedef struct VideoProcessing_ColorSpaceInfo { /** The metadata type of the video */ int32_t metadataType; /** The color space type of the video, see {@link enum OH_NativeBuffer_ColorSpace} */ int32_t colorSpace; /** The pixel format of the video, see {@link enum OH_NativeBuffer_Format} */ int32_t pixelFormat; -} VideoProcessing_ColorSpaceInformation; +} VideoProcessing_ColorSpaceInfo; /** * @brief Video processing error code. -- Gitee From b9ad6d101c83f6b68f2b666ffcf94e5b483574f0 Mon Sep 17 00:00:00 2001 From: rchdlee Date: Tue, 7 May 2024 14:36:43 +0800 Subject: [PATCH 11/30] update doc Signed-off-by: rchdlee --- multimedia/video_processing_engine/image_processing.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h index 8a2f73c9acc..e805fd5bb13 100644 --- a/multimedia/video_processing_engine/image_processing.h +++ b/multimedia/video_processing_engine/image_processing.h @@ -31,7 +31,7 @@ * * @library libimage_processing.so * @syscap SystemCapability.Multimedia.VideoProcessingEngine - * @since + * @since 12 */ #ifndef VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_H -- Gitee From bcbb5877337c6edb97682201de657f894092232f Mon Sep 17 00:00:00 2001 From: rchdlee Date: Wed, 8 May 2024 09:55:42 +0800 Subject: [PATCH 12/30] update doc Signed-off-by: rchdlee --- multimedia/video_processing_engine/video_processing.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multimedia/video_processing_engine/video_processing.h b/multimedia/video_processing_engine/video_processing.h index 6aa7887af05..4adf91eef41 100644 --- a/multimedia/video_processing_engine/video_processing.h +++ b/multimedia/video_processing_engine/video_processing.h @@ -93,6 +93,8 @@ bool OH_VideoProcessing_IsColorSpaceConversionSupported( * @param type Use VIDEO_PROCESSING_TYPE_XXX to specify the processing type. The processing type of the instance can not * be changed. * @return {@link VIDEO_PROCESSING_SUCCESS} if creating a video processing instance successfully. \n + * {@link VIDEO_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the type is not supported. For example, if metadata + * generation is not supported by vendor, it returns unsupported processing. \n * {@link VIDEO_PROCESSING_ERROR_CREATE_FAILED} if failed to create a video processing instance. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or *instance is not null. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if type is invalid. -- Gitee From fc09204a88a6a5a31add1ec786f14be465a401a2 Mon Sep 17 00:00:00 2001 From: rchdlee Date: Thu, 9 May 2024 13:30:47 +0800 Subject: [PATCH 13/30] update interfaces Signed-off-by: rchdlee --- multimedia/video_processing_engine/image_processing_types.h | 2 +- multimedia/video_processing_engine/video_processing_types.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index eebca881ea5..fd04fa4ec8c 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -112,7 +112,7 @@ typedef enum ImageProcessing_ErrorCode { /** Operation is successful */ IMAGE_PROCESSING_SUCCESS, /** Some unknown error occurred */ - IMAGE_PROCESSING_ERROR_UNKNOWN, + IMAGE_PROCESSING_ERROR_UNKNOWN = 29200001, /** Initialize global environment for image processing failed */ IMAGE_PROCESSING_ERROR_INITIALIZE_FAILED, /** Create image processing instance failed */ diff --git a/multimedia/video_processing_engine/video_processing_types.h b/multimedia/video_processing_engine/video_processing_types.h index 0e9e2d3ceb9..0b816ba3f47 100644 --- a/multimedia/video_processing_engine/video_processing_types.h +++ b/multimedia/video_processing_engine/video_processing_types.h @@ -105,7 +105,7 @@ typedef enum VideoProcessing_ErrorCode { /** Operation is successful */ VIDEO_PROCESSING_SUCCESS, /** Some unknown error occurred */ - VIDEO_PROCESSING_ERROR_UNKNOWN, + VIDEO_PROCESSING_ERROR_UNKNOWN = 29210001, /** Initializing global environment for video processing failed */ VIDEO_PROCESSING_ERROR_INITIALIZE_FAILED, /** Create video processing instance failed */ -- Gitee From ebc985e4492d7f7269c1fdbafd0d0e69263bcf20 Mon Sep 17 00:00:00 2001 From: rchdlee Date: Thu, 9 May 2024 14:12:56 +0800 Subject: [PATCH 14/30] update interfaces Signed-off-by: rchdlee --- multimedia/video_processing_engine/image_processing_types.h | 4 ++-- multimedia/video_processing_engine/video_processing_types.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index fd04fa4ec8c..e817f123be7 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -111,6 +111,8 @@ typedef struct ImageProcessing_ColorSpaceInfo { typedef enum ImageProcessing_ErrorCode { /** Operation is successful */ IMAGE_PROCESSING_SUCCESS, + /** Parameter is invalid */ + IMAGE_PROCESSING_ERROR_INVALID_PARAMETER = 401, /** Some unknown error occurred */ IMAGE_PROCESSING_ERROR_UNKNOWN = 29200001, /** Initialize global environment for image processing failed */ @@ -127,8 +129,6 @@ typedef enum ImageProcessing_ErrorCode { IMAGE_PROCESSING_ERROR_NO_MEMORY, /** Image processing instance is invalid */ IMAGE_PROCESSING_ERROR_INVALID_INSTANCE, - /** Parameter is invalid */ - IMAGE_PROCESSING_ERROR_INVALID_PARAMETER, /** Value is invalid. */ IMAGE_PROCESSING_ERROR_INVALID_VALUE } ImageProcessing_ErrorCode; diff --git a/multimedia/video_processing_engine/video_processing_types.h b/multimedia/video_processing_engine/video_processing_types.h index 0b816ba3f47..9fc8998435b 100644 --- a/multimedia/video_processing_engine/video_processing_types.h +++ b/multimedia/video_processing_engine/video_processing_types.h @@ -104,6 +104,8 @@ typedef struct VideoProcessing_ColorSpaceInfo { typedef enum VideoProcessing_ErrorCode { /** Operation is successful */ VIDEO_PROCESSING_SUCCESS, + /** Parameter is invalid. */ + VIDEO_PROCESSING_ERROR_INVALID_PARAMETER = 401, /** Some unknown error occurred */ VIDEO_PROCESSING_ERROR_UNKNOWN = 29210001, /** Initializing global environment for video processing failed */ @@ -120,8 +122,6 @@ typedef enum VideoProcessing_ErrorCode { VIDEO_PROCESSING_ERROR_NO_MEMORY, /** Video processing instance is invalid */ VIDEO_PROCESSING_ERROR_INVALID_INSTANCE, - /** Parameter is invalid. */ - VIDEO_PROCESSING_ERROR_INVALID_PARAMETER, /** Value is invalid */ VIDEO_PROCESSING_ERROR_INVALID_VALUE } VideoProcessing_ErrorCode; -- Gitee From 66f1465ba03a1b25536a0eefb8bae6800f298321 Mon Sep 17 00:00:00 2001 From: rchdlee Date: Thu, 9 May 2024 14:44:24 +0800 Subject: [PATCH 15/30] update files Signed-off-by: rchdlee --- .../{ => image_processing}/BUILD.gn | 27 +++----------- .../libimage_processing.ndk.json | 0 .../video_processing/BUILD.gn | 35 +++++++++++++++++++ .../libvideo_processing.ndk.json | 0 4 files changed, 39 insertions(+), 23 deletions(-) rename multimedia/video_processing_engine/{ => image_processing}/BUILD.gn (62%) rename multimedia/video_processing_engine/{ => image_processing}/libimage_processing.ndk.json (100%) create mode 100644 multimedia/video_processing_engine/video_processing/BUILD.gn rename multimedia/video_processing_engine/{ => video_processing}/libvideo_processing.ndk.json (100%) diff --git a/multimedia/video_processing_engine/BUILD.gn b/multimedia/video_processing_engine/image_processing/BUILD.gn similarity index 62% rename from multimedia/video_processing_engine/BUILD.gn rename to multimedia/video_processing_engine/image_processing/BUILD.gn index f746ec798cb..d83d40c712e 100644 --- a/multimedia/video_processing_engine/BUILD.gn +++ b/multimedia/video_processing_engine/image_processing/BUILD.gn @@ -12,12 +12,13 @@ # limitations under the License. import("//build/ohos.gni") +import("//build/ohos/ndk/ndk.gni") ohos_ndk_headers("image_processing_ndk_headers") { dest_dir = "$ndk_headers_out_dir/multimedia/video_processing_engine" sources = [ - "./image_processing.h", - "./image_processing_types.h", + "../image_processing.h", + "../image_processing_types.h", ] } @@ -31,24 +32,4 @@ ohos_ndk_library("libimage_processing_ndk") { "multimedia/video_processing_engine/image_processing_types.h", "multimedia/video_processing_engine/image_processing.h", ] -} - -ohos_ndk_headers("video_processing_ndk_headers") { - dest_dir = "$ndk_headers_out_dir/multimedia/video_processing_engine" - sources = [ - "./video_processing.h", - "./video_processing_types.h", - ] -} - -ohos_ndk_library("libvideo_processing_ndk") { - ndk_description_file = "./libvideo_processing.ndk.json" - output_name = "video_processing" - output_extension = "so" - min_compact_version = "12" - system_capability = "SystemCapability.Multimedia.VideoProcessingEngine" - system_capability_headers = [ - "multimedia/video_processing_engine/video_processing_types.h", - "multimedia/video_processing_engine/video_processing.h", - ] -} +} \ No newline at end of file diff --git a/multimedia/video_processing_engine/libimage_processing.ndk.json b/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json similarity index 100% rename from multimedia/video_processing_engine/libimage_processing.ndk.json rename to multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json diff --git a/multimedia/video_processing_engine/video_processing/BUILD.gn b/multimedia/video_processing_engine/video_processing/BUILD.gn new file mode 100644 index 00000000000..c1eb534aa10 --- /dev/null +++ b/multimedia/video_processing_engine/video_processing/BUILD.gn @@ -0,0 +1,35 @@ +# Copyright (c) 2024 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") + +ohos_ndk_headers("video_processing_ndk_headers") { + dest_dir = "$ndk_headers_out_dir/multimedia/video_processing_engine" + sources = [ + "../video_processing.h", + "../video_processing_types.h", + ] +} + +ohos_ndk_library("libvideo_processing_ndk") { + ndk_description_file = "./libvideo_processing.ndk.json" + output_name = "video_processing" + output_extension = "so" + min_compact_version = "12" + system_capability = "SystemCapability.Multimedia.VideoProcessingEngine" + system_capability_headers = [ + "multimedia/video_processing_engine/video_processing_types.h", + "multimedia/video_processing_engine/video_processing.h", + ] +} \ No newline at end of file diff --git a/multimedia/video_processing_engine/libvideo_processing.ndk.json b/multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json similarity index 100% rename from multimedia/video_processing_engine/libvideo_processing.ndk.json rename to multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json -- Gitee From 31f8bad456e9092ab5afcb5a1fa2ab5279088e1b Mon Sep 17 00:00:00 2001 From: rchdlee Date: Mon, 13 May 2024 10:05:36 +0800 Subject: [PATCH 16/30] update format Signed-off-by: rchdlee --- multimedia/video_processing_engine/image_processing/BUILD.gn | 2 +- multimedia/video_processing_engine/video_processing/BUILD.gn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing/BUILD.gn b/multimedia/video_processing_engine/image_processing/BUILD.gn index d83d40c712e..d3c02809bee 100644 --- a/multimedia/video_processing_engine/image_processing/BUILD.gn +++ b/multimedia/video_processing_engine/image_processing/BUILD.gn @@ -32,4 +32,4 @@ ohos_ndk_library("libimage_processing_ndk") { "multimedia/video_processing_engine/image_processing_types.h", "multimedia/video_processing_engine/image_processing.h", ] -} \ No newline at end of file +} diff --git a/multimedia/video_processing_engine/video_processing/BUILD.gn b/multimedia/video_processing_engine/video_processing/BUILD.gn index c1eb534aa10..0dc56d02583 100644 --- a/multimedia/video_processing_engine/video_processing/BUILD.gn +++ b/multimedia/video_processing_engine/video_processing/BUILD.gn @@ -32,4 +32,4 @@ ohos_ndk_library("libvideo_processing_ndk") { "multimedia/video_processing_engine/video_processing_types.h", "multimedia/video_processing_engine/video_processing.h", ] -} \ No newline at end of file +} -- Gitee From d364211e54f4e62ee67108cf6b497d19ea17ce2f Mon Sep 17 00:00:00 2001 From: xuedong Date: Sat, 18 May 2024 16:39:23 +0800 Subject: [PATCH 17/30] update interfaces Signed-off-by: xuedong --- .../image_processing.h | 33 ++++++++++++- .../image_processing_types.h | 49 ++++++++++++++++++- .../video_processing.h | 33 ++++++++++++- .../video_processing_types.h | 49 ++++++++++++++++++- 4 files changed, 160 insertions(+), 4 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h index e805fd5bb13..78f3538fcc3 100644 --- a/multimedia/video_processing_engine/image_processing.h +++ b/multimedia/video_processing_engine/image_processing.h @@ -146,6 +146,37 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Create(OH_ImageProcessing** instanc */ ImageProcessing_ErrorCode OH_ImageProcessing_Destroy(OH_ImageProcessing* instance); +/** + * @brief Set parameter. which will be used by {@link OH_ImageProcessing_Process}. + * + * Adds parameter identified by the specified keyword. The parameter will be used by {@link OH_ImageProcessing_Process}. + * + * @param instance An image processing instance pointer. + * @param parameter The parameter used by {@link OH_ImageProcessing_Process}. + * @return {@link IMAGE_PROCESSING_SUCCESS} if setting parameter is successful. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the parameter is null. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_VALUE} if some property of the parameter is invalid. For example, the parameter + * contains unsupported keyword or value. \n + * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_SetParameter(OH_ImageProcessing* instance, const OH_AVFormat* parameter); + +/** + * @brief Get parameter. + * + * Gets parameter identified by the specified keyword. + * + * @param instance An image processing instance pointer. + * @param parameter The parameter which has been set before. + * @return {@link IMAGE_PROCESSING_SUCCESS} if getting parameter is successful. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the parameter is null. \n + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* instance, OH_AVFormat* parameter); + /** * @brief Process image. * @@ -174,4 +205,4 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Process(OH_ImageProcessing* instanc #endif #endif // VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_H -/** @} */ \ No newline at end of file +/** @} */ diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index e817f123be7..9148eebefe3 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -59,6 +59,13 @@ typedef struct OH_ImageProcessing OH_ImageProcessing; */ typedef struct OH_PixelmapNative OH_PixelmapNative; +/** + * @brief Forward declaration of OH_AVFormat. + * + * @since 12 + */ +typedef struct OH_AVFormat OH_AVFormat; + /** * @brief Used to create an image processing instance for color space conversion. * @@ -86,6 +93,28 @@ extern const int32_t IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION; */ extern const int32_t IMAGE_PROCESSING_TYPE_METADATA_GENERATION; +/** + * @brief Used to create an image processing instance for detail enhancement. + * + * Scale images with specified qualities or just enhance detail for rendering an image. + * + * @see OH_ImageProcessing_Create + * @since 12 + */ +extern const int32_t IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER; + +/** + * @brief The keyword used to specify quality level for detail enhancement. + * + * Use {@link OH_ImageProcessing_SetParameter} to set the quality level. + * Use {@link OH_ImageProcessing_GetParameter} to get the current quality level. + * + * @see OH_ImageProcessing_SetParameter + * @see OH_ImageProcessing_GetParameter + * @since 12 + */ +extern const char* IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL; + /** * @brief The color space information is used for color space conversion capability query. * @@ -103,6 +132,24 @@ typedef struct ImageProcessing_ColorSpaceInfo { int32_t pixelFormat; } ImageProcessing_ColorSpaceInfo; +/** + * @brief The quatily level is used for detail enhancement. + * + * @see OH_ImageProcessing_SetParameter + * @see OH_ImageProcessing_GetParameter + * @since 12 + */ +typedef enum ImageDetailEnhancer_QualityLevel { + /** No detail enhancement */ + IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_NONE, + /** A low level of detail enhancement quality. It's the default level */ + IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_LOW, + /** A medium level of detail enhancement quality */ + IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_MEDIUM, + /** A high level of detail enhancement quality */ + IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_HIGH, +} ImageDetailEnhancer_QualityLevel; + /** * @brief Image processing error code. * @@ -138,4 +185,4 @@ typedef enum ImageProcessing_ErrorCode { #endif #endif // VIDEO_PROCESSING_ENGINE_C_API_IMAGE_PROCESSING_TYPES_H -/** @} */ \ No newline at end of file +/** @} */ diff --git a/multimedia/video_processing_engine/video_processing.h b/multimedia/video_processing_engine/video_processing.h index 4adf91eef41..0fd4447119e 100644 --- a/multimedia/video_processing_engine/video_processing.h +++ b/multimedia/video_processing_engine/video_processing.h @@ -164,6 +164,37 @@ VideoProcessing_ErrorCode OH_VideoProcessing_SetSurface(OH_VideoProcessing* inst */ VideoProcessing_ErrorCode OH_VideoProcessing_GetSurface(OH_VideoProcessing* instance, OHNativeWindow** window); +/** + * @brief Set parameter. + * + * Adds parameter identified by the specified keyword. + * + * @param instance An video processing instance pointer. + * @param parameter The parameter used video processing. + * @return {@link VIDEO_PROCESSING_SUCCESS} if setting parameter is successful. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if the parameter is null. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_VALUE} if some property of the parameter is invalid. For example, the parameter + * contains unsupported keyword or value. \n + * {@link VIDEO_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_SetParameter(OH_VideoProcessing* instance, const OH_AVFormat* parameter); + +/** + * @brief Get parameter. + * + * Gets parameter identified by the specified keyword. + * + * @param instance An video processing instance pointer. + * @param parameter The parameter which has been set before. + * @return {@link VIDEO_PROCESSING_SUCCESS} if getting parameter is successful. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an video processing instance. \n + * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if the parameter is null. \n + * @since 12 + */ +VideoProcessing_ErrorCode OH_VideoProcessing_GetParameter(OH_VideoProcessing* instance, OH_AVFormat* parameter); + /** * @brief Start video processing instance. * @@ -276,4 +307,4 @@ VideoProcessing_ErrorCode OH_VideoProcessingCallback_BindOnNewOutputBuffer(Video #endif #endif // VIDEO_PROCESSING_ENGINE_C_API_VIDEO_PROCESSING_H -/** @} */ \ No newline at end of file +/** @} */ diff --git a/multimedia/video_processing_engine/video_processing_types.h b/multimedia/video_processing_engine/video_processing_types.h index 9fc8998435b..52afe97ee97 100644 --- a/multimedia/video_processing_engine/video_processing_types.h +++ b/multimedia/video_processing_engine/video_processing_types.h @@ -59,6 +59,13 @@ typedef struct OH_VideoProcessing OH_VideoProcessing; */ typedef struct NativeWindow OHNativeWindow; +/** + * @brief Forward declaration of OH_AVFormat. + * + * @since 12 + */ +typedef struct OH_AVFormat OH_AVFormat; + /** * @brief Used to create a video processing instance for color space conversion. * @@ -81,6 +88,28 @@ extern const int32_t VIDEO_PROCESSING_TYPE_COLOR_SPACE_CONVERSION; */ extern const int32_t VIDEO_PROCESSING_TYPE_METADATA_GENERATION; +/** + * @brief Used to create an video processing instance for detail enhancement. + * + * Scale video with specified qualities. + * + * @see OH_ImageProcessing_Create + * @since 12 + */ +extern const int32_t VIDEO_PROCESSING_TYPE_DETAIL_ENHANCER; + +/** + * @brief The keyword used to specify quality level for detail enhancement. + * + * Use {@link OH_VideoProcessing_SetParameter} to set the quality level. + * Use {@link OH_VideoProcessing_GetParameter} to get the current quality level. + * + * @see OH_VideoProcessing_SetParameter + * @see OH_VideoProcessing_GetParameter + * @since 12 + */ +extern const char* VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL; + /** * @brief Video color space information structure of querying if video color space conversion is supported. * @@ -96,6 +125,24 @@ typedef struct VideoProcessing_ColorSpaceInfo { int32_t pixelFormat; } VideoProcessing_ColorSpaceInfo; +/** + * @brief The quatily level is used for detail enhancement. + * + * @see OH_VideoProcessing_SetParameter + * @see OH_VideoProcessing_GetParameter + * @since 12 + */ +typedef enum VideoDetailEnhancer_QualityLevel { + /** No detail enhancement */ + VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_NONE, + /** A low level of detail enhancement quality. It's the default level */ + VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_LOW, + /** A medium level of detail enhancement quality */ + VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_MEDIUM, + /** A high level of detail enhancement quality */ + VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_HIGH, +} VideoDetailEnhancer_QualityLevel; + /** * @brief Video processing error code. * @@ -208,4 +255,4 @@ typedef void (*OH_VideoProcessingCallback_OnNewOutputBuffer)(OH_VideoProcessing* #endif #endif // VIDEO_PROCESSING_ENGINE_C_API_VIDEO_PROCESSING_TYPES_H -/** @} */ \ No newline at end of file +/** @} */ -- Gitee From 060575c4562a6f01a7c87448c51093772cedeff5 Mon Sep 17 00:00:00 2001 From: xuedong Date: Sat, 18 May 2024 16:39:23 +0800 Subject: [PATCH 18/30] update interfaces Signed-off-by: xuedong --- .../image_processing/libimage_processing.ndk.json | 13 +++++++++++++ .../video_processing/libvideo_processing.ndk.json | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json b/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json index caba0f39565..e2ad4e7f2f1 100644 --- a/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json +++ b/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json @@ -27,6 +27,14 @@ "first_introduced": "12", "name": "OH_ImageProcessing_Destroy" }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_SetParameter" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_GetParameter" + }, { "first_introduced": "12", "name": "OH_ImageProcessing_Process" @@ -40,5 +48,10 @@ "first_introduced": "12", "name": "IMAGE_PROCESSING_TYPE_METADATA_GENERATION", "type": "variable" + }, + { + "first_introduced": "12", + "name": "IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER", + "type": "variable" } ] diff --git a/multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json b/multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json index 9f9d6480195..d67026acfe6 100644 --- a/multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json +++ b/multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json @@ -31,6 +31,14 @@ "first_introduced": "12", "name": "OH_VideoProcessing_GetSurface" }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_SetParameter" + }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_GetParameter" + }, { "first_introduced": "12", "name": "OH_VideoProcessing_Start" @@ -72,5 +80,10 @@ "first_introduced": "12", "name": "VIDEO_PROCESSING_TYPE_METADATA_GENERATION", "type": "variable" + }, + { + "first_introduced": "12", + "name": "VIDEO_PROCESSING_TYPE_DETAIL_ENHANCER", + "type": "variable" } ] -- Gitee From b2b55574a040673b5074315aaf36c2dd60e53b6b Mon Sep 17 00:00:00 2001 From: rchdlee Date: Mon, 20 May 2024 14:12:02 +0800 Subject: [PATCH 19/30] update docs Signed-off-by: rchdlee --- .../video_processing_engine/image_processing.h | 14 +++++++------- .../image_processing_types.h | 11 ++++++----- .../video_processing_engine/video_processing.h | 14 +++++++------- .../video_processing_types.h | 13 +++++++------ 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h index 78f3538fcc3..4f04a5d162c 100644 --- a/multimedia/video_processing_engine/image_processing.h +++ b/multimedia/video_processing_engine/image_processing.h @@ -147,29 +147,29 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Create(OH_ImageProcessing** instanc ImageProcessing_ErrorCode OH_ImageProcessing_Destroy(OH_ImageProcessing* instance); /** - * @brief Set parameter. which will be used by {@link OH_ImageProcessing_Process}. + * @brief Set parameter for image processing. * - * Adds parameter identified by the specified keyword. The parameter will be used by {@link OH_ImageProcessing_Process}. + * Add parameter identified by the specified parameter key. * * @param instance An image processing instance pointer. - * @param parameter The parameter used by {@link OH_ImageProcessing_Process}. + * @param parameter The parameter for image processing. * @return {@link IMAGE_PROCESSING_SUCCESS} if setting parameter is successful. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the parameter is null. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_VALUE} if some property of the parameter is invalid. For example, the parameter - * contains unsupported keyword or value. \n + * contains unsupported parameter key or value. \n * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ ImageProcessing_ErrorCode OH_ImageProcessing_SetParameter(OH_ImageProcessing* instance, const OH_AVFormat* parameter); /** - * @brief Get parameter. + * @brief Get parameter of image processing. * - * Gets parameter identified by the specified keyword. + * Get parameter identified by the specified parameter key. * * @param instance An image processing instance pointer. - * @param parameter The parameter which has been set before. + * @param parameter The parameter used by the image processing instance. * @return {@link IMAGE_PROCESSING_SUCCESS} if getting parameter is successful. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the parameter is null. \n diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index 9148eebefe3..8670c50b7c3 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -96,7 +96,7 @@ extern const int32_t IMAGE_PROCESSING_TYPE_METADATA_GENERATION; /** * @brief Used to create an image processing instance for detail enhancement. * - * Scale images with specified qualities or just enhance detail for rendering an image. + * Scale image with specified quality or just enhance detail for rendering an image. * * @see OH_ImageProcessing_Create * @since 12 @@ -104,13 +104,12 @@ extern const int32_t IMAGE_PROCESSING_TYPE_METADATA_GENERATION; extern const int32_t IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER; /** - * @brief The keyword used to specify quality level for detail enhancement. + * @brief The key is used to specify quality level for image detail enhancement. * + * See {@link ImageDetailEnhancer_QualityLevel} for values. * Use {@link OH_ImageProcessing_SetParameter} to set the quality level. * Use {@link OH_ImageProcessing_GetParameter} to get the current quality level. * - * @see OH_ImageProcessing_SetParameter - * @see OH_ImageProcessing_GetParameter * @since 12 */ extern const char* IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL; @@ -133,7 +132,9 @@ typedef struct ImageProcessing_ColorSpaceInfo { } ImageProcessing_ColorSpaceInfo; /** - * @brief The quatily level is used for detail enhancement. + * @brief The quality level is used for detail enhancement. + * + * It is the value for parameter key {@link IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL}. * * @see OH_ImageProcessing_SetParameter * @see OH_ImageProcessing_GetParameter diff --git a/multimedia/video_processing_engine/video_processing.h b/multimedia/video_processing_engine/video_processing.h index 0fd4447119e..cd8a020c8c3 100644 --- a/multimedia/video_processing_engine/video_processing.h +++ b/multimedia/video_processing_engine/video_processing.h @@ -165,29 +165,29 @@ VideoProcessing_ErrorCode OH_VideoProcessing_SetSurface(OH_VideoProcessing* inst VideoProcessing_ErrorCode OH_VideoProcessing_GetSurface(OH_VideoProcessing* instance, OHNativeWindow** window); /** - * @brief Set parameter. + * @brief Set parameter for video processing. * - * Adds parameter identified by the specified keyword. + * Add parameter identified by the specified parameter key. * * @param instance An video processing instance pointer. - * @param parameter The parameter used video processing. + * @param parameter The parameter for video processing. * @return {@link VIDEO_PROCESSING_SUCCESS} if setting parameter is successful. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an video processing instance. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if the parameter is null. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_VALUE} if some property of the parameter is invalid. For example, the parameter - * contains unsupported keyword or value. \n + * contains unsupported parameter key or value. \n * {@link VIDEO_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ VideoProcessing_ErrorCode OH_VideoProcessing_SetParameter(OH_VideoProcessing* instance, const OH_AVFormat* parameter); /** - * @brief Get parameter. + * @brief Get parameter of video processing. * - * Gets parameter identified by the specified keyword. + * Get parameter identified by the specified parameter key. * * @param instance An video processing instance pointer. - * @param parameter The parameter which has been set before. + * @param parameter The parameter used by the video processing instance. * @return {@link VIDEO_PROCESSING_SUCCESS} if getting parameter is successful. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an video processing instance. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if the parameter is null. \n diff --git a/multimedia/video_processing_engine/video_processing_types.h b/multimedia/video_processing_engine/video_processing_types.h index 52afe97ee97..4a2dbb6b0a2 100644 --- a/multimedia/video_processing_engine/video_processing_types.h +++ b/multimedia/video_processing_engine/video_processing_types.h @@ -89,9 +89,9 @@ extern const int32_t VIDEO_PROCESSING_TYPE_COLOR_SPACE_CONVERSION; extern const int32_t VIDEO_PROCESSING_TYPE_METADATA_GENERATION; /** - * @brief Used to create an video processing instance for detail enhancement. + * @brief Used to create an video processing instance of detail enhancement. * - * Scale video with specified qualities. + * Scale video with specified quality. * * @see OH_ImageProcessing_Create * @since 12 @@ -99,13 +99,12 @@ extern const int32_t VIDEO_PROCESSING_TYPE_METADATA_GENERATION; extern const int32_t VIDEO_PROCESSING_TYPE_DETAIL_ENHANCER; /** - * @brief The keyword used to specify quality level for detail enhancement. + * @brief The key is used to specify quality level for video detail enhancement. * + * See {@link VideoDetailEnhancer_QualityLevel} for values. * Use {@link OH_VideoProcessing_SetParameter} to set the quality level. * Use {@link OH_VideoProcessing_GetParameter} to get the current quality level. * - * @see OH_VideoProcessing_SetParameter - * @see OH_VideoProcessing_GetParameter * @since 12 */ extern const char* VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL; @@ -126,7 +125,9 @@ typedef struct VideoProcessing_ColorSpaceInfo { } VideoProcessing_ColorSpaceInfo; /** - * @brief The quatily level is used for detail enhancement. + * @brief The quality level is used for detail enhancement. + * + * It is the value for parameter key {@link VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL}. * * @see OH_VideoProcessing_SetParameter * @see OH_VideoProcessing_GetParameter -- Gitee From c49cf28dd7fa450ae08babe86aec9d3d784f763e Mon Sep 17 00:00:00 2001 From: xuedong Date: Tue, 21 May 2024 14:50:37 +0800 Subject: [PATCH 20/30] update docs Signed-off-by: xuedong --- .../video_processing_engine/image_processing.h | 4 ++-- .../image_processing_types.h | 17 ++++++++++------- .../video_processing_engine/video_processing.h | 4 ++-- .../video_processing_types.h | 17 ++++++++++------- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h index 4f04a5d162c..eb8ab8cdb3c 100644 --- a/multimedia/video_processing_engine/image_processing.h +++ b/multimedia/video_processing_engine/image_processing.h @@ -57,7 +57,7 @@ extern "C" { * {@link IMAGE_PROCESSING_ERROR_INITIALIZE_FAILED} if initialization is failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_InitializeEnvironment(); +ImageProcessing_ErrorCode OH_ImageProcessing_InitializeEnvironment(void); /** * @brief Deinitialize global environment for image processing. @@ -73,7 +73,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_InitializeEnvironment(); * {@link OH_ImageProcessing_InitializeEnvironment} is not called. \n * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_DeinitializeEnvironment(); +ImageProcessing_ErrorCode OH_ImageProcessing_DeinitializeEnvironment(void); /** * @brief Query whether the image color space conversion is supported. diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index 8670c50b7c3..4831b9dcc8e 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -96,7 +96,8 @@ extern const int32_t IMAGE_PROCESSING_TYPE_METADATA_GENERATION; /** * @brief Used to create an image processing instance for detail enhancement. * - * Scale image with specified quality or just enhance detail for rendering an image. + * Scale or resize images with the specified quality or just enhance details for rendering an image without changing + * its resolution. * * @see OH_ImageProcessing_Create * @since 12 @@ -104,12 +105,14 @@ extern const int32_t IMAGE_PROCESSING_TYPE_METADATA_GENERATION; extern const int32_t IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER; /** - * @brief The key is used to specify quality level for image detail enhancement. + * @brief The key is used to specify the quality level for image detail enhancement. * - * See {@link ImageDetailEnhancer_QualityLevel} for values. + * See {@link ImageDetailEnhancer_QualityLevel} for its value. * Use {@link OH_ImageProcessing_SetParameter} to set the quality level. * Use {@link OH_ImageProcessing_GetParameter} to get the current quality level. * + * @see OH_VideoProcessing_SetParameter + * @see OH_VideoProcessing_GetParameter * @since 12 */ extern const char* IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL; @@ -134,7 +137,7 @@ typedef struct ImageProcessing_ColorSpaceInfo { /** * @brief The quality level is used for detail enhancement. * - * It is the value for parameter key {@link IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL}. + * It is the value of the key parameter {@link IMAGE_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL}. * * @see OH_ImageProcessing_SetParameter * @see OH_ImageProcessing_GetParameter @@ -143,11 +146,11 @@ typedef struct ImageProcessing_ColorSpaceInfo { typedef enum ImageDetailEnhancer_QualityLevel { /** No detail enhancement */ IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_NONE, - /** A low level of detail enhancement quality. It's the default level */ + /** A low level of detail enhancement quality but with a fast speed. It's the default level */ IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_LOW, - /** A medium level of detail enhancement quality */ + /** A medium level of detail enhancement quality. Its speed is between the low setting and high setting */ IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_MEDIUM, - /** A high level of detail enhancement quality */ + /** A high level of detail enhancement quality but with a relatively slow speed */ IMAGE_DETAIL_ENHANCER_QUALITY_LEVEL_HIGH, } ImageDetailEnhancer_QualityLevel; diff --git a/multimedia/video_processing_engine/video_processing.h b/multimedia/video_processing_engine/video_processing.h index cd8a020c8c3..34e4c2fdc72 100644 --- a/multimedia/video_processing_engine/video_processing.h +++ b/multimedia/video_processing_engine/video_processing.h @@ -54,7 +54,7 @@ extern "C" { * {@link VIDEO_PROCESSING_ERROR_INITIALIZE_FAILED} if initialization is failed. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_InitializeEnvironment(); +VideoProcessing_ErrorCode OH_VideoProcessing_InitializeEnvironment(void); /** * @brief Deinitialize global environment for video processing. @@ -70,7 +70,7 @@ VideoProcessing_ErrorCode OH_VideoProcessing_InitializeEnvironment(); * {@link OH_VideoProcessing_InitializeEnvironment} is not called. \n * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_DeinitializeEnvironment(); +VideoProcessing_ErrorCode OH_VideoProcessing_DeinitializeEnvironment(void); /** * @brief Query if the video color space conversion is supported. diff --git a/multimedia/video_processing_engine/video_processing_types.h b/multimedia/video_processing_engine/video_processing_types.h index 4a2dbb6b0a2..ea3af2258bc 100644 --- a/multimedia/video_processing_engine/video_processing_types.h +++ b/multimedia/video_processing_engine/video_processing_types.h @@ -91,7 +91,8 @@ extern const int32_t VIDEO_PROCESSING_TYPE_METADATA_GENERATION; /** * @brief Used to create an video processing instance of detail enhancement. * - * Scale video with specified quality. + * Scale or resize video with the specified quality or just enhance details for rendering without changing its + * resolution. * * @see OH_ImageProcessing_Create * @since 12 @@ -99,12 +100,14 @@ extern const int32_t VIDEO_PROCESSING_TYPE_METADATA_GENERATION; extern const int32_t VIDEO_PROCESSING_TYPE_DETAIL_ENHANCER; /** - * @brief The key is used to specify quality level for video detail enhancement. + * @brief The key is used to specify the quality level for video detail enhancement. * - * See {@link VideoDetailEnhancer_QualityLevel} for values. + * See {@link VideoDetailEnhancer_QualityLevel} for its values. * Use {@link OH_VideoProcessing_SetParameter} to set the quality level. * Use {@link OH_VideoProcessing_GetParameter} to get the current quality level. * + * @see OH_VideoProcessing_SetParameter + * @see OH_VideoProcessing_GetParameter * @since 12 */ extern const char* VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL; @@ -127,7 +130,7 @@ typedef struct VideoProcessing_ColorSpaceInfo { /** * @brief The quality level is used for detail enhancement. * - * It is the value for parameter key {@link VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL}. + * It is the value of the key parameter {@link VIDEO_DETAIL_ENHANCER_PARAMETER_KEY_QUALITY_LEVEL}. * * @see OH_VideoProcessing_SetParameter * @see OH_VideoProcessing_GetParameter @@ -136,11 +139,11 @@ typedef struct VideoProcessing_ColorSpaceInfo { typedef enum VideoDetailEnhancer_QualityLevel { /** No detail enhancement */ VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_NONE, - /** A low level of detail enhancement quality. It's the default level */ + /** A low level of detail enhancement quality but with a fast speed. It's the default level */ VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_LOW, - /** A medium level of detail enhancement quality */ + /** A medium level of detail enhancement quality. Its speed is between the low setting and high setting */ VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_MEDIUM, - /** A high level of detail enhancement quality */ + /** A high level of detail enhancement quality but with a relatively slow speed */ VIDEO_DETAIL_ENHANCER_QUALITY_LEVEL_HIGH, } VideoDetailEnhancer_QualityLevel; -- Gitee From dc25cf09be4a1c0568e0f0239dbdeedcc61c2580 Mon Sep 17 00:00:00 2001 From: liushang Date: Fri, 5 Jul 2024 10:33:33 +0800 Subject: [PATCH 21/30] add compose and decompose Signed-off-by: liushang --- .../image_processing.h | 100 +++++++++++++++++- .../image_processing_types.h | 33 ++++-- .../video_processing.h | 11 ++ 3 files changed, 134 insertions(+), 10 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h index eb8ab8cdb3c..6262f9f5fff 100644 --- a/multimedia/video_processing_engine/image_processing.h +++ b/multimedia/video_processing_engine/image_processing.h @@ -118,6 +118,17 @@ bool OH_ImageProcessing_IsDecompositionSupported( const ImageProcessing_ColorSpaceInfo* destinationImageInfo, const ImageProcessing_ColorSpaceInfo* destinationGainmapInfo); +/** + * @brief Query whether the image metadata generation is supported. + * + * @param sourceImageInfo Input image color space information pointer. + * @return true if the image metadata generation is supported.. \n + * false if the image metadata generation is unsupported. + * @since 12 + */ +bool OH_ImageProcessing_IsMetadataGenerationSupported( + const ImageProcessing_ColorSpaceInfo* sourceImageInfo); + /** * @brief Create an image processing instance. * @@ -178,11 +189,9 @@ ImageProcessing_ErrorCode OH_ImageProcessing_SetParameter(OH_ImageProcessing* in ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* instance, OH_AVFormat* parameter); /** - * @brief Process image. + * @brief Conversion between single-layer images. * * The processing type is specified when creating the instance. - * For color space conversion, it includes the conversion between single-layer images, composition from dual-layer HDR - * images to single-layer HDR images, and decomposition from single-layer image to dual-layer HDR image. * * @param instance An image processing instance pointer. * @param sourceImage Input image pointer. @@ -197,9 +206,92 @@ ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* in * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_Process(OH_ImageProcessing* instance, OH_PixelmapNative* sourceImage, +ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessing* instance, const OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage); +/** + * @brief Composition from dual-layer HDR images to single-layer HDR images. + * + * The processing type is specified when creating the instance. + * + * @param instance An image processing instance pointer. + * @param sourceImage Input image pointer. + * @param sourceGainmap Input gainmap pointer. + * @param destinationImage Output image pointer. + * @return {@link IMAGE_PROCESSING_SUCCESS} if processing image is successful. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the image is null. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_VALUE} if some property of image is invalid. For example, the color space + * of the image is unsupported. \n + * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the processing is not supported. \n + * {@link IMAGE_PROCESSING_ERROR_PROCESS_FAILED} if processing error occurs. \n + * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* instance, const OH_PixelmapNative* sourceImage, + const OH_PixelmapNative* sourceGainmap, OH_PixelmapNative* destinationImage); + +/** + * @brief Decomposition from single-layer HDR images to dual-layer HDR images. + * + * The processing type is specified when creating the instance. + * + * @param instance An image processing instance pointer. + * @param sourceImage Input image pointer. + * @param destinationImage Output image pointer. + * @param destinationGainmap Output gainmap pointer. + * @return {@link IMAGE_PROCESSING_SUCCESS} if processing image is successful. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the image is null. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_VALUE} if some property of image is invalid. For example, the color space + * of the image is unsupported. \n + * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the processing is not supported. \n + * {@link IMAGE_PROCESSING_ERROR_PROCESS_FAILED} if processing error occurs. \n + * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_Deompose(OH_ImageProcessing* instance, const OH_PixelmapNative* sourceImage, + OH_PixelmapNative* destinationImage, OH_PixelmapNative* destinationGainmap); + +/** + * @brief Generation for HDR images. + * + * The processing type is specified when creating the instance. + * + * @param instance An image processing instance pointer. + * @param sourceImage Input image pointer. + * @return {@link IMAGE_PROCESSING_SUCCESS} if processing image is successful. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the image is null. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_VALUE} if some property of image is invalid. For example, the color space + * of the image is unsupported. \n + * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the processing is not supported. \n + * {@link IMAGE_PROCESSING_ERROR_PROCESS_FAILED} if processing error occurs. \n + * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing* instance, OH_PixelmapNative* sourceImage); + +/** + * @brief enhancement for images. + * + * The processing type is specified when creating the instance. + * + * @param instance An image processing instance pointer. + * @param sourceImage Input image pointer. + * @param destinationImage Output image pointer. + * @return {@link IMAGE_PROCESSING_SUCCESS} if processing image is successful. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the image is null. \n + * {@link IMAGE_PROCESSING_ERROR_INVALID_VALUE} if some property of image is invalid. For example, the color space + * of the image is unsupported. \n + * {@link IMAGE_PROCESSING_ERROR_UNSUPPORTED_PROCESSING} if the processing is not supported. \n + * {@link IMAGE_PROCESSING_ERROR_PROCESS_FAILED} if processing error occurs. \n + * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. + * @since 12 + */ +ImageProcessing_ErrorCode OH_ImageProcessing_EnhanceDetail(OH_ImageProcessing* instance, const OH_PixelmapNative* sourceImage, + OH_PixelmapNative* destinationImage); #ifdef __cplusplus } #endif diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index 4831b9dcc8e..e072cc6c12a 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -69,19 +69,40 @@ typedef struct OH_AVFormat OH_AVFormat; /** * @brief Used to create an image processing instance for color space conversion. * - * Color space conversion includes the conversion between dual-layer HDR images and single-layer HDR images, - * as well as the color space conversion of SDR images, and the conversion of SDR images to HDR images. Some + * Color space conversion includes the conversion of single-layer HDR images to SDR images, as well as + * the color space conversion of SDR images, and the conversion of SDR images to single-layer HDR images. Some * capabilities are supported by vendor. Use {@link OH_ImageProcessing_IsColorSpaceConversionSupported} to query if - * the conversion is supported between single-layer images. Use {@link OH_ImageProcessing_IsCompositionSupported} to - * query if the composition is supported from dual-layer HDR image to single-layer HDR image. Use - * {@link OH_ImageProcessing_IsDecompositionSupported} to query if the decomposition is supported from single-layer - * image to dual-layer HDR image. + * the conversion is supported between single-layer images. * * @see OH_ImageProcessing_Create * @since 12 */ extern const int32_t IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION; +/** + * @brief Used to create an image processing instance for HDR image composition. + * + * HDR image compose includes the conversion from dual-layer HDR images to single-layer HDR images. Some + * capabilities are supported by vendor. Use {@link OH_ImageProcessing_IsCompositionSupported} to + * query if the composition is supported from dual-layer HDR image to single-layer HDR image. + * + * @see OH_ImageProcessing_Create + * @since 12 + */ +extern const int32_t IMAGE_PROCESSING_TYPE_COMPOSITION; + +/** + * @brief Used to create an image processing instance for HDR image decomposition. + * + * HDR image decompose includes the conversion from single-layer HDR images to dual-layer HDR images. Some + * capabilities are supported by vendor. Use {@link OH_ImageProcessing_IsDecompositionSupported} to + * query if the decomposition is supported from single-layer image to dual-layer HDR image. + * + * @see OH_ImageProcessing_Create + * @since 12 + */ +extern const int32_t IMAGE_PROCESSING_TYPE_DECOMPOSITION; + /** * @brief Used to create an image processing instance for metadata generation. * diff --git a/multimedia/video_processing_engine/video_processing.h b/multimedia/video_processing_engine/video_processing.h index 34e4c2fdc72..531587e9871 100644 --- a/multimedia/video_processing_engine/video_processing.h +++ b/multimedia/video_processing_engine/video_processing.h @@ -85,6 +85,17 @@ bool OH_VideoProcessing_IsColorSpaceConversionSupported( const VideoProcessing_ColorSpaceInfo* sourceVideoInfo, const VideoProcessing_ColorSpaceInfo* destinationVideoInfo); +/** + * @brief Query if the video metadata generation is supported. + * + * @param sourceVideoInfo Source video color space information. + * @return true if the video metadata generation is supported. \n + * false if the video metadata generation is not supported. + * @since 12 + */ +bool OH_VideoProcessing_IsMetadataGenerationSupported( + const VideoProcessing_ColorSpaceInfo* sourceVideoInfo); + /** * @brief Create a video processing instance. * -- Gitee From c6ff1a7406d3d0c8ee9f6b15976e35b8fe0c84f7 Mon Sep 17 00:00:00 2001 From: liushang Date: Fri, 5 Jul 2024 15:40:37 +0800 Subject: [PATCH 22/30] fix enhancedetail Signed-off-by: liushang --- .../image_processing.h | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h index 6262f9f5fff..0019b925449 100644 --- a/multimedia/video_processing_engine/image_processing.h +++ b/multimedia/video_processing_engine/image_processing.h @@ -191,9 +191,11 @@ ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* in /** * @brief Conversion between single-layer images. * - * The processing type is specified when creating the instance. + * The function generate the destinationImage from sourceImage. It include the colorspace conversion from + * HDR image to SDR image, SDR image to HDR image, SDR image to SDR image and HDR image to HDR image. * - * @param instance An image processing instance pointer. + * @param instance An image processing instance pointer. The instance should be created with + * type {@link IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION}. * @param sourceImage Input image pointer. * @param destinationImage Output image pointer. * @return {@link IMAGE_PROCESSING_SUCCESS} if processing image is successful. \n @@ -212,9 +214,10 @@ ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessin /** * @brief Composition from dual-layer HDR images to single-layer HDR images. * - * The processing type is specified when creating the instance. + * The function generate the destinationImage from sourceImage and sourceGainmap. * - * @param instance An image processing instance pointer. + * @param instance An image processing instance pointer. The instance should be created with + * type {@link IMAGE_PROCESSING_TYPE_COMPOSITION}. * @param sourceImage Input image pointer. * @param sourceGainmap Input gainmap pointer. * @param destinationImage Output image pointer. @@ -234,9 +237,10 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* instanc /** * @brief Decomposition from single-layer HDR images to dual-layer HDR images. * - * The processing type is specified when creating the instance. + * The function generate the destinationImage and destinationGainmap from sourceImage. * - * @param instance An image processing instance pointer. + * @param instance An image processing instance pointer. The instance should be created with + * type {@link IMAGE_PROCESSING_TYPE_DECOMPOSITION}. * @param sourceImage Input image pointer. * @param destinationImage Output image pointer. * @param destinationGainmap Output gainmap pointer. @@ -254,11 +258,12 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Deompose(OH_ImageProcessing* instan OH_PixelmapNative* destinationImage, OH_PixelmapNative* destinationGainmap); /** - * @brief Generation for HDR images. + * @brief Metadata Generation for HDR images. * - * The processing type is specified when creating the instance. + * The function generate metadata for the sourceImage. * - * @param instance An image processing instance pointer. + * @param instance An image processing instance pointer. The instance should be created with + * type {@link IMAGE_PROCESSING_TYPE_METADATA_GENERATION}. * @param sourceImage Input image pointer. * @return {@link IMAGE_PROCESSING_SUCCESS} if processing image is successful. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n @@ -273,11 +278,14 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Deompose(OH_ImageProcessing* instan ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing* instance, OH_PixelmapNative* sourceImage); /** - * @brief enhancement for images. + * @brief Clarity enhancement for images. * - * The processing type is specified when creating the instance. + * The function generate the destinationImage from sourceImage with necessary scaling operation according to the size + * preset in the sourceImage and destinationImage. Different levels of scaling methonds are provided to balance + * performance and image quality. * - * @param instance An image processing instance pointer. + * @param instance An image processing instance pointer. The instance should be created with + * type {@link IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER}. * @param sourceImage Input image pointer. * @param destinationImage Output image pointer. * @return {@link IMAGE_PROCESSING_SUCCESS} if processing image is successful. \n -- Gitee From ec0ff75b0bad6a4b2402064acff99bb3ec140450 Mon Sep 17 00:00:00 2001 From: liushang Date: Fri, 5 Jul 2024 18:11:11 +0800 Subject: [PATCH 23/30] modify json file Signed-off-by: liushang --- .../libimage_processing.ndk.json | 32 ++++++++++++++++++- .../libvideo_processing.ndk.json | 4 +++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json b/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json index e2ad4e7f2f1..8cb58693c7d 100644 --- a/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json +++ b/multimedia/video_processing_engine/image_processing/libimage_processing.ndk.json @@ -19,6 +19,10 @@ "first_introduced": "12", "name": "OH_ImageProcessing_IsDecompositionSupported" }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_IsMetadataGenerationSupported" + }, { "first_introduced": "12", "name": "OH_ImageProcessing_Create" @@ -37,13 +41,39 @@ }, { "first_introduced": "12", - "name": "OH_ImageProcessing_Process" + "name": "OH_ImageProcessing_ConvertColorSpace" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_Compose" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_Decompose" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_GenerateMetadata" + }, + { + "first_introduced": "12", + "name": "OH_ImageProcessing_EnhanceDetail" }, { "first_introduced": "12", "name": "IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION", "type": "variable" }, + { + "first_introduced": "12", + "name": "IMAGE_PROCESSING_TYPE_COMPOSITION", + "type": "variable" + }, + { + "first_introduced": "12", + "name": "IMAGE_PROCESSING_TYPE_DECOMPOSITION", + "type": "variable" + }, { "first_introduced": "12", "name": "IMAGE_PROCESSING_TYPE_METADATA_GENERATION", diff --git a/multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json b/multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json index d67026acfe6..dd2fe35ab8f 100644 --- a/multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json +++ b/multimedia/video_processing_engine/video_processing/libvideo_processing.ndk.json @@ -11,6 +11,10 @@ "first_introduced": "12", "name": "OH_VideoProcessing_IsColorSpaceConversionSupported" }, + { + "first_introduced": "12", + "name": "OH_VideoProcessing_IsMetadataGenerationSupported" + }, { "first_introduced": "12", "name": "OH_VideoProcessing_Create" -- Gitee From 0bed4e0300ea12edc0f7c532d79aed9e84f29058 Mon Sep 17 00:00:00 2001 From: liushang Date: Mon, 8 Jul 2024 10:03:41 +0800 Subject: [PATCH 24/30] delete const Signed-off-by: liushang --- multimedia/video_processing_engine/image_processing.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h index 0019b925449..d9f025cdcdb 100644 --- a/multimedia/video_processing_engine/image_processing.h +++ b/multimedia/video_processing_engine/image_processing.h @@ -208,7 +208,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* in * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessing* instance, const OH_PixelmapNative* sourceImage, +ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessing* instance, OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage); /** @@ -231,8 +231,8 @@ ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessin * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* instance, const OH_PixelmapNative* sourceImage, - const OH_PixelmapNative* sourceGainmap, OH_PixelmapNative* destinationImage); +ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* instance, OH_PixelmapNative* sourceImage, + OH_PixelmapNative* sourceGainmap, OH_PixelmapNative* destinationImage); /** * @brief Decomposition from single-layer HDR images to dual-layer HDR images. @@ -254,7 +254,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* instanc * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_Deompose(OH_ImageProcessing* instance, const OH_PixelmapNative* sourceImage, +ImageProcessing_ErrorCode OH_ImageProcessing_Deompose(OH_ImageProcessing* instance, OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage, OH_PixelmapNative* destinationGainmap); /** @@ -298,7 +298,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_EnhanceDetail(OH_ImageProcessing* instance, const OH_PixelmapNative* sourceImage, +ImageProcessing_ErrorCode OH_ImageProcessing_EnhanceDetail(OH_ImageProcessing* instance, OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage); #ifdef __cplusplus } -- Gitee From 9d9da3ed3cfa26283237606972a442ed44d25649 Mon Sep 17 00:00:00 2001 From: liushang Date: Mon, 8 Jul 2024 11:00:39 +0800 Subject: [PATCH 25/30] add kit Signed-off-by: liushang --- multimedia/video_processing_engine/image_processing.h | 1 + multimedia/video_processing_engine/image_processing_types.h | 1 + multimedia/video_processing_engine/video_processing.h | 1 + multimedia/video_processing_engine/video_processing_types.h | 1 + 4 files changed, 4 insertions(+) diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h index d9f025cdcdb..03a8d76da91 100644 --- a/multimedia/video_processing_engine/image_processing.h +++ b/multimedia/video_processing_engine/image_processing.h @@ -31,6 +31,7 @@ * * @library libimage_processing.so * @syscap SystemCapability.Multimedia.VideoProcessingEngine + * @kit Image Kit * @since 12 */ diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index e072cc6c12a..8ac94aaee5b 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -29,6 +29,7 @@ * * @library libimage_processing.so * @syscap SystemCapability.Multimedia.VideoProcessingEngine + * @kit Image Kit * @since 12 */ diff --git a/multimedia/video_processing_engine/video_processing.h b/multimedia/video_processing_engine/video_processing.h index 531587e9871..2aa4fc1d888 100644 --- a/multimedia/video_processing_engine/video_processing.h +++ b/multimedia/video_processing_engine/video_processing.h @@ -29,6 +29,7 @@ * * @library libvideo_processing.so * @syscap SystemCapability.Multimedia.VideoProcessingEngine + * @kit Media Kit * @since 12 */ diff --git a/multimedia/video_processing_engine/video_processing_types.h b/multimedia/video_processing_engine/video_processing_types.h index ea3af2258bc..3d3c4961512 100644 --- a/multimedia/video_processing_engine/video_processing_types.h +++ b/multimedia/video_processing_engine/video_processing_types.h @@ -29,6 +29,7 @@ * * @library libvideo_processing.so * @syscap SystemCapability.Multimedia.VideoProcessingEngine + * @kit Media Kit * @since 12 */ -- Gitee From ef1ce306406513b9ffbe81ce6ce090e81c58da17 Mon Sep 17 00:00:00 2001 From: liushang Date: Wed, 10 Jul 2024 20:34:22 +0800 Subject: [PATCH 26/30] FIX Signed-off-by: liushang --- multimedia/video_processing_engine/image_processing.h | 7 ++++--- .../video_processing_engine/image_processing_types.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h index 03a8d76da91..a190f3dd095 100644 --- a/multimedia/video_processing_engine/image_processing.h +++ b/multimedia/video_processing_engine/image_processing.h @@ -209,8 +209,8 @@ ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* in * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessing* instance, OH_PixelmapNative* sourceImage, - OH_PixelmapNative* destinationImage); +ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessing* instance, + OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage); /** * @brief Composition from dual-layer HDR images to single-layer HDR images. @@ -276,7 +276,8 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Deompose(OH_ImageProcessing* instan * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing* instance, OH_PixelmapNative* sourceImage); +ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing* instance, + OH_PixelmapNative* sourceImage); /** * @brief Clarity enhancement for images. diff --git a/multimedia/video_processing_engine/image_processing_types.h b/multimedia/video_processing_engine/image_processing_types.h index 8ac94aaee5b..e95313fe32b 100644 --- a/multimedia/video_processing_engine/image_processing_types.h +++ b/multimedia/video_processing_engine/image_processing_types.h @@ -85,7 +85,7 @@ extern const int32_t IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION; * * HDR image compose includes the conversion from dual-layer HDR images to single-layer HDR images. Some * capabilities are supported by vendor. Use {@link OH_ImageProcessing_IsCompositionSupported} to - * query if the composition is supported from dual-layer HDR image to single-layer HDR image. + * query if the composition is supported from dual-layer HDR image to single-layer HDR image. * * @see OH_ImageProcessing_Create * @since 12 -- Gitee From 0d51eeac7302fb4f4603f67651e3f717e51b9bdd Mon Sep 17 00:00:00 2001 From: liushang Date: Sat, 13 Jul 2024 14:53:22 +0800 Subject: [PATCH 27/30] modify instance Signed-off-by: liushang --- .../image_processing.h | 48 ++++++++++--------- .../video_processing.h | 44 +++++++++-------- .../video_processing_types.h | 14 +++--- 3 files changed, 55 insertions(+), 51 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h index a190f3dd095..7e48590a40b 100644 --- a/multimedia/video_processing_engine/image_processing.h +++ b/multimedia/video_processing_engine/image_processing.h @@ -133,8 +133,8 @@ bool OH_ImageProcessing_IsMetadataGenerationSupported( /** * @brief Create an image processing instance. * - * @param instance Output parameter. The *instance points to a new image processing object. The *instance must be null - * before passed in. + * @param imageProcessing Output parameter. The *imageProcessing points to a new image processing object. + * The *imageProcessing must be null before passed in. * @param type Use IMAGE_PROCESSING_TYPE_XXX to specify the processing type. The processing type of the instance can not * be changed. * @return {@link IMAGE_PROCESSING_SUCCESS} if creating an image processing successfully. \n @@ -145,25 +145,25 @@ bool OH_ImageProcessing_IsMetadataGenerationSupported( * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if type is invalid. \n * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_Create(OH_ImageProcessing** instance, int32_t type); +ImageProcessing_ErrorCode OH_ImageProcessing_Create(OH_ImageProcessing** imageProcessing, int32_t type); /** * @brief Destroy the image processing instance. * - * @param instance An image processing instance pointer. It is recommended setting the instance pointer to null after - * the instance is destroyed. + * @param imageProcessing An image processing instance pointer. It is recommended setting the + * instance pointer to null after the instance is destroyed. * @return {@link IMAGE_PROCESSING_SUCCESS} if the instance is destroyed successfully. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_Destroy(OH_ImageProcessing* instance); +ImageProcessing_ErrorCode OH_ImageProcessing_Destroy(OH_ImageProcessing* imageProcessing); /** * @brief Set parameter for image processing. * * Add parameter identified by the specified parameter key. * - * @param instance An image processing instance pointer. + * @param imageProcessing An image processing instance pointer. * @param parameter The parameter for image processing. * @return {@link IMAGE_PROCESSING_SUCCESS} if setting parameter is successful. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n @@ -173,21 +173,23 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Destroy(OH_ImageProcessing* instanc * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_SetParameter(OH_ImageProcessing* instance, const OH_AVFormat* parameter); +ImageProcessing_ErrorCode OH_ImageProcessing_SetParameter(OH_ImageProcessing* imageProcessing, + const OH_AVFormat* parameter); /** * @brief Get parameter of image processing. * * Get parameter identified by the specified parameter key. * - * @param instance An image processing instance pointer. + * @param imageProcessing An image processing instance pointer. * @param parameter The parameter used by the image processing instance. * @return {@link IMAGE_PROCESSING_SUCCESS} if getting parameter is successful. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the parameter is null. \n * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* instance, OH_AVFormat* parameter); +ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* imageProcessing, + OH_AVFormat* parameter); /** * @brief Conversion between single-layer images. @@ -195,7 +197,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* in * The function generate the destinationImage from sourceImage. It include the colorspace conversion from * HDR image to SDR image, SDR image to HDR image, SDR image to SDR image and HDR image to HDR image. * - * @param instance An image processing instance pointer. The instance should be created with + * @param imageProcessing An image processing instance pointer. The instance should be created with * type {@link IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION}. * @param sourceImage Input image pointer. * @param destinationImage Output image pointer. @@ -209,7 +211,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* in * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessing* instance, +ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessing* imageProcessing, OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage); /** @@ -217,7 +219,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessin * * The function generate the destinationImage from sourceImage and sourceGainmap. * - * @param instance An image processing instance pointer. The instance should be created with + * @param imageProcessing An image processing instance pointer. The instance should be created with * type {@link IMAGE_PROCESSING_TYPE_COMPOSITION}. * @param sourceImage Input image pointer. * @param sourceGainmap Input gainmap pointer. @@ -232,15 +234,15 @@ ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessin * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* instance, OH_PixelmapNative* sourceImage, - OH_PixelmapNative* sourceGainmap, OH_PixelmapNative* destinationImage); +ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* imageProcessing, + OH_PixelmapNative* sourceImage, OH_PixelmapNative* sourceGainmap, OH_PixelmapNative* destinationImage); /** * @brief Decomposition from single-layer HDR images to dual-layer HDR images. * * The function generate the destinationImage and destinationGainmap from sourceImage. * - * @param instance An image processing instance pointer. The instance should be created with + * @param imageProcessing An image processing instance pointer. The instance should be created with * type {@link IMAGE_PROCESSING_TYPE_DECOMPOSITION}. * @param sourceImage Input image pointer. * @param destinationImage Output image pointer. @@ -255,15 +257,15 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* instanc * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_Deompose(OH_ImageProcessing* instance, OH_PixelmapNative* sourceImage, - OH_PixelmapNative* destinationImage, OH_PixelmapNative* destinationGainmap); +ImageProcessing_ErrorCode OH_ImageProcessing_Deompose(OH_ImageProcessing* imageProcessing, + OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage, OH_PixelmapNative* destinationGainmap); /** * @brief Metadata Generation for HDR images. * * The function generate metadata for the sourceImage. * - * @param instance An image processing instance pointer. The instance should be created with + * @param imageProcessing An image processing instance pointer. The instance should be created with * type {@link IMAGE_PROCESSING_TYPE_METADATA_GENERATION}. * @param sourceImage Input image pointer. * @return {@link IMAGE_PROCESSING_SUCCESS} if processing image is successful. \n @@ -276,7 +278,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Deompose(OH_ImageProcessing* instan * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing* instance, +ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing* imageProcessing, OH_PixelmapNative* sourceImage); /** @@ -286,7 +288,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing * preset in the sourceImage and destinationImage. Different levels of scaling methonds are provided to balance * performance and image quality. * - * @param instance An image processing instance pointer. The instance should be created with + * @param imageProcessing An image processing instance pointer. The instance should be created with * type {@link IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER}. * @param sourceImage Input image pointer. * @param destinationImage Output image pointer. @@ -300,8 +302,8 @@ ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_EnhanceDetail(OH_ImageProcessing* instance, OH_PixelmapNative* sourceImage, - OH_PixelmapNative* destinationImage); +ImageProcessing_ErrorCode OH_ImageProcessing_EnhanceDetail(OH_ImageProcessing* imageProcessing, + OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage); #ifdef __cplusplus } #endif diff --git a/multimedia/video_processing_engine/video_processing.h b/multimedia/video_processing_engine/video_processing.h index 2aa4fc1d888..4d6ba359098 100644 --- a/multimedia/video_processing_engine/video_processing.h +++ b/multimedia/video_processing_engine/video_processing.h @@ -100,8 +100,8 @@ bool OH_VideoProcessing_IsMetadataGenerationSupported( /** * @brief Create a video processing instance. * - * @param instance Output parameter. The *instance points to a new video processing object. The *instance must be null - * before passed in. + * @param videoProcessing Output parameter. The *videoProcessing points to a new video processing object. + * The *videoProcessing must be null before passed in. * @param type Use VIDEO_PROCESSING_TYPE_XXX to specify the processing type. The processing type of the instance can not * be changed. * @return {@link VIDEO_PROCESSING_SUCCESS} if creating a video processing instance successfully. \n @@ -112,28 +112,28 @@ bool OH_VideoProcessing_IsMetadataGenerationSupported( * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if type is invalid. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_Create(OH_VideoProcessing** instance, int type); +VideoProcessing_ErrorCode OH_VideoProcessing_Create(OH_VideoProcessing** videoProcessing, int type); /** * @brief Destroy the video processing instance. * * Stop the instance before destroying it. see {@link OH_VideoProcessing_Stop}. \n * - * @param instance The video processing instance pointer to be destroyed. It is recommended setting the instance pointer + * @param videoProcessing The video processing instance pointer to be destroyed. It is recommended setting the instance pointer * to null after the instance is destroyed. * @return {@link VIDEO_PROCESSING_SUCCESS} if the instance is destroyed successfully . \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if the instance is still running. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_Destroy(OH_VideoProcessing* instance); +VideoProcessing_ErrorCode OH_VideoProcessing_Destroy(OH_VideoProcessing* videoProcessing); /** * @brief Register callback object. * * Register the callback object before starting video processing. * - * @param instance A video processing instance pointer. + * @param videoProcessing A video processing instance pointer. * @param callback Callback pointer to be registered. * @param userData User's custom data pointer. * @return {@link VIDEO_PROCESSING_SUCCESS} if callback is registered successfully. \n @@ -142,7 +142,7 @@ VideoProcessing_ErrorCode OH_VideoProcessing_Destroy(OH_VideoProcessing* instanc * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if video processing instance is running. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_RegisterCallback(OH_VideoProcessing* instance, +VideoProcessing_ErrorCode OH_VideoProcessing_RegisterCallback(OH_VideoProcessing* videoProcessing, const VideoProcessing_Callback* callback, void* userData); /** @@ -150,14 +150,15 @@ VideoProcessing_ErrorCode OH_VideoProcessing_RegisterCallback(OH_VideoProcessing * * Set the output surface before starting video processing. * - * @param instance A video processing instance pointer. + * @param videoProcessing A video processing instance pointer. * @param window The output surface pointer. * @return {@link VIDEO_PROCESSING_SUCCESS} if setting output surface successfully. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if window is null. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_SetSurface(OH_VideoProcessing* instance, const OHNativeWindow* window); +VideoProcessing_ErrorCode OH_VideoProcessing_SetSurface(OH_VideoProcessing* videoProcessing, + const OHNativeWindow* window); /** * @brief Create an input surface. @@ -165,7 +166,7 @@ VideoProcessing_ErrorCode OH_VideoProcessing_SetSurface(OH_VideoProcessing* inst * Create the input surface before starting video processing. * Call {@link OH_NativeWindow_DestroyNativeWindow} to destroy the input surface. * - * @param instance A video processing instance pointer. + * @param videoProcessing A video processing instance pointer. * @param window The input surface pointer. For example, it is the output surface of a video decoder. * @return {@link VIDEO_PROCESSING_SUCCESS} if operation is successful. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n @@ -174,14 +175,14 @@ VideoProcessing_ErrorCode OH_VideoProcessing_SetSurface(OH_VideoProcessing* inst * or video processing instance is running. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_GetSurface(OH_VideoProcessing* instance, OHNativeWindow** window); +VideoProcessing_ErrorCode OH_VideoProcessing_GetSurface(OH_VideoProcessing* videoProcessing, OHNativeWindow** window); /** * @brief Set parameter for video processing. * * Add parameter identified by the specified parameter key. * - * @param instance An video processing instance pointer. + * @param videoProcessing An video processing instance pointer. * @param parameter The parameter for video processing. * @return {@link VIDEO_PROCESSING_SUCCESS} if setting parameter is successful. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an video processing instance. \n @@ -191,21 +192,22 @@ VideoProcessing_ErrorCode OH_VideoProcessing_GetSurface(OH_VideoProcessing* inst * {@link VIDEO_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_SetParameter(OH_VideoProcessing* instance, const OH_AVFormat* parameter); +VideoProcessing_ErrorCode OH_VideoProcessing_SetParameter(OH_VideoProcessing* videoProcessing, + const OH_AVFormat* parameter); /** * @brief Get parameter of video processing. * * Get parameter identified by the specified parameter key. * - * @param instance An video processing instance pointer. + * @param videoProcessing An video processing instance pointer. * @param parameter The parameter used by the video processing instance. * @return {@link VIDEO_PROCESSING_SUCCESS} if getting parameter is successful. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an video processing instance. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if the parameter is null. \n * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_GetParameter(OH_VideoProcessing* instance, OH_AVFormat* parameter); +VideoProcessing_ErrorCode OH_VideoProcessing_GetParameter(OH_VideoProcessing* videoProcessing, OH_AVFormat* parameter); /** * @brief Start video processing instance. @@ -213,14 +215,14 @@ VideoProcessing_ErrorCode OH_VideoProcessing_GetParameter(OH_VideoProcessing* in * After successfully calling this function, the state {@link VIDEO_PROCESSING_STATE_RUNNING} is reported by callback * function {@link OH_VideoProcessingCallback_OnState}. * - * @param instance A video processing instance pointer. + * @param videoProcessing A video processing instance pointer. * @return {@link VIDEO_PROCESSING_SUCCESS} if the operation is successful. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if output surface is not set, input surface is not created or * instance is already running. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_Start(OH_VideoProcessing* instance); +VideoProcessing_ErrorCode OH_VideoProcessing_Start(OH_VideoProcessing* videoProcessing); /** * @brief To stop video processing instance. @@ -228,13 +230,13 @@ VideoProcessing_ErrorCode OH_VideoProcessing_Start(OH_VideoProcessing* instance) * After the video processing instance is stopped successfully, the state {@link VIDEO_PROCESSING_STATE_STOPPED} is * reported by callback function {@link OH_VideoProcessing_OnState}. * - * @param instance A video processing instance pointer. + * @param videoProcessing A video processing instance pointer. * @return {@link VIDEO_PROCESSING_SUCCESS} if the operation is successful. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if instance is already stopped. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_Stop(OH_VideoProcessing* instance); +VideoProcessing_ErrorCode OH_VideoProcessing_Stop(OH_VideoProcessing* videoProcessing); /** * @brief Send the output buffer out. @@ -242,7 +244,7 @@ VideoProcessing_ErrorCode OH_VideoProcessing_Stop(OH_VideoProcessing* instance); * If the callback function {@link OH_VideoProcessingCallback_OnNewOutputBuffer} is set, the buffer's index is reported * to user by the callback function when an output buffer is ready. * - * @param instance A video processing instance pointer. + * @param videoProcessing A video processing instance pointer. * @param index The output buffer's index. * @return {@link VIDEO_PROCESSING_SUCCESS} if the operation is successful. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n @@ -251,7 +253,7 @@ VideoProcessing_ErrorCode OH_VideoProcessing_Stop(OH_VideoProcessing* instance); * not set or instance is stopped. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_RenderOutputBuffer(OH_VideoProcessing* instance, uint32_t index); +VideoProcessing_ErrorCode OH_VideoProcessing_RenderOutputBuffer(OH_VideoProcessing* videoProcessing, uint32_t index); /** * @brief Create a video processing callback object. diff --git a/multimedia/video_processing_engine/video_processing_types.h b/multimedia/video_processing_engine/video_processing_types.h index 3d3c4961512..2a0719d1256 100644 --- a/multimedia/video_processing_engine/video_processing_types.h +++ b/multimedia/video_processing_engine/video_processing_types.h @@ -215,13 +215,13 @@ typedef struct VideoProcessing_Callback VideoProcessing_Callback; * {@link VIDEO_PROCESSING_ERROR_PROCESS_FAILED}, some processing error occurs. \n * For more errors, see {@link VideoProcessing_ErrorCode}. * - * @param instance The video processing instance. + * @param videoProcessing The video processing instance. * @param error Error code reporting to user. * @param userData User's custom data. * @since 12 */ -typedef void (*OH_VideoProcessingCallback_OnError)(OH_VideoProcessing* instance, VideoProcessing_ErrorCode error, - void* userData); +typedef void (*OH_VideoProcessingCallback_OnError)(OH_VideoProcessing* videoProcessing, + VideoProcessing_ErrorCode error, void* userData); /** * @brief The callback function pointer definition for reporting video processing state. @@ -231,12 +231,12 @@ typedef void (*OH_VideoProcessingCallback_OnError)(OH_VideoProcessing* instance, * The state will be {@link VIDEO_PROCESSING_STATE_STOPPED} after all the buffers cached before * {@link OH_VideoProcessing_Stop} is called are processed. * - * @param instance The video processing instance. + * @param videoProcessing The video processing instance. * @param state see {@link VideoProcessing_State}. * @param userData User's custom data. * @since 12 */ -typedef void (*OH_VideoProcessingCallback_OnState)(OH_VideoProcessing* instance, VideoProcessing_State state, +typedef void (*OH_VideoProcessingCallback_OnState)(OH_VideoProcessing* videoProcessing, VideoProcessing_State state, void* userData); /** @@ -247,12 +247,12 @@ typedef void (*OH_VideoProcessingCallback_OnState)(OH_VideoProcessing* instance, * If this function is not registered, the output buffer is sent out as soon as the buffer is filled with processed * data without reporting. * - * @param instance The video processing instance. + * @param videoProcessing The video processing instance. * @param index The index of the new output buffer. * @param userData The user's custom data. * @since 12 */ -typedef void (*OH_VideoProcessingCallback_OnNewOutputBuffer)(OH_VideoProcessing* instance, uint32_t index, +typedef void (*OH_VideoProcessingCallback_OnNewOutputBuffer)(OH_VideoProcessing* videoProcessing, uint32_t index, void* userData); #ifdef __cplusplus -- Gitee From 9b8bcf896416032c2e7d4c9055d4e4b85bef7339 Mon Sep 17 00:00:00 2001 From: liushang Date: Sat, 13 Jul 2024 15:00:57 +0800 Subject: [PATCH 28/30] over 120 Signed-off-by: liushang --- multimedia/video_processing_engine/video_processing.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/video_processing_engine/video_processing.h b/multimedia/video_processing_engine/video_processing.h index 4d6ba359098..427272ba583 100644 --- a/multimedia/video_processing_engine/video_processing.h +++ b/multimedia/video_processing_engine/video_processing.h @@ -119,8 +119,8 @@ VideoProcessing_ErrorCode OH_VideoProcessing_Create(OH_VideoProcessing** videoPr * * Stop the instance before destroying it. see {@link OH_VideoProcessing_Stop}. \n * - * @param videoProcessing The video processing instance pointer to be destroyed. It is recommended setting the instance pointer - * to null after the instance is destroyed. + * @param videoProcessing The video processing instance pointer to be destroyed. It is recommended setting the + * instance pointer to null after the instance is destroyed. * @return {@link VIDEO_PROCESSING_SUCCESS} if the instance is destroyed successfully . \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if the instance is still running. -- Gitee From d93812035cc492cf645ce88988dc898716bfd1aa Mon Sep 17 00:00:00 2001 From: liushang Date: Sat, 13 Jul 2024 15:16:58 +0800 Subject: [PATCH 29/30] modify imageProcessing to imageProcessor Signed-off-by: liushang --- .../image_processing.h | 38 ++++++++--------- .../video_processing.h | 42 +++++++++---------- .../video_processing_types.h | 12 +++--- 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h index 7e48590a40b..490d3d3e264 100644 --- a/multimedia/video_processing_engine/image_processing.h +++ b/multimedia/video_processing_engine/image_processing.h @@ -133,8 +133,8 @@ bool OH_ImageProcessing_IsMetadataGenerationSupported( /** * @brief Create an image processing instance. * - * @param imageProcessing Output parameter. The *imageProcessing points to a new image processing object. - * The *imageProcessing must be null before passed in. + * @param imageProcessor Output parameter. The *imageProcessor points to a new image processing object. + * The *imageProcessor must be null before passed in. * @param type Use IMAGE_PROCESSING_TYPE_XXX to specify the processing type. The processing type of the instance can not * be changed. * @return {@link IMAGE_PROCESSING_SUCCESS} if creating an image processing successfully. \n @@ -145,25 +145,25 @@ bool OH_ImageProcessing_IsMetadataGenerationSupported( * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if type is invalid. \n * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_Create(OH_ImageProcessing** imageProcessing, int32_t type); +ImageProcessing_ErrorCode OH_ImageProcessing_Create(OH_ImageProcessing** imageProcessor, int32_t type); /** * @brief Destroy the image processing instance. * - * @param imageProcessing An image processing instance pointer. It is recommended setting the + * @param imageProcessor An image processing instance pointer. It is recommended setting the * instance pointer to null after the instance is destroyed. * @return {@link IMAGE_PROCESSING_SUCCESS} if the instance is destroyed successfully. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_Destroy(OH_ImageProcessing* imageProcessing); +ImageProcessing_ErrorCode OH_ImageProcessing_Destroy(OH_ImageProcessing* imageProcessor); /** * @brief Set parameter for image processing. * * Add parameter identified by the specified parameter key. * - * @param imageProcessing An image processing instance pointer. + * @param imageProcessor An image processing instance pointer. * @param parameter The parameter for image processing. * @return {@link IMAGE_PROCESSING_SUCCESS} if setting parameter is successful. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n @@ -173,7 +173,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Destroy(OH_ImageProcessing* imagePr * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_SetParameter(OH_ImageProcessing* imageProcessing, +ImageProcessing_ErrorCode OH_ImageProcessing_SetParameter(OH_ImageProcessing* imageProcessor, const OH_AVFormat* parameter); /** @@ -181,14 +181,14 @@ ImageProcessing_ErrorCode OH_ImageProcessing_SetParameter(OH_ImageProcessing* im * * Get parameter identified by the specified parameter key. * - * @param imageProcessing An image processing instance pointer. + * @param imageProcessor An image processing instance pointer. * @param parameter The parameter used by the image processing instance. * @return {@link IMAGE_PROCESSING_SUCCESS} if getting parameter is successful. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an image processing instance. \n * {@link IMAGE_PROCESSING_ERROR_INVALID_PARAMETER} if the parameter is null. \n * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* imageProcessing, +ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* imageProcessor, OH_AVFormat* parameter); /** @@ -197,7 +197,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* im * The function generate the destinationImage from sourceImage. It include the colorspace conversion from * HDR image to SDR image, SDR image to HDR image, SDR image to SDR image and HDR image to HDR image. * - * @param imageProcessing An image processing instance pointer. The instance should be created with + * @param imageProcessor An image processing instance pointer. The instance should be created with * type {@link IMAGE_PROCESSING_TYPE_COLOR_SPACE_CONVERSION}. * @param sourceImage Input image pointer. * @param destinationImage Output image pointer. @@ -211,7 +211,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_GetParameter(OH_ImageProcessing* im * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessing* imageProcessing, +ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessing* imageProcessor, OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage); /** @@ -219,7 +219,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessin * * The function generate the destinationImage from sourceImage and sourceGainmap. * - * @param imageProcessing An image processing instance pointer. The instance should be created with + * @param imageProcessor An image processing instance pointer. The instance should be created with * type {@link IMAGE_PROCESSING_TYPE_COMPOSITION}. * @param sourceImage Input image pointer. * @param sourceGainmap Input gainmap pointer. @@ -234,7 +234,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_ConvertColorSpace(OH_ImageProcessin * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* imageProcessing, +ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* imageProcessor, OH_PixelmapNative* sourceImage, OH_PixelmapNative* sourceGainmap, OH_PixelmapNative* destinationImage); /** @@ -242,7 +242,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* imagePr * * The function generate the destinationImage and destinationGainmap from sourceImage. * - * @param imageProcessing An image processing instance pointer. The instance should be created with + * @param imageProcessor An image processing instance pointer. The instance should be created with * type {@link IMAGE_PROCESSING_TYPE_DECOMPOSITION}. * @param sourceImage Input image pointer. * @param destinationImage Output image pointer. @@ -257,7 +257,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* imagePr * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_Deompose(OH_ImageProcessing* imageProcessing, +ImageProcessing_ErrorCode OH_ImageProcessing_Deompose(OH_ImageProcessing* imageProcessor, OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage, OH_PixelmapNative* destinationGainmap); /** @@ -265,7 +265,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Deompose(OH_ImageProcessing* imageP * * The function generate metadata for the sourceImage. * - * @param imageProcessing An image processing instance pointer. The instance should be created with + * @param imageProcessor An image processing instance pointer. The instance should be created with * type {@link IMAGE_PROCESSING_TYPE_METADATA_GENERATION}. * @param sourceImage Input image pointer. * @return {@link IMAGE_PROCESSING_SUCCESS} if processing image is successful. \n @@ -278,7 +278,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Deompose(OH_ImageProcessing* imageP * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing* imageProcessing, +ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing* imageProcessor, OH_PixelmapNative* sourceImage); /** @@ -288,7 +288,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing * preset in the sourceImage and destinationImage. Different levels of scaling methonds are provided to balance * performance and image quality. * - * @param imageProcessing An image processing instance pointer. The instance should be created with + * @param imageProcessor An image processing instance pointer. The instance should be created with * type {@link IMAGE_PROCESSING_TYPE_DETAIL_ENHANCER}. * @param sourceImage Input image pointer. * @param destinationImage Output image pointer. @@ -302,7 +302,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_GenerateMetadata(OH_ImageProcessing * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_EnhanceDetail(OH_ImageProcessing* imageProcessing, +ImageProcessing_ErrorCode OH_ImageProcessing_EnhanceDetail(OH_ImageProcessing* imageProcessor, OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage); #ifdef __cplusplus } diff --git a/multimedia/video_processing_engine/video_processing.h b/multimedia/video_processing_engine/video_processing.h index 427272ba583..94f94f1a9e2 100644 --- a/multimedia/video_processing_engine/video_processing.h +++ b/multimedia/video_processing_engine/video_processing.h @@ -100,8 +100,8 @@ bool OH_VideoProcessing_IsMetadataGenerationSupported( /** * @brief Create a video processing instance. * - * @param videoProcessing Output parameter. The *videoProcessing points to a new video processing object. - * The *videoProcessing must be null before passed in. + * @param videoProcessor Output parameter. The *videoProcessor points to a new video processing object. + * The *videoProcessor must be null before passed in. * @param type Use VIDEO_PROCESSING_TYPE_XXX to specify the processing type. The processing type of the instance can not * be changed. * @return {@link VIDEO_PROCESSING_SUCCESS} if creating a video processing instance successfully. \n @@ -112,28 +112,28 @@ bool OH_VideoProcessing_IsMetadataGenerationSupported( * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if type is invalid. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_Create(OH_VideoProcessing** videoProcessing, int type); +VideoProcessing_ErrorCode OH_VideoProcessing_Create(OH_VideoProcessing** videoProcessor, int type); /** * @brief Destroy the video processing instance. * * Stop the instance before destroying it. see {@link OH_VideoProcessing_Stop}. \n * - * @param videoProcessing The video processing instance pointer to be destroyed. It is recommended setting the + * @param videoProcessor The video processing instance pointer to be destroyed. It is recommended setting the * instance pointer to null after the instance is destroyed. * @return {@link VIDEO_PROCESSING_SUCCESS} if the instance is destroyed successfully . \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if the instance is still running. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_Destroy(OH_VideoProcessing* videoProcessing); +VideoProcessing_ErrorCode OH_VideoProcessing_Destroy(OH_VideoProcessing* videoProcessor); /** * @brief Register callback object. * * Register the callback object before starting video processing. * - * @param videoProcessing A video processing instance pointer. + * @param videoProcessor A video processing instance pointer. * @param callback Callback pointer to be registered. * @param userData User's custom data pointer. * @return {@link VIDEO_PROCESSING_SUCCESS} if callback is registered successfully. \n @@ -142,7 +142,7 @@ VideoProcessing_ErrorCode OH_VideoProcessing_Destroy(OH_VideoProcessing* videoPr * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if video processing instance is running. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_RegisterCallback(OH_VideoProcessing* videoProcessing, +VideoProcessing_ErrorCode OH_VideoProcessing_RegisterCallback(OH_VideoProcessing* videoProcessor, const VideoProcessing_Callback* callback, void* userData); /** @@ -150,14 +150,14 @@ VideoProcessing_ErrorCode OH_VideoProcessing_RegisterCallback(OH_VideoProcessing * * Set the output surface before starting video processing. * - * @param videoProcessing A video processing instance pointer. + * @param videoProcessor A video processing instance pointer. * @param window The output surface pointer. * @return {@link VIDEO_PROCESSING_SUCCESS} if setting output surface successfully. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if window is null. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_SetSurface(OH_VideoProcessing* videoProcessing, +VideoProcessing_ErrorCode OH_VideoProcessing_SetSurface(OH_VideoProcessing* videoProcessor, const OHNativeWindow* window); /** @@ -166,7 +166,7 @@ VideoProcessing_ErrorCode OH_VideoProcessing_SetSurface(OH_VideoProcessing* vide * Create the input surface before starting video processing. * Call {@link OH_NativeWindow_DestroyNativeWindow} to destroy the input surface. * - * @param videoProcessing A video processing instance pointer. + * @param videoProcessor A video processing instance pointer. * @param window The input surface pointer. For example, it is the output surface of a video decoder. * @return {@link VIDEO_PROCESSING_SUCCESS} if operation is successful. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n @@ -175,14 +175,14 @@ VideoProcessing_ErrorCode OH_VideoProcessing_SetSurface(OH_VideoProcessing* vide * or video processing instance is running. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_GetSurface(OH_VideoProcessing* videoProcessing, OHNativeWindow** window); +VideoProcessing_ErrorCode OH_VideoProcessing_GetSurface(OH_VideoProcessing* videoProcessor, OHNativeWindow** window); /** * @brief Set parameter for video processing. * * Add parameter identified by the specified parameter key. * - * @param videoProcessing An video processing instance pointer. + * @param videoProcessor An video processing instance pointer. * @param parameter The parameter for video processing. * @return {@link VIDEO_PROCESSING_SUCCESS} if setting parameter is successful. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an video processing instance. \n @@ -192,7 +192,7 @@ VideoProcessing_ErrorCode OH_VideoProcessing_GetSurface(OH_VideoProcessing* vide * {@link VIDEO_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_SetParameter(OH_VideoProcessing* videoProcessing, +VideoProcessing_ErrorCode OH_VideoProcessing_SetParameter(OH_VideoProcessing* videoProcessor, const OH_AVFormat* parameter); /** @@ -200,14 +200,14 @@ VideoProcessing_ErrorCode OH_VideoProcessing_SetParameter(OH_VideoProcessing* vi * * Get parameter identified by the specified parameter key. * - * @param videoProcessing An video processing instance pointer. + * @param videoProcessor An video processing instance pointer. * @param parameter The parameter used by the video processing instance. * @return {@link VIDEO_PROCESSING_SUCCESS} if getting parameter is successful. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not an video processing instance. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_PARAMETER} if the parameter is null. \n * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_GetParameter(OH_VideoProcessing* videoProcessing, OH_AVFormat* parameter); +VideoProcessing_ErrorCode OH_VideoProcessing_GetParameter(OH_VideoProcessing* videoProcessor, OH_AVFormat* parameter); /** * @brief Start video processing instance. @@ -215,14 +215,14 @@ VideoProcessing_ErrorCode OH_VideoProcessing_GetParameter(OH_VideoProcessing* vi * After successfully calling this function, the state {@link VIDEO_PROCESSING_STATE_RUNNING} is reported by callback * function {@link OH_VideoProcessingCallback_OnState}. * - * @param videoProcessing A video processing instance pointer. + * @param videoProcessor A video processing instance pointer. * @return {@link VIDEO_PROCESSING_SUCCESS} if the operation is successful. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if output surface is not set, input surface is not created or * instance is already running. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_Start(OH_VideoProcessing* videoProcessing); +VideoProcessing_ErrorCode OH_VideoProcessing_Start(OH_VideoProcessing* videoProcessor); /** * @brief To stop video processing instance. @@ -230,13 +230,13 @@ VideoProcessing_ErrorCode OH_VideoProcessing_Start(OH_VideoProcessing* videoProc * After the video processing instance is stopped successfully, the state {@link VIDEO_PROCESSING_STATE_STOPPED} is * reported by callback function {@link OH_VideoProcessing_OnState}. * - * @param videoProcessing A video processing instance pointer. + * @param videoProcessor A video processing instance pointer. * @return {@link VIDEO_PROCESSING_SUCCESS} if the operation is successful. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n * {@link VIDEO_PROCESSING_ERROR_OPERATION_NOT_PERMITTED} if instance is already stopped. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_Stop(OH_VideoProcessing* videoProcessing); +VideoProcessing_ErrorCode OH_VideoProcessing_Stop(OH_VideoProcessing* videoProcessor); /** * @brief Send the output buffer out. @@ -244,7 +244,7 @@ VideoProcessing_ErrorCode OH_VideoProcessing_Stop(OH_VideoProcessing* videoProce * If the callback function {@link OH_VideoProcessingCallback_OnNewOutputBuffer} is set, the buffer's index is reported * to user by the callback function when an output buffer is ready. * - * @param videoProcessing A video processing instance pointer. + * @param videoProcessor A video processing instance pointer. * @param index The output buffer's index. * @return {@link VIDEO_PROCESSING_SUCCESS} if the operation is successful. \n * {@link VIDEO_PROCESSING_ERROR_INVALID_INSTANCE} if instance is null or not a video processing instance. \n @@ -253,7 +253,7 @@ VideoProcessing_ErrorCode OH_VideoProcessing_Stop(OH_VideoProcessing* videoProce * not set or instance is stopped. * @since 12 */ -VideoProcessing_ErrorCode OH_VideoProcessing_RenderOutputBuffer(OH_VideoProcessing* videoProcessing, uint32_t index); +VideoProcessing_ErrorCode OH_VideoProcessing_RenderOutputBuffer(OH_VideoProcessing* videoProcessor, uint32_t index); /** * @brief Create a video processing callback object. diff --git a/multimedia/video_processing_engine/video_processing_types.h b/multimedia/video_processing_engine/video_processing_types.h index 2a0719d1256..8a1093a4651 100644 --- a/multimedia/video_processing_engine/video_processing_types.h +++ b/multimedia/video_processing_engine/video_processing_types.h @@ -215,12 +215,12 @@ typedef struct VideoProcessing_Callback VideoProcessing_Callback; * {@link VIDEO_PROCESSING_ERROR_PROCESS_FAILED}, some processing error occurs. \n * For more errors, see {@link VideoProcessing_ErrorCode}. * - * @param videoProcessing The video processing instance. + * @param videoProcessor The video processing instance. * @param error Error code reporting to user. * @param userData User's custom data. * @since 12 */ -typedef void (*OH_VideoProcessingCallback_OnError)(OH_VideoProcessing* videoProcessing, +typedef void (*OH_VideoProcessingCallback_OnError)(OH_VideoProcessing* videoProcessor, VideoProcessing_ErrorCode error, void* userData); /** @@ -231,12 +231,12 @@ typedef void (*OH_VideoProcessingCallback_OnError)(OH_VideoProcessing* videoProc * The state will be {@link VIDEO_PROCESSING_STATE_STOPPED} after all the buffers cached before * {@link OH_VideoProcessing_Stop} is called are processed. * - * @param videoProcessing The video processing instance. + * @param videoProcessor The video processing instance. * @param state see {@link VideoProcessing_State}. * @param userData User's custom data. * @since 12 */ -typedef void (*OH_VideoProcessingCallback_OnState)(OH_VideoProcessing* videoProcessing, VideoProcessing_State state, +typedef void (*OH_VideoProcessingCallback_OnState)(OH_VideoProcessing* videoProcessor, VideoProcessing_State state, void* userData); /** @@ -247,12 +247,12 @@ typedef void (*OH_VideoProcessingCallback_OnState)(OH_VideoProcessing* videoProc * If this function is not registered, the output buffer is sent out as soon as the buffer is filled with processed * data without reporting. * - * @param videoProcessing The video processing instance. + * @param videoProcessor The video processing instance. * @param index The index of the new output buffer. * @param userData The user's custom data. * @since 12 */ -typedef void (*OH_VideoProcessingCallback_OnNewOutputBuffer)(OH_VideoProcessing* videoProcessing, uint32_t index, +typedef void (*OH_VideoProcessingCallback_OnNewOutputBuffer)(OH_VideoProcessing* videoProcessor, uint32_t index, void* userData); #ifdef __cplusplus -- Gitee From c68b7b373f68f45131ee437cb427320b3fb9826d Mon Sep 17 00:00:00 2001 From: liushang Date: Mon, 5 Aug 2024 13:41:40 +0800 Subject: [PATCH 30/30] decompose fix Signed-off-by: liushang --- multimedia/video_processing_engine/image_processing.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/video_processing_engine/image_processing.h b/multimedia/video_processing_engine/image_processing.h index 490d3d3e264..1c4eb56a270 100644 --- a/multimedia/video_processing_engine/image_processing.h +++ b/multimedia/video_processing_engine/image_processing.h @@ -257,7 +257,7 @@ ImageProcessing_ErrorCode OH_ImageProcessing_Compose(OH_ImageProcessing* imagePr * {@link IMAGE_PROCESSING_ERROR_NO_MEMORY} if memory allocation failed. * @since 12 */ -ImageProcessing_ErrorCode OH_ImageProcessing_Deompose(OH_ImageProcessing* imageProcessor, +ImageProcessing_ErrorCode OH_ImageProcessing_Decompose(OH_ImageProcessing* imageProcessor, OH_PixelmapNative* sourceImage, OH_PixelmapNative* destinationImage, OH_PixelmapNative* destinationGainmap); /** -- Gitee