| librygel-server Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Prerequisites | Signals | ||||
RygelDataSourceRygelDataSource — Interface for all data streams provided by a RygelMediaEngine. |
enum RygelDataSourceError; void rygel_data_source_start (RygelDataSource *self,RygelHTTPSeek *offsets,GError **error); void rygel_data_source_freeze (RygelDataSource *self); void rygel_data_source_thaw (RygelDataSource *self); void rygel_data_source_stop (RygelDataSource *self); RygelDataSource; struct RygelDataSourceIface;
The data source is responsible for providing the streamable byte-stream via its data_available signal. End-of-stream is signalled by the done signal, while errors are signalled by the error signal.
Implementations should fulfil at least these requirements:
It should support at least the file:// URI scheme.
It should be able to stream any kind of binary data, regardless of the format.
RygelDataSource instances are provided by rygel_media_engine_create_data_source() which will return a derived RygelDataSource that uses a specific IO backend and/or multimedia backend to stream the multimedia data at the URI.
The derived RygelDataSource may provide additional API for use by the derived media engine. For instance, rygel_media_engine_get_transcoders() may return derived RygelTranscoder instances, and these may use that additional API in their create_source() implementations, for instance to access resources or data structures of the specific multimedia backend.
typedef enum {
RYGEL_DATA_SOURCE_ERROR_GENERAL,
RYGEL_DATA_SOURCE_ERROR_SEEK_FAILED
} RygelDataSourceError;
void rygel_data_source_start (RygelDataSource *self,RygelHTTPSeek *offsets,GError **error);
Start producing the data.
GError will be returned in error if anything goes wrong while starting the stream. Throws DataSourceError.SEEK_FAILED if a seek method is not supported or the range is not fulfillable.
|
the RygelDataSource instance |
|
optional limits of the stream for partial streaming. [in][allow-none] |
|
location to store the error occuring, or NULL to ignore |
void rygel_data_source_freeze (RygelDataSource *self);
Temporarily stop data generation.
May be called multiple times. If the source is already frozen, the following calles to freeze are ignored. After callging freeze(), so data_available() signal should be emitted.
|
the RygelDataSource instance |
void rygel_data_source_thaw (RygelDataSource *self);
Resume data generation from a previous freeze call.
May be called multiple times, will be ignored if the source is not frozen.
|
the RygelDataSource instance |
void rygel_data_source_stop (RygelDataSource *self);
Stop producing data. After calling stop(), calling start() should produce data from the beginning and not resume streaming.
|
the RygelDataSource instance |
typedef struct _RygelDataSource RygelDataSource;
Interface for all data streams provided by a RygelMediaEngine.
The data source is responsible for providing the streamable byte-stream via its data_available signal. End-of-stream is signalled by the done signal, while errors are signalled by the error signal.
Implementations should fulfil at least these requirements:
It should support at least the file:// URI scheme.
It should be able to stream any kind of binary data, regardless of the format.
RygelDataSource instances are provided by rygel_media_engine_create_data_source() which will return a derived RygelDataSource that uses a specific IO backend and/or multimedia backend to stream the multimedia data at the URI.
The derived RygelDataSource may provide additional API for use by the derived media engine. For instance, rygel_media_engine_get_transcoders() may return derived RygelTranscoder instances, and these may use that additional API in their create_source() implementations, for instance to access resources or data structures of the specific multimedia backend.
struct RygelDataSourceIface {
GTypeInterface parent_iface;
void (*start) (RygelDataSource* self, RygelHTTPSeek* offsets, GError** error);
void (*freeze) (RygelDataSource* self);
void (*thaw) (RygelDataSource* self);
void (*stop) (RygelDataSource* self);
};
Interface for creating RygelDataSource implementations.
"data-available" signalvoid user_function (RygelDataSource *data_source,
gpointer data_length1,
gint data,
gpointer user_data) : Run Last
Emitted when the source has produced some data.
|
the RygelDataSource instance that received the signal |
|
length of the data array |
|
user data set when the signal handler was connected. |
"done" signalvoid user_function (RygelDataSource *data_source,
gpointer user_data) : Run Last
Emitted when the source does not have data anymore.
|
the RygelDataSource instance that received the signal |
|
user data set when the signal handler was connected. |
"error" signalvoid user_function (RygelDataSource *data_source,
gpointer error,
gpointer user_data) : Run Last
Emitted when the source encounters a problem during data generation.
|
the RygelDataSource instance that received the signal |
|
user data set when the signal handler was connected. |