diff options
author | Chocobozzz <me@florianbigard.com> | 2023-04-21 14:55:10 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2023-05-09 08:57:34 +0200 |
commit | 0c9668f77901e7540e2c7045eb0f2974a4842a69 (patch) | |
tree | 226d3dd1565b0bb56588897af3b8530e6216e96b /shared/models/runners/runner-job-success-body.model.ts | |
parent | 6bcb854cdea8688a32240bc5719c7d139806e00b (diff) | |
download | PeerTube-0c9668f77901e7540e2c7045eb0f2974a4842a69.tar.gz PeerTube-0c9668f77901e7540e2c7045eb0f2974a4842a69.tar.zst PeerTube-0c9668f77901e7540e2c7045eb0f2974a4842a69.zip |
Implement remote runner jobs in server
Move ffmpeg functions to @shared
Diffstat (limited to 'shared/models/runners/runner-job-success-body.model.ts')
-rw-r--r-- | shared/models/runners/runner-job-success-body.model.ts | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/shared/models/runners/runner-job-success-body.model.ts b/shared/models/runners/runner-job-success-body.model.ts new file mode 100644 index 000000000..223b7552d --- /dev/null +++ b/shared/models/runners/runner-job-success-body.model.ts | |||
@@ -0,0 +1,41 @@ | |||
1 | export interface RunnerJobSuccessBody { | ||
2 | runnerToken: string | ||
3 | jobToken: string | ||
4 | |||
5 | payload: RunnerJobSuccessPayload | ||
6 | } | ||
7 | |||
8 | // --------------------------------------------------------------------------- | ||
9 | |||
10 | export type RunnerJobSuccessPayload = | ||
11 | VODWebVideoTranscodingSuccess | | ||
12 | VODHLSTranscodingSuccess | | ||
13 | VODAudioMergeTranscodingSuccess | | ||
14 | LiveRTMPHLSTranscodingSuccess | ||
15 | |||
16 | export interface VODWebVideoTranscodingSuccess { | ||
17 | videoFile: Blob | string | ||
18 | } | ||
19 | |||
20 | export interface VODHLSTranscodingSuccess { | ||
21 | videoFile: Blob | string | ||
22 | resolutionPlaylistFile: Blob | string | ||
23 | } | ||
24 | |||
25 | export interface VODAudioMergeTranscodingSuccess { | ||
26 | videoFile: Blob | string | ||
27 | } | ||
28 | |||
29 | export interface LiveRTMPHLSTranscodingSuccess { | ||
30 | |||
31 | } | ||
32 | |||
33 | export function isWebVideoOrAudioMergeTranscodingPayloadSuccess ( | ||
34 | payload: RunnerJobSuccessPayload | ||
35 | ): payload is VODHLSTranscodingSuccess | VODAudioMergeTranscodingSuccess { | ||
36 | return !!(payload as VODHLSTranscodingSuccess | VODAudioMergeTranscodingSuccess)?.videoFile | ||
37 | } | ||
38 | |||
39 | export function isHLSTranscodingPayloadSuccess (payload: RunnerJobSuccessPayload): payload is VODHLSTranscodingSuccess { | ||
40 | return !!(payload as VODHLSTranscodingSuccess)?.resolutionPlaylistFile | ||
41 | } | ||