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.
Satu produsen, beberapa transportasi buffering kamera konsumen
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Fitur ini memperkenalkan serangkaian metode yang memungkinkan klien kamera menambahkan dan
menghapus platform output secara dinamis saat sesi pengambilan gambar aktif dan
streaming kamera sedang berlangsung. Output baru dapat dipetakan ke streaming
kamera bersama
tertentu yang dipilih pengguna. Setelah ditambahkan, platform dapat dihapus kapan saja.
Ide umumnya adalah berbagi buffering yang terkait dengan streaming kamera
tertentu dalam beberapa platform output. Penghitung referensi internal melacak
buffer saat siap untuk diproses lebih lanjut di sisi konsumen.
Saat semua konsumen menyelesaikan tugasnya masing-masing, buffering akan dikeluarkan dari antrean dan
tersedia untuk kamera.
Gambar 1. Berbagi buffer
Gambar 1 menggambarkan satu contoh skenario saat buffering yang diproses oleh streaming
kamera 2 secara dinamis dilampirkan dan dilepaskan, dihitung referensi, dan dikelola
oleh komponen pemisah streaming di dalam streaming output bersama khusus dalam
layanan kamera.
Contoh dan sumber
Implementasi inti fitur ini dapat ditemukan di
modul
Camera3StreamSplitter
. Dokumentasi tentang fitur ini dapat ditemukan di referensi developer:
Implementasi
Tidak ada implementasi yang diperlukan di sisi HAL Kamera karena fitur ini
diimplementasikan di sisi framework.
Validasi
Implementasi Anda harus lulus kasus CTS yang mencakup fitur ini dari
modul
MultiViewTest dan
library JNI native
untuk API native.
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-26 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-26 UTC."],[],[],null,["# Single producer, multiple consumer camera buffer transport\n\nThis feature introduces a set of methods that allows camera clients to add and\nremove output surfaces dynamically while the capture session is active and\ncamera streaming is ongoing. A new output can map to a specific, user-selected\n[shared camera](https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration#enableSurfaceSharing())\nstream. After a surface is added, it can be removed at any time.\n\nThe general idea is to share the buffers associated with a particular camera\nstream within several output surfaces. An internal reference counter keeps track\nof the buffers as they become ready for further processing on the consumer side.\nWhen all consumers complete their respective tasks the buffer gets dequeued and\nis available for the camera.\n\n**Figure 1.** Buffer sharing\n\nFigure 1 depicts one example scenario where the buffers processed by camera\nstream 2 are dynamically attached and detached, reference counted, and managed\nby the stream splitter component inside a dedicated shared output stream within\nthe camera service.\n\nExamples and source\n-------------------\n\nThe core implementation of this feature can be found in the\n[`Camera3StreamSplitter`](https://android.googlesource.com/platform/frameworks/av/+/android16-release/services/camera/libcameraservice/device3/Camera3StreamSplitter.cpp)\nmodule. Documentation on this feature can be found in the developer reference:\n\n- [`updateOutputConfiguration()`](https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html#updateOutputConfiguration(android.hardware.camera2.params.OutputConfiguration))\n- [`addSurface()`](https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration#addSurface(android.view.Surface))\n- [`removeSurface()`](https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration#removeSurface(android.view.Surface))\n\nImplementation\n--------------\n\nNo implementation is required on the Camera HAL side as this feature is\nimplemented on the framework side.\n\nValidation\n----------\n\nYour implementation must pass CTS cases that cover this feature from the\n[MultiViewTest](https://android.googlesource.com/platform/cts/+/android16-release/tests/camera/src/android/hardware/camera2/cts/MultiViewTest.java)\nmodule and the\n[native JNI library](https://android.googlesource.com/platform/cts/+/android16-release/tests/camera/libctscamera2jni/native-camera-jni.cpp)\nfor the native API."]]