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 camera2_request_queue_src_ops
#include <
camera2.h
>
Solicita el protocolo de la cola de entrada:
El framework contiene la cola y su contenido. Al principio, la cola está vacía.
-
Cuando se coloca el primer búfer de metadatos en la cola, el framework le indica al dispositivo que llame a notify_request_queue_not_empty().
-
Después de recibir notify_request_queue_not_empty, el dispositivo debe llamar a dequeue() una vez que esté listo para controlar el siguiente búfer.
-
Una vez que el dispositivo haya procesado un búfer y esté listo para el siguiente, debe volver a llamar a dequeue() en lugar de esperar una notificación. Si no hay más búferes disponibles, dequeue() mostrará un valor nulo. Después de este punto, cuando un búfer esté disponible, el framework debe volver a llamar a notify_request_queue_not_empty(). Si el dispositivo recibe un valor NULL de la cola, no es necesario que vuelva a consultarla hasta que se reciba una llamada notify_request_queue_not_empty() de la fuente.
-
Si el dispositivo llama a buffer_count() y recibe 0, esto no significa que el framework proporcionará una llamada a notify_request_queue_not_empty(). El framework solo proporcionará una notificación de este tipo después de que el dispositivo haya recibido un valor NULL de la cola de espera o en el inicio inicial.
-
La llamada dequeue() en respuesta a notify_request_queue_not_empty() puede estar en el mismo subproceso que la llamada notify_request_queue_not_empty() y se puede realizar desde la llamada de notificación.
-
Todos los búferes de solicitudes eliminados de la cola se deben devolver al framework llamando a free_request, incluso cuando se producen errores, se solicita una limpieza del dispositivo o cuando se apaga el dispositivo.
Definición en la línea
220
del archivo
camera2.h
.
Obtén un búfer de metadatos del framework. Devuelve OK si no hay errores. Si la cola está vacía, muestra NULL en el búfer. En ese caso, el dispositivo debe esperar un mensaje notify_request_queue_not_empty() antes de intentar volver a quitar elementos de la cola. Los búferes obtenidos de esta manera se deben devolver al framework con
free_request()
.
Definición en la línea
237
del archivo
camera2.h
.
Devuelve un búfer de metadatos al framework una vez que se haya usado, o si se produce un error o un cierre.
Definición en la línea
243
del archivo
camera2.h
.
Obtén el recuento de búferes de solicitudes pendientes en la cola. Puede mostrar CAMERA2_REQUEST_QUEUE_IS_BOTTOMLESS si actualmente se configuró una solicitud repetida (solicitud de transmisión). Llamar a este método no tiene efecto en si el framework llamará al método notify_request_queue_not_empty().
Definición en la línea
228
del archivo
camera2.h
.
La documentación de esta struct se generó a partir del siguiente archivo:
-
hardware/libhardware/include/hardware/
camera2.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: camera2_request_queue_src_ops Struct Reference\n\ncamera2_request_queue_src_ops Struct Reference\n==============================================\n\n[Data Fields](#pub-attribs) \ncamera2_request_queue_src_ops Struct Reference \n\n`\n#include \u003c\n`[camera2.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)`\n\u003e\n`\n\n|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Data Fields ----------- ||\n| int(\\* | [request_count](/reference/hal/structcamera2__request__queue__src__ops#a19ec09251038ee392fedcaeb68ede229) )(const struct [camera2_request_queue_src_ops](/reference/hal/structcamera2__request__queue__src__ops) \\*q) |\n| ||\n| int(\\* | [dequeue_request](/reference/hal/structcamera2__request__queue__src__ops#a79adee987dbd6a8ea0cfab81c89ae579) )(const struct [camera2_request_queue_src_ops](/reference/hal/structcamera2__request__queue__src__ops) \\*q, [camera_metadata_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h) \\*\\*buffer) |\n| ||\n| int(\\* | [free_request](/reference/hal/structcamera2__request__queue__src__ops#aa45ae2fd2aedf1843378e213e65a66f8) )(const struct [camera2_request_queue_src_ops](/reference/hal/structcamera2__request__queue__src__ops) \\*q, [camera_metadata_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h) \\*old_buffer) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nRequest input queue protocol:\n\n\nThe framework holds the queue and its contents. At start, the queue is empty.\n\n1. When the first metadata buffer is placed into the queue, the framework signals the device by calling notify_request_queue_not_empty().\n2. After receiving notify_request_queue_not_empty, the device must call dequeue() once it's ready to handle the next buffer.\n3. Once the device has processed a buffer, and is ready for the next buffer, it must call dequeue() again instead of waiting for a notification. If there are no more buffers available, dequeue() will return NULL. After this point, when a buffer becomes available, the framework must call notify_request_queue_not_empty() again. If the device receives a NULL return from dequeue, it does not need to query the queue again until a notify_request_queue_not_empty() call is received from the source.\n4. If the device calls buffer_count() and receives 0, this does not mean that the framework will provide a notify_request_queue_not_empty() call. The framework will only provide such a notification after the device has received a NULL from dequeue, or on initial startup.\n5. The dequeue() call in response to notify_request_queue_not_empty() may be on the same thread as the notify_request_queue_not_empty() call, and may be performed from within the notify call.\n6. All dequeued request buffers must be returned to the framework by calling free_request, including when errors occur, a device flush is requested, or when the device is shutting down.\n\n\nDefinition at line\n[220](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)\nof file\n[camera2.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)\n.\n\nField Documentation\n-------------------\n\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| int(\\* dequeue_request)(const struct [camera2_request_queue_src_ops](/reference/hal/structcamera2__request__queue__src__ops) \\*q, [camera_metadata_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h) \\*\\*buffer) |\n\n\nGet a metadata buffer from the framework. Returns OK if there is no error. If the queue is empty, returns NULL in buffer. In that case, the device must wait for a notify_request_queue_not_empty() message before attempting to dequeue again. Buffers obtained in this way must be returned to the framework with\n[free_request()](/reference/hal/structcamera2__request__queue__src__ops#aa45ae2fd2aedf1843378e213e65a66f8)\n.\n\n\nDefinition at line\n[237](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)\nof file\n[camera2.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)\n.\n\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| int(\\* free_request)(const struct [camera2_request_queue_src_ops](/reference/hal/structcamera2__request__queue__src__ops) \\*q, [camera_metadata_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera_common.h) \\*old_buffer) |\n\n\nReturn a metadata buffer to the framework once it has been used, or if an error or shutdown occurs.\n\n\nDefinition at line\n[243](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)\nof file\n[camera2.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)\n.\n\n|---------------------------------------------------------------------------------------------------------------------------------|\n| int(\\* request_count)(const struct [camera2_request_queue_src_ops](/reference/hal/structcamera2__request__queue__src__ops) \\*q) |\n\n\nGet the count of request buffers pending in the queue. May return CAMERA2_REQUEST_QUEUE_IS_BOTTOMLESS if a repeating request (stream request) is currently configured. Calling this method has no effect on whether the notify_request_queue_not_empty() method will be called by the framework.\n\n\nDefinition at line\n[228](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)\nof file\n[camera2.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)\n.\n\n*** ** * ** ***\n\nThe documentation for this struct was generated from the following file:\n\n- hardware/libhardware/include/hardware/ [camera2.h](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera2.h)"]]