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