SwfdecLoader

SwfdecLoader — object used for input

Functions

Properties

SwfdecLoaderDataType data-type Read
gulong loaded Read / Write
glong size Read / Write
SwfdecURL * url Read

Types and Values

Object Hierarchy

    GObject
    ╰── SwfdecStream
        ╰── SwfdecLoader
            ╰── SwfdecFileLoader
                ╰── SwfdecGtkLoader

Includes

#include <swfdec/swfdec.h>

Description

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.

Functions

swfdec_loader_set_url ()

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 .

Parameters

loader

the loader to update

 

url

string specifying the new URL. The url must be a valid absolute URL.

 

swfdec_loader_get_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.

Parameters

loader

a SwfdecLoader

 

Returns

a SwfdecURL describing loader or NULL if the url is not known yet.


swfdec_loader_set_size ()

void
swfdec_loader_set_size (SwfdecLoader *loader,
                        gulong size);

Sets the size of bytes in this loader. This function may only be called once.

Parameters

loader

a SwfdecLoader

 

size

the amount of bytes in this loader

 

swfdec_loader_get_size ()

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.

Parameters

loader

a SwfdecLoader

 

Returns

the total number of bytes for this loader or -1 if unknown


swfdec_loader_get_loaded ()

gulong
swfdec_loader_get_loaded (SwfdecLoader *loader);

Gets the amount of bytes that have already been pushed into loader and are available to Swfdec.

Parameters

loader

a SwfdecLoader

 

Returns

Amount of bytes in loader


swfdec_loader_get_data_type ()

SwfdecLoaderDataType
swfdec_loader_get_data_type (SwfdecLoader *loader);

Queries the type of data this loader provides. The type is determined automatically by Swfdec.

Parameters

loader

a SwfdecLoader

 

Returns

the type this data was identified to be in or SWFDEC_LOADER_DATA_UNKNOWN if not identified

Types and Values

struct SwfdecLoader

struct SwfdecLoader;

This is the base object used for providing input. It is abstract, use a subclass to provide your input.


struct SwfdecFileLoader

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

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.

Members

load ()

initialize a new loader based on a parent loader object. The new loader will already have its URL set.

 

Property Details

The “data-type” property

  “data-type”                SwfdecLoaderDataType

the data's type as identified by Swfdec.

Flags: Read

Default value: SWFDEC_LOADER_DATA_UNKNOWN


The “loaded” property

  “loaded”                   gulong

bytes already loaded.

Flags: Read / Write


The “size” property

  “size”                     glong

amount of bytes in loader.

Flags: Read / Write

Allowed values: >= -1

Default value: -1


The “url” property

  “url”                      SwfdecURL *

URL for this file.

Flags: Read