Gnash
0.8.11dev
|
NetStream_as ActionScript class. More...
#include <NetStream_as.h>
Public Types | |
enum | PauseMode { pauseModeToggle = -1, pauseModePause = 0, pauseModeUnPause = 1 } |
Public Member Functions | |
NetStream_as (as_object *owner) | |
Contruct a NetStream object. More... | |
~NetStream_as () | |
PlayHead::PlaybackStatus | playbackState () const |
int | videoHeight () const |
Get the real height of the video in pixels if the decoder exists. More... | |
int | videoWidth () const |
Get the real width of the video in pixels if the decoder exists. More... | |
void | close () |
void | setAudioController (DisplayObject *controller) |
Make audio controlled by given DisplayObject. More... | |
void | pause (PauseMode mode) |
Pauses/starts the playback of the media played by the current instance. More... | |
void | play (const std::string &source) |
Starts the playback of the media. More... | |
void | seek (boost::uint32_t pos) |
Seek in the media played by the current instance. More... | |
boost::int32_t | time () |
Tells where the playhead currently is. More... | |
void | update () |
double | getCurrentFPS () |
Returns the current framerate in frames per second. More... | |
void | setNetCon (NetConnection_as *nc) |
Sets the NetConnection needed to access external files. More... | |
bool | isConnected () const |
Return true if the NetStream has an associated NetConnection. More... | |
void | setBufferTime (boost::uint32_t time) |
boost::uint32_t | bufferTime () |
long | bytesLoaded () |
Returns the number of bytes of the media file that have been buffered. More... | |
long | bytesTotal () |
Returns the total number of bytes (size) of the media file. More... | |
long | bufferLength () |
std::auto_ptr< image::GnashImage > | get_video () |
Returns the video frame closest to current cursor. See time(). More... | |
void | setInvalidatedVideo (DisplayObject *ch) |
Register the DisplayObject to invalidate on video updates. More... | |
virtual void | markReachableResources () const |
Mark any reachable resources other than the owner. More... | |
![]() | |
ActiveRelay (as_object *owner) | |
virtual | ~ActiveRelay () |
Make sure we are removed from the list of callbacks on destruction. More... | |
virtual void | setReachable () |
Mark any other reachable resources, and finally mark our owner. More... | |
virtual void | clean () |
Remove the ActiveRelay from movie_root's callback set. More... | |
as_object & | owner () const |
Return the as_object that this Relay is attached to. More... | |
![]() | |
virtual | ~Relay ()=0 |
Static Public Member Functions | |
static unsigned int | audio_streamer (void *udata, boost::int16_t *samples, unsigned int nSamples, bool &eof) |
Callback used by sound_handler to get audio data. More... | |
Additional Inherited Members |
NetStream_as ActionScript class.
This class is responsible for handlign external media files. Provides interfaces for playback control.
gnash::NetStream_as::NetStream_as | ( | as_object * | owner | ) |
Contruct a NetStream object.
The default size needed to begin playback (_bufferTime) of media is 100 milliseconds.
gnash::NetStream_as::~NetStream_as | ( | ) |
|
static |
Callback used by sound_handler to get audio data.
This is a sound_handler::aux_streamer_ptr type.
It might be invoked by a separate thread (neither main, nor decoder thread).
long gnash::NetStream_as::bufferLength | ( | ) |
Returns the number of millisecond of the media file that is buffered and yet to be played
Referenced by update().
|
inline |
Returns what the buffer time has been set to. (100 milliseconds is default)
long gnash::NetStream_as::bytesLoaded | ( | ) |
Returns the number of bytes of the media file that have been buffered.
long gnash::NetStream_as::bytesTotal | ( | ) |
Returns the total number of bytes (size) of the media file.
void gnash::NetStream_as::close | ( | ) |
Closes the video session and frees all ressources used for decoding except the FLV-parser (this might not be correct).
References gnash::BufferedAudioStreamer::cleanAudioQueue(), and gnash::BufferedAudioStreamer::detachAuxStreamer().
Referenced by play().
std::auto_ptr< image::GnashImage > gnash::NetStream_as::get_video | ( | ) |
Returns the video frame closest to current cursor. See time().
|
inline |
Returns the current framerate in frames per second.
|
inline |
Return true if the NetStream has an associated NetConnection.
|
virtual |
Mark any reachable resources other than the owner.
Override this function if the subclass holds references to GC resources other than the owner.
Reimplemented from gnash::ActiveRelay.
References gnash::GcResource::setReachable(), and gnash::ActiveRelay::setReachable().
Pauses/starts the playback of the media played by the current instance.
mode | Defines what mode to put the instance in. |
References _, gnash::PlayHead::getState(), pauseModePause, pauseModeToggle, pauseModeUnPause, and gnash::PlayHead::PLAY_PAUSED.
void gnash::NetStream_as::play | ( | const std::string & | source | ) |
Starts the playback of the media.
source | Defines what file to play |
References _, gnash::BufferedAudioStreamer::attachAuxStreamer(), close(), gnash::NetConnection_as::getStream(), IF_VERBOSE_ASCODING_ERRORS, and gnash::NetConnection_as::isConnected().
|
inline |
References gnash::PlayHead::getState().
Referenced by gnash::Video::clear().
void gnash::NetStream_as::seek | ( | boost::uint32_t | pos | ) |
Seek in the media played by the current instance.
pos | Defines in seconds where to seek to |
References _, gnash::BufferedAudioStreamer::cleanAudioQueue(), GNASH_REPORT_FUNCTION, and gnash::PlayHead::seekTo().
void gnash::NetStream_as::setAudioController | ( | DisplayObject * | controller | ) |
Make audio controlled by given DisplayObject.
References gnash::getRoot(), and gnash::ActiveRelay::owner().
void gnash::NetStream_as::setBufferTime | ( | boost::uint32_t | time | ) |
Specifies the number of milliseconds to buffer before starting to display the stream.
time | The time in milliseconds that should be buffered. |
References time().
|
inline |
Register the DisplayObject to invalidate on video updates.
Referenced by gnash::Video::setStream().
|
inline |
Sets the NetConnection needed to access external files.
nc | The NetConnection object to use for network access |
boost::int32_t gnash::NetStream_as::time | ( | ) |
Tells where the playhead currently is.
References gnash::PlayHead::getPosition().
Referenced by setBufferTime().
|
virtual |
Called at the heart-beat frequency. Used to process queued status messages and (re)start after a buffering pause. In NetStreamFfmpeg it is also used to find the next video frame to be shown, though this might change.
Implements gnash::ActiveRelay.
References _, gnash::BufferedAudioStreamer::_audioQueue, gnash::BufferedAudioStreamer::_audioQueueMutex, gnash::PlayHead::advanceIfConsumed(), bufferLength(), gnash::key::e, gnash::PlayHead::getPosition(), gnash::PlayHead::getState(), gnash::key::i, gnash::ActiveRelay::owner(), gnash::PlayHead::PLAY_PAUSED, and gnash::PlayHead::seekTo().
int gnash::NetStream_as::videoHeight | ( | ) | const |
Get the real height of the video in pixels if the decoder exists.
Referenced by gnash::Video::height().
int gnash::NetStream_as::videoWidth | ( | ) | const |
Get the real width of the video in pixels if the decoder exists.
Referenced by gnash::Video::width().