This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AV1 | |
def encode(bytes) | |
end | |
def decode(bytes) | |
end | |
end | |
class H264 | |
def encode(bytes) | |
end | |
def decode(bytes) | |
end | |
end | |
# ... | |
supported_codecs = [AV1.new, H264.new, HEVC.new] | |
class MediaFramework | |
def encode(type, bytes) | |
codec = supported_codecs.find {|c| c.class.name.downcase == type} | |
codec.encode(bytes) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment