המחשבונים מתקשרים ביניהם על ידי שליחה וקבלה של מנות. בדרך כלל אירוע אחד
המנה נשלחת יחד עם כל שידור קלט בכל חותמת זמן של הקלט. חבילה יכולה
להכיל נתונים מכל סוג שהוא, כגון פריים יחיד של סרטון או מספר שלם יחיד
מספר זיהויים.
יצירת חבילה
בדרך כלל, חבילות נוצרות באמצעות mediapipe::MakePacket<T>() או
mediapipe::Adopt() (מ-package.h).
// Create a packet containing some new data.Packetp=MakePacket<MyDataClass>("constructor_argument");// Make a new packet with the same data and a different timestamp.Packetp2=p.At(Timestamp::PostStream());
או:
// Create some new data.autodata=absl::make_unique<MyDataClass>("constructor_argument");// Create a packet to own the data.Packetp=Adopt(data.release()).At(Timestamp::PostStream());
מתבצעת גישה לנתונים בתוך חבילה באמצעות Packet::Get<T>()
[[["התוכן קל להבנה","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-24 (שעון UTC)."],[],[],null,["Calculators communicate by sending and receiving packets. Typically a single\npacket is sent along each input stream at each input timestamp. A packet can\ncontain any kind of data, such as a single frame of video or a single integer\ndetection count.\n\nCreating a packet\n\nPackets are generally created with `mediapipe::MakePacket\u003cT\u003e()` or\n`mediapipe::Adopt()` (from packet.h). \n\n // Create a packet containing some new data.\n Packet p = MakePacket\u003cMyDataClass\u003e(\"constructor_argument\");\n // Make a new packet with the same data and a different timestamp.\n Packet p2 = p.At(Timestamp::PostStream());\n\nor: \n\n // Create some new data.\n auto data = absl::make_unique\u003cMyDataClass\u003e(\"constructor_argument\");\n // Create a packet to own the data.\n Packet p = Adopt(data.release()).At(Timestamp::PostStream());\n\nData within a packet is accessed with `Packet::Get\u003cT\u003e()`"]]