SwfdecStream

SwfdecStream — object used for input

Functions

Properties

gboolean complete Read
gchar * error Read
gboolean open Read

Types and Values

Object Hierarchy

    GObject
    ╰── SwfdecStream
        ├── SwfdecLoader
        ╰── SwfdecSocket

Includes

#include <swfdec/swfdec.h>

Description

SwfdecStream is the base class used for communication inside Swfdec. If you are a UNIX developer, think of this class as the equivalent to a file descriptor. SwfdecLoader and SwfdecSocket are the subclasses supposed to be used for files or network sockets, respectively.

This class provides the functions necessary to implement subclasses of streams. None of the functions described in this section should be used by anything but subclass implementations. Consider them "protected".

Functions

swfdec_stream_is_open ()

gboolean
swfdec_stream_is_open (SwfdecStream *stream);

Checks if the given stream is currrently open. Some functions, for example swfdec_socket_send(), require an open stream.

Parameters

stream

a SwfdecStream

 

Returns

TRUE if the stream is open, FALSE otherwise.


swfdec_stream_is_complete ()

gboolean
swfdec_stream_is_complete (SwfdecStream *stream);

Checks if all data has successfully been transmitted through the stream and it has been closed.

Parameters

stream

a SwfdecStream

 

Returns

TRUE if the stream is completed, FALSE otherwise.


swfdec_stream_open ()

void
swfdec_stream_open (SwfdecStream *stream);

Call this function when your stream opened the resulting file. For HTTP this is when having received the headers. You must call this function before swfdec_stream_push() can be called.

Parameters

stream

a SwfdecStream

 

swfdec_stream_push ()

void
swfdec_stream_push (SwfdecStream *stream,
                    SwfdecBuffer *buffer);

Makes the data in buffer available to stream and processes it. The stream must be open.

Parameters

stream

a SwfdecStream

 

buffer

new data to make available. The stream takes the reference to the buffer.

 

swfdec_stream_close ()

void
swfdec_stream_close (SwfdecStream *stream);

Indicates to stream that no more data will follow. The stream must be open.

Parameters

stream

a SwfdecStream

 

swfdec_stream_error ()

void
swfdec_stream_error (SwfdecStream *stream,
                     const char *error,
                     ...);

Moves the stream in the error state if it wasn't before. A stream that is in the error state will not process any more data. Also, internal error handling scripts may be executed.

Parameters

stream

a SwfdecStream

 

error

a printf-style string describing the error

 

...

arguments for the error string

 

swfdec_stream_errorv ()

void
swfdec_stream_errorv (SwfdecStream *stream,
                      const char *error,
                      va_list args);

This function is the va_list alternative to swfdec_stream_error(). See that function for details.

Parameters

stream

a SwfdecStream

 

error

a printf-style error string

 

args

arguments for error

 

Types and Values

struct SwfdecStream

struct SwfdecStream;

This is the base object used for providing input. It is abstract, use a subclass to provide your input. All members are considered private.


struct SwfdecStreamClass

struct SwfdecStreamClass {
  /* get a nice description string */
  const char *		(* describe)		(SwfdecStream *		stream);
  /* close the stream. */
  void			(* close)		(SwfdecStream *		stream);
};

This is the base class used for providing input. You are supposed to create a subclass that fills in the function pointers mentioned above.

Members

describe ()

Provide a string describing your string. Default implementations of this function exist for both the SwfdecLoader and SwfdecStream subclasses. They return the URL for the stream.

 

close ()

Called when Swfdec requests that the stream be closed. After this function was called, Swfdec will consider the stream finished and will not ever read data from it again.

 

Property Details

The “complete” property

  “complete”                 gboolean

TRUE when all data has been transmitted.

Flags: Read

Default value: FALSE


The “error” property

  “error”                    gchar *

NULL when no error or string describing error.

Flags: Read

Default value: NULL


The “open” property

  “open”                     gboolean

TRUE while data is flowing.

Flags: Read

Default value: FALSE