File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -363,6 +363,12 @@ const videoDecoderConfig: VideoDecoderConfig = {
363363 codec : "avc1.64000c" ,
364364} ;
365365
366+ const videoDecoderConfigWithRotationAndFlip : VideoDecoderConfig = {
367+ codec : "avc1.64000c" ,
368+ rotation : 180 ,
369+ flip : false ,
370+ } ;
371+
366372// @ts -expect-error
367373VideoDecoder . isConfigSupported ( ) ;
368374
@@ -376,6 +382,13 @@ VideoDecoder.isConfigSupported(videoDecoderConfig).then((result: VideoDecoderSup
376382 result . config ;
377383} ) ;
378384
385+ VideoDecoder . isConfigSupported ( videoDecoderConfigWithRotationAndFlip ) . then ( ( result : VideoDecoderSupport ) => {
386+ // $ExpectType boolean | undefined
387+ result . supported ;
388+ // $ExpectType VideoDecoderConfig | undefined
389+ result . config ;
390+ } ) ;
391+
379392function videoOutput ( output : VideoFrame ) : void {
380393 // $ExpectType number | undefined
381394 output . visibleRect ?. width ;
@@ -418,6 +431,9 @@ videoDecoder.configure({ description: new Uint8Array(0) });
418431// $ExpectType void
419432videoDecoder . configure ( videoDecoderConfig ) ;
420433
434+ // $ExpectType void
435+ videoDecoder . configure ( videoDecoderConfigWithRotationAndFlip ) ;
436+
421437// additional properties are allowed
422438const futureVideoDecoderConfig = {
423439 codec : "avc1.64000c" ,
@@ -593,6 +609,10 @@ videoFrame.visibleRect?.height;
593609videoFrame . displayWidth ;
594610// $ExpectType number
595611videoFrame . displayHeight ;
612+ // $ExpectType number | undefined
613+ videoFrame . rotation ;
614+ // $ExpectType boolean | undefined
615+ videoFrame . flip ;
596616
597617// @ts -expect-error
598618new VideoFrame ( new ArrayBuffer ( 1024 ) , {
Original file line number Diff line number Diff line change @@ -121,6 +121,8 @@ interface VideoDecoderConfig {
121121 displayAspectWidth ?: number | undefined ;
122122 hardwareAcceleration ?: HardwarePreference | undefined ;
123123 optimizeForLatency ?: boolean | undefined ;
124+ rotation ?: number | undefined ;
125+ flip ?: boolean | undefined ;
124126}
125127
126128interface VideoDecoderInit {
@@ -427,6 +429,7 @@ interface VideoFrame {
427429 readonly timestamp : number ;
428430 readonly visibleRect : DOMRectReadOnly | null ;
429431 readonly rotation ?: number ;
432+ readonly flip ?: boolean ;
430433 allocationSize ( options ?: VideoFrameCopyToOptions ) : number ;
431434 clone ( ) : VideoFrame ;
432435 close ( ) : void ;
You can’t perform that action at this time.
0 commit comments