1# Multimedia Subsystem Changelog 2 3## cl.multimedia.1 Changed the Return Value Type in the Thumbnail Callback of Camera Kit 4 5**Access Level** 6 7System API 8 9**Reason for Change** 10 11When a user touches a thumbnail after burst shooting, the first-phase image quickly reported by the system for lightweight processing does not match the thumbnail. This is because the image callback sequence in the first phase may be incorrect, resulting in a mismatch between these images and their corresponding thumbnails during callback handling. 12 13**Change Impact** 14 15This change is a non-compatible change. 16 17Before change: The **on('quickThumbnail')** API is used to listen for thumbnail output events, and its callback returns an image.PixelMap object. 18 19After change: The **on('quickThumbnail')** API is used to listen for thumbnail output events, and its callback returns a QuickThumbnail object. 20 21**Start API Level** 22 2310 24 25**Change Since** 26 27OpenHarmony SDK 5.0.0.56 28 29**Key API/Component Changes** 30 31APIs of @ohos.multimedia.camera 32- on(type: 'quickThumbnail', callback: AsyncCallback\<image.PixelMap>): void 33- off(type: 'quickThumbnail', callback?: AsyncCallback\<image.PixelMap>): void 34 35**Adaptation Guide** 36 37When obtaining the callback information from the framework, the application must obtain the quick thumbnail information based on the **QuickThumbnail** class. 38 39**QuickThumbnail** contains the following fields: 40- **captureId:number**: capture ID corresponding to the thumbnail. 41- **thumbnailImage:image.PixelMap**: reported thumbnail. 42 43The sample code is as follows: 44 45 private async quickThumbnail(err, quickThumbnail: camera.QuickThumbnail): Promise\<void> { 46 if (!quickThumbnail?.thumbnailImage) { 47 hilog.info(TAG, 'SHOT2SEE quickThumbnail thumbnailImage is null.'); 48 return; 49 } 50 if (!quickThumbnail?.captureId) { 51 hilog.info(TAG, 'SHOT2SEE quickThumbnail captureId is null.'); 52 return; 53 } 54 hilog.info(TAG, 'SHOT2SEE quickThumbnail success.'); 55 if (err) { 56 const error = `Camera_quickThumbnail Error: ${err.code}}`; 57 hilog.error(TAG, error); 58 const pic: PictureCameraDuration = PictureCameraDuration.getInstance(); 59 pic.setSavePictureFailReason(error); 60 workerCallback.onSavePictureFailed(pic.getPictureId(), pic.getPictureUri(), CaptureFailedType.THUMBNAIL, error); 61 return; 62 } 63 PictureCameraDuration.getInstance().setQuickThumbEndTime(new Date().getTime()); 64 let mediaLibraryService = await modulesManager.getMediaLibrary(); 65 let resPixelMap: image.PixelMap = 66 await mediaLibraryService.getQuickThumbnailWatermarkFilter(quickThumbnail.thumbnailImage, this.isInBurstCapture); 67 68 try { 69 workerCallback.quickThumbnail(resPixelMap, this.isDeferEnabled, quickThumbnail.captureId); 70 if (this.mPickerInfo.isPicker) { 71 const pickerService = await modulesManager.getPickerFileService(); 72 pickerService.resetPickerBuffer(); 73 return; 74 } 75 if (!this.isDeferEnabled) { 76 const mediaLibrary = await modulesManager.getMediaLibrary(); 77 await mediaLibrary.saveThumbnail(quickThumbnail.thumbnailImage, this.savePhotoFormat); // Save the thumbnail in single-segment mode. 78 } 79 } catch (e) { 80 const error = `onQuickThumbnail save error: ${JSON.stringify(e)}.`; 81 hilog.error(TAG, error); 82 const pic: PictureCameraDuration = PictureCameraDuration.getInstance(); 83 const errorReason = pic.getSavePictureFailReason(); 84 workerCallback.onSavePictureFailed(pic.getPictureId(), pic.getPictureUri(), CaptureFailedType.THUMBNAIL, errorReason); 85 PictureCameraDuration.getInstance().setIsCaptureSuccess(false); 86 PictureCameraDuration.getInstance().setPhotoCaptureFailReason(error); 87 workerCallback.onUserBehaviorPhotoInterval(); 88 } finally { 89 quickThumbnail?.thumbnailImage?.release(); 90 resPixelMap?.release(); 91 } 92 } 93