* Returns the number of bytes needed to hold a copy of the frame's pixel data.
(options: VideoFrameCopyToOptions = {})
| 267 | * Returns the number of bytes needed to hold a copy of the frame's pixel data. |
| 268 | */ |
| 269 | allocationSize(options: VideoFrameCopyToOptions = {}): number { |
| 270 | // 1. If [[Detached]] is true, throw an InvalidStateError DOMException. |
| 271 | this.ensureNotClosed(); |
| 272 | |
| 273 | // 2. If [[format]] is null, throw a NotSupportedError DOMException. |
| 274 | if (this.format === null) { |
| 275 | throw new Error('NotSupportedError: VideoFrame format is null'); |
| 276 | } |
| 277 | |
| 278 | // 3. Let combinedLayout be the result of running the Parse VideoFrameCopyToOptions algorithm with options. |
| 279 | // 4. If combinedLayout is an exception, throw combinedLayout. |
| 280 | const combinedLayout = ParseVideoFrameCopyToOptions(this, options); |
| 281 | |
| 282 | // 5. Return combinedLayout's allocationSize. |
| 283 | return combinedLayout.allocationSize; |
| 284 | } |
| 285 | |
| 286 | /** |
| 287 | * Copies the frame's pixel data to a destination buffer. Returns the layout of the planes in the destination |
nothing calls this directly
no test coverage detected