Начиная с 27 марта 2025 г. мы рекомендуем использовать android-latest-release
вместо aosp-main
для создания и участия в AOSP. Дополнительные сведения см. в разделе Изменения в AOSP .
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Ссылка на структуру camera3_stream_buffer
#include < camera3.h >
camera3_stream_buffer_t:
Один буфер из потока camera3. Он включает в себя дескриптор родительского потока, дескриптор самого буфера gralloc и барьеры синхронизации.
Буфер не определяет, будет ли он использоваться для ввода или вывода; это определяется типом его родительского потока и тем, как буфер передается устройству HAL.
Определение в строке 1755 файла camera3.h .
Ограничитель синхронизации получения для этого буфера. HAL должен дождаться этого ограничительного fd, прежде чем пытаться прочитать или записать в этот буфер.
Для платформы может быть установлено значение -1, чтобы указать, что для этого буфера ожидание не требуется.
Когда HAL возвращает выходной буфер в платформу с помощью функцииprocess_capture_result(), параметрacquire_fence должен быть установлен в -1. Если HAL никогда не ожидает получения_fence из-за ошибки при заполнении буфера, при вызове функцииprocess_capture_result() HAL должен установить для Release_fence буфера значение Acquire_fence, переданное ему платформой. Это позволит платформе ожидать ожидания перед повторным использованием буфера.
Для входных буферов HAL не должен изменять полеacquire_fence во время вызоваprocess_capture_request().
>= CAMERA_DEVICE_API_VERSION_3_2:
Когда HAL возвращает входной буфер в платформу с помощью функцииprocess_capture_result(), параметрacquire_fence должен быть установлен в -1. Если HAL никогда не ожидает получения ограничения входного буфера из-за ошибки, ограничения синхронизации должны обрабатываться аналогично тому, как они обрабатываются для выходных буферов.
Определение в строке 1800 файла camera3.h .
Собственный дескриптор буфера
Определение в строке 1764 файла camera3.h .
Ограждение синхронизации выпуска для этого буфера. HAL должен установить это ограничение при возврате буферов в платформу или записать -1, чтобы указать, что для этого буфера ожидание не требуется.
Для выходных буферов ограничения должны быть установлены в массиве выходных_буферов, передаваемом в процесс_capture_result().
<= CAMERA_DEVICE_API_VERSION_3_1:
Для входного буфера ограничение освобождения должно быть установлено вызовомprocess_capture_request().
>= CAMERA_DEVICE_API_VERSION_3_2:
Для входного буфера границы должны быть установлены в input_buffer, передаваемом в процесс_capture_result().
После сигнализации Release_fence для этого буфера HAL не должен предпринимать дальнейших попыток доступа к этому буферу, поскольку право собственности было полностью передано обратно в структуру.
Если было указано ограничение -1, то право собственности на этот буфер передается обратно сразу же после вызоваprocess_capture_result.
Определение в строке 1827 файла camera3.h .
Текущее состояние буфера, одно из значений camera3_buffer_status_t. Платформа не будет передавать в HAL буферы, находящиеся в состоянии ошибки. В случае, если буфер не может быть заполнен HAL, его статус должен быть установлен на CAMERA3_BUFFER_STATUS_ERROR при возвращении в платформу с помощьюprocess_capture_result().
Определение в строке 1773 файла camera3.h .
Дескриптор потока, с которым связан этот буфер.
Определение в строке 1759 файла camera3.h .
Документация для этой структуры была создана из следующего файла:
- Аппаратное обеспечение/libhardware/include/hardware/ camera3.h
Контент и образцы кода на этой странице предоставлены по лицензиям. Java и OpenJDK – это зарегистрированные товарные знаки корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-29 UTC.
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2025-07-29 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)"]]