À partir du 27 mars 2025, nous vous recommandons d'utiliser android-latest-release
au lieu de aosp-main
pour créer et contribuer à AOSP. Pour en savoir plus, consultez la section Modifications apportées à AOSP.
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Référence de la struct camera3_stream_buffer
#include <
camera3.h
>
camera3_stream_buffer_t:
Un seul tampon à partir d'un flux camera3. Il inclut un gestionnaire de son flux parent, le gestionnaire du tampon gralloc lui-même et des barrières de synchronisation.
La mémoire tampon ne spécifie pas si elle doit être utilisée pour l'entrée ou la sortie. Cela est déterminé par le type de flux parent et la manière dont la mémoire tampon est transmise à l'appareil HAL.
Définition à la ligne
1755
du fichier
camera3.h
.
Barrière de synchronisation d'acquisition pour ce tampon. Le HAL doit attendre ce fd de clôture avant de tenter de lire ou d'écrire dans ce tampon.
Le framework peut être défini sur -1 pour indiquer qu'aucun temps d'attente n'est nécessaire pour ce tampon.
Lorsque le HAL renvoie un tampon de sortie au framework avec process_capture_result(), la valeur acquire_fence doit être définie sur -1. Si la HAL n'attend jamais sur le acquire_fence en raison d'une erreur de remplissage d'un tampon, lors de l'appel de process_capture_result(), la HAL doit définir le release_fence du tampon sur l'acquire_fence qui lui est transmis par le framework. Cela permet au framework d'attendre la clôture avant de réutiliser la mémoire tampon.
Pour les tampons d'entrée, le HAL ne doit pas modifier le champ acquire_fence lors de l'appel process_capture_request().
>= CAMERA_DEVICE_API_VERSION_3_2:
Lorsque le HAL renvoie un tampon d'entrée au framework avec process_capture_result(), acquire_fence doit être défini sur -1. Si le HAL n'attend jamais la barrière d'acquisition du tampon d'entrée en raison d'une erreur, les barrières de synchronisation doivent être gérées de la même manière que pour les tampons de sortie.
Définition à la ligne
1800
du fichier
camera3.h
.
Le handle natif vers le tampon
Définition à la ligne
1764
du fichier
camera3.h
.
Barrière de synchronisation de libération pour ce tampon. Le HAL doit définir cette barrière lorsqu'il renvoie des tampons au framework, ou écrire -1 pour indiquer qu'aucune attente n'est requise pour ce tampon.
Pour les tampons de sortie, les barrières doivent être définies dans le tableau "output_buffers" transmis à process_capture_result().
<= CAMERA_DEVICE_API_VERSION_3_1:
Pour le tampon d'entrée, la barrière de libération doit être définie par l'appel process_capture_request().
>= CAMERA_DEVICE_API_VERSION_3_2:
Pour le tampon d'entrée, les barrières doivent être définies dans le tampon d'entrée transmis à process_capture_result().
Une fois le release_fence signalé pour ce tampon, le HAL ne doit plus tenter d'y accéder, car la propriété a été entièrement transférée au framework.
Si une clôture de -1 a été spécifiée, la propriété de ce tampon est immédiatement transférée lors de l'appel de process_capture_result.
Définition à la ligne
1827
du fichier
camera3.h
.
État actuel du tampon, l'une des valeurs camera3_buffer_status_t. Le framework ne transmettra pas de tampons en état d'erreur à la HAL. Si un tampon n'a pas pu être rempli par le HAL, son état doit être défini sur CAMERA3_BUFFER_STATUS_ERROR lorsqu'il est renvoyé au framework avec process_capture_result().
Définition à la ligne
1773
du fichier
camera3.h
.
Handle du flux auquel ce tampon est associé
Définition à la ligne
1759
du fichier
camera3.h
.
La documentation de ce struct a été générée à partir du fichier suivant :
-
hardware/libhardware/include/hardware/
camera3.h
Le contenu et les exemples de code de cette page sont soumis aux licences décrites dans la Licence de contenu. Java et OpenJDK sont des marques ou des marques déposées d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/27 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/07/27 (UTC)."],[],[],null,["# Android Hardware Abstraction Layer: camera3_stream_buffer Struct Reference\n\ncamera3_stream_buffer Struct Reference\n======================================\n\n[Data Fields](#pub-attribs) \ncamera3_stream_buffer Struct Reference \n\n`\n#include \u003c\n`[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)`\n\u003e\n`\n\n|---------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| [camera3_stream_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h) \\* | [stream](/reference/hal/structcamera3__stream__buffer#afaf6c85f165b4180fe63affae0232dad) |\n| ||\n| buffer_handle_t \\* | [buffer](/reference/hal/structcamera3__stream__buffer#ab87cddef201db642e7972d124d741dc2) |\n| ||\n| int | [status](/reference/hal/structcamera3__stream__buffer#a6e27f49150e9a14580fb313cc2777e00) |\n| ||\n| int | [acquire_fence](/reference/hal/structcamera3__stream__buffer#a5d59e0770b54af97a9fe151da5688719) |\n| ||\n| int | [release_fence](/reference/hal/structcamera3__stream__buffer#a248e5f7856e4c2877715fc9fda8d8ba8) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\ncamera3_stream_buffer_t:\n\n\nA single buffer from a camera3 stream. It includes a handle to its parent stream, the handle to the gralloc buffer itself, and sync fences\n\n\nThe buffer does not specify whether it is to be used for input or output; that is determined by its parent stream type and how the buffer is passed to the HAL device.\n\n\nDefinition at line\n[1755](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\nField Documentation\n-------------------\n\n\n|-------------------|\n| int acquire_fence |\n\n\nThe acquire sync fence for this buffer. The HAL must wait on this fence fd before attempting to read from or write to this buffer.\n\n\nThe framework may be set to -1 to indicate that no waiting is necessary for this buffer.\n\n\nWhen the HAL returns an output buffer to the framework with process_capture_result(), the acquire_fence must be set to -1. If the HAL never waits on the acquire_fence due to an error in filling a buffer, when calling process_capture_result() the HAL must set the release_fence of the buffer to be the acquire_fence passed to it by the framework. This will allow the framework to wait on the fence before reusing the buffer.\n\n\nFor input buffers, the HAL must not change the acquire_fence field during the process_capture_request() call.\n\n\n\\\u003e= CAMERA_DEVICE_API_VERSION_3_2:\n\n\nWhen the HAL returns an input buffer to the framework with process_capture_result(), the acquire_fence must be set to -1. If the HAL never waits on input buffer acquire fence due to an error, the sync fences should be handled similarly to the way they are handled for output buffers.\n\n\nDefinition at line\n[1800](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\n|--------------------------|\n| buffer_handle_t\\* buffer |\n\n\nThe native handle to the buffer\n\n\nDefinition at line\n[1764](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\n|-------------------|\n| int release_fence |\n\n\nThe release sync fence for this buffer. The HAL must set this fence when returning buffers to the framework, or write -1 to indicate that no waiting is required for this buffer.\n\n\nFor the output buffers, the fences must be set in the output_buffers array passed to process_capture_result().\n\n\n\\\u003c= CAMERA_DEVICE_API_VERSION_3_1:\n\n\nFor the input buffer, the release fence must be set by the process_capture_request() call.\n\n\n\\\u003e= CAMERA_DEVICE_API_VERSION_3_2:\n\n\nFor the input buffer, the fences must be set in the input_buffer passed to process_capture_result().\n\n\nAfter signaling the release_fence for this buffer, the HAL should not make any further attempts to access this buffer as the ownership has been fully transferred back to the framework.\n\n\nIf a fence of -1 was specified then the ownership of this buffer is transferred back immediately upon the call of process_capture_result.\n\n\nDefinition at line\n[1827](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\n|------------|\n| int status |\n\n\nCurrent state of the buffer, one of the camera3_buffer_status_t values. The framework will not pass buffers to the HAL that are in an error state. In case a buffer could not be filled by the HAL, it must have its status set to CAMERA3_BUFFER_STATUS_ERROR when returned to the framework with process_capture_result().\n\n\nDefinition at line\n[1773](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\n|----------------------------------------------------------------------------------------------------------------------------------|\n| [camera3_stream_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h) \\* stream |\n\n\nThe handle of the stream this buffer is associated with\n\n\nDefinition at line\n[1759](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\nof file\n[camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [camera3.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h)"]]