Title: [286742] trunk/Source/WebCore
Revision
286742
Author
jer.no...@apple.com
Date
2021-12-08 14:57:36 -0800 (Wed, 08 Dec 2021)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (286741 => 286742)


--- trunk/Source/WebCore/ChangeLog	2021-12-08 22:10:34 UTC (rev 286741)
+++ trunk/Source/WebCore/ChangeLog	2021-12-08 22:57:36 UTC (rev 286742)
@@ -2,9 +2,21 @@
 
         [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:
+
+2021-12-08  Jer Noble  <jer.no...@apple.com>
+
+        [MSE] Add a Modules/mediasource/README.md file
+        https://bugs.webkit.org/show_bug.cgi?id=234026
+
+        Reviewed by Eric Carlson.
+
         * Modules/mediasource/README.md: Added.
 
 2021-12-08  Truitt Savell  <tsav...@apple.com>

Modified: trunk/Source/WebCore/Modules/mediasource/README.md (286741 => 286742)


--- trunk/Source/WebCore/Modules/mediasource/README.md	2021-12-08 22:10:34 UTC (rev 286741)
+++ trunk/Source/WebCore/Modules/mediasource/README.md	2021-12-08 22:57:36 UTC (rev 286742)
@@ -4,7 +4,7 @@
 
 ## Basic Concepts
 
-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.
+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 requiring the UA to handle same.
 
 Clients `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.
 
@@ -52,11 +52,23 @@
 
 SourceBufferPrivate 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).
 
+### MediaTime ### 
+
+_([.h](../../WTF/wtf/MediaTime.h), [.cpp](../../WTF/wtf/MediaTime.cpp))_
+
+MediaTime is a rational-number time class for manipulating time values commonly found in media files. The unit of MediaTime is seconds.
+
+Media 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.
+
+Media 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.
+
+MediaTime offers convenience methods to convert from (`createTimeWithDouble()`) and to (`toDouble()`) floating-point values.
+
 ### MediaSample ###
 
 _([.h](../platform/MediaSample.h), [.cpp](../platform/MediaSample.cpp))_
 
-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.
+MediaSample 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.
 
 ### SampleMap ###
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to