|
Shaka Packager SDK
|
#include <timestamp_util.h>
Public Member Functions | |
| int64_t | Unwrap (int64_t wrapped_pts) |
| void | Reset () |
| Resets the unwrapper state (for stream discontinuities). | |
| bool | IsInitialized () const |
Unwraps 33-bit PTS/DTS timestamps to produce monotonically increasing 64-bit timestamps, handling wrap-around transitions.
This class maintains state across multiple timestamp observations and detects when a wrap-around occurs, automatically adjusting the output to maintain monotonicity.
Example usage: PtsUnwrapper unwrapper; unwrapper.Unwrap(8589934500); // Returns 8589934500 (first call) unwrapper.Unwrap(100); // Returns 8589934692 (detected wrap) unwrapper.Unwrap(200); // Returns 8589934792 (continues)
Thread-safety: NOT thread-safe. Each stream should have its own instance.
Definition at line 70 of file timestamp_util.h.
|
inline |
Returns true if the unwrapper has been initialized with at least one timestamp.
Definition at line 85 of file timestamp_util.h.
| void shaka::media::PtsUnwrapper::Reset | ( | ) |
Resets the unwrapper state (for stream discontinuities).
Definition at line 88 of file timestamp_util.cc.
| int64_t shaka::media::PtsUnwrapper::Unwrap | ( | int64_t | wrapped_pts | ) |
Unwraps a wrapped timestamp to a monotonically increasing value.
| wrapped_pts | 33-bit PTS/DTS value (may wrap around) |
Definition at line 36 of file timestamp_util.cc.