Inherit rotation from VideoFrame when constructing VideoSample from it

This commit is contained in:
JonnyBurger
2025-11-06 13:51:17 +01:00
parent ea9b0501fd
commit f0d0e51537
+4 -1
View File
@@ -161,7 +161,10 @@ export class VideoSample implements Disposable {
this.format = init.format;
this.codedWidth = init.codedWidth!;
this.codedHeight = init.codedHeight!;
this.rotation = init.rotation ?? 0;
this.rotation = init.rotation
?? (typeof VideoFrame !== 'undefined' && data instanceof VideoFrame && 'rotation' in data
? data.rotation as Rotation
: 0);
this.timestamp = init.timestamp!;
this.duration = init.duration ?? 0;
this.colorSpace = new VideoColorSpace(init.colorSpace);