@predy-js/render-interface 0.3.3-beta.2 → 0.3.3-beta.4
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 +10 -4
- package/package.json +1 -1
- package/types/native/PredyNativeInternal.ts +9 -0
- package/types/native/VideoDecoder.ts +11 -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
|
/**
|
@@ -39,6 +39,7 @@ export interface PredyVideoDecoderMetadata {
|
|
39
39
|
*/
|
40
40
|
export interface PredyVideoDecoderConstructor {
|
41
41
|
name: string;
|
42
|
+
prefetchOnly?: boolean;
|
42
43
|
}
|
43
44
|
export type PredyVideoDecoderLoadedCallback = (error?: Error, metadata?: PredyVideoDecoderMetadata) => void;
|
44
45
|
export type PredyVideoDecoderSeekFrameCallback = (error?: Error, frame?: PredyVideoDecoderFrameData) => void;
|
@@ -46,6 +47,11 @@ export interface PredyVideoDecoder {
|
|
46
47
|
readonly name: string;
|
47
48
|
readonly status: PredyVideoDecoderStatus;
|
48
49
|
readonly metadata?: PredyVideoDecoderMetadata;
|
50
|
+
/**
|
51
|
+
* 只做资源请求,不进行视频解码,
|
52
|
+
* 这种情况下,seekFrame永远返回error(prefetch only)
|
53
|
+
*/
|
54
|
+
readonly prefetchOnly: boolean;
|
49
55
|
/**
|
50
56
|
* 是否要跳播/回播,如果不需要的话,Decoder可以自行释放已经播放的帧
|
51
57
|
*/
|
@@ -54,10 +60,10 @@ export interface PredyVideoDecoder {
|
|
54
60
|
/**
|
55
61
|
* 加载视频,解析视频的metadata,设置frame数组,
|
56
62
|
* 此函数只能调用一次,如果需要解析其他的视频,需要重新创建对象
|
57
|
-
* @param
|
63
|
+
* @param url 视频地址
|
58
64
|
* @param callback 解析回调
|
59
65
|
*/
|
60
|
-
loadVideo(
|
66
|
+
loadVideo(url: string, callback: PredyVideoDecoderLoadedCallback): void;
|
61
67
|
/**
|
62
68
|
* 解析视频的下一帧,获得图像数据。
|
63
69
|
* @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
|
|
@@ -44,6 +44,7 @@ export interface PredyVideoDecoderMetadata {
|
|
44
44
|
*/
|
45
45
|
export interface PredyVideoDecoderConstructor {
|
46
46
|
name: string,
|
47
|
+
prefetchOnly?: boolean,
|
47
48
|
}
|
48
49
|
|
49
50
|
export type PredyVideoDecoderLoadedCallback = (error?: Error, metadata?: PredyVideoDecoderMetadata) => void;
|
@@ -53,6 +54,12 @@ export interface PredyVideoDecoder {
|
|
53
54
|
readonly name: string,
|
54
55
|
readonly status: PredyVideoDecoderStatus,
|
55
56
|
readonly metadata?: PredyVideoDecoderMetadata,
|
57
|
+
|
58
|
+
/**
|
59
|
+
* 只做资源请求,不进行视频解码,
|
60
|
+
* 这种情况下,seekFrame永远返回error(prefetch only)
|
61
|
+
*/
|
62
|
+
readonly prefetchOnly: boolean,
|
56
63
|
/**
|
57
64
|
* 是否要跳播/回播,如果不需要的话,Decoder可以自行释放已经播放的帧
|
58
65
|
*/
|
@@ -62,10 +69,10 @@ export interface PredyVideoDecoder {
|
|
62
69
|
/**
|
63
70
|
* 加载视频,解析视频的metadata,设置frame数组,
|
64
71
|
* 此函数只能调用一次,如果需要解析其他的视频,需要重新创建对象
|
65
|
-
* @param
|
72
|
+
* @param url 视频地址
|
66
73
|
* @param callback 解析回调
|
67
74
|
*/
|
68
|
-
loadVideo(
|
75
|
+
loadVideo(url: string, callback: PredyVideoDecoderLoadedCallback): void,
|
69
76
|
|
70
77
|
/**
|
71
78
|
* 解析视频的下一帧,获得图像数据。
|