// Copyright 2019 The MediaPipe Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Two classes: Timestamp and TimestampDiff for specifying timestamps // within the CalculatorFramework (and mediapipe in general). MediaPipe // timestamps are in units of _microseconds_. // // There are several special values (All these values must be constructed // using the static methods provided): // Unset: The default initialization value, not generally // valid when a timestamp is required. // Unstarted: The timestamp before any valid timestamps. This is // the input timestamp during Open(). // PreStream: A value for specifying that a packet contains "header" // data that should be processed before any other // timestamp. Like PostStream, if this value is sent then // it must be the only value that is sent on the stream. // Min: The minimum range timestamp to see in Process(). // Any number of "range" timestamp can be sent over a // stream, provided that they are sent in monotonically // increasing order. // Max: The maximum range timestamp to see in Process(). // PostStream: A value for specifying that a packet pertains to // the entire stream. This "summary" timestamp occurs // after all the "range" timestamps. If this timestamp // is sent on a stream, it must be the only packet sent. // OneOverPostStream: // The value immediately following PostStream. // This should only be used internally. // Done: The timestamp after all valid timestamps. // This is the input timestamp during Close(). #ifndef MEDIAPIPE_FRAMEWORK_TIMESTAMP_H_ #define MEDIAPIPE_FRAMEWORK_TIMESTAMP_H_ #include <cmath> #include <cstdint> #include <string> #include "absl/log/absl_check.h" #include "mediapipe/framework/deps/safe_int.h" #include "mediapipe/framework/port/logging.h" mediapipe // namespace mediapipe #endif // MEDIAPIPE_FRAMEWORK_TIMESTAMP_H_