11 lines
384 B
Java
11 lines
384 B
Java
package facade;
|
|
|
|
/** CodecFactory — inspects a VideoFile and returns the matching Codec. */
|
|
class CodecFactory {
|
|
static Codec extract(VideoFile file) {
|
|
System.out.println(" CodecFactory: extracting codec from " + file.getFilename());
|
|
if ("mpeg4".equals(file.getCodecType())) return new MPEG4CompressionCodec();
|
|
return new OggCompressionCodec();
|
|
}
|
|
}
|