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