1# Camera Subsystem Changelog
2
3OpenHarmony 4.1.6.1 has the following changes.
4
5## cl.camera.1 API getSupportedOutputCapability Changed
6
7**Access Level**
8
9Public API
10
11**Reason for Change**
12
13The input parameter **mode: SceneMode** is added so that the API **getSupportedOutputCapability** can be used to query the output capability supported by the camera in the specified scene mode.
14
15**Change Impact**
16
17The API **getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability** is deprecated in API version 11 and will be retained for five more versions.
18
19The API **getSupportedOutputCapability(camera: CameraDevice, mode: SceneMode): CameraOutputCapability** is added in API version 11.
20
21**Key API/Component Changes**
22
23- Involved API:
24
25  getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability
26
27- Before change:
28
29  The input parameter is **camera: CameraDevice**.
30
31- After change:
32
33  The input parameter **mode: SceneMode** is added.
34
35**Adaptation Guide**
36
37Call **getSupportedSceneModes(camera: CameraDevice): Array\<SceneMode\>** to obtain the scene modes supported by the camera, and then call **getSupportedOutputCapability(camera: CameraDevice, mode: SceneMode): CameraOutputCapability** to obtain the output capability supported by the camera in the specified scene mode.
38
39**API Level**
40
4111
42
43**Change Since**
44
45OpenHarmony SDK 4.1.6.3
46
47## cl.camera.2 API createPhotoOutput Changed
48
49**Access Level**
50
51Public API
52
53**Reason for Change**
54
55The input parameter **surfaceId: string** is deleted so that the API **createPhotoOutput** can be used to create a **PhotoOutput** object only based on the photo configuration.
56
57**Change Impact**
58
59The API **createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput** is deprecated in API version 11 and will be retained for five more versions.
60
61The API **createPhotoOutput (profile: Profile): PhotoOutput** is added in API version 11.
62
63**Key API/Component Changes**
64
65- Involved API:
66
67  createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput
68
69- Before change:
70
71  The input parameters are **profile** (specifying the supported photo configuration) and **surfaceId** (specifying the surface ID obtained from **ImageReceiver**).
72
73- After change:
74
75  The input parameter contains only **profile**.
76
77**Adaptation Guide**
78
79Use **createPhotoOutput(profile: Profile): PhotoOutput** to create a **PhotoOutput** object.
80
81**API Level**
82
8311
84
85**Change Since**
86
87OpenHarmony SDK 4.1.6.3
88
89## cl.camera.3 API createCaptureSession Changed
90
91**Access Level**
92
93Public API
94
95**Reason for Change**
96
97Since API version 11, sessions are classified into photo sessions and video sessions, which are created by using the new API **createSession\<T extends Session\>(mode: SceneMode): T**.
98
99**Change Impact**
100
101The API **createCaptureSession(): CaptureSession** is deprecated in API version 11 and will be retained for five more versions.
102
103The API **createSession\<T extends Session\>(mode: SceneMode): T** is added in API version 11.
104
105**Key API/Component Changes**
106
107- Involved API:
108
109  createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput
110
111- Before change:
112
113  **createCaptureSession(): CaptureSession** is used to create a **CaptureSession** instance.
114
115- After change:
116
117  **createSession\<T extends Session\>(mode: SceneMode): T** is used to create a **PhotoSession** or **VideoSession** instance.
118
119**Adaptation Guide**
120
121Call **createSession\<T extends Session\>(mode: SceneMode): T** to create a **PhotoSession** or **VideoSession** instance.
122
123**API Level**
124
12511
126
127**Change Since**
128
129OpenHarmony SDK 4.1.6.3
130
131## cl.camera.4 API CaptureSession Changed
132
133**Access Level**
134
135Public API
136
137**Reason for Change**
138
139**CaptureSession** is used to store all resources **CameraInput** and **CameraOutput** required for running a camera, and apply to the camera device for a photo session or video session.
140
141**Change Impact**
142
143**CaptureSession** and its APIs are deprecated in API version 11 and will be retained for five more versions.
144
145**PhotoSession** and **VideoSession** are added in API version 11 to distinguish photo sessions and video sessions.
146
147**Key API/Component Changes**
148
149- Involved API:
150
151  CaptureSession
152
153- Before change:
154
155  **createCaptureSession(): CaptureSession** is used to create a **CaptureSession** instance.
156
157- After change:
158
159  **createSession\<T extends Session\>(mode: SceneMode): T** is used to create a **PhotoSession** or **VideoSession** instance.
160
161**Adaptation Guide**
162
163Use the **PhotoSession** and **VideoSession** classes.
164
165**API Level**
166
16711
168
169**Change Since**
170
171OpenHarmony SDK 4.1.6.3
172
173## cl.camera.5 APIs start() and stop() of PreviewOutput Changed
174
175**Access Level**
176
177Public API
178
179**Reason for Change**
180
181The start and stop operations of **PreviewOutput** can be included in the start and stop operations of the session.
182
183**Change Impact**
184
185The **start()** and **stop()** APIs of the **PreviewOutput** class is deprecated in API version 11 version and will be retained for five more versions. The operations are included in the start and stop operations of the session.
186
187**Key API/Component Changes**
188
189- Involved API:
190
191  **start()** and **stop()** APIs of the **PreviewOutput** class
192
193- Before change:
194
195  interface PreviewOutput extends CameraOutput
196    start(callback: AsyncCallback\<void\>): void
197    start(): Promise\<void\>
198    stop(callback: AsyncCallback\<void\>): void
199    stop(): Promise\<void\>
200
201- After change:
202
203  The **start()** and **stop()** APIs of the **PhotoSession** or **VideoSession** class are used to trigger the start and end operations.
204
205**Adaptation Guide**
206
207No adaptation is required. The start and stop operations of **PreviewOutput** are triggered by the **start()** and **stop()** APIs of the **PhotoSession** or **VideoSession** class.
208
209## cl.camera.6 APIs for Subscribing to or Unsubscribing from the captureStart Event Changed
210
211**API Level**
212
21311
214
215**Change Since**
216
217OpenHarmony SDK 4.1.6.3
218
219**Access Level**
220
221Public API
222
223**Reason for Change**
224
225The **'captureStart'** event is used to listen for the start of photographing, and the capture ID is returned through the callback. In API version 11, the **'captureStartWithInfo'** event is used, and more information is returned.
226
227**Change Impact**
228
229The APIs for subscribing to or unsubscribing from the **'captureStart'** event are deprecated in API version 11 and will be retained for five more versions.
230
231The APIs for subscribing to or unsubscribing from the **'captureStartWithInfo'** events are added to API version 11. The **CaptureStartInfo** struct is returned through the callback, which can be extended to obtain more information.
232
233**Key API/Component Changes**
234
235- Involved API:
236
237  on(type: 'captureStart', callback: AsyncCallback\<number\>): void
238  off(type: 'captureStart', callback?: AsyncCallback\<number\>): void
239
240- Before change:
241
242  The **'captureStart'** event is used, and the capture ID is returned through the callback.
243
244- After change:
245
246  The **CaptureStartInfo** struct is used to return more information.
247  The API **on(type: 'captureStartWithInfo', callback: AsyncCallback\<CaptureStartInfo\>): void** is added.
248  The API **off(type: 'captureStartWithInfo', callback?: AsyncCallback\<CaptureStartInfo\>): void** is added.
249
250**Adaptation Guide**
251
252Use the new APIs to obtain the **CaptureStartInfo** struct.
253
254**API Level**
255
25611
257
258**Change Since**
259
260OpenHarmony SDK 4.1.6.3
261