Mulai 27 Maret 2025, sebaiknya gunakan android-latest-release
, bukan aosp-main
, untuk mem-build dan berkontribusi pada AOSP. Untuk mengetahui informasi selengkapnya, lihat Perubahan pada AOSP.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Referensi Struct camera3_callback_ops
#include <
camera3.h
>
Definisi di baris
2397
dari file
camera3.h
.
beri tahu:
Callback notifikasi asinkron dari HAL, diaktifkan karena berbagai alasan. Hanya untuk informasi yang tidak bergantung pada pengambilan frame, atau yang memerlukan pengaturan waktu tertentu. Kepemilikan struktur pesan tetap berada di HAL, dan msg hanya perlu valid selama durasi panggilan ini.
Beberapa thread dapat memanggil
notify()
secara bersamaan.
<= CAMERA_DEVICE_API_VERSION_3_1:
Notifikasi untuk dimulainya eksposur untuk permintaan tertentu harus dikirim oleh HAL sebelum panggilan pertama ke
process_capture_result()
untuk permintaan tersebut dilakukan.
>= CAMERA_DEVICE_API_VERSION_3_2:
Buffer yang dikirimkan ke framework tidak akan dikirim ke lapisan aplikasi hingga stempel waktu awal eksposur (atau stempel waktu awal eksposur gambar input untuk permintaan pemrosesan ulang) diterima melalui panggilan SHUTTER
notify()
. Sangat disarankan untuk mengirimkan panggilan ini sesegera mungkin.
Persyaratan performa:
Ini adalah panggilan non-pemblokiran. Framework akan menampilkan panggilan ini dalam 5 md.
Definisi di baris
2499
dari file
camera3.h
.
process_capture_result:
Mengirim hasil dari perekaman yang telah selesai ke framework.
process_capture_result()
dapat dipanggil beberapa kali oleh HAL sebagai respons terhadap satu permintaan pengambilan gambar. Hal ini memungkinkan, misalnya, metadata dan buffer beresolusi rendah ditampilkan dalam satu panggilan, dan buffer JPEG yang diproses pasca dalam panggilan berikutnya, setelah tersedia. Setiap panggilan harus menyertakan nomor frame permintaan yang menampilkan metadata atau buffer.
Komponen (buffer atau metadata) dari hasil lengkap hanya dapat disertakan dalam satu panggilan process_capture_result. Buffer untuk setiap aliran, dan metadata hasil, harus ditampilkan oleh HAL untuk setiap permintaan dalam salah satu panggilan process_capture_result, bahkan jika terjadi error yang menghasilkan beberapa output. Panggilan ke
process_capture_result()
tanpa buffer output atau metadata hasil tidak diizinkan.
Urutan menampilkan metadata dan buffer untuk satu hasil tidak penting, tetapi buffer untuk aliran tertentu harus ditampilkan dalam urutan FIFO. Jadi, buffer untuk permintaan 5 untuk stream A harus selalu ditampilkan sebelum buffer untuk permintaan 6 untuk stream A. Hal ini juga berlaku untuk metadata hasil; metadata untuk permintaan 5 harus ditampilkan sebelum metadata untuk permintaan 6.
Namun, setiap streaming bersifat independen, sehingga dapat diterima dan diharapkan bahwa buffer untuk permintaan 5 untuk streaming A dapat ditampilkan setelah buffer untuk permintaan 6 untuk streaming B. Selain itu, dapat diterima bahwa metadata hasil untuk permintaan 6 untuk streaming B ditampilkan sebelum buffer untuk permintaan 5 untuk streaming A.
HAL mempertahankan kepemilikan struktur hasil, yang hanya perlu valid untuk diakses selama panggilan ini. Framework akan menyalin apa pun yang diperlukan sebelum panggilan ini ditampilkan.
Buffer output belum perlu diisi; framework akan menunggu pagar sinkronisasi pelepasan buffer streaming sebelum membaca data buffer. Oleh karena itu, metode ini harus dipanggil oleh HAL sesegera mungkin, meskipun beberapa atau semua buffer output masih dalam proses pengisian. HAL harus menyertakan pagar sinkronisasi rilis yang valid ke dalam setiap entri buffer aliran output_buffers, atau -1 jika buffer aliran tersebut sudah terisi.
Jika buffer hasil tidak dapat dibuat untuk permintaan, HAL harus menampilkan buffer metadata kosong, tetapi tetap menyediakan buffer output dan penghalang sinkronisasinya. Selain itu,
notify()
harus dipanggil dengan pesan ERROR_RESULT.
Jika buffer output tidak dapat diisi, kolom statusnya harus disetel ke STATUS_ERROR. Selain itu,
notify()
harus dipanggil dengan pesan ERROR_BUFFER.
Jika seluruh pengambilan gagal, metode ini tetap perlu dipanggil untuk menampilkan buffer output ke framework. Semua status buffer harus berupa STATUS_ERROR, dan metadata hasil harus berupa buffer kosong. Selain itu,
notify()
harus dipanggil dengan pesan ERROR_REQUEST. Dalam hal ini, pesan ERROR_RESULT/ERROR_BUFFER individual tidak boleh dikirim.
Persyaratan performa:
Ini adalah panggilan non-pemblokiran. Framework akan menampilkan panggilan ini dalam 5 md.
Latensi pipeline (lihat S7 untuk definisi) harus kurang dari atau sama dengan 4 interval frame, dan harus kurang dari atau sama dengan 8 interval frame.
Definisi di baris
2466
dari file
camera3.h
.
Dokumentasi untuk struct ini dibuat dari file berikut:
-
hardware/libhardware/include/hardware/
camera3.h
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-27 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)"]]