1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef MOVING_PHOTO_IMPL_H 17 #define MOVING_PHOTO_IMPL_H 18 19 #include <mutex> 20 21 #include "cj_common_ffi.h" 22 #include "photo_accesshelper_utils.h" 23 24 namespace OHOS { 25 namespace Media { 26 class FfiMovingPhotoImpl : public OHOS::FFI::FFIData { DECL_TYPE(FfiMovingPhotoImpl,OHOS::FFI::FFIData)27 DECL_TYPE(FfiMovingPhotoImpl, OHOS::FFI::FFIData) 28 public: 29 explicit FfiMovingPhotoImpl(const std::string& photoUri) : photoUri_(photoUri) {} 30 FfiMovingPhotoImpl(const std::string& photoUri, SourceMode sourceMode); 31 std::string GetUri(); 32 SourceMode GetSourceMode(); 33 void SetSourceMode(SourceMode sourceMode); 34 void RequestContent(char* imageFileUri, char* videoFileUri, int32_t &errCode); 35 void RequestContent(int32_t resourceType, char* fileUri, int32_t &errCode); 36 CArrUI8 RequestContent(int32_t resourceType, int32_t &errCode); 37 static int32_t OpenReadOnlyFile(const std::string& uri, bool isReadImage); 38 static int32_t OpenReadOnlyLivePhoto(const std::string& destLivePhotoUri); 39 private: 40 std::string photoUri_; 41 SourceMode sourceMode_ = SourceMode::EDITED_MODE; 42 }; 43 } 44 } 45 #endif