mediapipe/docs/framework_concepts/packets.md
MediaPipe Team 6b0ab0e012 Project import generated by Copybara.
GitOrigin-RevId: e9b30181bd6a75481835643d6f48c1c05730ff87
2020-08-05 22:14:25 -04:00

758 B

layout title parent nav_order
default Packets Framework Concepts 3

Packets

{: .no_toc }

  1. TOC {:toc}

Each calculator is a node of of a graph. We describe how to create a new calculator, how to initialize a calculator, how to perform its calculations, input and output streams, timestamps, and options

Creating a packet

Packets are generally created with MediaPipe::Adopt() (from packet.h).

// Create some data.
auto data = absl::make_unique<MyDataClass>("constructor_argument");
// Create a packet to own the data.
Packet p = Adopt(data.release());
// Make a new packet with the same data and a different timestamp.
Packet p2 = p.At(Timestamp::PostStream());

Data within a packet is accessed with Packet::Get<T>()