mirror of
https://gitee.com/openharmony/interface_sdk_c
synced 2024-11-27 00:41:01 +00:00
!1390 添加媒体库0826 api并修改addtogroup问题
Merge pull request !1390 from caochuan/media-library-0826-api
This commit is contained in:
commit
01cc7fda10
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup MediaAccessHelper
|
||||
* @addtogroup MediaAssetManager
|
||||
* @{
|
||||
*
|
||||
* @brief Provides APIs of request capability for Media Source.
|
||||
|
@ -82,6 +82,15 @@ typedef struct OH_MediaAssetManager OH_MediaAssetManager;
|
||||
*/
|
||||
typedef struct OH_MediaAssetChangeRequest OH_MediaAssetChangeRequest;
|
||||
|
||||
/**
|
||||
* @brief Define Moving Photo
|
||||
*
|
||||
* This structure provides the ability to obtain information about moving photo.
|
||||
*
|
||||
* @since 13
|
||||
*/
|
||||
typedef struct OH_MovingPhoto OH_MovingPhoto;
|
||||
|
||||
/**
|
||||
* @brief Define Media Asset
|
||||
*
|
||||
@ -291,6 +300,22 @@ typedef void (*OH_MediaLibrary_OnImageDataPrepared)(MediaLibrary_ErrorCode resul
|
||||
MediaLibrary_RequestId requestId, MediaLibrary_MediaQuality mediaQuality, MediaLibrary_MediaContentType type,
|
||||
OH_ImageSourceNative* imageSourceNative);
|
||||
|
||||
/**
|
||||
* @brief Called when a requested moving photo is prepared.
|
||||
*
|
||||
* This function is called when the requested moving photo is prepared.
|
||||
*
|
||||
* @param result results {@link MediaLibrary_ErrorCode} of the processing of the requested resources.
|
||||
* @param requestId indicates the {@link MediaLibrary_RequestId} of the request.
|
||||
* @param mediaQuality the {@link MediaLibrary_MediaQuality} of the requested source.
|
||||
* @param type the {@link MediaLibrary_MediaContentType} of the requested source.
|
||||
* @param movingPhoto it used to obtain {@link OH_MovingPhoto} information when the data is prepared.
|
||||
* @since 13
|
||||
*/
|
||||
typedef void (*OH_MediaLibrary_OnMovingPhotoDataPrepared)(MediaLibrary_ErrorCode result,
|
||||
MediaLibrary_RequestId requestId, MediaLibrary_MediaQuality mediaQuality, MediaLibrary_MediaContentType type,
|
||||
OH_MovingPhoto* movingPhoto);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup MediaAsset
|
||||
* @addtogroup MediaAssetManager
|
||||
* @{
|
||||
*
|
||||
* @brief Provides APIs of request capability for Media Source.
|
||||
@ -59,6 +59,37 @@ extern "C" {
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MediaAsset_GetUri(OH_MediaAsset* mediaAsset, const char** uri);
|
||||
|
||||
/**
|
||||
* @brief Get the media file type of the media asset.
|
||||
*
|
||||
* @param mediaAsset the {@link OH_MediaAsset} instance.
|
||||
* @param mediaType the media file type of the media asset.
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MediaAsset_GetMediaType(OH_MediaAsset* mediaAsset, MediaLibrary_MediaType* mediaType);
|
||||
|
||||
/**
|
||||
* @brief Get the subtype of the media asset.
|
||||
*
|
||||
* @param mediaAsset the {@link OH_MediaAsset} instance.
|
||||
* @param mediaSubType the subtype of the media asset.
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MediaAsset_GetMediaSubType(OH_MediaAsset* mediaAsset,
|
||||
MediaLibrary_MediaSubType* mediaSubType);
|
||||
|
||||
/**
|
||||
* @brief Get the display name of the media asset.
|
||||
*
|
||||
@ -89,6 +120,69 @@ MediaLibrary_ErrorCode OH_MediaAsset_GetDisplayName(OH_MediaAsset* mediaAsset, c
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MediaAsset_GetSize(OH_MediaAsset* mediaAsset, uint32_t* size);
|
||||
|
||||
/**
|
||||
* @brief Get the date of asset creation.
|
||||
*
|
||||
* @param mediaAsset the {@link OH_MediaAsset} instance.
|
||||
* @param dateAdded the creation date of the asset.
|
||||
* The value is the number of seconds elapsed since the Epoch time (00:00:00 UTC on January 1, 1970).
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MediaAsset_GetDateAdded(OH_MediaAsset* mediaAsset, uint32_t* dateAdded);
|
||||
|
||||
/**
|
||||
* @brief Get the modified date of the asset.
|
||||
*
|
||||
* @param mediaAsset the {@link OH_MediaAsset} instance.
|
||||
* @param dateModified the modified date of the asset.
|
||||
* The value is the number of seconds elapsed since the Epoch time.
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MediaAsset_GetDateModified(OH_MediaAsset* mediaAsset, uint32_t* dateModified);
|
||||
|
||||
/**
|
||||
* @brief Get the date taken of the asset.
|
||||
*
|
||||
* @param mediaAsset the {@link OH_MediaAsset} instance.
|
||||
* @param dateTaken the date taken of the asset.
|
||||
* The value is the number of seconds elapsed since the Epoch time.
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MediaAsset_GetDateTaken(OH_MediaAsset* mediaAsset, uint32_t* dateTaken);
|
||||
|
||||
/**
|
||||
* @brief Get the creation time of the asset in milliseconds.
|
||||
*
|
||||
* @param mediaAsset the {@link OH_MediaAsset} instance.
|
||||
* @param dateAddedMs the creation time of the asset in milliseconds.
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MediaAsset_GetDateAddedMs(OH_MediaAsset* mediaAsset, uint32_t* dateAddedMs);
|
||||
|
||||
/**
|
||||
* @brief Get the modified time of the asset in milliseconds.
|
||||
*
|
||||
@ -104,6 +198,21 @@ MediaLibrary_ErrorCode OH_MediaAsset_GetSize(OH_MediaAsset* mediaAsset, uint32_t
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MediaAsset_GetDateModifiedMs(OH_MediaAsset* mediaAsset, uint32_t* dateModifiedMs);
|
||||
|
||||
/**
|
||||
* @brief Get the duration of the media asset in milliseconds.
|
||||
*
|
||||
* @param mediaAsset the {@link OH_MediaAsset} instance.
|
||||
* @param duration the duration of the media asset in milliseconds.
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MediaAsset_GetDuration(OH_MediaAsset* mediaAsset, uint32_t* duration);
|
||||
|
||||
/**
|
||||
* @brief Get the image width(in pixels) of the media asset.
|
||||
*
|
||||
@ -149,6 +258,36 @@ MediaLibrary_ErrorCode OH_MediaAsset_GetHeight(OH_MediaAsset* mediaAsset, uint32
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MediaAsset_GetOrientation(OH_MediaAsset* mediaAsset, uint32_t* orientation);
|
||||
|
||||
/**
|
||||
* @brief Get the favorite state of the asset.
|
||||
*
|
||||
* @param mediaAsset the {@link OH_MediaAsset} instance.
|
||||
* @param favorite the favorite state of the media asset.
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MediaAsset_IsFavorite(OH_MediaAsset* mediaAsset, uint32_t* favorite);
|
||||
|
||||
/**
|
||||
* @brief Get the title of the media asset.
|
||||
*
|
||||
* @param mediaAsset the {@link OH_MediaAsset} instance.
|
||||
* @param title the title of the media asset.
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MediaAsset_GetTitle(OH_MediaAsset* mediaAsset, const char** title);
|
||||
|
||||
/**
|
||||
* @brief Release the media asset
|
||||
*
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup MediaAssetChangeRequest
|
||||
* @addtogroup MediaAssetManager
|
||||
* @{
|
||||
*
|
||||
* @brief Provides APIs of request capability for Media Source.
|
||||
@ -58,6 +58,25 @@ extern "C" {
|
||||
*/
|
||||
OH_MediaAssetChangeRequest* OH_MediaAssetChangeRequest_Create(OH_MediaAsset* mediaAsset);
|
||||
|
||||
/**
|
||||
* @brief Add resource of the asset using file uri.
|
||||
*
|
||||
* @param changeRequest the {@link OH_MediaAssetChangeRequest} instance.
|
||||
* @param resourceType the {@link MediaLibrary_ResourceType} of the resource to add.
|
||||
* @param fileUri the file uri.
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* {@link #MEDIA_LIBRARY_NO_SUCH_FILE} if file does not exist.
|
||||
* {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
|
||||
* {@link #MEDIA_LIBRARY_OPERATION_NOT_SUPPORTED} if operation is not supported.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MediaAssetChangeRequest_AddResourceWithUri(OH_MediaAssetChangeRequest* changeRequest,
|
||||
MediaLibrary_ResourceType resourceType, char* fileUri);
|
||||
|
||||
/**
|
||||
* @brief Add resource of the asset using ArrayBuffer.
|
||||
*
|
||||
@ -77,6 +96,25 @@ OH_MediaAssetChangeRequest* OH_MediaAssetChangeRequest_Create(OH_MediaAsset* med
|
||||
MediaLibrary_ErrorCode OH_MediaAssetChangeRequest_AddResourceWithBuffer(OH_MediaAssetChangeRequest* changeRequest,
|
||||
MediaLibrary_ResourceType resourceType, uint8_t* buffer, uint32_t length);
|
||||
|
||||
/**
|
||||
* @brief Get write cache handler.
|
||||
*
|
||||
* @permission ohos.permission.WRITE_IMAGEVIDEO
|
||||
* @param changeRequest the {@link OH_MediaAssetChangeRequest} instance.
|
||||
* @param fd the write cache handler.
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
|
||||
* {@link #MEDIA_LIBRARY_PERMISSION_DENIED} if permission is denied.
|
||||
* {@link #MEDIA_LIBRARY_OPERATION_NOT_SUPPORTED} if operation is not supported.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MediaAssetChangeRequest_GetWriteCacheHandler(OH_MediaAssetChangeRequest* changeRequest,
|
||||
int32_t* fd);
|
||||
|
||||
/**
|
||||
* @brief Save the photo asset captured by camera.
|
||||
*
|
||||
|
@ -23,6 +23,7 @@ ohos_ndk_headers("media_asset_manager_header") {
|
||||
"../media_asset_capi.h",
|
||||
"../media_asset_change_request_capi.h",
|
||||
"../media_asset_manager_capi.h",
|
||||
"../moving_photo_capi.h",
|
||||
]
|
||||
}
|
||||
|
||||
@ -36,6 +37,7 @@ ohos_ndk_library("libmedia_asset_manager") {
|
||||
"multimedia/media_library/media_asset_base_capi.h",
|
||||
"multimedia/media_library/media_access_helper_capi.h",
|
||||
"multimedia/media_library/media_asset_capi.h",
|
||||
"multimedia/media_library/moving_photo_capi.h",
|
||||
"multimedia/media_library/media_asset_change_request_capi.h",
|
||||
]
|
||||
}
|
||||
|
@ -15,10 +15,18 @@
|
||||
"first_introduced": "12",
|
||||
"name": "OH_MediaAssetManager_CancelRequest"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MediaAssetManager_RequestMovingPhoto"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_MediaAssetManager_RequestImage"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MediaAssetManager_Release"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_MediaAccessHelper_ApplyChanges"
|
||||
@ -27,6 +35,14 @@
|
||||
"first_introduced": "12",
|
||||
"name": "OH_MediaAsset_GetUri"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MediaAsset_GetMediaType"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MediaAsset_GetMediaSubType"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_MediaAsset_GetDisplayName"
|
||||
@ -35,10 +51,30 @@
|
||||
"first_introduced": "12",
|
||||
"name": "OH_MediaAsset_GetSize"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MediaAsset_GetDateAdded"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MediaAsset_GetDateModified"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MediaAsset_GetDateTaken"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MediaAsset_GetDateAddedMs"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_MediaAsset_GetDateModifiedMs"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MediaAsset_GetDuration"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_MediaAsset_GetWidth"
|
||||
@ -51,18 +87,54 @@
|
||||
"first_introduced": "12",
|
||||
"name": "OH_MediaAsset_GetOrientation"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MediaAsset_IsFavorite"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MediaAsset_GetTitle"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_MediaAsset_Release"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MovingPhoto_GetUri"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MovingPhoto_RequestContentWithUris"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MovingPhoto_RequestContentWithUri"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MovingPhoto_RequestContentWithBuffer"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MovingPhoto_Release"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_MediaAssetChangeRequest_Create"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MediaAssetChangeRequest_AddResourceWithUri"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_MediaAssetChangeRequest_AddResourceWithBuffer"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_MediaAssetChangeRequest_GetWriteCacheHandler"
|
||||
},
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_MediaAssetChangeRequest_SaveCameraPhoto"
|
||||
|
@ -96,6 +96,30 @@ MediaLibrary_RequestId OH_MediaAssetManager_RequestVideoForPath(OH_MediaAssetMan
|
||||
*/
|
||||
bool OH_MediaAssetManager_CancelRequest(OH_MediaAssetManager* manager, const MediaLibrary_RequestId requestId);
|
||||
|
||||
/**
|
||||
* @brief Request moving photo object.
|
||||
*
|
||||
* @permission ohos.permission.READ_IMAGEVIDEO
|
||||
* @param manager the pointer to {@link OH_MediaAssetManager} instance.
|
||||
* @param mediaAsset the {@link OH_MediaAsset} instance of media file object to be requested.
|
||||
* @param requestOptions the {@link MediaLibrary_RequestOptions} for image request strategy mode.
|
||||
* @param requestId indicates the {@link MediaLibrary_RequestId} of the request, which is an output parameter.
|
||||
* @param callback the {@link OH_MediaLibrary_OnMovingPhotoDataPrepared} that will be called
|
||||
* when the requested source is prepared.
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* {@link #MEDIA_LIBRARY_OPERATION_NOT_SUPPORTED} if operation is not supported.
|
||||
* {@link #MEDIA_LIBRARY_PERMISSION_DENIED} if permission is denied.
|
||||
* {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MediaAssetManager_RequestMovingPhoto(OH_MediaAssetManager* manager,
|
||||
OH_MediaAsset* mediaAsset, MediaLibrary_RequestOptions requestOptions, MediaLibrary_RequestId* requestId,
|
||||
OH_MediaLibrary_OnMovingPhotoDataPrepared callback);
|
||||
|
||||
/**
|
||||
* @brief Request image resources based on different strategy modes.
|
||||
*
|
||||
@ -120,6 +144,19 @@ MediaLibrary_ErrorCode OH_MediaAssetManager_RequestImage(OH_MediaAssetManager* m
|
||||
MediaLibrary_RequestOptions requestOptions, MediaLibrary_RequestId* requestId,
|
||||
OH_MediaLibrary_OnImageDataPrepared callback);
|
||||
|
||||
/**
|
||||
* @brief Release the {@link OH_MediaAssetManager} instance.
|
||||
*
|
||||
* @param manager the {@link OH_MediaAssetManager} instance.
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MediaAssetManager_Release(OH_MediaAssetManager* manager);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
138
multimedia/media_library/moving_photo_capi.h
Normal file
138
multimedia/media_library/moving_photo_capi.h
Normal file
@ -0,0 +1,138 @@
|
||||
/*
|
||||
* 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 MediaAssetManager
|
||||
* @{
|
||||
*
|
||||
* @brief Provides APIs of request capability for Media Source.
|
||||
*
|
||||
* @since 13
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file moving_photo_capi.h
|
||||
*
|
||||
* @brief Defines APIs related to moving photo.
|
||||
*
|
||||
* Provides the ability to obtain moving photo information.
|
||||
*
|
||||
* @kit MediaLibraryKit
|
||||
* @syscap SystemCapability.FileManagement.PhotoAccessHelper.Core
|
||||
* @library libmedia_asset_manager.so
|
||||
* @since 13
|
||||
*/
|
||||
|
||||
#ifndef MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MOVING_PHOTO_H
|
||||
#define MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MOVING_PHOTO_H
|
||||
|
||||
#include "media_asset_base_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Get uri of the moving photo.
|
||||
*
|
||||
* @param movingPhoto the {@link OH_MovingPhoto} instance.
|
||||
* @param uri the uri of the moving photo.
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MovingPhoto_GetUri(OH_MovingPhoto* movingPhoto, const char** uri);
|
||||
|
||||
/**
|
||||
* @brief Request the image and video content of the moving photo and write to destination uri.
|
||||
*
|
||||
* @permission ohos.permission.READ_IMAGEVIDEO
|
||||
* @param movingPhoto the {@link OH_MovingPhoto} instance.
|
||||
* @param imageUri the destination file uri to save the image data.
|
||||
* @param videoUri the destination file uri to save the video data.
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* {@link #MEDIA_LIBRARY_PERMISSION_DENIED} if permission is denied.
|
||||
* {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MovingPhoto_RequestContentWithUris(OH_MovingPhoto* movingPhoto, char* imageUri,
|
||||
char* videoUri);
|
||||
|
||||
/**
|
||||
* @brief Request the image or video content of the moving photo and write to destination uri.
|
||||
*
|
||||
* @permission ohos.permission.READ_IMAGEVIDEO
|
||||
* @param movingPhoto the {@link OH_MovingPhoto} instance.
|
||||
* @param resourceType the {@link MediaLibrary_ResourceType} of the moving photo content to request.
|
||||
* @param uri the destination file uri to save the data.
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* {@link #MEDIA_LIBRARY_PERMISSION_DENIED} if permission is denied.
|
||||
* {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MovingPhoto_RequestContentWithUri(OH_MovingPhoto* movingPhoto,
|
||||
MediaLibrary_ResourceType resourceType, char* uri);
|
||||
|
||||
/**
|
||||
* @brief Request data of the moving photo.
|
||||
*
|
||||
* @permission ohos.permission.READ_IMAGEVIDEO
|
||||
* @param movingPhoto the {@link OH_MovingPhoto} instance.
|
||||
* @param resourceType the {@link MediaLibrary_ResourceType} of the moving photo content to request.
|
||||
* @param buffer the buffer of the content.
|
||||
* @param size the size of the buffer.
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* {@link #MEDIA_LIBRARY_PERMISSION_DENIED} if permission is denied.
|
||||
* {@link #MEDIA_LIBRARY_INTERNAL_SYSTEM_ERROR} if internal system error.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MovingPhoto_RequestContentWithBuffer(OH_MovingPhoto* movingPhoto,
|
||||
MediaLibrary_ResourceType resourceType, const uint8_t** buffer, uint32_t* size);
|
||||
|
||||
/**
|
||||
* @brief Release the {@link OH_MovingPhoto} instance.
|
||||
*
|
||||
* @param movingPhoto the {@link OH_MovingPhoto} instance.
|
||||
* @return {@link #MEDIA_LIBRARY_OK} if the method call succeeds.
|
||||
* {@link #MEDIA_LIBRARY_PARAMETER_ERROR} Parameter error. Possible causes:
|
||||
* 1. Mandatory parameters are left unspecified.
|
||||
* 2. Incorrect parameter types.
|
||||
* 3. Parameter verification failed.
|
||||
* @since 13
|
||||
*/
|
||||
MediaLibrary_ErrorCode OH_MovingPhoto_Release(OH_MovingPhoto* movingPhoto);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // MULTIMEDIA_MEDIA_LIBRARY_NATIVE_MOVING_PHOTO_H
|
||||
/** @} */
|
Loading…
Reference in New Issue
Block a user