Rearchitected transcoding to treat codecs and encoders as separate concepts.
ActivityPub Tests / federation-test (push) Failing after 4s
ActivityPub Tests / chat-sanitization-test (push) Failing after 3s
ActivityPub Tests / follower-validation-test (push) Failing after 4s
Extract Default Translations / extract-and-commit (push) Successful in 4m21s
Automated API tests / test (push) Has been cancelled
Browser Tests / cypress-run (push) Has been cancelled
Chromatic / chromatic-deployment (push) Has been cancelled
CSS Lint and Formatting / css-lint (push) Has been cancelled
javascript-packages / Generate API Documentation (push) Has been cancelled
Lint / Go linter (push) Has been cancelled
Go Tests / test (push) Has been cancelled
Go Tests / test-bsds (map[name:freebsd version:12.2]) (push) Has been cancelled
Go Tests / test-bsds (map[name:openbsd version:6.8]) (push) Has been cancelled
HLS tests / tests (push) Has been cancelled
ActivityPub Tests / federation-test (push) Failing after 4s
ActivityPub Tests / chat-sanitization-test (push) Failing after 3s
ActivityPub Tests / follower-validation-test (push) Failing after 4s
Extract Default Translations / extract-and-commit (push) Successful in 4m21s
Automated API tests / test (push) Has been cancelled
Browser Tests / cypress-run (push) Has been cancelled
Chromatic / chromatic-deployment (push) Has been cancelled
CSS Lint and Formatting / css-lint (push) Has been cancelled
javascript-packages / Generate API Documentation (push) Has been cancelled
Lint / Go linter (push) Has been cancelled
Go Tests / test (push) Has been cancelled
Go Tests / test-bsds (map[name:freebsd version:12.2]) (push) Has been cancelled
Go Tests / test-bsds (map[name:openbsd version:6.8]) (push) Has been cancelled
HLS tests / tests (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package transcoder
|
||||
|
||||
const videoCodecH264 = "h264"
|
||||
|
||||
// VideoCodec represents a video compression format (e.g., H.264, H.265).
|
||||
type VideoCodec interface {
|
||||
Name() string
|
||||
DisplayName() string
|
||||
}
|
||||
|
||||
// H264Codec implements VideoCodec for the H.264 format.
|
||||
type H264Codec struct{}
|
||||
|
||||
func (c *H264Codec) Name() string {
|
||||
return videoCodecH264
|
||||
}
|
||||
|
||||
func (c *H264Codec) DisplayName() string {
|
||||
return "H.264"
|
||||
}
|
||||
|
||||
var videoCodecRegistry = map[string]VideoCodec{
|
||||
videoCodecH264: &H264Codec{},
|
||||
}
|
||||
|
||||
func getVideoCodec(name string) VideoCodec {
|
||||
if codec, ok := videoCodecRegistry[name]; ok {
|
||||
return codec
|
||||
}
|
||||
return &H264Codec{}
|
||||
}
|
||||
Reference in New Issue
Block a user