2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
camera3_callback_ops 구조체 참조
#include <
camera3.h
>
camera3.h
파일의
2397
번째 줄에 정의되어 있습니다.
알림:
다양한 이유로 실행되는 HAL의 비동기 알림 콜백입니다. 프레임 캡처와 무관하거나 특정 타이밍이 필요한 정보에만 사용됩니다. 메시지 구조의 소유권은 HAL에 유지되며 msg는 이 호출이 지속되는 동안만 유효하면 됩니다.
여러 스레드가 동시에
notify()
를 호출할 수 있습니다.
<= CAMERA_DEVICE_API_VERSION_3_1:
특정 요청의 노출 시작 알림은 해당 요청에 대한
process_capture_result()
의 첫 번째 호출이 이루어지기 전에 HAL에서 전송해야 합니다.
>= CAMERA_DEVICE_API_VERSION_3_2:
프레임워크에 전달된 버퍼는 노출 시작 타임스탬프 (또는 재처리 요청의 입력 이미지 노출 시작 타임스탬프)가 SHUTTER
notify()
호출을 통해 수신될 때까지 애플리케이션 레이어로 디스패치되지 않습니다. 이 호출은 최대한 빨리 디스패치하는 것이 좋습니다.
성능 요구사항:
이는 비차단 호출입니다. 프레임워크는 이 호출을 5ms 내에 반환합니다.
camera3.h
파일의
2499
번째 줄에 정의되어 있습니다.
process_capture_result:
완료된 캡처의 결과를 프레임워크에 전송합니다.
process_capture_result()
는 단일 캡처 요청에 대한 응답으로 HAL에 의해 여러 번 호출될 수 있습니다. 이를 통해 예를 들어 메타데이터와 저해상도 버퍼는 한 번의 호출로 반환되고 후처리된 JPEG 버퍼는 나중에 사용할 수 있게 되면 호출로 반환될 수 있습니다. 각 호출에는 메타데이터 또는 버퍼를 반환하는 요청의 프레임 번호가 포함되어야 합니다.
전체 결과의 구성요소 (버퍼 또는 메타데이터)는 하나의 process_capture_result 호출에만 포함될 수 있습니다. 각 스트림의 버퍼와 결과 메타데이터는 일부 출력을 생성하는 오류가 있는 경우에도 process_capture_result 호출 중 하나에서 각 요청에 대해 HAL에 의해 반환되어야 합니다. 출력 버퍼나 결과 메타데이터 없이
process_capture_result()
를 호출하는 것은 허용되지 않습니다.
단일 결과의 메타데이터와 버퍼를 반환하는 순서는 중요하지 않지만 지정된 스트림의 버퍼는 FIFO 순서로 반환해야 합니다. 따라서 스트림 A의 요청 5 버퍼는 항상 스트림 A의 요청 6 버퍼보다 먼저 반환되어야 합니다. 결과 메타데이터에도 적용됩니다. 요청 6의 메타데이터보다 요청 5의 메타데이터가 먼저 반환되어야 합니다.
하지만 스트림은 서로 독립적이므로 스트림 A의 요청 5 버퍼가 스트림 B의 요청 6 버퍼보다 늦게 반환되어도 괜찮습니다. 스트림 B의 요청 6 결과 메타데이터가 스트림 A의 요청 5 버퍼보다 먼저 반환되어도 괜찮습니다.
HAL은 결과 구조체의 소유권을 유지하며 이 호출 중에 액세스할 때만 유효하면 됩니다. 프레임워크는 이 호출이 반환되기 전에 필요한 모든 것을 복사합니다.
출력 버퍼는 아직 채울 필요가 없습니다. 프레임워크는 스트림 버퍼 출시 동기화 펜스를 기다린 후 버퍼 데이터를 읽습니다. 따라서 일부 또는 모든 출력 버퍼가 아직 채워지고 있더라도 HAL에서 이 메서드를 최대한 빨리 호출해야 합니다. HAL은 각 output_buffers 스트림 버퍼 항목에 유효한 출시 동기화 펜스를 포함해야 합니다. 스트림 버퍼가 이미 채워진 경우에는 -1을 포함해야 합니다.
요청에 대해 결과 버퍼를 구성할 수 없는 경우 HAL은 빈 메타데이터 버퍼를 반환해야 하지만 출력 버퍼와 동기화 펜스는 계속 제공해야 합니다. 또한
notify()
는 ERROR_RESULT 메시지와 함께 호출해야 합니다.
출력 버퍼를 채울 수 없는 경우 상태 필드를 STATUS_ERROR로 설정해야 합니다. 또한
notify()
는 ERROR_BUFFER 메시지와 함께 호출해야 합니다.
전체 캡처가 실패한 경우에도 출력 버퍼를 프레임워크에 반환하기 위해 이 메서드를 호출해야 합니다. 모든 버퍼 상태는 STATUS_ERROR여야 하고 결과 메타데이터는 빈 버퍼여야 합니다. 또한
notify()
는 ERROR_REQUEST 메시지와 함께 호출해야 합니다. 이 경우 개별 ERROR_RESULT/ERROR_BUFFER 메시지를 전송하면 안 됩니다.
성능 요구사항:
이는 비차단 호출입니다. 프레임워크는 이 호출을 5ms 내에 반환합니다.
파이프라인 지연 시간 (정의는 S7 참고)은 프레임 간격의 4배 이하여야 하며 프레임 간격의 8배 이하여야 합니다.
camera3.h
파일의
2466
번째 줄에 정의되어 있습니다.
이 구조체의 문서는 다음 파일에서 생성되었습니다.
-
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_callback_ops Struct Reference\n\ncamera3_callback_ops Struct Reference\n=====================================\n\n[Data Fields](#pub-attribs) \ncamera3_callback_ops 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| void(\\* | [process_capture_result](/reference/hal/structcamera3__callback__ops#a2f7cf688a195532999b8498d6ef15e45) )(const struct [camera3_callback_ops](/reference/hal/structcamera3__callback__ops) \\*, const [camera3_capture_result_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h) \\*result) |\n| ||\n| void(\\* | [notify](/reference/hal/structcamera3__callback__ops#a6d702d6e962f95105b984b17462619b3) )(const struct [camera3_callback_ops](/reference/hal/structcamera3__callback__ops) \\*, const [camera3_notify_msg_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h) \\*msg) |\n| ||\n\n\nDetailed Description\n--------------------\n\n\nDefinition at line\n[2397](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| void(\\* notify)(const struct [camera3_callback_ops](/reference/hal/structcamera3__callback__ops) \\*, const [camera3_notify_msg_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h) \\*msg) |\n\n\nnotify:\n\n\nAsynchronous notification callback from the HAL, fired for various reasons. Only for information independent of frame capture, or that require specific timing. The ownership of the message structure remains with the HAL, and the msg only needs to be valid for the duration of this call.\n\n\nMultiple threads may call\n[notify()](/reference/hal/structcamera3__callback__ops#a6d702d6e962f95105b984b17462619b3)\nsimultaneously.\n\n\n\\\u003c= CAMERA_DEVICE_API_VERSION_3_1:\n\n\nThe notification for the start of exposure for a given request must be sent by the HAL before the first call to\n[process_capture_result()](/reference/hal/structcamera3__callback__ops#a2f7cf688a195532999b8498d6ef15e45)\nfor that request is made.\n\n\n\\\u003e= CAMERA_DEVICE_API_VERSION_3_2:\n\n\nBuffers delivered to the framework will not be dispatched to the application layer until a start of exposure timestamp (or input image's start of exposure timestamp for a reprocess request) has been received via a SHUTTER\n[notify()](/reference/hal/structcamera3__callback__ops#a6d702d6e962f95105b984b17462619b3)\ncall. It is highly recommended to dispatch this call as early as possible.\n\n*** ** * ** ***\n\n\nPerformance requirements:\n\n\nThis is a non-blocking call. The framework will return this call in 5ms.\n\n\nDefinition at line\n[2499](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| void(\\* process_capture_result)(const struct [camera3_callback_ops](/reference/hal/structcamera3__callback__ops) \\*, const [camera3_capture_result_t](https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/camera3.h) \\*result) |\n\n\nprocess_capture_result:\n\n\nSend results from a completed capture to the framework.\n[process_capture_result()](/reference/hal/structcamera3__callback__ops#a2f7cf688a195532999b8498d6ef15e45)\nmay be invoked multiple times by the HAL in response to a single capture request. This allows, for example, the metadata and low-resolution buffers to be returned in one call, and post-processed JPEG buffers in a later call, once it is available. Each call must include the frame number of the request it is returning metadata or buffers for.\n\n\nA component (buffer or metadata) of the complete result may only be included in one process_capture_result call. A buffer for each stream, and the result metadata, must be returned by the HAL for each request in one of the process_capture_result calls, even in case of errors producing some of the output. A call to\n[process_capture_result()](/reference/hal/structcamera3__callback__ops#a2f7cf688a195532999b8498d6ef15e45)\nwith neither output buffers or result metadata is not allowed.\n\n\nThe order of returning metadata and buffers for a single result does not matter, but buffers for a given stream must be returned in FIFO order. So the buffer for request 5 for stream A must always be returned before the buffer for request 6 for stream A. This also applies to the result metadata; the metadata for request 5 must be returned before the metadata for request 6.\n\n\nHowever, different streams are independent of each other, so it is acceptable and expected that the buffer for request 5 for stream A may be returned after the buffer for request 6 for stream B is. And it is acceptable that the result metadata for request 6 for stream B is returned before the buffer for request 5 for stream A is.\n\n\nThe HAL retains ownership of result structure, which only needs to be valid to access during this call. The framework will copy whatever it needs before this call returns.\n\n\nThe output buffers do not need to be filled yet; the framework will wait on the stream buffer release sync fence before reading the buffer data. Therefore, this method should be called by the HAL as soon as possible, even if some or all of the output buffers are still in being filled. The HAL must include valid release sync fences into each output_buffers stream buffer entry, or -1 if that stream buffer is already filled.\n\n\nIf the result buffer cannot be constructed for a request, the HAL should return an empty metadata buffer, but still provide the output buffers and their sync fences. In addition,\n[notify()](/reference/hal/structcamera3__callback__ops#a6d702d6e962f95105b984b17462619b3)\nmust be called with an ERROR_RESULT message.\n\n\nIf an output buffer cannot be filled, its status field must be set to STATUS_ERROR. In addition,\n[notify()](/reference/hal/structcamera3__callback__ops#a6d702d6e962f95105b984b17462619b3)\nmust be called with a ERROR_BUFFER message.\n\n\nIf the entire capture has failed, then this method still needs to be called to return the output buffers to the framework. All the buffer statuses should be STATUS_ERROR, and the result metadata should be an empty buffer. In addition,\n[notify()](/reference/hal/structcamera3__callback__ops#a6d702d6e962f95105b984b17462619b3)\nmust be called with a ERROR_REQUEST message. In this case, individual ERROR_RESULT/ERROR_BUFFER messages should not be sent.\n\n\nPerformance requirements:\n\n\nThis is a non-blocking call. The framework will return this call in 5ms.\n\n\nThe pipeline latency (see S7 for definition) should be less than or equal to 4 frame intervals, and must be less than or equal to 8 frame intervals.\n\n\nDefinition at line\n[2466](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)"]]