Package com.avpkit.core
Class Configuration
- java.lang.Object
-
- com.avpkit.core.Configuration
-
public class Configuration extends java.lang.Object
A global configuration class for AVPKit.This object can help print setting options on
IConfigurableclasses, and also provides a convenient methodconfigure(Properties, IConfigurable)that lets you configureIConfigurableobjects from a Java properties or FFmpeg preset file.- Author:
- aclarke
- See Also:
configure(Properties, IConfigurable),IConfigurable
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intconfigure(java.lang.String file, IConfigurable config)Configures anIConfigurablefrom a file.static intconfigure(java.util.Properties properties, IConfigurable config)Configures anIConfigurablefrom a set of JavaProperties.static voidmain(java.lang.String[] args)A main program that just prints information on all avaiable AVPKit options.static voidprintConfigurable(java.io.PrintStream stream, IConfigurable configObj)Print out all configurable options on theIConfigurableobject.static voidprintHelp(java.io.PrintStream stream)Print out help about this AVPKit installation.static voidprintOption(java.io.PrintStream stream, IConfigurable configObj, IProperty prop)Print information about the property on the configurable object.static voidprintSupportedCodecs(java.io.PrintStream stream)Print out all installed and supported codecs on this system.static voidprintSupportedContainerFormats(java.io.PrintStream stream)Print out all installed and supported container formats on this system.static voidprintSupportedContainerProperties(java.io.PrintStream stream)Print out allIContainersupported properties.static voidprintSupportedStreamCoderProperties(java.io.PrintStream stream)Print out allIStreamCodersupported properties.static voidprintSupportedVideoResamplerProperties(java.io.PrintStream stream)Print out allIVideoResamplersupported properties, if that option is supported in this version of AVPKit.
-
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
A main program that just prints information on all avaiable AVPKit options.- Parameters:
args- ignored
-
printHelp
public static void printHelp(java.io.PrintStream stream)
Print out help about this AVPKit installation. Specifically all installed and supported container formats, installed and supported codecs, allIContaineroptions, allIStreamCoderoptions and allIVideoResampleroptions.- Parameters:
stream- stream to print to
-
printSupportedContainerFormats
public static void printSupportedContainerFormats(java.io.PrintStream stream)
Print out all installed and supported container formats on this system.- Parameters:
stream- stream to print to
-
printSupportedCodecs
public static void printSupportedCodecs(java.io.PrintStream stream)
Print out all installed and supported codecs on this system.- Parameters:
stream- stream to print to
-
printSupportedVideoResamplerProperties
public static void printSupportedVideoResamplerProperties(java.io.PrintStream stream)
Print out allIVideoResamplersupported properties, if that option is supported in this version of AVPKit.- Parameters:
stream- stream to print to.
-
printSupportedStreamCoderProperties
public static void printSupportedStreamCoderProperties(java.io.PrintStream stream)
Print out allIStreamCodersupported properties.- Parameters:
stream- stream to print to.
-
printSupportedContainerProperties
public static void printSupportedContainerProperties(java.io.PrintStream stream)
Print out allIContainersupported properties.- Parameters:
stream- stream to print to.
-
printConfigurable
public static void printConfigurable(java.io.PrintStream stream, IConfigurable configObj)
Print out all configurable options on theIConfigurableobject.- Parameters:
stream- stream to print toconfigObj-IConfigurableobject.
-
printOption
public static void printOption(java.io.PrintStream stream, IConfigurable configObj, IProperty prop)
Print information about the property on the configurable object.- Parameters:
stream- stream to print toconfigObj- configurable objectprop- property on object
-
configure
public static int configure(java.util.Properties properties, IConfigurable config)
Configures anIConfigurablefrom a set of JavaProperties.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");- Parameters:
properties- The properties to use.config- The item to configure.- Returns:
- <0 on error; >= 0 on success.
- Since:
- 3.4
-
configure
public static int configure(java.lang.String file, IConfigurable config)
Configures anIConfigurablefrom a file.This is a handy way to configure a AVPKit
IConfigurableobject, and will also work with FFmpeg preset files.- Parameters:
file- A filename for the properties file.config- The item to configure.- Returns:
- <0 on error; >= 0 on success.
- Since:
- 3.4
-
-