• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 INNER_API_MEDIA_LIBRARY_HELPER_INCLUDE_MEDIA_PHOTO_PROXY_H
17 #define INNER_API_MEDIA_LIBRARY_HELPER_INCLUDE_MEDIA_PHOTO_PROXY_H
18 
19 #include <refbase.h>
20 #include <string>
21 
22 namespace OHOS {
23 namespace Media {
24 enum class PhotoFormat : int32_t {
25     RGBA = 0,
26     JPG,
27     MP4,
28     HEIF,
29     YUV,
30     DNG,
31 };
32 
33 enum class PhotoQuality : int32_t {
34     HIGH = 0,
35     LOW,
36 };
37 
38 enum class DeferredProcType : int32_t {
39     BACKGROUND = 0,
40     OFFLINE,
41 };
42 
43 class PhotoProxy : public RefBase {
44 public:
PhotoProxy()45     PhotoProxy() {}
46     virtual ~PhotoProxy() = default;
47 
48     virtual std::string GetTitle() = 0;
49     virtual std::string GetExtension() = 0; // 图片后缀,例如:jpg/png
50     virtual std::string GetPhotoId() = 0; // 分段式图片id
51     virtual DeferredProcType GetDeferredProcType() = 0; // 分段式拍照类型,相机框架写入,通过媒体库直接透传回相机框架
52     virtual int32_t GetWidth() = 0;
53     virtual int32_t GetHeight() = 0;
54     virtual void *GetFileDataAddr() = 0;
55     virtual size_t GetFileSize() = 0;
56     virtual PhotoFormat GetFormat() = 0; // RGBA、JPG
57     virtual PhotoQuality GetPhotoQuality() = 0; // 后续相机框架可能通过AddPhotoProxy传入高质量图
58     virtual std::string GetBurstKey() = 0; // 一组连拍照片一个key,uuid
59     virtual bool IsCoverPhoto() = 0; // 设置封面,1表示封面
60     virtual void Release() = 0;
61     virtual double GetLatitude() = 0;
62     virtual double GetLongitude() = 0;
63     virtual int32_t GetShootingMode() = 0;
64     virtual uint32_t GetCloudImageEnhanceFlag() = 0;
GetStageVideoTaskStatus()65     virtual int32_t GetStageVideoTaskStatus() // 动态照片是否需要下发分段式视频任务,返回状态枚举值
66     {
67         return 0;
68     }
69 };
70 } // Media
71 } // OHOS
72 #endif // INNER_API_MEDIA_LIBRARY_HELPER_INCLUDE_MEDIA_PHOTO_PROXY_H