2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
camera2_request_queue_src_ops 구조체 참조
#include <
camera2.h
>
입력 대기열 프로토콜 요청:
프레임워크는 대기열과 그 콘텐츠를 보유합니다. 시작 시 대기열은 비어 있습니다.
-
첫 번째 메타데이터 버퍼가 대기열에 배치되면 프레임워크는 notify_request_queue_not_empty()를 호출하여 기기에 신호를 보냅니다.
-
notify_request_queue_not_empty를 수신한 후 기기는 다음 버퍼를 처리할 준비가 되면 dequeue()를 호출해야 합니다.
-
기기가 버퍼를 처리하고 다음 버퍼를 받을 준비가 되면 알림을 기다리는 대신 dequeue()를 다시 호출해야 합니다. 사용할 수 있는 버퍼가 더 이상 없으면 dequeue()가 NULL을 반환합니다. 이 시점 이후 버퍼를 사용할 수 있게 되면 프레임워크는 notify_request_queue_not_empty()를 다시 호출해야 합니다. 기기가 dequeue에서 NULL 반환을 수신하면 소스에서 notify_request_queue_not_empty() 호출을 수신할 때까지 대기열을 다시 쿼리할 필요가 없습니다.
-
기기가 buffer_count()를 호출하고 0을 수신한다고 해서 프레임워크가 notify_request_queue_not_empty() 호출을 제공하는 것은 아닙니다. 프레임워크는 기기가 큐에서 NULL을 수신한 후에만 또는 초기 시작 시 이러한 알림을 제공합니다.
-
notify_request_queue_not_empty()에 대한 응답으로 호출되는 dequeue()는 notify_request_queue_not_empty() 호출과 동일한 스레드에 있을 수 있으며 notify 호출 내에서 실행될 수 있습니다.
-
오류가 발생하거나 기기 플러시가 요청되거나 기기가 종료되는 경우를 포함하여 모든 큐에서 제거된 요청 버퍼는 free_request를 호출하여 프레임워크로 반환해야 합니다.
camera2.h
파일의
220
번 행에 정의되어 있습니다.
프레임워크에서 메타데이터 버퍼를 가져옵니다. 오류가 없으면 OK를 반환합니다. 대기열이 비어 있으면 버퍼에 NULL을 반환합니다. 이 경우 기기는 notify_request_queue_not_empty() 메시지를 기다린 후에야 다시 큐를 삭제할 수 있습니다. 이 방법으로 가져온 버퍼는
free_request()
를 사용하여 프레임워크에 반환해야 합니다.
camera2.h
FILE의
237
행에 정의되어 있습니다.
메타데이터 버퍼가 사용된 후 또는 오류나 종료가 발생하면 프레임워크에 메타데이터 버퍼를 반환합니다.
camera2.h
FILE의
243
행에 정의되어 있습니다.
대기열에 대기 중인 요청 버퍼 수를 가져옵니다. 반복 요청 (스트림 요청)이 현재 구성된 경우 CAMERA2_REQUEST_QUEUE_IS_BOTTOMLESS를 반환할 수 있습니다. 이 메서드를 호출해도 프레임워크에서 notify_request_queue_not_empty() 메서드를 호출할지 여부에 영향을 미치지 않습니다.
camera2.h
파일의
228
번 행에 정의되어 있습니다.
이 구조체에 관한 문서는 다음 파일에서 생성되었습니다.
-
hardware/libhardware/include/hardware/
camera2.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: 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)"]]