2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
camera3_stream_buffer 구조체 참조
#include <
camera3.h
>
camera3_stream_buffer_t:
camera3 스트림의 단일 버퍼입니다. 상위 스트림의 핸들, gralloc 버퍼 자체의 핸들, 동기화 펜스가 포함됩니다.
버퍼는 입력용인지 출력용인지 지정하지 않습니다. 이는 상위 스트림 유형과 버퍼가 HAL 기기에 전달되는 방식에 따라 결정됩니다.
camera3.h
파일의
1755
строке에 정의가 있습니다.
이 버퍼의 획득 동기화 울타리입니다. HAL은 이 버퍼에서 읽거나 쓰려고 시도하기 전에 이 펜스 fd를 기다려야 합니다.
프레임워크는 이 버퍼에 대기가 필요하지 않음을 나타내기 위해 -1로 설정될 수 있습니다.
HAL이 process_capture_result()를 사용하여 프레임워크에 출력 버퍼를 반환하면 acquire_fence를 -1로 설정해야 합니다. 버퍼를 채우는 데 오류가 발생하여 HAL이 acquire_fence를 기다리지 않는 경우 process_capture_result()를 호출할 때 HAL은 버퍼의 release_fence를 프레임워크에서 전달한 acquire_fence로 설정해야 합니다. 이렇게 하면 프레임워크가 버퍼를 재사용하기 전에 펜스를 기다릴 수 있습니다.
입력 버퍼의 경우 HAL은 process_capture_request() 호출 중에 acquire_fence 필드를 변경하면 안 됩니다.
>= CAMERA_DEVICE_API_VERSION_3_2:
HAL이 process_capture_result()를 사용하여 프레임워크에 입력 버퍼를 반환하는 경우 acquire_fence를 -1로 설정해야 합니다. HAL이 오류로 인해 입력 버퍼 획득 펜스를 기다리지 않는 경우 동기화 펜스는 출력 버퍼에 대해 처리되는 방식과 유사하게 처리되어야 합니다.
camera3.h
파일의
1800
줄에 정의되어 있습니다.
이 버퍼의 출시 동기화 펜스입니다. HAL은 프레임워크에 버퍼를 반환할 때 이 펜스를 설정하거나 -1을 써서 이 버퍼에 대기할 필요가 없음을 나타내야 합니다.
출력 버퍼의 경우 process_capture_result()에 전달된 output_buffers 배열에서 펜스를 설정해야 합니다.
<= CAMERA_DEVICE_API_VERSION_3_1:
입력 버퍼의 경우 process_capture_request() 호출에 의해 해제 펜스가 설정되어야 합니다.
>= CAMERA_DEVICE_API_VERSION_3_2:
입력 버퍼의 경우 울타리는 process_capture_result()에 전달된 input_buffer에 설정되어야 합니다.
이 버퍼의 release_fence를 신호한 후에는 소유권이 프레임워크로 완전히 다시 이전되었으므로 HAL이 이 버퍼에 액세스하려고 시도해서는 안 됩니다.
펜스 -1이 지정된 경우 process_capture_result를 호출하면 이 버퍼의 소유권이 즉시 다시 이전됩니다.
camera3.h
FILE의
1827
라인에 정의가 있습니다.
버퍼의 현재 상태입니다(camera3_buffer_status_t 값 중 하나). 프레임워크는 오류 상태인 버퍼를 HAL에 전달하지 않습니다. HAL에서 버퍼를 채울 수 없는 경우 process_capture_result()를 사용하여 프레임워크로 반환될 때 상태가 CAMERA3_BUFFER_STATUS_ERROR로 설정되어야 합니다.
camera3.h
파일의
1773
줄에 정의되어 있습니다.
이 구조체에 관한 문서는 다음 파일에서 생성되었습니다.
-
hardware/libhardware/include/hardware/
camera3.h
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(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-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)"]]