* Creates a copy of this frame.
()
| 428 | * Creates a copy of this frame. |
| 429 | */ |
| 430 | clone(): VideoFramePolyfill { |
| 431 | this.ensureNotClosed(); |
| 432 | assert(this.data); |
| 433 | assert(this.format !== null); |
| 434 | |
| 435 | if (this.data instanceof Frame) { |
| 436 | const clone = this.data.clone(); |
| 437 | if (!clone) { |
| 438 | throw new Error('Error obtaining frame clone.'); |
| 439 | } |
| 440 | return new VideoFramePolyfill(clone, { |
| 441 | displayWidth: this.displayWidth, |
| 442 | displayHeight: this.displayHeight, |
| 443 | visibleRect: this.visibleRect ?? undefined, |
| 444 | }); |
| 445 | } else { |
| 446 | return new VideoFramePolyfill(this); |
| 447 | } |
| 448 | } |
| 449 | |
| 450 | /** |
| 451 | * Closes the frame and releases all resources. |
nothing calls this directly
no test coverage detected