Swfdec Reference Manual | ||||
---|---|---|---|---|
#include <swfdec/swfdec.h> SwfdecLoader; SwfdecFileLoader; SwfdecLoaderClass; void swfdec_loader_set_url (SwfdecLoader *loader, const char *url); const SwfdecURL* swfdec_loader_get_url (SwfdecLoader *loader); void swfdec_loader_set_size (SwfdecLoader *loader, gulong size); glong swfdec_loader_get_size (SwfdecLoader *loader); gulong swfdec_loader_get_loaded (SwfdecLoader *loader); SwfdecLoaderDataType swfdec_loader_get_data_type (SwfdecLoader *loader);
GObject +----SwfdecStream +----SwfdecLoader +----SwfdecFileLoader
GObject +----SwfdecStream +----SwfdecLoader +----SwfdecFileLoader +----SwfdecGtkLoader
"data-type" SwfdecLoaderDataType : Read "loaded" gulong : Read / Write "size" glong : Read / Write "url" SwfdecURL* : Read
SwfdecLoader is the base class used for reading input. Since developers normally need to adapt input to the needs of their application, this class is provided to be adapted to their needs. It is used both for HTTP and RTMP access.
Since Flash files can load new resources while operating, a SwfdecLoader can be instructed to load another resource.
For convenience, a SwfdecLoader for file access is provided by Swfdec.
typedef struct _SwfdecLoader SwfdecLoader;
This is the base object used for providing input. It is abstract, use a subclass to provide your input.
typedef struct _SwfdecFileLoader SwfdecFileLoader;
This is a SwfdecLoader that can load content from files. This symbol is exported so you can subclass your own loaders from it and have automatic file access.
typedef struct { void (* load) (SwfdecLoader * loader, SwfdecPlayer * player, const char * url, SwfdecBuffer * buffer, guint n_headers, const char ** header_names, const char ** header_values); } SwfdecLoaderClass;
This is the base class used for input. If you create a subclass, you are supposed to set the function pointers listed above.
|
initialize a new loader based on a parent loader object. The new loader will already have its URL set. |
void swfdec_loader_set_url (SwfdecLoader *loader, const char *url);
Updates the url of the given loader
to point to the new url
. This is useful
whe encountering HTTP redirects, as the loader is supposed to reference the
final URL after all rdirections.
This function may only be called once and must have been called before
calling swfdec_stream_open()
on loader
.
|
the loader to update |
|
string specifying the new URL. The url must be a valid absolute URL. |
const SwfdecURL* swfdec_loader_get_url (SwfdecLoader *loader);
Gets the url this loader is handling. This is mostly useful for writing subclasses of SwfdecLoader.
|
a SwfdecLoader |
Returns : |
a SwfdecURL describing loader or NULL if the url is not known
yet.
|
void swfdec_loader_set_size (SwfdecLoader *loader, gulong size);
Sets the size of bytes in this loader. This function may only be called once.
|
a SwfdecLoader |
|
the amount of bytes in this loader |
glong swfdec_loader_get_size (SwfdecLoader *loader);
Queries the amount of bytes inside loader
. If the size is unknown, -1 is
returned. Otherwise the number is greater or equal to 0.
|
a SwfdecLoader |
Returns : |
the total number of bytes for this loader or -1 if unknown |
gulong swfdec_loader_get_loaded (SwfdecLoader *loader);
Gets the amount of bytes that have already been pushed into loader
and are
available to Swfdec.
|
a SwfdecLoader |
Returns : |
Amount of bytes in loader
|
SwfdecLoaderDataType swfdec_loader_get_data_type (SwfdecLoader *loader);
Queries the type of data this loader provides. The type is determined automatically by Swfdec.
|
a SwfdecLoader |
Returns : |
the type this data was identified to be in or SWFDEC_LOADER_DATA_UNKNOWN if not identified |
"data-type"
property"data-type" SwfdecLoaderDataType : Read
the data's type as identified by Swfdec.
Default value: SWFDEC_LOADER_DATA_UNKNOWN
"size"
property"size" glong : Read / Write
amount of bytes in loader.
Allowed values: >= -1
Default value: -1