import HashMap from "@ohos.util.HashMap"; import { convertSceneType } from '../Utils'; export class CameraInfoDetail { constructor(w3, x3) { this.available = true; this.previewProfiles = new HashMap(); this.photoProfiles = new HashMap(); this.videoProfiles = new HashMap(); this.sysCamera = w3; this.sysCameraManager = x3; this.supportModes = this.sysCameraManager.getSupportedSceneModes(this.sysCamera).map((z3) => z3.valueOf()); } getSysSupportPreviewProfiles(v3) { return this.sysCameraManager.getSupportedOutputCapability(this.sysCamera, convertSceneType(v3)).previewProfiles; } getSysSupportPhotoProfiles(u3) { return this.sysCameraManager.getSupportedOutputCapability(this.sysCamera, convertSceneType(u3)).photoProfiles; } getSysSupportVideoProfiles(t3) { return this.sysCameraManager.getSupportedOutputCapability(this.sysCamera, convertSceneType(t3)).videoProfiles; } getSupportPhotoProfiles(n3) { if (!this.photoProfiles.hasKey(n3)) { let o3 = this.sysCameraManager.getSupportedOutputCapability(this.sysCamera, n3.valueOf()).photoProfiles; let p3 = []; for (let q3 = 0; q3 < o3.length; q3++) { const r3 = o3[q3]; let s3 = { format: r3.format.valueOf(), size: r3.size, }; p3.push(s3); } this.photoProfiles.set(n3, p3); } return this.photoProfiles.get(n3); } getSupportVideoProfiles(h3) { if (!this.photoProfiles.hasKey(h3)) { let i3 = this.sysCameraManager.getSupportedOutputCapability(this.sysCamera, h3.valueOf()).videoProfiles; let j3 = []; for (let k3 = 0; k3 < i3.length; k3++) { const l3 = i3[k3]; let m3 = { format: l3.format.valueOf(), size: l3.size, frameRateRange: { min: l3.frameRateRange.min, max: l3.frameRateRange.max, }, }; j3.push(m3); } this.videoProfiles.set(h3, j3); } return this.videoProfiles.get(h3); } getSupportPreviewProfiles(b3) { if (!this.previewProfiles.hasKey(b3)) { let c3 = this.sysCameraManager.getSupportedOutputCapability(this.sysCamera, b3.valueOf()).previewProfiles; let d3 = []; for (let e3 = 0; e3 < c3.length; e3++) { const f3 = c3[e3]; let g3 = { format: f3.format.valueOf(), size: f3.size, }; d3.push(g3); } this.previewProfiles.set(b3, d3); } return this.previewProfiles.get(b3); } getCameraPosition() { return this.sysCamera.cameraPosition.valueOf(); } getSupportModes() { return this.supportModes; } getCameraId() { return this.sysCamera.cameraId; } updateCameraStatus(a3) { this.available = a3; } getAvailable() { return this.available; } } 