Od 27 marca 2025 r. zalecamy używanie android-latest-release
zamiast aosp-main
do kompilowania i wspołtworzenia AOSP. Więcej informacji znajdziesz w artykule o zmianach w AOSP.
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Dokumentacja struktury camera3_callback_ops
#include <
camera3.h
>
Definicja w wierszu
2397
pliku
camera3.h
.
notify:
Asynchroniczne wywołanie zwrotne powiadomienia z HAL, wywoływane z różnych powodów. Tylko w przypadku informacji niezależnych od przechwytywania klatek lub wymagających określonego czasu. Własność struktury wiadomości pozostaje przy HAL, a wiadomość musi być ważna tylko przez czas trwania tego wywołania.
Wiele wątków może jednocześnie wywoływać metodę
notify()
.
<= CAMERA_DEVICE_API_VERSION_3_1:
Powiadomienie o rozpoczęciu ekspozycji w przypadku danego żądania musi zostać wysłane przez HAL przed pierwszym wywołaniem funkcji
process_capture_result()
dla tego żądania.
>= CAMERA_DEVICE_API_VERSION_3_2:
Bufory dostarczone do platformy nie będą wysyłane do warstwy aplikacji, dopóki nie zostanie odebrany znacznik czasu rozpoczęcia ekspozycji (lub znacznik czasu rozpoczęcia ekspozycji obrazu wejściowego w przypadku żądania ponownego przetwarzania) za pomocą wywołania SHUTTER
notify()
. Zdecydowanie zalecamy jak najszybsze wysłanie tego wywołania.
Wymagania dotyczące skuteczności:
Jest to wywołanie nieblokujące. Framework zwróci to wywołanie za 5 ms.
Definicja w wierszu
2499
w pliku
camera3.h
.
process_capture_result:
Przesyłanie wyników zakończonego przechwytywania do platformy.
process_capture_result()
może być wywoływana wielokrotnie przez HAL w odpowiedzi na pojedyncze żądanie przechwytywania. Dzięki temu np. metadane i bufory o niskiej rozdzielczości mogą być zwracane w jednym wywołaniu, a przetworzone bufory JPEG w późniejszym wywołaniu, gdy będą dostępne. Każde wywołanie musi zawierać numer klatki żądania, dla którego zwracane są metadane lub bufory.
Komponent (bufor lub metadane) pełnego wyniku może być uwzględniony tylko w jednym wywołaniu funkcji process_capture_result. Bufor dla każdego strumienia i metadane wyniku muszą być zwracane przez HAL w przypadku każdego żądania w jednym z wywołań funkcji process_capture_result, nawet w przypadku błędów powodujących powstanie niektórych danych wyjściowych. Wywołanie funkcji
process_capture_result()
bez buforów wyjściowych lub metadanych wyniku jest niedozwolone.
Kolejność zwracania metadanych i buforów dla pojedynczego wyniku nie ma znaczenia, ale bufory dla danego strumienia muszą być zwracane w kolejności FIFO. Bufor dla żądania 5 w przypadku strumienia A musi być zawsze zwracany przed buforem dla żądania 6 w przypadku strumienia A. Dotyczy to również metadanych wyników. Metadane żądania 5 muszą zostać zwrócone przed metadanymi żądania 6.
Poszczególne strumienie są jednak od siebie niezależne, więc jest dopuszczalne i oczekiwane, że bufor żądania 5 w strumieniu A może zostać zwrócony po buforze żądania 6 w strumieniu B. Dopuszczalne jest też, że metadane wyniku żądania 6 w strumieniu B zostaną zwrócone przed buforem żądania 5 w strumieniu A.
HAL zachowuje własność struktury wyniku, która musi być prawidłowa tylko podczas tego połączenia. Framework skopiuje wszystko, czego potrzebuje, zanim ta funkcja zwróci wartość.
Bufory wyjściowe nie muszą być jeszcze wypełnione. Framework będzie czekać na synchronizację zwolnienia bufora strumienia, zanim odczyta dane bufora. Dlatego ta metoda powinna być wywoływana przez HAL jak najszybciej, nawet jeśli niektóre lub wszystkie bufory wyjściowe są nadal wypełniane. HAL musi zawierać w każdym wpisie bufora strumienia output_buffers prawidłowe bariery synchronizacji wydania lub wartość -1, jeśli bufor strumienia jest już wypełniony.
Jeśli nie można utworzyć bufora wyników dla żądania, HAL powinien zwrócić pusty bufor metadanych, ale nadal udostępniać bufor wyjściowy i jego bariery synchronizacji. Dodatkowo należy wywołać funkcję
notify()
z komunikatem ERROR_RESULT.
Jeśli bufora wyjściowego nie można wypełnić, w jego polu stanu musi być ustawiona wartość STATUS_ERROR. Dodatkowo funkcja
notify()
musi być wywoływana z komunikatem ERROR_BUFFER.
Jeśli całe przechwytywanie się nie powiodło, tę metodę nadal trzeba wywołać, aby zwrócić bufory wyjściowe do platformy. Wszystkie stany bufora powinny mieć wartość STATUS_ERROR, a metadane wyniku powinny być pustym buforem. Dodatkowo należy wywołać funkcję
notify()
z komunikatem ERROR_REQUEST. W takim przypadku nie należy wysyłać poszczególnych komunikatów ERROR_RESULT/ERROR_BUFFER.
Wymagania dotyczące skuteczności:
Jest to wywołanie nieblokujące. Framework zwróci to wywołanie za 5 ms.
Opóźnienie potoku (definicja w sekcji S7) powinno być mniejsze lub równe 4 interwałom klatek i nie może przekraczać 8 interwałów klatek.
Definicja w wierszu
2466
w pliku
camera3.h
.
Dokumentacja tej struktury została wygenerowana z tego pliku:
-
hardware/libhardware/include/hardware/
camera3.h
Treść strony i umieszczone na niej fragmenty kodu podlegają licencjom opisanym w Licencji na treści. Java i OpenJDK są znakami towarowymi lub zastrzeżonymi znakami towarowymi należącymi do firmy Oracle lub jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-27 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 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)"]]