Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 33 additions & 16 deletions index.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,29 @@
will become unsaturated after making sufficient progress on the current
workload.

: <dfn>Presentation Timestamp</dfn>
:: An integer value, in microseconds, indicating when a {{VideoFrame}},
{{AudioData}}, {{EncodedVideoChunk}}, or {{EncodedAudioChunk}} is expected
to be presented (rendered) relative to other frames or chunks in the same
media sequence.

The origin (zero point) of the timestamp is defined by the media itself and
does not necessarily correspond to wall-clock time, nor is it guaranteed to

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can even flip this, saying that those times are not associated with a clock domain, and this is just a media timeline.

But this isn't wrong either.

be shared across different media sources or tracks.

<div class='note'>
NOTE: Because the origin is determined by the producer:
* For pre-recorded or animated media, it typically represents time elapsed
from the start of the clip or presentation.
* For live capture sources, it typically reflects the capture time
relative to a monotonic clock, so that preserving relative timestamp
deltas during playback reproduces the original capture timing.
* Within WebCodecs, decoders and encoders preserve presentation timestamps
between encoded chunks and decoded frames or audio data, and encoders
can use the relative timing between timestamps to guide rate control.

</div>

<dfn>Codec Processing Model</dfn> {#codec-processing-model-section}
===================================================================

Expand Down Expand Up @@ -2617,7 +2640,7 @@
: <dfn attribute for=EncodedAudioChunk>\[[type]]</dfn>
:: Describes whether the chunk is a [=key chunk=].
: <dfn attribute for=EncodedAudioChunk>\[[timestamp]]</dfn>
:: The presentation timestamp, given in microseconds.
:: The [=presentation timestamp=], given in microseconds.
: <dfn attribute for=EncodedAudioChunk>\[[duration]]</dfn>
:: The presentation duration, given in microseconds.
: <dfn attribute for=EncodedAudioChunk>[[byte length]]</dfn>
Expand Down Expand Up @@ -2723,7 +2746,7 @@
: <dfn attribute for=EncodedVideoChunk>\[[type]]</dfn>
:: The {{EncodedVideoChunkType}} of this {{EncodedVideoChunk}};
: <dfn attribute for=EncodedVideoChunk>\[[timestamp]]</dfn>
:: The presentation timestamp, given in microseconds.
:: The [=presentation timestamp=], given in microseconds.
: <dfn attribute for=EncodedVideoChunk>\[[duration]]</dfn>
:: The presentation duration, given in microseconds.
: <dfn attribute for=EncodedVideoChunk>[[byte length]]</dfn>
Expand Down Expand Up @@ -2917,7 +2940,7 @@
:: The number of audio channels for this {{AudioData}}.

: <dfn attribute for=AudioData>\[[timestamp]]</dfn>
:: The presentation timestamp, in microseconds, for this {{AudioData}}.
:: The [=presentation timestamp=], in microseconds, for this {{AudioData}}.

### Constructors ###{#audiodata-constructors}
<dfn constructor for=AudioData title="AudioData(init)">
Expand Down Expand Up @@ -2985,7 +3008,7 @@
{{AudioData/[[number of channels]]}}.

: <dfn attribute for=AudioData>timestamp</dfn>
:: The presentation timestamp, in microseconds, for this {{AudioData}}.
:: The [=presentation timestamp=], in microseconds, for this {{AudioData}}.

The {{AudioData/numberOfChannels}} getter steps are to return
{{AudioData/[[timestamp]]}}.
Expand Down Expand Up @@ -3528,12 +3551,10 @@
adjustments.

: <dfn attribute for=VideoFrame>\[[duration]]</dfn>
:: The presentation duration, given in microseconds. The duration is copied
from the {{EncodedVideoChunk}} corresponding to this {{VideoFrame}}.
:: The presentation duration, given in microseconds.

: <dfn attribute for=VideoFrame>\[[timestamp]]</dfn>
:: The presentation timestamp, given in microseconds. The timestamp is copied
from the {{EncodedVideoChunk}} corresponding to this {{VideoFrame}}.
:: The [=presentation timestamp=], given in microseconds.

: <dfn attribute for=VideoFrame>[[color space]]</dfn>
:: The {{VideoColorSpace}} associated with this frame.
Expand Down Expand Up @@ -3820,17 +3841,13 @@
{{VideoFrame/[[display height]]}}.

: <dfn attribute for=VideoFrame>timestamp</dfn>
:: The presentation timestamp, given in microseconds. For decode,
timestamp is copied from the {{EncodedVideoChunk}} corresponding
to this {{VideoFrame}}. For encode, timestamp is copied to the
{{EncodedVideoChunk}}s corresponding to this {{VideoFrame}}.
:: The [=presentation timestamp=], given in microseconds.

The {{VideoFrame/timestamp}} getter steps are to return
{{VideoFrame/[[timestamp]]}}.

: <dfn attribute for=VideoFrame>duration</dfn>
:: The presentation duration, given in microseconds. The duration is copied
from the {{EncodedVideoChunk}} corresponding to this VideoFrame.
:: The presentation duration, given in microseconds.

The {{VideoFrame/duration}} getter steps are to return
{{VideoFrame/[[duration]]}}.
Expand Down Expand Up @@ -5810,7 +5827,7 @@
2. Let |duration| be the presentation duration for |output| as
described by |encodedFrame|. If |encodedFrame| does not have a
duration, assign `null` to |duration|.
3. Let |timestamp| be the presentation timestamp for |output| as
3. Let |timestamp| be the [=presentation timestamp=] for |output| as
described by |encodedFrame|. If |encodedFrame| does not have a
timestamp:
1. If |encodedFrame| is a still image assign `0` to |timestamp|.
Expand Down Expand Up @@ -5879,7 +5896,7 @@
15. Let |duration| be the presentation duration for |output| as
described by |encodedFrame|. If |encodedFrame| does not describe a
duration, assign `null` to |duration|.
16. Let |timestamp| be the presentation timestamp for |output| as
16. Let |timestamp| be the [=presentation timestamp=] for |output| as
described by |encodedFrame|. If |encodedFrame| does not have a
timestamp:
1. If |encodedFrame| is a still image assign `0` to |timestamp|.
Expand Down
Loading