2023-04-21 07:55:10 -05:00
|
|
|
import { MRunnerJob } from '@server/types/models/runners'
|
|
|
|
import { RunnerJobSuccessPayload, RunnerJobType, RunnerJobUpdatePayload } from '@shared/models'
|
|
|
|
import { AbstractJobHandler } from './abstract-job-handler'
|
|
|
|
import { LiveRTMPHLSTranscodingJobHandler } from './live-rtmp-hls-transcoding-job-handler'
|
2023-05-04 08:55:51 -05:00
|
|
|
import { VideoStudioTranscodingJobHandler } from './video-studio-transcoding-job-handler'
|
2023-04-21 07:55:10 -05:00
|
|
|
import { VODAudioMergeTranscodingJobHandler } from './vod-audio-merge-transcoding-job-handler'
|
|
|
|
import { VODHLSTranscodingJobHandler } from './vod-hls-transcoding-job-handler'
|
|
|
|
import { VODWebVideoTranscodingJobHandler } from './vod-web-video-transcoding-job-handler'
|
|
|
|
|
|
|
|
const processors: Record<RunnerJobType, new() => AbstractJobHandler<unknown, RunnerJobUpdatePayload, RunnerJobSuccessPayload>> = {
|
|
|
|
'vod-web-video-transcoding': VODWebVideoTranscodingJobHandler,
|
|
|
|
'vod-hls-transcoding': VODHLSTranscodingJobHandler,
|
|
|
|
'vod-audio-merge-transcoding': VODAudioMergeTranscodingJobHandler,
|
2023-05-04 08:29:34 -05:00
|
|
|
'live-rtmp-hls-transcoding': LiveRTMPHLSTranscodingJobHandler,
|
2023-05-04 08:55:51 -05:00
|
|
|
'video-studio-transcoding': VideoStudioTranscodingJobHandler
|
2023-04-21 07:55:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
export function getRunnerJobHandlerClass (job: MRunnerJob) {
|
|
|
|
return processors[job.type]
|
|
|
|
}
|