com.flagstone.transform
Class FSDefineVideo

java.lang.Object
  extended by com.flagstone.transform.FSTransformObject
      extended by com.flagstone.transform.FSMovieObject
          extended by com.flagstone.transform.FSDefineObject
              extended by com.flagstone.transform.FSDefineVideo
All Implemented Interfaces:
java.lang.Cloneable

public class FSDefineVideo
extends FSDefineObject

The FSDefineVideo class is used to display video within a Flash file.

Video objects contain a unique identifier and are treated in the same way as shapes, buttons, images, etc. The video data displayed is define using the FSVideoFrame class. Each frame of video is displayed whenever display list is updated using the FSShowFrame object - any timing information stored within the video data is ignored.

An FSDefineVideo is defined with the following information:

Attributes
type Identifies the data structure when it is encoded. Read-only.
identifier A unique identifier, in the range 1..65535, that is used to reference the video from other objects, e.g. when adding or removing from the display list.
frameCount The number of frames that will be displayed.
width Width of each frame in pixels
height Height of each frame in pixels.
deblocking Whether a filter is used when assembling the blocks of video data into a frame. This may be set to Off to turn off the deblock filter in the Flash Player; On to turn on the Flash Player's filter or UseVideo to allow the video data to specify whether the deblocking filter is used.
smoothing Controls whether the Flash Player performs smoothing to increase the quality of the image displayed albeit at the price of performance.
codec Identifies the format of the video data either FSDefineVideo.H263 for data encoded using the Sorenson modified H263 format or FSDefineVideo.ScreenVideo for data encoded using Macromedia's Screen Video format.

The ScreenVideo format was introduced in Flash 7, only the H263 format was supported in Flash 6.

History

The FSDefineVideo class represents the DefineVideo of the Macromedia Flash (SWF) File Format Specification. It was introduced in Flash 6. The ScreenVideo format was introduced in Flash 7.


Field Summary
static int H263
          The video data was encoded using the Sorenson modified H263 format.
static int Off
          Instruct the Flash Player to turn the deblocking filter off.
static int On
          Instruct the Flash Player to turn the deblocking filter on.
static int ScreenVideo
          The video data was encoded using Macromedia's ScreenVideo format.
static int UseVideo
          Instruct the Flash Player to use the deblocking value specified in the video data.
 
Fields inherited from class com.flagstone.transform.FSDefineObject
identifier
 
Fields inherited from class com.flagstone.transform.FSMovieObject
ButtonColorTransform, ButtonSound, DefineBitsPtr, DefineButton, DefineButton2, DefineFont, DefineFont2, DefineImage, DefineImage2, DefineJPEGImage, DefineJPEGImage2, DefineJPEGImage3, DefineMorphShape, DefineMovieClip, DefineShape, DefineShape2, DefineShape3, DefineSound, DefineText, DefineText2, DefineTextField, DefineVideo, DoAction, EnableDebugger, EnableDebugger2, Export, extendLength, FontInfo, FontInfo2, FrameLabel, Free, Import, Initialize, JPEGTables, length, LimitScript, PathsArePostscript, PlaceObject, PlaceObject2, Protect, QuicktimeMovie, RemoveObject, RemoveObject2, SerialNumber, SetBackgroundColor, ShowFrame, SoundStreamBlock, SoundStreamHead, SoundStreamHead2, StartSound, TabOrder, type, VideoFrame
 
Constructor Summary
FSDefineVideo(FSCoder coder)
          Construct an FSDefineVideo object, initialising it with values decoded from an encoded object.
FSDefineVideo(FSDefineVideo obj)
          Constructs an FSDefineVideo object by copying values from an existing object.
FSDefineVideo(int anIdentifier, int count, int width, int height, int deblocking, boolean smoothing, int codec)
          Constructs an FSDefineVideo object with the specified parameters.
 
Method Summary
 void appendDescription(java.lang.StringBuffer buffer, int depth)
          AppendDescription is used to present a string description of the object including all nested objects up to a specified depth.
 java.lang.Object clone()
          Creates a deep copy of the entire object.
 void decode(FSCoder coder)
           
 void encode(FSCoder coder)
           
 boolean equals(java.lang.Object anObject)
          Returns true if anObject is equal to this one.
 int getCodec()
          Get the format used to encode the video data, either FSDefineVideo.H263 for data encoded using the Sorenson modified H263 format or FSDefineVideo.ScreenVideo (Flash 7 only) for data encoded using Macromedia's Screen Video format.
 int getDeblocking()
          Gets the method used to control the Flash Player's deblocking filter.
 int getFrameCount()
          Gets the number of frames in the video.
 int getHeight()
          Gets the height of each frame in pixels.
 boolean getSmoothing()
          Gets the method used to control Flash Player's smoothing filter.
 int getWidth()
          Gets the width of each frame in pixels.
 int length(FSCoder coder)
           
 void setCodec(int codec)
          Set the format used to encode the video data, either FSDefineVideo.H263 for data encoded using the Sorenson modified H263 format or FSDefineVideo.ScreenVideo (Flash 7 only) for data encoded using Macromedia's Screen Video format.
 void setDeblocking(int deblocking)
          Sets the method used to control the Flash Player's deblocking filter.
 void setFrameCount(int count)
          Sets the number of frames in the video.
 void setHeight(int height)
          Sets the height of each frame in pixels.
 void setSmoothing(boolean smoothing)
          Sets the method used to control Flash Player's smoothing filter.
 void setWidth(int width)
          Sets the width of each frame in pixels.
 
Methods inherited from class com.flagstone.transform.FSDefineObject
getIdentifier, setIdentifier
 
Methods inherited from class com.flagstone.transform.FSMovieObject
getType
 
Methods inherited from class com.flagstone.transform.FSTransformObject
name, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

H263

public static final int H263
The video data was encoded using the Sorenson modified H263 format.

See Also:
Constant Field Values

ScreenVideo

public static final int ScreenVideo
The video data was encoded using Macromedia's ScreenVideo format.

See Also:
Constant Field Values

UseVideo

public static final int UseVideo
Instruct the Flash Player to use the deblocking value specified in the video data.

See Also:
Constant Field Values

Off

public static final int Off
Instruct the Flash Player to turn the deblocking filter off.

See Also:
Constant Field Values

On

public static final int On
Instruct the Flash Player to turn the deblocking filter on.

See Also:
Constant Field Values
Constructor Detail

FSDefineVideo

public FSDefineVideo(FSCoder coder)
Construct an FSDefineVideo object, initialising it with values decoded from an encoded object.

Parameters:
coder - an FSCoder containing the binary data.

FSDefineVideo

public FSDefineVideo(int anIdentifier,
                     int count,
                     int width,
                     int height,
                     int deblocking,
                     boolean smoothing,
                     int codec)
Constructs an FSDefineVideo object with the specified parameters.

Parameters:
anIdentifier - the unique identifier for this object
count - the number of video frames.
width - the width of each frame in pixels.
height - the height of each frame in pixels.
deblocking - controls whether the Flash Player's deblocking filter is used, either Off, On or UseVideo to allow the video data to specify whether the deblocking filter is used.
smoothing - turns smoothing on or off to improve the quality of the displayed image.
codec - the format of the video data. Flash 6 supports FSDefineVideo.H263. Support for Macromedia's ScreenVideo format was added in Flash 7.

FSDefineVideo

public FSDefineVideo(FSDefineVideo obj)
Constructs an FSDefineVideo object by copying values from an existing object.

Parameters:
obj - an FSDefineVideo object.
Method Detail

getFrameCount

public int getFrameCount()
Gets the number of frames in the video.

Returns:
the number of video frames.

setFrameCount

public void setFrameCount(int count)
Sets the number of frames in the video.

Parameters:
count - the number of video frames.

getWidth

public int getWidth()
Gets the width of each frame in pixels.

Returns:
the width of the frame.

setWidth

public void setWidth(int width)
Sets the width of each frame in pixels.

Parameters:
width - the width of the frame.

getHeight

public int getHeight()
Gets the height of each frame in pixels.

Returns:
the height of the frame.

setHeight

public void setHeight(int height)
Sets the height of each frame in pixels.

Parameters:
height - the height of the frame.

getDeblocking

public int getDeblocking()
Gets the method used to control the Flash Player's deblocking filter.

Returns:
the deblocking filter control, either FSDefineVideo.Off, FSDefineVideo.On or FSDefineVideo.UseVideo to allow the video data to specify whether the deblocking filter is used.

setDeblocking

public void setDeblocking(int deblocking)
Sets the method used to control the Flash Player's deblocking filter.

Parameters:
deblocking - the deblocking filter control, either FSDefineVideo.Off, FSDefineVideo.On or FSDefineVideo.UseVideo to allow the video data to specify whether the deblocking filter is used.

getSmoothing

public boolean getSmoothing()
Gets the method used to control Flash Player's smoothing filter.

Returns:
true if smoothing is turned on, false if it is turned off.

setSmoothing

public void setSmoothing(boolean smoothing)
Sets the method used to control Flash Player's smoothing filter.

Parameters:
smoothing - true if smoothing is turned on, false if it is turned off.

getCodec

public int getCodec()
Get the format used to encode the video data, either FSDefineVideo.H263 for data encoded using the Sorenson modified H263 format or FSDefineVideo.ScreenVideo (Flash 7 only) for data encoded using Macromedia's Screen Video format.

Returns:
the codec used to encode the video, either FSDefineVideo.H263 or FSDefineVideo.ScreenVideo.

setCodec

public void setCodec(int codec)
Set the format used to encode the video data, either FSDefineVideo.H263 for data encoded using the Sorenson modified H263 format or FSDefineVideo.ScreenVideo (Flash 7 only) for data encoded using Macromedia's Screen Video format.

Parameters:
codec - the format used encode the video, either FSDefineVideo.H263 or FSDefineVideo.ScreenVideo.

clone

public java.lang.Object clone()
Description copied from class: FSTransformObject
Creates a deep copy of the entire object.

Overrides:
clone in class FSTransformObject
Returns:
a copy of the object.

equals

public boolean equals(java.lang.Object anObject)
Description copied from class: FSMovieObject
Returns true if anObject is equal to this one. Objects are considered equal if they would generate identical binary data when they are encoded to a Flash file.

Overrides:
equals in class FSMovieObject
Returns:
true if this object would be identical to anObject when encoded.

appendDescription

public void appendDescription(java.lang.StringBuffer buffer,
                              int depth)
Description copied from class: FSTransformObject
AppendDescription is used to present a string description of the object including all nested objects up to a specified depth. This method provide a more controlled way of creating a string representation of an object since large objects such as font or shape definitions can contain dozens of nested objects. The representation of the object is appended to the StringBuffer, showing the name of the class and values of the attributes it contains. If the object contains any attributes that are objects then the object graph will be traversed up to the specified depth. If objects are nested at a level less than specified depth then the full string representation of the object is displayed. For objects at the specified depth only the name of the class is displayed. Any objects below this depth are not displayed.

Overrides:
appendDescription in class FSDefineObject
Parameters:
buffer - a StringBuffer to which the description of each object is appended.
depth - the maximum level of nesting up to which objects will be displayed.

length

public int length(FSCoder coder)
Overrides:
length in class FSDefineObject

encode

public void encode(FSCoder coder)
Overrides:
encode in class FSDefineObject

decode

public void decode(FSCoder coder)
Overrides:
decode in class FSDefineObject