blob: 1fd7a8a5d4d7fa2bfe4d5a6ba310f6635466e7e0 [file] [log] [blame]
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.media2;
using zx;
/// Expresses presentation time as a linear function of reference
/// time. The reference timeline is typically the system monotonic
/// clock, but may be another clock.
type PresentationTimeline = struct {
/// Initial presentation time of this piece of the piecewise-
/// linear presentation timeline.
@allow_deprecated_struct_defaults
initial_presentation_time zx.duration = 0;
/// Initial reference time of this piece of the piecewise-
/// linear presentation timeline.
@allow_deprecated_struct_defaults
initial_reference_time zx.time = 0;
/// Presentation rate, typically 1.0. Non-positive values are
/// not permitted. This field gives the rate at which the
/// presentation progresses if `progressing` is true. If
/// `progressing` is false, the effective rate is zero.
// TODO(dalesat): consider removing this.
// TODO(dalesat): consider use a rational for this.
@allow_deprecated_struct_defaults
rate float32 = 1.0;
/// Indicates whether presentation is progressing. If this
/// value is true, presentation is progressing at the rate
/// given by the `rate` field. If this value is false, the
/// effective presentation rate is zero.
@allow_deprecated_struct_defaults
progressing bool = false;
};
/// Describes units used in packet timestamps.
///
/// The `packet_timestamp_interval` and `presentation_interval` establish the
/// units of the `Timestamp` values in packets in a stream. For
/// example, if the timestamps are in nanosecond units, the two
/// intervals are equal. If the timestamps are frame indices in a
/// 44.1k frames/second audio stream, `packet_timestamp_interval` would be
/// 44,100, and `presentation_interval` would be 1,000,000,000.
/// The intervals constitute a ratio, so the values 441 and
/// 10,000,000 would do just as well for the second example.
type PacketTimestampUnits = struct {
/// Timestamp interval corresponding to `presentation_interval`.
@allow_deprecated_struct_defaults
packet_timestamp_interval int64 = 1000000000;
/// Duration in the presentation timeline corresponding to
/// `packet_timestamp_interval`.
@allow_deprecated_struct_defaults
presentation_interval zx.duration = 1000000000;
};