|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--quicktime.app.RecordMovie
This class is used to record a movie from a source QDGraphics. It provides a profiling mode so that the an estimate of the compression time for each frame captured. The use of this class can enable a movie to be recorded where the record rate is unrelated to the capture rate. That is, a recorded rate of 10 frames a second can be specified and each frame that is captured will have a duration of 1/10 of a second regardless of how long the compression process takes or how often the frameReady method is called.
Typically this class is used as a utility service by some other class that wants to provide recording capabilities. When a RecordMovie object is set in the target class, the target class notifies the RecordMovie object that it now has a source QDGraphics. Whenever appropriate, the target class then notifies the RecordMovie object that a frame is ready to be captured from the QDGraphics object and the RecordMovie object either captures that frame or profiles the compression based on its current mode of operation. When the frameReady method has been called the specified number of frames when recording it returns false to indicate that it is no longer interested and the target class can discard the RecordMovie object and ceases notification of frame readiness. In its turn the RecordMovie disavows any knowledge of the QDGraphics object it was compressing until the next time it receives notification that it has been added to a source.
Once a movie has completed recording the RecordMovie object will spawn a thread and call the RecordMovieCallback's finish method with the movie that has just been recorded. The recorded movie will have a video track added with all of the data captured and the application can at this point do whatever is appropriate with the movie - save it, play it back, etc. Each record operation will add a new video track with the specified compression and visual media characteristics.
An example usage of the RecordMovie class:
RecordMovie rm = new RecordMovie (myMovie, myRecordCallback); rm.setCompressionSettings (...); myRecordThis.setRecordMovie (rm);An example definition of a Class that uses the RecordMovie object to capture its QDGraphics:
class RecordThis { QDGraphics g; RecordMovie rm; public void setRecordMovie (RecordMovie rm) throws QTException { rm.addedToSource (g); this.rm = rm; } // some call in this object that is responsible for drawing void blitImage () { //do blit to g //.... if (rm != null && rm.frameReady() == false) //capture current state of g rm = null; //no longer interested drop reference to rm } }
quicktime.app.display.Compositor
Constructor Summary | |
RecordMovie()
Creates a default RecordMovie object. |
|
RecordMovie(Movie theMovie,
RecordMovieCallback cBack)
Record the output of each composited image to a frame. |
|
RecordMovie(Movie theMovie,
RecordMovieCallback cBack,
QDRect rectBounds)
Record the output of each composited image to a frame. |
Method Summary | |
void |
abortRecording()
Aborts recording before it has completed. |
void |
addedToSource(QDGraphics g)
This method is called by the target object that control the drawing and capturing of the image drawn in the QDGraphics. |
boolean |
frameReady()
The source of the record operation calls this method whether the RecordMovie object is preflighting or recording whenever it is appropriate for the RecordMovie object to capture the current state of the QDGraphics. |
boolean |
isPreflighting()
Returns true if the RecordMovie object is preflighting a compression operation. |
void |
recordMode(int numRecordFrames)
Places a RecordMovie object in record mode. |
void |
setCompressionSettings(int scale,
int spatialQuality,
int temporalQuality,
int keyFrameRate,
int codecType,
CodecComponent codec)
Establishes the type of compression that will be applied to the source QDGraphics when the recording or preflighting is done. |
void |
setMovie(Movie theMovie,
RecordMovieCallback cBack)
Sets the movie that a video track will be added to in any consequent record operation and the callback object that will be called when the movie is finished recording. |
void |
setPreflighting(boolean flag)
This call will do a preflight of the record and you will be able to asses the impact of compressing a single pass of the QDGraphics target. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RecordMovie() throws QTException
public RecordMovie(Movie theMovie, RecordMovieCallback cBack) throws QTException
theMovie
- the movie to which a video track will be addedcBack
- when recording is finished the cBack.finish method is called with the resultant movie. If this
value is null then no notification is given to the application when recording is completed.public RecordMovie(Movie theMovie, RecordMovieCallback cBack, QDRect rectBounds) throws QTException
theMovie
- the movie to which a video track will be addedcBack
- when recording is finished the cBack.finish method is called with the resultant movie. If this
value is null then no notification is given to the application when recording is completed.rectBounds
- if only some part of the QDGraphics is to be captured you can specify the rectangle
here. A value of null means that the entire QDGraphics bounds will be capturedMethod Detail |
public void setMovie(Movie theMovie, RecordMovieCallback cBack) throws QTException
theMovie
- to recordcBack
- the call back objectpublic void setCompressionSettings(int scale, int spatialQuality, int temporalQuality, int keyFrameRate, int codecType, CodecComponent codec) throws QTException
scale
- the time scale of the video track that is addedspatialQuality
- the spatial compression quality that is to be applied when compressing each frametemporalQuality
- the temporal compression quality that is to be applied when compressing each framekeyFrameRate
- the key frame rate that is used if temporal compression is used.
A value of zero lets QuickTime decide on the keyFrameRate. This is disregarded if no temporal compression is specifiedcodecType
- the codec identifier that is used to specify which compressor is used to compress the imagescodec
- qualifies which type of codec of codecType is used, ex. bestSpeed, bestQuality, etc.public void addedToSource(QDGraphics g) throws QTException
g
- the graphics object which is the source of the compression and capture operations of the RecordMovie classframeReady()
public void setPreflighting(boolean flag) throws QTException
flag
- if true preflighting is enabled, if false preflighting is disabled.public boolean isPreflighting()
public void recordMode(int numRecordFrames) throws QTException
numRecordFrames
- the number of frames the record activity should recordpublic void abortRecording() throws QTException
public boolean frameReady() throws QTException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |