Gnash
0.8.10
|
VideoStream ActionScript object. More...
#include <Video.h>
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. |
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.
gnash::Video::Video | ( | as_object * | object, |
const SWF::DefineVideoStreamTag * | def, | ||
DisplayObject * | parent | ||
) |
gnash::Video::~Video | ( | ) |
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.
References gnash::DisplayObject::invalidated(), gnash::geometry::SnappingRanges2d::add(), gnash::DisplayObject::m_old_invalidated_ranges, assert, gnash::SWFRect::expand_to_transformed_rect(), gnash::getWorldMatrix(), and gnash::SWFRect::getRange().
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::DisplayObject::saveOriginalTarget().
Render the DisplayObject.
All DisplayObjects must have a display() function.
Implements gnash::DisplayObject.
References assert, gnash::DisplayObject::transform(), gnash::Renderer::drawVideoFrame(), and gnash::DisplayObject::clear_invalidated().
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.
References gnash::NetStream_as::videoHeight().
void gnash::Video::markOwnResources | ( | ) | const [protected, virtual] |
Mark video-specific reachable resources.
video-specific reachable resources are:
Reimplemented from gnash::DisplayObject.
References gnash::ActiveRelay::setReachable().
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.
x | Point x coordinate in world space |
y | Point y coordinate in world space |
Implements gnash::DisplayObject.
References gnash::DisplayObject::pointInBounds().
void gnash::Video::setSmoothing | ( | bool | b | ) | [inline] |
Set whether smoothing is required.
References gnash::key::b.
void gnash::Video::setStream | ( | NetStream_as * | ns | ) |
Set the input stream for this video.
References gnash::NetStream_as::setInvalidatedVideo().
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 gnash::NetStream_as::videoWidth().