Public Member Functions | Protected Member Functions

gnash::Video Class Reference

VideoStream ActionScript object. More...

#include <Video.h>

Inheritance diagram for gnash::Video:
Inheritance graph
[legend]
Collaboration diagram for gnash::Video:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Video (as_object *object, const SWF::DefineVideoStreamTag *def, DisplayObject *parent)
 ~Video ()
virtual bool pointInShape (boost::int32_t x, boost::int32_t y) const
 Return true if the given point falls in this DisplayObject's shape.
virtual SWFRect getBounds () const
virtual void construct (as_object *init=0)
 Register this video instance as a live DisplayObject.
virtual void display (Renderer &renderer, const Transform &xform)
 Render the DisplayObject.
void add_invalidated_bounds (InvalidatedRanges &ranges, bool force)
 Add the DisplayObject's invalidated bounds *to* the given ranges list.
void setStream (NetStream_as *ns)
 Set the input stream for this video.
void clear ()
int height () const
 Get the height of the video.
int width () const
 Get the width of the video.
bool smoothing () const
 Whether this Video object should request smoothing when scaled.
void setSmoothing (bool b)
 Set whether smoothing is required.

Protected Member Functions

virtual void markOwnResources () const
 Mark video-specific reachable resources.

Detailed Description

VideoStream ActionScript object.

A VideoStream provides audio/video frames either embedded into the SWF itself or loaded from the network using an associated NetStream object.


Constructor & Destructor Documentation

gnash::Video::Video ( as_object object,
const SWF::DefineVideoStreamTag def,
DisplayObject parent 
)
gnash::Video::~Video (  ) 

Member Function Documentation

void gnash::Video::add_invalidated_bounds ( InvalidatedRanges ranges,
bool  force 
) [virtual]

Add the DisplayObject's invalidated bounds *to* the given ranges list.

NOTE that this method should include the bounds that it covered the last time clear_invalidated() was called, as those need to be rerendered as well (to clear the region previously occupied by this DisplayObject).

That's why it returns the *union* of old_invalidated_ranges and the current bounds. The function is also used internally by set_invalidated() to update m_old_invalidated_ranges itself (you may notice some kind of circular reference), but that's no problem since old_invalidated_ranges is NULL during that call.

It is used to determine what area needs to be re-rendered. The coordinates are world coordinates (in TWIPS). Only instances with _invalidated flag set are checked unless force is set.

Reimplemented from gnash::DisplayObject.

void gnash::Video::clear (  ) 
void gnash::Video::construct ( as_object init = 0  )  [virtual]

Register this video instance as a live DisplayObject.

Reimplemented from gnash::DisplayObject.

References gnash::media::EncodedVideoFrame::frameNum().

void gnash::Video::display ( Renderer renderer,
const Transform xform 
) [virtual]

Render the DisplayObject.

All DisplayObjects must have a display() function.

Implements gnash::DisplayObject.

References gnash::NetStream_as::videoHeight().

SWFRect gnash::Video::getBounds (  )  const [virtual]

Implements gnash::DisplayObject.

int gnash::Video::height (  )  const

Get the height of the video.

The method depends on whether it is an embedded or a live stream. This returns 0 until the height is known, which for FLV streams is only after decoding. The value may possibly vary during playback.

void gnash::Video::markOwnResources (  )  const [protected, virtual]

Mark video-specific reachable resources.

video-specific reachable resources are:

  • Associated NetStream if any (_ns)

Reimplemented from gnash::DisplayObject.

References gnash::getVM(), and gnash::VM::registerNative().

virtual bool gnash::Video::pointInShape ( boost::int32_t  x,
boost::int32_t  y 
) const [inline, virtual]

Return true if the given point falls in this DisplayObject's shape.

Parameters:
x Point x coordinate in world space
y Point y coordinate in world space
Returns:
Whether (x, y) is within the DisplayObject's bounds.

Implements gnash::DisplayObject.

References gnash::DisplayObject::pointInBounds().

void gnash::Video::setSmoothing ( bool  b  )  [inline]

Set whether smoothing is required.

void gnash::Video::setStream ( NetStream_as ns  ) 
bool gnash::Video::smoothing (  )  const [inline]

Whether this Video object should request smoothing when scaled.

int gnash::Video::width (  )  const

Get the width of the video.

The method depends on whether it is an embedded or a live stream. This returns 0 until the height is known, which for FLV streams is only after decoding. The value may possibly vary during playback.

References _.


The documentation for this class was generated from the following files: