Gnash  0.8.11dev
Static Public Member Functions | Static Public Attributes | List of all members
gnash::MovieFactory Class Reference

#include <MovieFactory.h>

Static Public Member Functions

static DSOEXPORT boost::intrusive_ptr< movie_definitionmakeMovie (const URL &url, const RunResources &runResources, const char *real_url=nullptr, bool startLoaderThread=true, const std::string *postdata=nullptr)
 Create a gnash::movie_definition from the given URL. More...
 
static DSOEXPORT boost::intrusive_ptr< movie_definitionmakeMovie (std::unique_ptr< IOChannel > in, const std::string &url, const RunResources &runResources, bool startLoaderThread)
 Load a movie from an already opened stream. More...
 
static DSOEXPORT void clear ()
 Clear the MovieFactory resources. More...
 

Static Public Attributes

static MovieLibrary movieLibrary
 

Member Function Documentation

§ clear()

void gnash::MovieFactory::clear ( )
static

§ makeMovie() [1/2]

boost::intrusive_ptr< movie_definition > gnash::MovieFactory::makeMovie ( const URL url,
const RunResources runResources,
const char *  real_url = nullptr,
bool  startLoaderThread = true,
const std::string *  postdata = nullptr 
)
static

Create a gnash::movie_definition from the given URL.

The URL can correspond to either a JPEG or SWF file.

This is just like create_movie(), except that it checks the "library" to see if a movie of this name has already been created, and returns that movie if so. Also, if it creates a new movie, it adds it back into the library.

The "library" is used when importing symbols from external movies, so this call might be useful if you want to explicitly load a movie that you know exports symbols (e.g. fonts) to other movies as well.

@ this explanation/functionality could be clearer!

If real_url is given, the movie's url will be set to that value.

Parameters
urlThe URL to load the movie from.
runResourcesA RunResources containing resources needed for parsing, such as the base URL for the run, the sound::sound_handler, and a StreamProvider.
real_urlThe url to encode as the _url member of the resulting movie definition. Use NULL if it is not different from the actual url (default). This is used to simulate a run from the official publication url.
startLoaderThreadIf false only the header will be read, and you'll need to call completeLoad on the returned movie_definition to actually start it. This is typically used to postpone parsing until a VirtualMachine is initialized. Initializing the VirtualMachine requires a target SWF version, which can be found in the SWF header.
postdataIf not NULL, use POST method (only valid for HTTP). NOTE: when POSTing, the movies library won't be used.

Now complete the load if the movie is an SWF movie

This is a no-op except for SWF movies.

References _, gnash::MovieLibrary::add(), gnash::MovieLibrary::get(), gnash::log_debug(), gnash::log_error(), movieLibrary, and gnash::URL::str().

Referenced by clear(), gnash::SWF::ImportAssetsTag::executeState(), gnash::MovieLoader::MovieLoader(), and gnash::Player::setScale().

§ makeMovie() [2/2]

boost::intrusive_ptr< movie_definition > gnash::MovieFactory::makeMovie ( std::unique_ptr< IOChannel in,
const std::string &  url,
const RunResources runResources,
bool  startLoaderThread 
)
static

Load a movie from an already opened stream.

The movie can be both an SWF or JPEG, the url parameter will be used to set the _url member of the resulting object.

Parameters
inThe stream to load the movie from. Ownership is transferred to the returned object.
urlThe url to use as the _url member of the resulting movie definition. This is required as it can not be derived from the IOChannel.
runResourcesA RunResources containing resources needed for parsing, such as the base URL for the run, the sound::sound_handler, and a StreamProvider.
startLoaderThreadIf false only the header will be read, and you'll need to call completeLoad on the returned movie_definition to actually start it. This is typically used to postpone parsing until a VirtualMachine is initialized. Initializing the VirtualMachine requires a target SWF version, which can be found in the SWF header.

References _, gnash::GNASH_FILETYPE_FLV, gnash::GNASH_FILETYPE_GIF, gnash::GNASH_FILETYPE_JPEG, gnash::GNASH_FILETYPE_PNG, gnash::GNASH_FILETYPE_SWF, gnash::log_error(), and gnash::log_unimpl().

Member Data Documentation

§ movieLibrary

MovieLibrary gnash::MovieFactory::movieLibrary
static

Referenced by clear(), and makeMovie().


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