⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286742 in webkit


Ignore:
Timestamp:
Dec 8, 2021, 2:57:36 PM (5 years ago)
Author:
jer.noble@apple.com
Message:

[MSE] Add a Modules/mediasource/README.md file
https://bugs.webkit.org/show_bug.cgi?id=234026
<rdar://problem/86227732>

Reviewed by Eric Carlson.

Follow-up to address review comments.

  • Modules/mediasource/README.md:
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r286738 r286742  
     12021-12-08  Jer Noble  <jer.noble@apple.com>
     2
     3        [MSE] Add a Modules/mediasource/README.md file
     4        https://bugs.webkit.org/show_bug.cgi?id=234026
     5        <rdar://problem/86227732>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Follow-up to address review comments.
     10
     11        * Modules/mediasource/README.md:
     12
    1132021-12-08  Jer Noble  <jer.noble@apple.com>
    214
  • trunk/Source/WebCore/Modules/mediasource/README.md

    r286738 r286742  
    55## Basic Concepts
    66
    7 The Media Source Extensions specification defines a set of classes which allows clients to implement their own loading, buffering, and variant switching behavior, as opposed to allowing the UA to handle same.
     7The Media Source Extensions specification defines a set of classes which allows clients to implement their own loading, buffering, and variant switching behavior, as opposed to requiring the UA to handle same.
    88
    99Clients `fetch()` media initialization segments and media segments, typically subsets of a single [fragmented MP4 file](https://www.w3.org/TR/mse-byte-stream-format-isobmff/) or [WebM file](https://www.w3.org/TR/mse-byte-stream-format-webm/), and append those segments into a SourceBuffer object, which is associated with a HTMLMediaElement through a [MediaSource](#mediasource) object.
     
    5353SourceBufferPrivate is a semi-abstract base class which accepts initialization segment and media segment buffers, parse those buffers with platform-specific parsers, and enqueue the resulting samples into platform-specific decoders. SourceBufferPrivate is also responsible for caching parsed samples in a [SampleMap](#samplemap).
    5454
     55### MediaTime ###
     56
     57_([.h](../../WTF/wtf/MediaTime.h), [.cpp](../../WTF/wtf/MediaTime.cpp))_
     58
     59MediaTime is a rational-number time class for manipulating time values commonly found in media files. The unit of MediaTime is seconds.
     60
     61Media containers such as mp4 and WebM represent time values as a ratio between a "time base" and a "time value". These values cannot necessarily be accurately represented as floating-point values without incurring cumulative rounding errors.  For example, a common frame rate in video formats is 29.97fps, however that value is an approximation of 30000/1001. So a media file containing a video track with a 29.97fps content will declare a "time base" scalar of 30000, and each frame will have a "time value" duration of 1001.
     62
     63Media Source Extension algorithms are very sensitive to small gaps between samples, and due to its rational-number behavior, MediaTime guarantees samples are contiguous by avoiding floating-point rounding errors.
     64
     65MediaTime offers convenience methods to convert from (`createTimeWithDouble()`) and to (`toDouble()`) floating-point values.
     66
    5567### MediaSample ###
    5668
    5769_([.h](../platform/MediaSample.h), [.cpp](../platform/MediaSample.cpp))_
    5870
    59 MediaSample is an abstract base class representing a sample parsed from a media segment. MediaSamples have `presentationTime()`, `decodeTime()`, and `duration()`, which are used to order these samples relative to one another in a [SampleMap](#samplemap). For codecs which support frame reordering, `presentationTime()` and `decodeTime()` for each sample may differ.
     71MediaSample is an abstract base class representing a sample parsed from a media segment. MediaSamples have `presentationTime()`, `decodeTime()`, and `duration()`, each of which are [MediaTime](#mediatime) values, which are used to order these samples relative to one another in a [SampleMap](#samplemap). For codecs which support frame reordering, `presentationTime()` and `decodeTime()` for each sample may differ.
    6072
    6173### SampleMap ###
Note: See TracChangeset for help on using the changeset viewer.