A partir del 27 de marzo de 2025, te recomendamos que uses android-latest-release
en lugar de aosp-main
para compilar y contribuir a AOSP. Para obtener más información, consulta Cambios en AOSP.
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Referencia de la estructura camera3_stream_buffer
#include <
camera3.h
>
camera3_stream_buffer_t:
Un solo búfer de una transmisión de camera3. Incluye un identificador para su flujo superior, el identificador del búfer de gralloc y las cercas de sincronización.
El búfer no especifica si se usará para entrada o salida; eso se determina según el tipo de transmisión superior y cómo se pasa el búfer al dispositivo HAL.
Definición en la línea
1755
del archivo
camera3.h
.
El cerco de sincronización de adquisición para este búfer. El HAL debe esperar en este fd de cerca antes de intentar leer o escribir en este búfer.
El framework se puede establecer en -1 para indicar que no es necesario esperar para este búfer.
Cuando HAL muestra un búfer de salida al framework con process_capture_result(), acquire_fence se debe establecer en -1. Si el sistema HAL nunca espera en el acquire_fence debido a un error en el llenado de un búfer, cuando se llame a process_capture_result(), el sistema HAL debe establecer el release_fence del búfer como el acquire_fence que le pasó el framework. Esto permitirá que el framework espere en el límite antes de volver a usar el búfer.
En el caso de los búferes de entrada, el sistema HAL no debe cambiar el campo acquire_fence durante la llamada a process_capture_request().
>= CAMERA_DEVICE_API_VERSION_3_2:
Cuando el HAL muestra un búfer de entrada al framework con process_capture_result(), acquire_fence se debe establecer en -1. Si el HAL nunca espera en la cerca de adquisición del búfer de entrada debido a un error, las cercas de sincronización se deben controlar de manera similar a la forma en que se controlan para los búferes de salida.
Definición en la línea
1800
del archivo
camera3.h
.
El control nativo del búfer
Definición en la línea
1764
del archivo
camera3.h
.
Es la cerca de sincronización de lanzamiento para este búfer. El sistema HAL debe establecer esta barrera cuando devuelve búferes al framework o escribir -1 para indicar que no se requiere espera para este búfer.
Para los búferes de salida, los cierres se deben establecer en el array output_buffers que se pasa a process_capture_result().
<= CAMERA_DEVICE_API_VERSION_3_1:
Para el búfer de entrada, la llamada process_capture_request() debe establecer la cerca de liberación.
>= CAMERA_DEVICE_API_VERSION_3_2:
Para el búfer de entrada, los cierres deben establecerse en el input_buffer que se pasa a process_capture_result().
Después de indicar el release_fence para este búfer, el sistema HAL no debe realizar más intentos de acceso a este búfer, ya que la propiedad se transfirió por completo al framework.
Si se especificó un límite de -1, la propiedad de este búfer se transfiere de inmediato después de la llamada a process_capture_result.
Definición en la línea
1827
del archivo
camera3.h
.
Es el estado actual del búfer, uno de los valores de camera3_buffer_status_t. El framework no pasará búferes al HAL que estén en un estado de error. En caso de que el HAL no pueda completar un búfer, su estado debe establecerse en CAMERA3_BUFFER_STATUS_ERROR cuando se devuelva al framework con process_capture_result().
Definición en la línea
1773
del archivo
camera3.h
.
Es el identificador de la transmisión con la que está asociado este búfer.
Definición en la línea
1759
del archivo
camera3.h
.
La documentación de esta struct se generó a partir del siguiente archivo:
-
hardware/libhardware/include/hardware/
camera3.h
El contenido y las muestras de código que aparecen en esta página están sujetas a las licencias que se describen en la Licencia de Contenido. Java y OpenJDK son marcas registradas de Oracle o sus afiliados.
Última actualización: 2025-07-27 (UTC)
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 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)"]]