17777dab0Sopenharmony_ci/*
27777dab0Sopenharmony_ci * Copyright (C) 2024 Huawei Device Co., Ltd.
37777dab0Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
47777dab0Sopenharmony_ci * you may not use this file except in compliance with the License.
57777dab0Sopenharmony_ci * You may obtain a copy of the License at
67777dab0Sopenharmony_ci *
77777dab0Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
87777dab0Sopenharmony_ci *
97777dab0Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
107777dab0Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
117777dab0Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
127777dab0Sopenharmony_ci * See the License for the specific language governing permissions and
137777dab0Sopenharmony_ci * limitations under the License.
147777dab0Sopenharmony_ci */
157777dab0Sopenharmony_ci
167777dab0Sopenharmony_ci/**
177777dab0Sopenharmony_ci * @addtogroup MediaAssetManager
187777dab0Sopenharmony_ci * @{
197777dab0Sopenharmony_ci *
207777dab0Sopenharmony_ci * @brief Provides APIs of request capability for Media Source.
217777dab0Sopenharmony_ci *
227777dab0Sopenharmony_ci * @since 13
237777dab0Sopenharmony_ci */
247777dab0Sopenharmony_ci
257777dab0Sopenharmony_ci/**
267777dab0Sopenharmony_ci * @file moving_photo_capi.h
277777dab0Sopenharmony_ci *
287777dab0Sopenharmony_ci * @brief Defines APIs related to moving photo.
297777dab0Sopenharmony_ci *
307777dab0Sopenharmony_ci * Provides the ability to obtain moving photo information.
317777dab0Sopenharmony_ci *
327777dab0Sopenharmony_ci * @kit MediaLibraryKit
337777dab0Sopenharmony_ci * @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
347777dab0Sopenharmony_ci * @library libmedia_asset_manager.so
357777dab0Sopenharmony_ci * @since 13
367777dab0Sopenharmony_ci */
377777dab0Sopenharmony_ci
387777dab0Sopenharmony_ci#ifndef MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MOVING_PHOTO_H
397777dab0Sopenharmony_ci#define MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MOVING_PHOTO_H
407777dab0Sopenharmony_ci
417777dab0Sopenharmony_ci#include "media_asset_base_capi.h"
427777dab0Sopenharmony_ci
437777dab0Sopenharmony_ci#ifdef __cplusplus
447777dab0Sopenharmony_ciextern "C" {
457777dab0Sopenharmony_ci#endif
467777dab0Sopenharmony_ci
477777dab0Sopenharmony_ci/**
487777dab0Sopenharmony_ci * @brief Get uri of the moving photo.
497777dab0Sopenharmony_ci *
507777dab0Sopenharmony_ci * @param movingPhoto the {@link OH_MovingPhoto} instance.
517777dab0Sopenharmony_ci * @param uri the uri of the moving photo.
527777dab0Sopenharmony_ci * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
537777dab0Sopenharmony_ci *         {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
547777dab0Sopenharmony_ci *                                                1. Mandatory parameters are left unspecified.
557777dab0Sopenharmony_ci *                                                2. Incorrect parameter types.
567777dab0Sopenharmony_ci *                                                3. Parameter verification failed.
577777dab0Sopenharmony_ci *         {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
587777dab0Sopenharmony_ci * @since 13
597777dab0Sopenharmony_ci*/
607777dab0Sopenharmony_ciMediaLibrary_ErrorCode OH_MovingPhoto_GetUri(OH_MovingPhoto* movingPhoto, const char** uri);
617777dab0Sopenharmony_ci
627777dab0Sopenharmony_ci/**
637777dab0Sopenharmony_ci * @brief Request the image and video content of the moving photo and write to destination uri.
647777dab0Sopenharmony_ci *
657777dab0Sopenharmony_ci * @permission ohos.permission.READ_IMAGEVIDEO
667777dab0Sopenharmony_ci * @param movingPhoto the {@link OH_MovingPhoto} instance.
677777dab0Sopenharmony_ci * @param imageUri the destination file uri to save the image data.
687777dab0Sopenharmony_ci * @param videoUri the destination file uri to save the video data.
697777dab0Sopenharmony_ci * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
707777dab0Sopenharmony_ci *         {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
717777dab0Sopenharmony_ci *                                                1. Mandatory parameters are left unspecified.
727777dab0Sopenharmony_ci *                                                2. Incorrect parameter types.
737777dab0Sopenharmony_ci *                                                3. Parameter verification failed.
747777dab0Sopenharmony_ci *         {@link #MEDIA_LIBRARY_PERMISSION_DENIED} if permission is denied.
757777dab0Sopenharmony_ci *         {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
767777dab0Sopenharmony_ci * @since 13
777777dab0Sopenharmony_ci*/
787777dab0Sopenharmony_ciMediaLibrary_ErrorCode OH_MovingPhoto_RequestContentWithUris(OH_MovingPhoto* movingPhoto, char* imageUri,
797777dab0Sopenharmony_ci    char* videoUri);
807777dab0Sopenharmony_ci
817777dab0Sopenharmony_ci/**
827777dab0Sopenharmony_ci * @brief Request the image or video content of the moving photo and write to destination uri.
837777dab0Sopenharmony_ci *
847777dab0Sopenharmony_ci * @permission ohos.permission.READ_IMAGEVIDEO
857777dab0Sopenharmony_ci * @param movingPhoto the {@link OH_MovingPhoto} instance.
867777dab0Sopenharmony_ci * @param resourceType the {@link MediaLibrary_ResourceType} of the moving photo content to request.
877777dab0Sopenharmony_ci * @param uri the destination file uri to save the data.
887777dab0Sopenharmony_ci * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
897777dab0Sopenharmony_ci *         {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
907777dab0Sopenharmony_ci *                                                1. Mandatory parameters are left unspecified.
917777dab0Sopenharmony_ci *                                                2. Incorrect parameter types.
927777dab0Sopenharmony_ci *                                                3. Parameter verification failed.
937777dab0Sopenharmony_ci *         {@link #MEDIA_LIBRARY_PERMISSION_DENIED} if permission is denied.
947777dab0Sopenharmony_ci *         {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
957777dab0Sopenharmony_ci * @since 13
967777dab0Sopenharmony_ci*/
977777dab0Sopenharmony_ciMediaLibrary_ErrorCode OH_MovingPhoto_RequestContentWithUri(OH_MovingPhoto* movingPhoto,
987777dab0Sopenharmony_ci    MediaLibrary_ResourceType resourceType, char* uri);
997777dab0Sopenharmony_ci
1007777dab0Sopenharmony_ci/**
1017777dab0Sopenharmony_ci * @brief Request data of the moving photo.
1027777dab0Sopenharmony_ci *
1037777dab0Sopenharmony_ci * @permission ohos.permission.READ_IMAGEVIDEO
1047777dab0Sopenharmony_ci * @param movingPhoto the {@link OH_MovingPhoto} instance.
1057777dab0Sopenharmony_ci * @param resourceType the {@link MediaLibrary_ResourceType} of the moving photo content to request.
1067777dab0Sopenharmony_ci * @param buffer the buffer of the content.
1077777dab0Sopenharmony_ci * @param size the size of the buffer.
1087777dab0Sopenharmony_ci * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
1097777dab0Sopenharmony_ci *         {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
1107777dab0Sopenharmony_ci *                                                1. Mandatory parameters are left unspecified.
1117777dab0Sopenharmony_ci *                                                2. Incorrect parameter types.
1127777dab0Sopenharmony_ci *                                                3. Parameter verification failed.
1137777dab0Sopenharmony_ci *         {@link #MEDIA_LIBRARY_PERMISSION_DENIED} if permission is denied.
1147777dab0Sopenharmony_ci *         {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
1157777dab0Sopenharmony_ci * @since 13
1167777dab0Sopenharmony_ci*/
1177777dab0Sopenharmony_ciMediaLibrary_ErrorCode OH_MovingPhoto_RequestContentWithBuffer(OH_MovingPhoto* movingPhoto,
1187777dab0Sopenharmony_ci    MediaLibrary_ResourceType resourceType, const uint8_t** buffer, uint32_t* size);
1197777dab0Sopenharmony_ci
1207777dab0Sopenharmony_ci/**
1217777dab0Sopenharmony_ci * @brief Release the {@link OH_MovingPhoto} instance.
1227777dab0Sopenharmony_ci *
1237777dab0Sopenharmony_ci * @param movingPhoto the {@link OH_MovingPhoto} instance.
1247777dab0Sopenharmony_ci * @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
1257777dab0Sopenharmony_ci *         {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
1267777dab0Sopenharmony_ci *                                                1. Mandatory parameters are left unspecified.
1277777dab0Sopenharmony_ci *                                                2. Incorrect parameter types.
1287777dab0Sopenharmony_ci *                                                3. Parameter verification failed.
1297777dab0Sopenharmony_ci * @since 13
1307777dab0Sopenharmony_ci*/
1317777dab0Sopenharmony_ciMediaLibrary_ErrorCode OH_MovingPhoto_Release(OH_MovingPhoto* movingPhoto);
1327777dab0Sopenharmony_ci
1337777dab0Sopenharmony_ci#ifdef __cplusplus
1347777dab0Sopenharmony_ci}
1357777dab0Sopenharmony_ci#endif
1367777dab0Sopenharmony_ci
1377777dab0Sopenharmony_ci#endif // MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MOVING_PHOTO_H
1387777dab0Sopenharmony_ci/** @} */