
public class Configuration extends Object
This object can help print setting options
on Configurable classes, and also
provides a convenient method configure(Properties, Configurable)
that lets you configure Configurable objects from
a Java properties or FFmpeg preset file.
configure(Properties, Configurable),
Configurable| Modifier and Type | Method and Description |
|---|---|
static void |
configure(Properties properties,
Configurable config)
Configures an
Configurable from a set of Java Properties. |
static void |
configure(String file,
Configurable config)
Configures an
Configurable from a file. |
static void |
printConfigurable(PrintStream stream,
Configurable configObj)
Print out all configurable options on the
Configurable object. |
static void |
printOption(PrintStream stream,
Configurable configObj,
Property prop)
Print information about the property on the configurable object.
|
public static void printConfigurable(PrintStream stream, Configurable configObj)
Configurable object.stream - stream to print toconfigObj - Configurable object.public static void printOption(PrintStream stream, Configurable configObj, Property prop)
stream - stream to print toconfigObj - configurable objectprop - property on objectpublic static void configure(Properties properties, Configurable config)
Configurable from a set of Java Properties.
Here's some sample code that shows configuring a IStreamCoder from a FFmpeg preset file:
Properties props = new Properties();
props.load(new FileInputStream(file));
IStreamCoder coder = IStreamCoder.make(Direction.ENCODING);
int retval = Configuration.configure(props, coder);
if (retval < 0)
throw new RuntimeException("Could not configure object");
properties - The properties to use.config - The item to configure.public static void configure(String file, Configurable config) throws FileNotFoundException, IOException
Configurable from a file.
This is a handy way to configure a Humble Video Configurable
object, and will also work with FFmpeg preset files.
file - A filename for the properties file.config - The item to configure.IOExceptionFileNotFoundExceptionCopyright © 2018 Humble Software. All rights reserved.