1 /* 2 * Copyright (c) 2025 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 OHOS_CAMERA_PHOTO_ASSET_BUFFER_CONSUMER_H 17 #define OHOS_CAMERA_PHOTO_ASSET_BUFFER_CONSUMER_H 18 19 #include "ibuffer_consumer_listener.h" 20 #include "surface.h" 21 #include <mutex> 22 23 namespace OHOS { 24 namespace CameraStandard { 25 class HStreamCapture; 26 namespace DeferredProcessing { 27 class TaskManager; 28 } 29 class PhotoAssetBufferConsumer : public IBufferConsumerListener { 30 public: 31 explicit PhotoAssetBufferConsumer(wptr<HStreamCapture> streamCapture); 32 ~PhotoAssetBufferConsumer() override; 33 void OnBufferAvailable() override; 34 35 private: 36 void ExecuteOnBufferAvailable(); 37 void StartWaitAuxiliaryTask( 38 const int32_t captureId, const int32_t auxiliaryCount, int64_t timestamp, sptr<SurfaceBuffer> &surfaceBuffer); 39 void AssembleDeferredPicture(int64_t timestamp, int32_t captureId); 40 void CleanAfterTransPicture(int32_t captureId); 41 42 wptr<HStreamCapture> streamCapture_ = nullptr; 43 std::mutex taskManagerMutex_; 44 std::shared_ptr<DeferredProcessing::TaskManager> taskManager_ = nullptr; 45 }; 46 47 } // namespace CameraStandard 48 } // namespace OHOS 49 #endif 50