A partire dal 27 marzo 2025, ti consigliamo di utilizzare android-latest-release
anziché aosp-main
per compilare e contribuire ad AOSP. Per ulteriori informazioni, vedi Modifiche ad AOSP.
Stabilizzazione dell'anteprima della fotocamera
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Per i dispositivi con Android 13 o versioni successive, il framework della fotocamera supporta la stabilizzazione video nello stream di anteprima e in altri stream non RAW nelle sessioni di acquisizione della fotocamera. Questa funzionalità consente alle app di terze parti di offrire un'esperienza what you see is what you get (WYSIWYG) quando si confrontano l'anteprima della fotocamera e la registrazione.
Implementazione
Per fornire questa funzionalità alle app di terze parti, i produttori di dispositivi devono pubblicizzare il supporto per le seguenti chiavi e implementare algoritmi di stabilizzazione dell'anteprima nell'HAL della fotocamera:
Per modificare le impostazioni predefinite per questa funzionalità, assegna un valore predefinito nel
modello di richiesta di acquisizione quando crei una richiesta di acquisizione utilizzando
createCaptureRequest
.
Per un'implementazione di riferimento di questa funzionalità, consulta il codice di EmulatedCamera
in Cuttlefish all'indirizzo hardware/google/camera/devices/EmulatedCamera/hwl/EmulatedSensor.cpp
.
Per ulteriori dettagli sulle modalità di stabilizzazione video, consulta
CONTROL_VIDEO_STABILIZATION_MODE
.
Convalida
Per testare l'implementazione di questa funzionalità, utilizza i seguenti test CTS e ITS:
CTS:
ITS (testa il campo visivo e la qualità della stabilizzazione):
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-07-26 UTC.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-26 UTC."],[],[],null,["# Camera preview stabilization\n\nFor devices running Android 13 or higher, the camera\nframework provides support for video stabilization on the preview stream\nand other non-RAW streams in camera capture sessions. This feature lets\nthird-party apps provide a *what you see is what you get* (WYSIWYG) experience\nwhen comparing between the camera preview and the recording.\n\nImplementation\n--------------\n\nTo provide third-party apps with this feature, device\nmanufacturers must advertise support for the following keys and implement\npreview stabilization algorithms in the camera HAL:\n\n- [`CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES`](https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES)\n- [`CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION`](https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION)\n\nTo modify the default settings for this feature, assign a default value in the\ncapture request template when creating a capture request using\n[`createCaptureRequest`](https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createCaptureRequest(int,%20java.util.Set%3Cjava.lang.String%3E)).\n\nFor a reference implementation of this feature, see the code for\n`EmulatedCamera` in [Cuttlefish](/docs/devices/cuttlefish) at\n[`hardware/google/camera/devices/EmulatedCamera/hwl/EmulatedSensor.cpp`](https://cs.android.com/android/platform/superproject/+/android-latest-release:hardware/google/camera/devices/EmulatedCamera/hwl/EmulatedSensor.cpp#823).\n\nFor more details on video stabilization modes, see\n[`CONTROL_VIDEO_STABILIZATION_MODE`](https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#CONTROL_VIDEO_STABILIZATION_MODE).\n\nValidation\n----------\n\nTo test your implementation of this feature, use the following CTS and ITS\ntests:\n\nCTS:\n\n- [`RobustnessTest.java#testMandatoryPreviewStabilizationOutputCombinations`](https://cs.android.com/android/platform/superproject/+/android-latest-release:cts/tests/camera/src/android/hardware/camera2/cts/RobustnessTest.java)\n\nITS (tests field of view and stabilization quality):\n\n- [`scene4/test_preview_Stabilization_fov.py`](/docs/compatibility/cts/camera-its-tests#test_preview_stabilization_fov)\n- [`sensor_fusion/test_preview_stabilization.py`](/docs/compatibility/cts/camera-its-tests#test_preview_stabilization)"]]