• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 CAMERA_PICTURE_PROXY_INTERFACE_H
17 #define CAMERA_PICTURE_PROXY_INTERFACE_H
18 
19 #include "surface_buffer.h"
20 #include "picture_interface.h"
21 #include "camera_dynamic_loader.h"
22 namespace OHOS {
23 namespace CameraStandard {
24 
25 class PictureProxy : public PictureIntf {
26 public:
27     explicit PictureProxy(
28         std::shared_ptr<Dynamiclib> mediaLibraryLib, std::shared_ptr<PictureIntf> pictureIntf);
29 
30     ~PictureProxy() override;
31     static std::shared_ptr<PictureProxy> CreatePictureProxy();
32     void Create(sptr<SurfaceBuffer> &surfaceBuffer) override;
33     void SetAuxiliaryPicture(sptr<SurfaceBuffer> &surfaceBuffer,
34         CameraAuxiliaryPictureType type) override;
35     void CreateWithDeepCopySurfaceBuffer(sptr<SurfaceBuffer> &surfaceBuffer) override;
36     bool Marshalling(Parcel &data) const override;
37     void UnmarshallingPicture(Parcel &data) override;
38     int32_t SetExifMetadata(sptr<SurfaceBuffer> &surfaceBuffer) override;
39     bool SetMaintenanceData(sptr<SurfaceBuffer> &surfaceBuffer) override;
40     void RotatePicture() override;
41     std::shared_ptr<PictureIntf> GetPictureIntf() const;
42 private:
43     // Keep the order of members in this class, the bottom member will be destroyed first
44     std::shared_ptr<Dynamiclib> pictureLib_ = nullptr;
45     std::shared_ptr<PictureIntf> pictureIntf_ = nullptr;
46 };
47 } // namespace CameraStandard
48 } // namespace OHOS
49 
50 #endif // CAMERA_PICTURE_PROXY_INTERFACE_H