176fd607bSopenharmony_ci/* 276fd607bSopenharmony_ci * Copyright (C) 2024 Huawei Device Co., Ltd. 376fd607bSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 476fd607bSopenharmony_ci * you may not use this file except in compliance with the License. 576fd607bSopenharmony_ci * You may obtain a copy of the License at 676fd607bSopenharmony_ci * 776fd607bSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 876fd607bSopenharmony_ci * 976fd607bSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1076fd607bSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1176fd607bSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1276fd607bSopenharmony_ci * See the License for the specific language governing permissions and 1376fd607bSopenharmony_ci * limitations under the License. 1476fd607bSopenharmony_ci */ 1576fd607bSopenharmony_ci 1676fd607bSopenharmony_ci/** 1776fd607bSopenharmony_ci * @addtogroup MediaAssetManager 1876fd607bSopenharmony_ci * @{ 1976fd607bSopenharmony_ci * 2076fd607bSopenharmony_ci * @brief Provides APIs of request capability for Media Source. 2176fd607bSopenharmony_ci * 2276fd607bSopenharmony_ci * @since 13 2376fd607bSopenharmony_ci */ 2476fd607bSopenharmony_ci 2576fd607bSopenharmony_ci/** 2676fd607bSopenharmony_ci * @file moving_photo_capi.h 2776fd607bSopenharmony_ci * 2876fd607bSopenharmony_ci * @brief Defines APIs related to moving photo. 2976fd607bSopenharmony_ci * 3076fd607bSopenharmony_ci * Provides the ability to obtain moving photo information. 3176fd607bSopenharmony_ci * 3276fd607bSopenharmony_ci * @kit MediaLibraryKit 3376fd607bSopenharmony_ci * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core 3476fd607bSopenharmony_ci * @library libmedia_asset_manager.so 3576fd607bSopenharmony_ci * @since 13 3676fd607bSopenharmony_ci */ 3776fd607bSopenharmony_ci 3876fd607bSopenharmony_ci#ifndef MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MOVING_PHOTO_H 3976fd607bSopenharmony_ci#define MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MOVING_PHOTO_H 4076fd607bSopenharmony_ci 4176fd607bSopenharmony_ci#include "media_asset_base_capi.h" 4276fd607bSopenharmony_ci 4376fd607bSopenharmony_ci#ifdef __cplusplus 4476fd607bSopenharmony_ciextern "C" { 4576fd607bSopenharmony_ci#endif 4676fd607bSopenharmony_ci 4776fd607bSopenharmony_ci/** 4876fd607bSopenharmony_ci * @brief Get uri of the moving photo. 4976fd607bSopenharmony_ci * 5076fd607bSopenharmony_ci * @param movingPhoto the {@link OH_MovingPhoto} instance. 5176fd607bSopenharmony_ci * @param uri the uri of the moving photo. 5276fd607bSopenharmony_ci * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. 5376fd607bSopenharmony_ci * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: 5476fd607bSopenharmony_ci * 1. Mandatory parameters are left unspecified. 5576fd607bSopenharmony_ci * 2. Incorrect parameter types. 5676fd607bSopenharmony_ci * 3. Parameter verification failed. 5776fd607bSopenharmony_ci * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. 5876fd607bSopenharmony_ci * @since 13 5976fd607bSopenharmony_ci */ 6076fd607bSopenharmony_ciMediaLibrary_ErrorCode OH_MovingPhoto_GetUri(OH_MovingPhoto* movingPhoto, const char** uri); 6176fd607bSopenharmony_ci 6276fd607bSopenharmony_ci/** 6376fd607bSopenharmony_ci * @brief Request the image and video content of the moving photo and write to destination uri. 6476fd607bSopenharmony_ci * 6576fd607bSopenharmony_ci * @permission ohos.permission.READ_IMAGEVIDEO 6676fd607bSopenharmony_ci * @param movingPhoto the {@link OH_MovingPhoto} instance. 6776fd607bSopenharmony_ci * @param imageUri the destination file uri to save the image data. 6876fd607bSopenharmony_ci * @param videoUri the destination file uri to save the video data. 6976fd607bSopenharmony_ci * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. 7076fd607bSopenharmony_ci * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: 7176fd607bSopenharmony_ci * 1. Mandatory parameters are left unspecified. 7276fd607bSopenharmony_ci * 2. Incorrect parameter types. 7376fd607bSopenharmony_ci * 3. Parameter verification failed. 7476fd607bSopenharmony_ci * {@link #MEDIA_LIBRARY_PERMISSION_DENIED} if permission is denied. 7576fd607bSopenharmony_ci * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. 7676fd607bSopenharmony_ci * @since 13 7776fd607bSopenharmony_ci */ 7876fd607bSopenharmony_ciMediaLibrary_ErrorCode OH_MovingPhoto_RequestContentWithUris(OH_MovingPhoto* movingPhoto, char* imageUri, 7976fd607bSopenharmony_ci char* videoUri); 8076fd607bSopenharmony_ci 8176fd607bSopenharmony_ci/** 8276fd607bSopenharmony_ci * @brief Request the image or video content of the moving photo and write to destination uri. 8376fd607bSopenharmony_ci * 8476fd607bSopenharmony_ci * @permission ohos.permission.READ_IMAGEVIDEO 8576fd607bSopenharmony_ci * @param movingPhoto the {@link OH_MovingPhoto} instance. 8676fd607bSopenharmony_ci * @param resourceType the {@link MediaLibrary_ResourceType} of the moving photo content to request. 8776fd607bSopenharmony_ci * @param uri the destination file uri to save the data. 8876fd607bSopenharmony_ci * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. 8976fd607bSopenharmony_ci * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: 9076fd607bSopenharmony_ci * 1. Mandatory parameters are left unspecified. 9176fd607bSopenharmony_ci * 2. Incorrect parameter types. 9276fd607bSopenharmony_ci * 3. Parameter verification failed. 9376fd607bSopenharmony_ci * {@link #MEDIA_LIBRARY_PERMISSION_DENIED} if permission is denied. 9476fd607bSopenharmony_ci * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. 9576fd607bSopenharmony_ci * @since 13 9676fd607bSopenharmony_ci */ 9776fd607bSopenharmony_ciMediaLibrary_ErrorCode OH_MovingPhoto_RequestContentWithUri(OH_MovingPhoto* movingPhoto, 9876fd607bSopenharmony_ci MediaLibrary_ResourceType resourceType, char* uri); 9976fd607bSopenharmony_ci 10076fd607bSopenharmony_ci/** 10176fd607bSopenharmony_ci * @brief Request data of the moving photo. 10276fd607bSopenharmony_ci * 10376fd607bSopenharmony_ci * @permission ohos.permission.READ_IMAGEVIDEO 10476fd607bSopenharmony_ci * @param movingPhoto the {@link OH_MovingPhoto} instance. 10576fd607bSopenharmony_ci * @param resourceType the {@link MediaLibrary_ResourceType} of the moving photo content to request. 10676fd607bSopenharmony_ci * @param buffer the buffer of the content. 10776fd607bSopenharmony_ci * @param size the size of the buffer. 10876fd607bSopenharmony_ci * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. 10976fd607bSopenharmony_ci * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: 11076fd607bSopenharmony_ci * 1. Mandatory parameters are left unspecified. 11176fd607bSopenharmony_ci * 2. Incorrect parameter types. 11276fd607bSopenharmony_ci * 3. Parameter verification failed. 11376fd607bSopenharmony_ci * {@link #MEDIA_LIBRARY_PERMISSION_DENIED} if permission is denied. 11476fd607bSopenharmony_ci * {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error. 11576fd607bSopenharmony_ci * @since 13 11676fd607bSopenharmony_ci */ 11776fd607bSopenharmony_ciMediaLibrary_ErrorCode OH_MovingPhoto_RequestContentWithBuffer(OH_MovingPhoto* movingPhoto, 11876fd607bSopenharmony_ci MediaLibrary_ResourceType resourceType, const uint8_t** buffer, uint32_t* size); 11976fd607bSopenharmony_ci 12076fd607bSopenharmony_ci/** 12176fd607bSopenharmony_ci * @brief Release the {@link OH_MovingPhoto} instance. 12276fd607bSopenharmony_ci * 12376fd607bSopenharmony_ci * @param movingPhoto the {@link OH_MovingPhoto} instance. 12476fd607bSopenharmony_ci * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds. 12576fd607bSopenharmony_ci * {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes: 12676fd607bSopenharmony_ci * 1. Mandatory parameters are left unspecified. 12776fd607bSopenharmony_ci * 2. Incorrect parameter types. 12876fd607bSopenharmony_ci * 3. Parameter verification failed. 12976fd607bSopenharmony_ci * @since 13 13076fd607bSopenharmony_ci */ 13176fd607bSopenharmony_ciMediaLibrary_ErrorCode OH_MovingPhoto_Release(OH_MovingPhoto* movingPhoto); 13276fd607bSopenharmony_ci 13376fd607bSopenharmony_ci#ifdef __cplusplus 13476fd607bSopenharmony_ci} 13576fd607bSopenharmony_ci#endif 13676fd607bSopenharmony_ci 13776fd607bSopenharmony_ci#endif // MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MOVING_PHOTO_H 13876fd607bSopenharmony_ci/** @} */