FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
webcodecs-node/dts-header.d.ts at main · Brooooooklyn/webcodecs-node · GitHub
Brooooooklyn
/
webcodecs-node
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
2
Star
94
Code
Issues
4
Pull requests
1
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
webcodecs-node
/
dts-header.d.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
166 lines (151 loc) · 4.54 KB
Breadcrumbs
webcodecs-node
/
dts-header.d.ts
Copy path
File metadata and controls
166 lines (151 loc) · 4.54 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// Import types from standard.d.ts for use in index.d.ts
import
type
{
VideoDecoderConfig
,
VideoEncoderConfig
,
AudioEncoderConfig
,
AudioDecoderConfig
,
VideoFrameBufferInit
,
EncodedVideoChunkInit
,
EncodedAudioChunkInit
,
AudioDataInit
,
VideoColorSpaceInit
,
ImageDecoderInit
,
BufferSource
,
AllowSharedBufferSource
,
}
from
'./standard'
// Re-export types from standard.d.ts
export
{
// Config types
VideoDecoderConfig
,
VideoEncoderConfig
,
AudioEncoderConfig
,
AudioDecoderConfig
,
VideoFrameBufferInit
,
// Init types (used by constructors)
EncodedVideoChunkInit
,
EncodedAudioChunkInit
,
AudioDataInit
,
VideoColorSpaceInit
,
ImageDecoderInit
,
// Buffer types
BufferSource
,
AllowSharedBufferSource
,
}
from
'./standard'
/**
* Interface for Canvas-like objects compatible with VideoFrame constructor.
* Compatible with @napi-rs/canvas Canvas class.
*
*
@napi
-rs/canvas is an optional peer dependency. If installed, Canvas objects
* can be used as VideoFrame sources. The Canvas pixel data is copied (RGBA format).
*/
export
interface
CanvasLike
{
readonly
width
:
number
readonly
height
:
number
/** Returns raw RGBA pixel data as a Buffer */
data
(
)
:
Uint8Array
}
// ============================================================================
// Muxer/Demuxer Types
// ============================================================================
/** Demuxer state */
export
type
DemuxerState
=
'unloaded'
|
'ready'
|
'demuxing'
|
'ended'
|
'closed'
/** Muxer state */
export
type
MuxerState
=
'configuring'
|
'muxing'
|
'finalized'
|
'closed'
/** Init options for Mp4Demuxer */
export
interface
Mp4DemuxerInit
{
/** Callback for video chunks */
videoOutput
?:
(
chunk
:
EncodedVideoChunk
)
=>
void
/** Callback for audio chunks */
audioOutput
?:
(
chunk
:
EncodedAudioChunk
)
=>
void
/** Error callback (required) */
error
:
(
error
:
Error
)
=>
void
}
/** Init options for WebMDemuxer */
export
interface
WebMDemuxerInit
{
/** Callback for video chunks */
videoOutput
?:
(
chunk
:
EncodedVideoChunk
)
=>
void
/** Callback for audio chunks */
audioOutput
?:
(
chunk
:
EncodedAudioChunk
)
=>
void
/** Error callback (required) */
error
:
(
error
:
Error
)
=>
void
}
/** Init options for MkvDemuxer */
export
interface
MkvDemuxerInit
{
/** Callback for video chunks */
videoOutput
?:
(
chunk
:
EncodedVideoChunk
)
=>
void
/** Callback for audio chunks */
audioOutput
?:
(
chunk
:
EncodedAudioChunk
)
=>
void
/** Error callback (required) */
error
:
(
error
:
Error
)
=>
void
}
/** Video track config for muxer */
export
interface
MuxerVideoTrackConfig
{
/** Codec string */
codec
:
string
/** Video width */
width
:
number
/** Video height */
height
:
number
/** Codec description (e.g., avcC for H.264) */
description
?:
Uint8Array
}
/** Audio track config for muxer */
export
interface
MuxerAudioTrackConfig
{
/** Codec string */
codec
:
string
/** Sample rate */
sampleRate
:
number
/** Number of channels */
numberOfChannels
:
number
/** Codec description */
description
?:
Uint8Array
}
// ============================================================================
// Async Iterator Types
// ============================================================================
/**
* Chunk yielded by demuxer async iterator.
*
* Contains either a video or audio chunk. Use the `chunkType` property
* to determine which type of chunk is present.
*
*
@example
* ```typescript
* for await (const chunk of demuxer) {
* if (chunk.chunkType === 'video') {
* videoDecoder.decode(chunk.videoChunk!)
* } else {
* audioDecoder.decode(chunk.audioChunk!)
* }
* }
* ```
*/
export
interface
DemuxerChunk
{
/** Type of chunk: 'video' or 'audio' */
chunkType
:
'video'
|
'audio'
/** Video chunk (present when chunkType is 'video') */
videoChunk
?:
EncodedVideoChunk
/** Audio chunk (present when chunkType is 'audio') */
audioChunk
?:
EncodedAudioChunk
}
/**
* Adds async iterator support to Mp4Demuxer.
* Declaration merging allows using `for await...of` with the demuxer.
*/
export
interface
Mp4Demuxer
{
[
Symbol
.
asyncIterator
]
(
)
:
AsyncGenerator
<
DemuxerChunk
,
void
,
void
>
}
/**
* Adds async iterator support to WebMDemuxer.
* Declaration merging allows using `for await...of` with the demuxer.
*/
export
interface
WebMDemuxer
{
[
Symbol
.
asyncIterator
]
(
)
:
AsyncGenerator
<
DemuxerChunk
,
void
,
void
>
}
/**
* Adds async iterator support to MkvDemuxer.
* Declaration merging allows using `for await...of` with the demuxer.
*/
export
interface
MkvDemuxer
{
[
Symbol
.
asyncIterator
]
(
)
:
AsyncGenerator
<
DemuxerChunk
,
void
,
void
>
}
Back
|
FazBrowse Home
|
New Git URL