@predy-js/render-interface 0.3.3-beta.2 → 0.3.3-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/statistic.js +1 -1
- package/dist/types/native/PredyNativeInternal.d.ts +8 -1
- package/dist/types/native/VideoDecoder.d.ts +4 -4
- package/package.json +1 -1
- package/types/native/PredyNativeInternal.ts +9 -0
- package/types/native/VideoDecoder.ts +4 -4
package/dist/statistic.js
CHANGED
@@ -4,6 +4,7 @@ import type { GPUCapability } from '../GPUCapability';
|
|
4
4
|
import type { PredyResizeTemplate, SDFImageOptions, SDFImage } from '@predy-js/specification';
|
5
5
|
import type { ImageBitmapInternal } from './ImageBitmapInternal';
|
6
6
|
import type { PredyVideoDecoder, PredyVideoDecoderConstructor } from './VideoDecoder';
|
7
|
+
import type { ResourcePlatform } from './ResourceInternal';
|
7
8
|
export interface PredyRequestOptions {
|
8
9
|
url: string;
|
9
10
|
disableCache?: boolean;
|
@@ -32,10 +33,16 @@ export declare enum PredyTextEncoding {
|
|
32
33
|
}
|
33
34
|
export declare enum PredyVideoCodec {
|
34
35
|
h264 = "avc1",
|
35
|
-
h265 = "hev1"
|
36
|
+
h265 = "hev1",
|
37
|
+
av1 = "av1"
|
36
38
|
}
|
37
39
|
export interface PredyNativeInternal {
|
38
40
|
webpDisabled?: boolean;
|
41
|
+
/**
|
42
|
+
* 是否支持获取gles3,但如果获取es3失败,会降级到es2
|
43
|
+
*/
|
44
|
+
supportGLES3?: boolean;
|
45
|
+
platform: ResourcePlatform;
|
39
46
|
createImageBitmap(data: TypedArray | string, //图片文件的数据
|
40
47
|
options: ImageBitmapConstructor, callback: ImageBitmapCallback): void;
|
41
48
|
getDefaultGPUCapability(): GPUCapability;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { VideoFrameFormat } from '@predy-js/specification';
|
2
2
|
/**
|
3
3
|
* video原始数据的切片,原始数据不暴露到js,只能通过decoder解析
|
4
4
|
* 只暴露当前的切片时间和是否是keyframe
|
@@ -31,7 +31,7 @@ export interface PredyVideoDecoderMetadata {
|
|
31
31
|
height: number;
|
32
32
|
duration: number;
|
33
33
|
frames: PredyVideoDecoderFrame[];
|
34
|
-
format:
|
34
|
+
format: VideoFrameFormat;
|
35
35
|
frameBufferSize: number;
|
36
36
|
}
|
37
37
|
/**
|
@@ -54,10 +54,10 @@ export interface PredyVideoDecoder {
|
|
54
54
|
/**
|
55
55
|
* 加载视频,解析视频的metadata,设置frame数组,
|
56
56
|
* 此函数只能调用一次,如果需要解析其他的视频,需要重新创建对象
|
57
|
-
* @param
|
57
|
+
* @param url 视频地址
|
58
58
|
* @param callback 解析回调
|
59
59
|
*/
|
60
|
-
loadVideo(
|
60
|
+
loadVideo(url: string, callback: PredyVideoDecoderLoadedCallback): void;
|
61
61
|
/**
|
62
62
|
* 解析视频的下一帧,获得图像数据。
|
63
63
|
* @param frameIndex frame的index
|
package/package.json
CHANGED
@@ -4,6 +4,7 @@ import type { GPUCapability } from '../GPUCapability';
|
|
4
4
|
import type { PredyResizeTemplate, SDFImageOptions, SDFImage } from '@predy-js/specification';
|
5
5
|
import type { ImageBitmapInternal } from './ImageBitmapInternal';
|
6
6
|
import type { PredyVideoDecoder, PredyVideoDecoderConstructor } from './VideoDecoder';
|
7
|
+
import type { ResourcePlatform } from './ResourceInternal';
|
7
8
|
|
8
9
|
export interface PredyRequestOptions {
|
9
10
|
url: string,
|
@@ -46,11 +47,19 @@ export enum PredyTextEncoding {
|
|
46
47
|
export enum PredyVideoCodec {
|
47
48
|
h264 = 'avc1',
|
48
49
|
h265 = 'hev1',
|
50
|
+
av1 = 'av1'
|
49
51
|
}
|
50
52
|
|
51
53
|
export interface PredyNativeInternal {
|
52
54
|
webpDisabled?: boolean,
|
53
55
|
|
56
|
+
/**
|
57
|
+
* 是否支持获取gles3,但如果获取es3失败,会降级到es2
|
58
|
+
*/
|
59
|
+
supportGLES3?: boolean,
|
60
|
+
|
61
|
+
platform: ResourcePlatform,
|
62
|
+
|
54
63
|
createImageBitmap(data: TypedArray | string, //图片文件的数据
|
55
64
|
options: ImageBitmapConstructor, callback: ImageBitmapCallback): void,
|
56
65
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { VideoFrameFormat } from '@predy-js/specification';
|
2
2
|
|
3
3
|
/**
|
4
4
|
* video原始数据的切片,原始数据不暴露到js,只能通过decoder解析
|
@@ -35,7 +35,7 @@ export interface PredyVideoDecoderMetadata {
|
|
35
35
|
height: number,
|
36
36
|
duration: number,
|
37
37
|
frames: PredyVideoDecoderFrame[],
|
38
|
-
format:
|
38
|
+
format: VideoFrameFormat,
|
39
39
|
frameBufferSize: number, // 每帧的buffer大小
|
40
40
|
}
|
41
41
|
|
@@ -62,10 +62,10 @@ export interface PredyVideoDecoder {
|
|
62
62
|
/**
|
63
63
|
* 加载视频,解析视频的metadata,设置frame数组,
|
64
64
|
* 此函数只能调用一次,如果需要解析其他的视频,需要重新创建对象
|
65
|
-
* @param
|
65
|
+
* @param url 视频地址
|
66
66
|
* @param callback 解析回调
|
67
67
|
*/
|
68
|
-
loadVideo(
|
68
|
+
loadVideo(url: string, callback: PredyVideoDecoderLoadedCallback): void,
|
69
69
|
|
70
70
|
/**
|
71
71
|
* 解析视频的下一帧,获得图像数据。
|