Top | ![]() |
![]() |
![]() |
![]() |
void | swfdec_loader_set_url () |
const SwfdecURL * | swfdec_loader_get_url () |
void | swfdec_loader_set_size () |
glong | swfdec_loader_get_size () |
gulong | swfdec_loader_get_loaded () |
SwfdecLoaderDataType | swfdec_loader_get_data_type () |
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.
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
.
const SwfdecURL *
swfdec_loader_get_url (SwfdecLoader *loader
);
Gets the url this loader is handling. This is mostly useful for writing subclasses of SwfdecLoader.
void swfdec_loader_set_size (SwfdecLoader *loader
,gulong size
);
Sets the size of bytes in this loader. This function may only be called once.
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.
gulong
swfdec_loader_get_loaded (SwfdecLoader *loader
);
Gets the amount of bytes that have already been pushed into loader
and are
available to Swfdec.
SwfdecLoaderDataType
swfdec_loader_get_data_type (SwfdecLoader *loader
);
Queries the type of data this loader provides. The type is determined automatically by Swfdec.
struct SwfdecLoader;
This is the base object used for providing input. It is abstract, use a subclass to provide your input.
struct 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.
struct SwfdecLoaderClass { void (* load) (SwfdecLoader * loader, SwfdecPlayer * player, const char * url, SwfdecBuffer * buffer, guint n_headers, const char ** header_names, const char ** header_values); };
This is the base class used for input. If you create a subclass, you are supposed to set the function pointers listed above.
“data-type”
property“data-type” SwfdecLoaderDataType
the data's type as identified by Swfdec.
Flags: Read
Default value: SWFDEC_LOADER_DATA_UNKNOWN
“size”
property “size” glong
amount of bytes in loader.
Flags: Read / Write
Allowed values: >= -1
Default value: -1