|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.actor.lib.Sink
ptolemy.actor.lib.jmf.MovieWriter
public class MovieWriter
This actor writes a video file (MPEG, AVI, or Quicktime). It receives JMFImageTokens at the input, and queues them up for writing.
The file is specified by the fileName attribute using any form acceptable to FileParameter.
If the confirmOverwrite parameter has value false, then this actor will overwrite the specified file if it exists without asking. If true (the default), then if the file exists, then this actor will ask for confirmation before overwriting.
FileParameter
,
Serialized Form
Red (cxh) |
Red (cxh) |
Nested Class Summary | |
---|---|
private class |
MovieWriter.ImageDataSource
|
private class |
MovieWriter.ImageSourceStream
|
Nested classes/interfaces inherited from class ptolemy.kernel.Entity |
---|
Entity.ContainedObjectsIterator |
Field Summary | |
---|---|
private static int |
_AVI
|
private java.util.ArrayList |
_bufferArrayList
|
private java.util.Iterator |
_bufferIterator
|
private boolean |
_confirmOverwrite
|
private boolean |
_ended
|
private java.io.File |
_file
|
private boolean |
_fileDone
|
private java.lang.String |
_fileRoot
|
private boolean |
_fileSuccess
|
private int |
_fileType
|
private MovieWriter.ImageSourceStream[] |
_imageSourceStream
|
private JMFImageToken |
_jmfImageToken
|
private static int |
_MPEG
|
private static int |
_QUICKTIME
|
private boolean |
_stateTransitionOK
|
private javax.media.format.VideoFormat |
_videoFormat
|
private java.lang.Object |
_waitFileSync
|
private java.lang.Object |
_waitSync
|
Parameter |
confirmOverwrite
If false, then overwrite the specified file if it exists without asking. |
FileParameter |
fileOrURL
The file name or URL from which to read. |
StringAttribute |
fileType
The type of file to write. |
Fields inherited from class ptolemy.actor.lib.Sink |
---|
input |
Fields inherited from class ptolemy.actor.AtomicActor |
---|
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Fields inherited from interface ptolemy.actor.Executable |
---|
COMPLETED, NOT_READY, STOP_ITERATING |
Constructor Summary | |
---|---|
MovieWriter(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name. |
Method Summary | |
---|---|
protected boolean |
_waitForFileDone()
Wait for the file to be written. |
protected boolean |
_waitForState(javax.media.Processor processor,
int state)
Block until the processor has transitioned to the given state. |
void |
attributeChanged(Attribute attribute)
An attempt is made to acquire the file name. |
void |
controllerUpdate(javax.media.ControllerEvent event)
The controller listener. |
void |
dataSinkUpdate(javax.media.datasink.DataSinkEvent event)
The data sink listener. |
void |
initialize()
Initialize this actor. |
boolean |
postfire()
Fire this actor. |
void |
wrapup()
Save the file. |
Methods inherited from class ptolemy.actor.TypedAtomicActor |
---|
_addPort, _fireAt, _fireAt, attributeTypeChanged, clone, newPort, typeConstraintList, typeConstraints |
Methods inherited from class ptolemy.kernel.ComponentEntity |
---|
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName |
Methods inherited from class ptolemy.kernel.Entity |
---|
_description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName |
Methods inherited from class ptolemy.kernel.InstantiableNamedObj |
---|
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ptolemy.actor.Actor |
---|
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList |
Methods inherited from interface ptolemy.actor.Executable |
---|
fire, isFireFunctional, isStrict, iterate, prefire, stop, stopFire, terminate |
Methods inherited from interface ptolemy.actor.Initializable |
---|
addInitializable, preinitialize, removeInitializable |
Methods inherited from interface ptolemy.kernel.util.Nameable |
---|
description, getContainer, getDisplayName, getFullName, getName, getName, setName |
Methods inherited from interface ptolemy.kernel.util.Derivable |
---|
getDerivedLevel, getDerivedList, propagateValue |
Field Detail |
---|
public Parameter confirmOverwrite
public FileParameter fileOrURL
FileParameter
public StringAttribute fileType
private java.util.ArrayList _bufferArrayList
private java.util.Iterator _bufferIterator
private boolean _confirmOverwrite
private boolean _ended
private java.io.File _file
private boolean _fileDone
private java.lang.String _fileRoot
private boolean _fileSuccess
private int _fileType
private MovieWriter.ImageSourceStream[] _imageSourceStream
private JMFImageToken _jmfImageToken
private boolean _stateTransitionOK
private javax.media.format.VideoFormat _videoFormat
private java.lang.Object _waitFileSync
private java.lang.Object _waitSync
private static final int _AVI
private static final int _MPEG
private static final int _QUICKTIME
Constructor Detail |
---|
public MovieWriter(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this actor.
IllegalActionException
- If the actor cannot be contained
by the proposed container.
NameDuplicationException
- If the container already has an
actor with this name.Method Detail |
---|
public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class NamedObj
attribute
- The attribute that changed.
IllegalActionException
- If the URL is null, or
invalid.public void controllerUpdate(javax.media.ControllerEvent event)
controllerUpdate
in interface javax.media.ControllerListener
event
- The controller event.public void dataSinkUpdate(javax.media.datasink.DataSinkEvent event)
dataSinkUpdate
in interface javax.media.datasink.DataSinkListener
event
- The controller event.public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class AtomicActor
IllegalActionException
- If a contained method throws it.public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class AtomicActor
IllegalActionException
- If a contained method throws it,
or if the buffer of the incoming JMFImageToken cannot be added
to the queue.public void wrapup() throws IllegalActionException
wrapup
in interface Initializable
wrapup
in class AtomicActor
IllegalActionException
- If a contained method throws it.protected boolean _waitForFileDone() throws IllegalActionException
IllegalActionException
- If there is a problem blocking
the processor until the state transition is completed.protected boolean _waitForState(javax.media.Processor processor, int state) throws IllegalActionException
processor
- The processor .state
- The state.
IllegalActionException
- If there is a problem blocking
the processor until the state transition is completed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |