package FFMPEG;
public abstract class VideoStream extends Stream
{
public final String manifest;
protected VideoStream(String manifest)
{
this.manifest = manifest;
// test
this.getManifestExtension();
}
@Override
public final String getManifest()
{
String ext = "." + this.getManifestExtension();
if (this.manifest.endsWith(ext))
{
return this.manifest;
}
else
{
return this.manifest + ext;
}
}
public final String getManifestExtension()
{
return getManifestExtension(this.getClass());
}
public static String getManifestExtension(Class extends VideoStream> c)
{
VideoStreamDirectory videoStreamDirectory = c.getAnnotation(VideoStreamDirectory.class);
if (videoStreamDirectory == null)
{
throw new RuntimeException("Class that extends " +
VideoStream.class.getName() +
" must have annotation " +
VideoStreamDirectory.class.getName());
}
return videoStreamDirectory.manifestExtension();
}
}