Skip to content

Commit

Permalink
更新依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
linnaea committed Oct 25, 2024
1 parent e15a819 commit 91667df
Show file tree
Hide file tree
Showing 8 changed files with 2,075 additions and 933 deletions.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
</style>

<script src="js/libav-6.0.7.0.2-webcodecs.js"></script>
<script src="js/libav-6.3.7.1-webcodecs.js"></script>
<script src="js/libavjs-webcodecs-bridge.js"></script>
<script>
const Lock = function() {
Expand Down Expand Up @@ -1370,10 +1370,10 @@
<div class="realtime-update" data-step="ORIENTATION" style="display: none">
<label for="orientation">输入朝向</label>
<select id="orientation">
<option value="0,1,2,3,0" id="oUpright" selected>正向</option>
<option value="3,2,1,0,2048" id="o180">180°</option>
<option value="1,3,0,2,3072" id="oLeft">朝左</option>
<option value="2,0,3,1,1024" id="oRight">朝右</option>
<option value="3,2,1,0,2048" id="o180">180°</option>
<option value="0,1,2,3,0" id="oUpright" selected>正向</option>
</select>
</div>

Expand Down
858 changes: 0 additions & 858 deletions js/libav-6.0.7.0.2-webcodecs.asm.js

This file was deleted.

1 change: 0 additions & 1 deletion js/libav-6.0.7.0.2-webcodecs.js

This file was deleted.

783 changes: 783 additions & 0 deletions js/libav-6.3.7.1-webcodecs.asm.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions js/libav-6.3.7.1-webcodecs.js

Large diffs are not rendered by default.

111 changes: 78 additions & 33 deletions js/libav.types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ export interface CodecParameters {
*/
format: number;

/**
* Bitrate. Not always set.
*/
bit_rate?: number;
bit_ratehi?: number;

/**
* Codec-specific bitstream restrictions that the stream conforms to.
*/
Expand Down Expand Up @@ -1833,6 +1839,7 @@ AVPixFmtDescriptor_log2_chroma_w(ptr: number): Promise<number>;
AVPixFmtDescriptor_log2_chroma_w_s(ptr: number, val: number): Promise<void>;
AVPixFmtDescriptor_nb_components(ptr: number): Promise<number>;
AVPixFmtDescriptor_nb_components_s(ptr: number, val: number): Promise<void>;
AVCodec_name(ptr: number): Promise<string>;
AVCodec_sample_fmts(ptr: number): Promise<number>;
AVCodec_sample_fmts_s(ptr: number, val: number): Promise<void>;
AVCodec_sample_fmts_a(ptr: number, idx: number): Promise<number>;
Expand Down Expand Up @@ -2186,6 +2193,8 @@ ff_block_reader_dev_send(
}
): Promise<void>;
/**
* @deprecated
* DEPRECATED. Use the onread callback.
* Metafunction to determine whether any device has any waiters. This can be
* used to determine whether more data needs to be sent before a previous step
* will be fully resolved.
Expand All @@ -2210,10 +2219,14 @@ ff_init_encoder(
* Similar to ff_init_encoder but doesn't need to initialize the frame.
* Returns [AVCodec, AVCodecContext, AVPacket, AVFrame]
* @param name libav decoder identifier or name
* @param codecpar Optional AVCodecParameters
* @param config Decoder configuration. Can just be a number for codec
* parameters, or can be multiple configuration options.
*/
ff_init_decoder(
name: string | number, codecpar?: number
name: string | number, config?: number | {
codecpar?: number | CodecParameters,
time_base?: [number, number]
}
): Promise<[number, number, number, number]>;
/**
* Free everything allocated by ff_init_encoder.
Expand All @@ -2240,12 +2253,22 @@ ff_free_decoder(
* @param frame AVFrame
* @param pkt AVPacket
* @param inFrames Array of frames in libav.js format
* @param fin Set to true if this is the end of encoding
* @param config Encoding options. May be "true" to indicate end of stream.
*/
ff_encode_multi(
ctx: number, frame: number, pkt: number, inFrames: (Frame | number)[],
fin?: boolean
): Promise<Packet[]>;
config?: boolean | {
fin?: boolean,
copyoutPacket?: "default"
}
): Promise<Packet[]>
ff_encode_multi(
ctx: number, frame: number, pkt: number, inFrames: (Frame | number)[],
config: {
fin?: boolean,
copyoutPacket: "ptr"
}
): Promise<number[]>;
/**
* Decode some number of packets at once. Done in one go to avoid excess
* message passing.
Expand All @@ -2265,15 +2288,15 @@ ff_decode_multi(
): Promise<Frame[]>
ff_decode_multi(
ctx: number, pkt: number, frame: number, inPackets: (Packet | number)[],
config?: boolean | {
config: {
fin?: boolean,
ignoreErrors?: boolean,
copyoutFrame: "ptr"
}
): Promise<number[]>
ff_decode_multi(
ctx: number, pkt: number, frame: number, inPackets: (Packet | number)[],
config?: boolean | {
config: {
fin?: boolean,
ignoreErrors?: boolean,
copyoutFrame: "ImageData"
Expand Down Expand Up @@ -2342,7 +2365,7 @@ ff_read_frame_multi(
}
): Promise<[number, Record<number, Packet[]>]>
ff_read_frame_multi(
fmt_ctx: number, pkt: number, opts?: {
fmt_ctx: number, pkt: number, opts: {
limit?: number, // OUTPUT limit, in bytes
unify?: boolean, // If true, unify the packets into a single stream (called 0), so that the output is in the same order as the input
copyoutPacket: "ptr" // Version of ff_copyout_packet to use
Expand All @@ -2361,14 +2384,14 @@ ff_read_frame_multi(
* @param opts Other options
*/
ff_read_multi(
fmt_ctx: number, pkt: number, devfile?: string, opts?: {
fmt_ctx: number, pkt: number, devfile?: string | null, opts?: {
limit?: number, // OUTPUT limit, in bytes
unify?: boolean, // If true, unify the packets into a single stream (called 0), so that the output is in the same order as the input
copyoutPacket?: "default" // Version of ff_copyout_packet to use
}
): Promise<[number, Record<number, Packet[]>]>
ff_read_multi(
fmt_ctx: number, pkt: number, devfile?: string, opts?: {
fmt_ctx: number, pkt: number, devfile: string | null, opts: {
limit?: number, // OUTPUT limit, in bytes
devLimit?: number, // INPUT limit, in bytes (don't read if less than this much data is available)
unify?: boolean, // If true, unify the packets into a single stream (called 0), so that the output is in the same order as the input
Expand Down Expand Up @@ -2432,28 +2455,28 @@ ff_filter_multi(
): Promise<Frame[]>
ff_filter_multi(
srcs: number, buffersink_ctx: number, framePtr: number,
inFrames: (Frame | number)[], config?: boolean | {
inFrames: (Frame | number)[], config: {
fin?: boolean,
copyoutFrame: "ptr"
}
): Promise<number[]>;
ff_filter_multi(
srcs: number[], buffersink_ctx: number, framePtr: number,
inFrames: (Frame | number)[][], config?: boolean[] | {
inFrames: (Frame | number)[][], config: {
fin?: boolean,
copyoutFrame: "ptr"
}[]
): Promise<number[]>
ff_filter_multi(
srcs: number, buffersink_ctx: number, framePtr: number,
inFrames: (Frame | number)[], config?: boolean | {
inFrames: (Frame | number)[], config: {
fin?: boolean,
copyoutFrame: "ImageData"
}
): Promise<ImageData[]>;
ff_filter_multi(
srcs: number[], buffersink_ctx: number, framePtr: number,
inFrames: (Frame | number)[][], config?: boolean[] | {
inFrames: (Frame | number)[][], config: {
fin?: boolean,
copyoutFrame: "ImageData"
}[]
Expand Down Expand Up @@ -2482,7 +2505,7 @@ ff_decode_filter_multi(
ff_decode_filter_multi(
ctx: number, buffersrc_ctx: number, buffersink_ctx: number, pkt: number,
frame: number, inPackets: (Packet | number)[],
config?: boolean | {
config: {
fin?: boolean,
ignoreErrors?: boolean,
copyoutFrame: "ptr"
Expand All @@ -2491,7 +2514,7 @@ ff_decode_filter_multi(
ff_decode_filter_multi(
ctx: number, buffersrc_ctx: number, buffersink_ctx: number, pkt: number,
frame: number, inPackets: (Packet | number)[],
config?: boolean | {
config: {
fin?: boolean,
ignoreErrors?: boolean,
copyoutFrame: "ImageData"
Expand Down Expand Up @@ -2648,7 +2671,12 @@ ffprobe(...args: (string | string[])[]): Promise<number>;
onwrite?: (filename: string, position: number, buffer: Uint8Array | Int8Array) => void;

/**
* Callback for bock reader devices. Set by the user.
* Callback for stream reader devices. Set by the user.
*/
onread?: (filename: string, pos: number, length: number) => void;

/**
* Callback for block reader devices. Set by the user.
*/
onblockread?: (filename: string, pos: number, length: number) => void;

Expand Down Expand Up @@ -3937,6 +3965,7 @@ AVPixFmtDescriptor_log2_chroma_w_sync(ptr: number): number;
AVPixFmtDescriptor_log2_chroma_w_s_sync(ptr: number, val: number): void;
AVPixFmtDescriptor_nb_components_sync(ptr: number): number;
AVPixFmtDescriptor_nb_components_s_sync(ptr: number, val: number): void;
AVCodec_name_sync(ptr: number): string;
AVCodec_sample_fmts_sync(ptr: number): number;
AVCodec_sample_fmts_s_sync(ptr: number, val: number): void;
AVCodec_sample_fmts_a_sync(ptr: number, idx: number): number;
Expand Down Expand Up @@ -4290,6 +4319,8 @@ ff_block_reader_dev_send_sync(
}
): void;
/**
* @deprecated
* DEPRECATED. Use the onread callback.
* Metafunction to determine whether any device has any waiters. This can be
* used to determine whether more data needs to be sent before a previous step
* will be fully resolved.
Expand All @@ -4314,10 +4345,14 @@ ff_init_encoder_sync(
* Similar to ff_init_encoder but doesn't need to initialize the frame.
* Returns [AVCodec, AVCodecContext, AVPacket, AVFrame]
* @param name libav decoder identifier or name
* @param codecpar Optional AVCodecParameters
* @param config Decoder configuration. Can just be a number for codec
* parameters, or can be multiple configuration options.
*/
ff_init_decoder_sync(
name: string | number, codecpar?: number
name: string | number, config?: number | {
codecpar?: number | CodecParameters,
time_base?: [number, number]
}
): [number, number, number, number];
/**
* Free everything allocated by ff_init_encoder.
Expand All @@ -4344,12 +4379,22 @@ ff_free_decoder_sync(
* @param frame AVFrame
* @param pkt AVPacket
* @param inFrames Array of frames in libav.js format
* @param fin Set to true if this is the end of encoding
* @param config Encoding options. May be "true" to indicate end of stream.
*/
ff_encode_multi_sync(
ctx: number, frame: number, pkt: number, inFrames: (Frame | number)[],
fin?: boolean
): Packet[];
config?: boolean | {
fin?: boolean,
copyoutPacket?: "default"
}
): Packet[]
ff_encode_multi_sync(
ctx: number, frame: number, pkt: number, inFrames: (Frame | number)[],
config: {
fin?: boolean,
copyoutPacket: "ptr"
}
): number[];
/**
* Decode some number of packets at once. Done in one go to avoid excess
* message passing.
Expand All @@ -4369,15 +4414,15 @@ ff_decode_multi_sync(
): Frame[]
ff_decode_multi_sync(
ctx: number, pkt: number, frame: number, inPackets: (Packet | number)[],
config?: boolean | {
config: {
fin?: boolean,
ignoreErrors?: boolean,
copyoutFrame: "ptr"
}
): number[]
ff_decode_multi_sync(
ctx: number, pkt: number, frame: number, inPackets: (Packet | number)[],
config?: boolean | {
config: {
fin?: boolean,
ignoreErrors?: boolean,
copyoutFrame: "ImageData"
Expand Down Expand Up @@ -4446,7 +4491,7 @@ ff_read_frame_multi_sync(
}
): [number, Record<number, Packet[]>] | Promise<[number, Record<number, Packet[]>]>
ff_read_frame_multi_sync(
fmt_ctx: number, pkt: number, opts?: {
fmt_ctx: number, pkt: number, opts: {
limit?: number, // OUTPUT limit, in bytes
unify?: boolean, // If true, unify the packets into a single stream (called 0), so that the output is in the same order as the input
copyoutPacket: "ptr" // Version of ff_copyout_packet to use
Expand All @@ -4465,14 +4510,14 @@ ff_read_frame_multi_sync(
* @param opts Other options
*/
ff_read_multi_sync(
fmt_ctx: number, pkt: number, devfile?: string, opts?: {
fmt_ctx: number, pkt: number, devfile?: string | null, opts?: {
limit?: number, // OUTPUT limit, in bytes
unify?: boolean, // If true, unify the packets into a single stream (called 0), so that the output is in the same order as the input
copyoutPacket?: "default" // Version of ff_copyout_packet to use
}
): [number, Record<number, Packet[]>] | Promise<[number, Record<number, Packet[]>]>
ff_read_multi_sync(
fmt_ctx: number, pkt: number, devfile?: string, opts?: {
fmt_ctx: number, pkt: number, devfile: string | null, opts: {
limit?: number, // OUTPUT limit, in bytes
devLimit?: number, // INPUT limit, in bytes (don't read if less than this much data is available)
unify?: boolean, // If true, unify the packets into a single stream (called 0), so that the output is in the same order as the input
Expand Down Expand Up @@ -4536,28 +4581,28 @@ ff_filter_multi_sync(
): Frame[]
ff_filter_multi_sync(
srcs: number, buffersink_ctx: number, framePtr: number,
inFrames: (Frame | number)[], config?: boolean | {
inFrames: (Frame | number)[], config: {
fin?: boolean,
copyoutFrame: "ptr"
}
): number[];
ff_filter_multi_sync(
srcs: number[], buffersink_ctx: number, framePtr: number,
inFrames: (Frame | number)[][], config?: boolean[] | {
inFrames: (Frame | number)[][], config: {
fin?: boolean,
copyoutFrame: "ptr"
}[]
): number[]
ff_filter_multi_sync(
srcs: number, buffersink_ctx: number, framePtr: number,
inFrames: (Frame | number)[], config?: boolean | {
inFrames: (Frame | number)[], config: {
fin?: boolean,
copyoutFrame: "ImageData"
}
): ImageData[];
ff_filter_multi_sync(
srcs: number[], buffersink_ctx: number, framePtr: number,
inFrames: (Frame | number)[][], config?: boolean[] | {
inFrames: (Frame | number)[][], config: {
fin?: boolean,
copyoutFrame: "ImageData"
}[]
Expand Down Expand Up @@ -4586,7 +4631,7 @@ ff_decode_filter_multi_sync(
ff_decode_filter_multi_sync(
ctx: number, buffersrc_ctx: number, buffersink_ctx: number, pkt: number,
frame: number, inPackets: (Packet | number)[],
config?: boolean | {
config: {
fin?: boolean,
ignoreErrors?: boolean,
copyoutFrame: "ptr"
Expand All @@ -4595,7 +4640,7 @@ ff_decode_filter_multi_sync(
ff_decode_filter_multi_sync(
ctx: number, buffersrc_ctx: number, buffersink_ctx: number, pkt: number,
frame: number, inPackets: (Packet | number)[],
config?: boolean | {
config: {
fin?: boolean,
ignoreErrors?: boolean,
copyoutFrame: "ImageData"
Expand Down
Loading

0 comments on commit 91667df

Please sign in to comment.