|
@@ -1821,8 +1821,207 @@ type
|
|
property port2 : TJSMessagePort read FPort2;
|
|
property port2 : TJSMessagePort read FPort2;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TJSVideoChunkMetaData }
|
|
|
|
+
|
|
|
|
+ TJSVideoChunkDecoderConfig = class external name 'Object' (TJSObject)
|
|
|
|
+ codec : string;
|
|
|
|
+ description : TJSObject;
|
|
|
|
+ codedWidth : NativeInt;
|
|
|
|
+ codedHeight : NativeInt;
|
|
|
|
+ displayAspectWidth : NativeInt;
|
|
|
|
+ displayAspectHeight : NativeInt;
|
|
|
|
+ colorSpace : TJSObject;
|
|
|
|
+ hardwareAcceleration : string;
|
|
|
|
+ optimizeForLatency : boolean;
|
|
|
|
+ end;
|
|
|
|
+ TJSVideoChunkMetaDataSvc = class external name 'Object' (TJSObject)
|
|
|
|
+ temporalLayerId : NativeInt;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ TJSVideoChunkMetaData = class external name 'Object' (TJSObject)
|
|
|
|
+ private
|
|
|
|
+ FalphaSideData: TJSObject; external name 'alphaSideData';
|
|
|
|
+ Fdecoderconfig: TJSVideoChunkDecoderConfig; external name 'decoderConfig';
|
|
|
|
+ FSvc: TJSVideoChunkMetaDataSvc; external name 'svc';
|
|
|
|
+ Public
|
|
|
|
+ property decoderConfig : TJSVideoChunkDecoderConfig read Fdecoderconfig;
|
|
|
|
+ property svc : TJSVideoChunkMetaDataSvc Read FSvc;
|
|
|
|
+ property alphaSideData : TJSObject Read FalphaSideData;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ { TDOMRectReadOnly }
|
|
|
|
+
|
|
|
|
+ TDOMRectReadOnly = class external name 'DOMRectReadOnly' (TJSObject)
|
|
|
|
+ private
|
|
|
|
+ Fbottom: integer; external name 'bottom';
|
|
|
|
+ Fheight: integer; external name 'height';
|
|
|
|
+ Fleft: integer; external name 'left';
|
|
|
|
+ Fright: integer; external name 'right';
|
|
|
|
+ Ftop: integer; external name 'top';
|
|
|
|
+ FWidth: integer; external name 'width';
|
|
|
|
+ Fx: integer; external name 'x';
|
|
|
|
+ Fy: integer; external name 'y';
|
|
|
|
+ public
|
|
|
|
+ property bottom : integer read Fbottom;
|
|
|
|
+ property height : integer read Fheight;
|
|
|
|
+ property left : integer read Fleft;
|
|
|
|
+ property right : integer read Fright;
|
|
|
|
+ property top : integer read Ftop;
|
|
|
|
+ property width : integer Read FWidth;
|
|
|
|
+ property x : integer read Fx;
|
|
|
|
+ property y : integer read Fy;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ TJSVideoColorSpaceOptions = class external name 'Object' (TJSObject)
|
|
|
|
+ primaries : string;
|
|
|
|
+ transfer : string;
|
|
|
|
+ matrix : string;
|
|
|
|
+ fullrange : boolean;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ { TJSVideoColorSpace }
|
|
|
|
+
|
|
|
|
+ TJSVideoColorSpace = class external name 'VideoColorSpace' (TJSObject)
|
|
|
|
+ private
|
|
|
|
+ FPrimaries: string; external name 'primaties';
|
|
|
|
+ Public
|
|
|
|
+ transfer : string;
|
|
|
|
+ matrix : string;
|
|
|
|
+ fullrander : boolean;
|
|
|
|
+ constructor new();
|
|
|
|
+ constructor new(aOptions : TJSVideoColorSpace);
|
|
|
|
+ property primaries : string read FPrimaries;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ { TJSVideoFrame }
|
|
|
|
+ TJSVideoFrameOptionsRect = class external name 'Object' (TJSObject)
|
|
|
|
+ x,y,width,height : integer;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ TJSVideoFrameOptions = class external name 'Object' (TJSObject)
|
|
|
|
+ duration : integer;
|
|
|
|
+ timestamp : integer;
|
|
|
|
+ alpha : string;
|
|
|
|
+ visibleRect : TJSVideoFrameOptionsRect;
|
|
|
|
+ displayWidth : integer;
|
|
|
|
+ displayHeight : integer;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ TJSVideoFrame = class external name 'VideoFrame' (TJSObject)
|
|
|
|
+ private
|
|
|
|
+ FcodedHeight: NativeInt; external name 'codedHeight';
|
|
|
|
+ FcodedRect: TDOMRectReadOnly; external name 'codedRect';
|
|
|
|
+ FcodedWidth: NativeInt; external name 'codedWidth';
|
|
|
|
+ FcolorSpace: TJSVideoColorSpace; external name 'colorSpace';
|
|
|
|
+ FdisplayHeight: NativeInt; external name 'displayHeight';
|
|
|
|
+ FdisplayWidth: NativeInt; external name 'displayWidth';
|
|
|
|
+ Fduration: NativeInt; external name 'duration';
|
|
|
|
+ Fformat: string; external name 'format';
|
|
|
|
+ Ftimestamp: NativeInt; external name 'timestamp';
|
|
|
|
+ FvisibleRect: TDOMRectReadOnly; external name 'visibleRect';
|
|
|
|
+ Public
|
|
|
|
+ constructor new(aFormat : TJSImageBitmap);
|
|
|
|
+ constructor new(aFormat : TJSVideoFrame);
|
|
|
|
+ constructor new(aFormat : TJSHTMLOffscreenCanvas);
|
|
|
|
+ constructor new(aFormat : TJSObject);
|
|
|
|
+ constructor new(aFormat : TJSImageBitmap; aOptions : TJSVideoFrameOptions);
|
|
|
|
+ constructor new(aFormat : TJSVideoFrame; aOptions : TJSVideoFrameOptions);
|
|
|
|
+ constructor new(aFormat : TJSHTMLOffscreenCanvas; aOptions : TJSVideoFrameOptions);
|
|
|
|
+ constructor new(aFormat : TJSObject; aOptions : TJSVideoFrameOptions);
|
|
|
|
+
|
|
|
|
+ property format : string read FFormat;
|
|
|
|
+ property codedHeight : NativeInt Read FcodedHeight;
|
|
|
|
+ property codedWidth : NativeInt Read FcodedWidth;
|
|
|
|
+ property codedRect : TDOMRectReadOnly read FcodedRect;
|
|
|
|
+ property colorSpace : TJSVideoColorSpace read FcolorSpace;
|
|
|
|
+ property displayHeight : NativeInt read FdisplayHeight;
|
|
|
|
+ property displayWidth : NativeInt read FdisplayWidth;
|
|
|
|
+ property duration : NativeInt read Fduration;
|
|
|
|
+ property timestamp : NativeInt read Ftimestamp;
|
|
|
|
+ property visibleRect : TDOMRectReadOnly read FvisibleRect;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ TJSEncodedVideoChunkOptions = class external name 'Object' (TJSObject)
|
|
|
|
+ type_ : string; external name 'type';
|
|
|
|
+ timestamp : NativeInt;
|
|
|
|
+ duration : NativeInt;
|
|
|
|
+ data : TJSObject;
|
|
|
|
+ transfer : TJSObjectDynArray;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ { TJSEncodedVideoChunk }
|
|
|
|
+
|
|
|
|
+ TJSEncodedVideoChunk = class external name 'EncodedVideoChunk' (TJSObject)
|
|
|
|
+ private
|
|
|
|
+ FbyteLength: NativeInt;external name 'byteLength';
|
|
|
|
+ FDuration: NativeInt;external name 'duration';
|
|
|
|
+ Ftimestamp: NativeInt;external name 'timestamp';
|
|
|
|
+ Ftype: string; external name 'type';
|
|
|
|
+ Public
|
|
|
|
+ constructor new(aOptions : TJSEncodedVideoChunkOptions);
|
|
|
|
+ property byteLength : NativeInt Read FbyteLength;
|
|
|
|
+ property timestamp : NativeInt Read Ftimestamp;
|
|
|
|
+ property duration : NativeInt Read FDuration;
|
|
|
|
+ property type_ : string read Ftype;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ TVideoEncoderOutputCallBack = reference to procedure (aData : TJSEncodedVideoChunk; aMetaData : TJSVideoChunkMetaData);
|
|
|
|
+ TVideoEncoderErrorCallBack = reference to procedure (aError: TJSError);
|
|
|
|
+
|
|
|
|
+ TJSNewVideoEncoderOptions = class external name 'Object' (TJSObject)
|
|
|
|
+ output : TVideoEncoderOutputCallBack;
|
|
|
|
+ error : TVideoEncoderErrorCallBack;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ TJSVideoEncoderConfiguration = class external name 'Object' (TJSObject)
|
|
|
|
+ codec : string;
|
|
|
|
+ width : NativeInt;
|
|
|
|
+ height: NativeInt;
|
|
|
|
+ displayWidth : NativeInt;
|
|
|
|
+ displayHeight : NativeInt;
|
|
|
|
+ hardwareAcceleration : string;
|
|
|
|
+ bitrate : NativeInt;
|
|
|
|
+ framerate: NativeInt;
|
|
|
|
+ alpha : string;
|
|
|
|
+ scalabilityMode : string;
|
|
|
|
+ bitrateMode : string;
|
|
|
|
+ latencyMode : string;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ TJSVideoEncodeQuantizerOptions = class external name 'Object' (TJSObject)
|
|
|
|
+ quantizer : Nativeint;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ TJSVideoEncodeOptions = class external name 'Object' (TJSObject)
|
|
|
|
+ keyFrame : boolean;
|
|
|
|
+ vp9 : TJSVideoEncodeQuantizerOptions;
|
|
|
|
+ av1 : TJSVideoEncodeQuantizerOptions;
|
|
|
|
+ avc : TJSVideoEncodeQuantizerOptions;
|
|
|
|
+ hevc : TJSVideoEncodeQuantizerOptions;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ { TJSVideoEncoder }
|
|
|
|
+
|
|
|
|
+ TJSVideoEncoder = class external name 'VideoEncoder' (TJSEventTarget)
|
|
|
|
+ private
|
|
|
|
+ FencodeQueueSize: NativeInt; external name 'encodeQueueSize';
|
|
|
|
+ FState: string; external name 'state';
|
|
|
|
+ Public
|
|
|
|
+ class function isConfigSupported(aOptions : TJSNewVideoEncoderOptions) : boolean;
|
|
|
|
+ constructor new(aOptions : TJSNewVideoEncoderOptions);
|
|
|
|
+ procedure close;
|
|
|
|
+ procedure configure(aConfig :TJSVideoEncoderConfiguration);
|
|
|
|
+ procedure encode(Frame : TJSVideoFrame; aOptions : TJSVideoEncodeOptions);
|
|
|
|
+ procedure flush;
|
|
|
|
+ procedure reset;
|
|
|
|
+ property encodeQueueSize : NativeInt Read FencodeQueueSize;
|
|
|
|
+ property State : string read FState;
|
|
|
|
+
|
|
|
|
+ end;
|
|
|
|
+
|
|
TJSScriptContext = (jscUnknown,jscMainBrowserThread,jscWebWorker,jscServiceWorker);
|
|
TJSScriptContext = (jscUnknown,jscMainBrowserThread,jscWebWorker,jscServiceWorker);
|
|
|
|
|
|
|
|
+
|
|
function isMainBrowserThread: boolean;
|
|
function isMainBrowserThread: boolean;
|
|
function isWebWorker : boolean;
|
|
function isWebWorker : boolean;
|
|
function IsServiceWorker :boolean;
|
|
function IsServiceWorker :boolean;
|