|
99 | 99 |
|
100 | 100 | spec: webrtc-svc; urlPrefix: https://w3c.github.io/webrtc-svc/ |
101 | 101 | type: dfn; text: scalability mode identifier; url:#scalabilitymodes* |
| 102 | + |
| 103 | +spec: ECMASCRIPT; urlPrefix: https://tc39.es/ecma262/ |
| 104 | + type: dfn; text: the current Realm; url: #current-realm |
102 | 105 | </pre> |
103 | 106 |
|
104 | 107 | <pre class='biblio'> |
|
3182 | 3185 | readonly attribute long long? timestamp; // microseconds |
3183 | 3186 | readonly attribute VideoColorSpace colorSpace; |
3184 | 3187 |
|
| 3188 | + VideoFrameMetadata getMetadata(); |
| 3189 | + |
3185 | 3190 | unsigned long allocationSize( |
3186 | 3191 | optional VideoFrameCopyToOptions options = {}); |
3187 | 3192 | Promise<sequence<PlaneLayout>> copyTo( |
|
3204 | 3209 | // Default matches image unless visibleRect is provided. |
3205 | 3210 | [EnforceRange] unsigned long displayWidth; |
3206 | 3211 | [EnforceRange] unsigned long displayHeight; |
| 3212 | + |
| 3213 | + VideoFrameMetadata metadata; |
3207 | 3214 | }; |
3208 | 3215 |
|
3209 | 3216 | dictionary VideoFrameBufferInit { |
|
3225 | 3232 |
|
3226 | 3233 | VideoColorSpaceInit colorSpace; |
3227 | 3234 | }; |
| 3235 | + |
| 3236 | +dictionary VideoFrameMetadata { |
| 3237 | +}; |
3228 | 3238 | </xmp> |
3229 | 3239 |
|
3230 | 3240 | ### Internal Slots ###{#videoframe-internal-slots} |
|
3279 | 3289 | : <dfn attribute for=VideoFrame>[[color space]]</dfn> |
3280 | 3290 | :: The {{VideoColorSpace}} associated with this frame. |
3281 | 3291 |
|
| 3292 | +: <dfn attribute for=VideoFrame>\[[metadata]]</dfn> |
| 3293 | +:: The {{VideoFrameMetadata}} associated with this frame. |
| 3294 | +<div class='note'> |
| 3295 | +{{VideoFrameMetadata}} is designed to be extended by other specifications. |
| 3296 | +Specifications that do extend {{VideoFrameMetadata}} need to make sure that |
| 3297 | +added properties are serializable. |
| 3298 | +</div> |
| 3299 | + |
3282 | 3300 | ### Constructors ###{#videoframe-constructors} |
3283 | 3301 |
|
3284 | 3302 | <dfn constructor for=VideoFrame title="VideoFrame(image, init)"> |
|
3426 | 3444 | 9. Assign the result of running the [=VideoFrame/Pick Color Space=] |
3427 | 3445 | algorithm, with |colorSpace| and {{VideoFrame/[[format]]}}, to |
3428 | 3446 | {{VideoFrame/[[color space]]}}. |
| 3447 | + 10. Assign the result of calling [=Copy VideoFrame metadata=] |
| 3448 | + with |init|'s {{VideoFrameInit/metadata}} to {{VideoFrame/[[metadata]]}}. |
3429 | 3449 | 17. Return |frame|. |
3430 | 3450 |
|
3431 | 3451 | ### Attributes ###{#videoframe-attributes} |
|
3624 | 3644 |
|
3625 | 3645 | When invoked, run the [=Close VideoFrame=] algorithm with [=this=]. |
3626 | 3646 |
|
| 3647 | +: <dfn method for=VideoFrame>getMetadata()</dfn> |
| 3648 | +:: Gets the {{VideoFrameMetadata}} associated with this frame. |
| 3649 | + |
| 3650 | + When invoked, return the result of calling [=Copy VideoFrame metadata=] |
| 3651 | + with [=this=] {{VideoFrame/[[metadata]]}}. |
| 3652 | + |
3627 | 3653 | ### Algorithms ###{#videoframe-algorithms} |
3628 | 3654 | : <dfn>Create a VideoFrame</dfn> (with |output|, |timestamp|, |duration|, |displayAspectWidth|, |displayAspectHeight|, and |colorSpace|) |
3629 | 3655 | :: 1. Let |frame| be a new {{VideoFrame}}, constructed as follows: |
|
3747 | 3773 | |otherFrame|.{{VideoFrame/timestamp}} to |
3748 | 3774 | |frame|.{{VideoFrame/timestamp}}. |
3749 | 3775 | 11. Assign |format| to |frame|.{{VideoFrame/[[format]]}}. |
| 3776 | + 12. Assign the result of calling [=Copy VideoFrame metadata=] |
| 3777 | + with |init|'s {{VideoFrameInit/metadata}} to {{VideoFrame/metadata}}. |
3750 | 3778 |
|
3751 | 3779 | : <dfn for=VideoFrame>Initialize Frame With Resource and Size</dfn> (with |
3752 | 3780 | |init|, |frame|, |resource|, |width| and |height|) |
|
3825 | 3853 | and {{VideoFrame/[[display height]]}}. |
3826 | 3854 | 5. Assign `null` to |frame|'s {{VideoFrame/[[duration]]}} and |
3827 | 3855 | {{VideoFrame/[[timestamp]]}}. |
| 3856 | + 6. Assign a new {{VideoFrameMetadata}} to |frame|'s {{VideoFrame/[[metadata]]}}. |
3828 | 3857 |
|
3829 | 3858 | : <dfn for=VideoFrame>Parse VideoFrameCopyToOptions</dfn> (with |options|) |
3830 | 3859 | :: 1. Let |defaultRect| be the result of performing the getter steps for |
|
3998 | 4027 | [=combined buffer layout/allocationSize=]. |
3999 | 4028 | 9. Return |combinedLayout|. |
4000 | 4029 |
|
| 4030 | +: <dfn for=VideoFrame>Copy VideoFrame metadata</dfn> (with |metadata|) |
| 4031 | +:: 1. Let |metadataCopySerialized| be [$StructuredSerialize$](|metadata|). |
| 4032 | + 2. Let |metadataCopy| be [$StructuredDeserialize$](|metadataCopySerialized|, [=the current Realm=]). |
| 4033 | + 3. return |metadataCopy|. |
| 4034 | + |
| 4035 | +The goal of this algorithm is to ensure that metadata owned by a {{VideoFrame}} is immutable. |
| 4036 | + |
4001 | 4037 | ### Transfer and Serialization ###{#videoframe-transfer-serialization} |
4002 | 4038 |
|
4003 | 4039 | : The {{VideoFrame}} [=transfer steps=] (with |value| and |dataHolder|) are: |
|
0 commit comments