החל מ-27 במרץ 2025, מומלץ להשתמש ב-android-latest-release
במקום ב-aosp-main
כדי ליצור תרומות ל-AOSP. מידע נוסף זמין במאמר שינויים ב-AOSP.
העברה של מאגר נתונים של מצלמה מבעלים יחיד לכמה צרכנים
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
התכונה הזו כוללת קבוצה של שיטות שמאפשרות ללקוחות מצלמה להוסיף ולהסיר משטחי פלט באופן דינמי בזמן שסשן הצילום פעיל והסטרימינג של המצלמה נמשך. אפשר למפות פלט חדש לשידור מצלמה משותפת ספציפי שנבחר על ידי המשתמש. אחרי שמוסיפים משטח, אפשר להסיר אותו מתי שרוצים.
הרעיון הכללי הוא לשתף את מאגרי הנתונים שמשויכים לשידור של מצלמה מסוימת במספר משטחי פלט. מונה הפניות פנימי עוקב אחרי המאגרים כשהם מוכנים לעיבוד נוסף בצד הצרכן.
כשכל הצרכנים משלימים את המשימות שלהם, המאגר מוסר מהתור וזמין למצלמה.
איור 1. שיתוף מאגר נתונים זמני
תרשים 1 מציג תרחיש לדוגמה שבו מאגרי הנתונים שמעובדים על ידי מקור הנתונים מס' 2 במצלמה מצורפים ומנותקים באופן דינמי, נספרים ומנוהלים על ידי הרכיב שמחלק את מקור הנתונים בתוך מקור נתונים ייעודי ומשותף של פלט בשירות המצלמה.
דוגמאות ומקור
ההטמעה המרכזית של התכונה הזו נמצאת במודול Camera3StreamSplitter
. מידע נוסף על התכונה הזו זמין במסמכי העזר למפתחים:
הטמעה
לא נדרשת הטמעה בצד ה-HAL של המצלמה, כי התכונה הזו מוטמעת בצד המסגרת.
אימות
ההטמעה שלכם צריכה לעבור את בדיקות CTS שמכסות את התכונה הזו מהמודול MultiViewTest ומספריית ה-JNI המקורית של ה-API המקורי.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון 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-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."]]