
public class FilterGraph extends Configurable
| Modifier and Type | Class and Description |
|---|---|
static class |
FilterGraph.AutoConvertFlag |
static class |
FilterGraph.State
States a graph can be in.
|
| Modifier and Type | Method and Description |
|---|---|
FilterAudioSink |
addAudioSink(String name,
int sampleRate,
AudioChannel.Layout channelLayout,
AudioFormat.Type format)
Add a FilterAudioSink.
|
FilterAudioSource |
addAudioSource(String name,
int sampleRate,
AudioChannel.Layout channelLayout,
AudioFormat.Type format,
Rational timeBase)
Add a FilterAudioSource.
|
Filter |
addFilter(FilterType type,
String name)
Add a filter with the given name to the graph.
|
FilterPictureSink |
addPictureSink(String name,
PixelFormat.Type format)
Add a FilterPictureSink.
|
FilterPictureSource |
addPictureSource(String name,
int width,
int height,
PixelFormat.Type format,
Rational timeBase,
Rational pixelAspectRatio)
Add a FilterPictureSource.
|
FilterGraph |
copyReference()
Create a new FilterGraph object that is actually referring to the
exact same underlying native object.
|
boolean |
equals(Object obj)
Compares two values, returning true if the underlying objects in native code are the same object.
|
FilterGraph.AutoConvertFlag |
getAutoConvert() |
String |
getDisplayString() |
Filter |
getFilter(String name) |
int |
getNumSinks() |
int |
getNumSources() |
FilterSink |
getSink(int index) |
FilterSink |
getSink(String name) |
FilterSource |
getSource(int index) |
FilterSource |
getSource(String name) |
FilterGraph.State |
getState() |
int |
hashCode()
Get a hashable value for this object.
|
static FilterGraph |
make()
Creates a new FilterGraph.
|
void |
open(String filterDescription)
Add a graph described by a string to a graph.
|
void |
queueCommand(String target,
String command,
String arguments,
int flags,
double ts)
Queue a command for one or more filter instances.
|
String |
sendCommand(String target,
String command,
String arguments,
int flags) |
void |
setAutoConvert(FilterGraph.AutoConvertFlag value)
Should this graph auto-convert audio or pictures into the formats
different filters require (rather than require the user to construct a graph with all filters sets correctly). |
getNumProperties, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsInt, getPropertyAsLong, getPropertyAsRational, getPropertyAsString, getPropertyMetaData, getPropertyMetaData, setProperty, setProperty, setProperty, setProperty, setProperty, setPropertydelete, getCurrentRefCountpublic FilterGraph copyReference()
copyReference in class Configurablepublic boolean equals(Object obj)
equals in class Configurablepublic int hashCode()
hashCode in class Configurablepublic static FilterGraph make()
public Filter addFilter(FilterType type, String name)
public Filter getFilter(String name)
public FilterAudioSource addAudioSource(String name, int sampleRate, AudioChannel.Layout channelLayout, AudioFormat.Type format, Rational timeBase)
name - the name; must be unique in graphtimeBase - timebase of frames that will be input. If null 1/sampleRate is assumed.sampleRate - the audio sample rateformat - the sample formatRuntimeException - if name is already in graph.InvalidArgument - if any argument is invalid.public FilterPictureSource addPictureSource(String name, int width, int height, PixelFormat.Type format, Rational timeBase, Rational pixelAspectRatio)
name - the name; must be unique in graphwidth - the width in pixels of MediaPicture objects that will be added to this source.height - the height in pixels of MediaPicture objects that will be added to this source.format - the pixel formattimeBase - timebase of frames that will be input. If null, 1/Global.DEFAULT_PTS_PER_SECOND is assumed.pixelAspectRatio - pixel aspect ratio. If null, 1/1 is assumed.RuntimeException - if name is already in graph.InvalidArgument - if any argument is invalid.public FilterAudioSink addAudioSink(String name, int sampleRate, AudioChannel.Layout channelLayout, AudioFormat.Type format)
name - the name; must be unique in graphsampleRate - the audio sample rateformat - the sample formatRuntimeException - if name is already in graph.InvalidArgument - if any argument is invalid.public FilterPictureSink addPictureSink(String name, PixelFormat.Type format)
name - the name; must be unique in graphformat - the pixel format desired of pictures taken from this sink.RuntimeException - if name is already in graph.InvalidArgument - if any argument is invalid.public int getNumSources()
public FilterSource getSource(int index)
index - The n'th of #getNumSoruces() FilterSources attached to this FilterGraph.InvalidArgument - if index < 0 || index >= #getNumSources()public FilterSource getSource(String name)
name - unique name of a FilterSource in this FilterGraph. Should have been added with #addSource(FilterSource,String).PropertyNotFoundException - if not in graph.public int getNumSinks()
public FilterSink getSink(int index)
index - The n'th of #getNumSoruces() FilterSinks attached to this FilterGraph.InvalidArgument - if index < 0 || index >= #getNumSinks()public FilterSink getSink(String name)
name - unique name of a FilterSink in this FilterGraph. Should have been added with #addSink(FilterSink,String).PropertyNotFoundException - if not in graph.public void setAutoConvert(FilterGraph.AutoConvertFlag value)
value - whether to auto-convert with MediaPictureResampler or MediaAudioResampler objects.public FilterGraph.AutoConvertFlag getAutoConvert()
public void open(String filterDescription)
filterDescription - The filter string to be parsed, in FFmpeg libavfilter format.RuntimeException - if any inputs or outputs are open (i.e. each filterpublic void queueCommand(String target, String command, String arguments, int flags, double ts)
target - the filter(s) to which the command should be sentcommand - the command to sent, for handling simplicity all commands must be alphanummeric onlyarguments - the argument for the commandts - time at which the command should be sent to the filterpublic String getDisplayString()
public FilterGraph.State getState()
Copyright © 2018 Humble Software. All rights reserved.