Rygel.DataSource – librygel-server – Vala Binding Reference

Rygel.DataSource – librygel-server Reference Manual

# DataSource

## Object Hierarchy:

## Description:

public interface DataSource : Object

Interface for all data streams provided by a #RygelMediaEngine.

When Rygel receives a HTTP request to stream a given file, it creates a RygelDataSource object for this new file and instructs the RygelDataSource to begin streaming. The RygelDataSource object will duly pass this request on to the underlying media framework, which will in turn pass streamed bytes back to the RygelDataSource object. The RygelDataSource passes these bytes to Rygel which adds them to the response it sends to the original HTTP request received from the client.

The data source is responsible for providing response header information describing the content being produced and a 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:

1. It should support at least the file:// URI scheme.
2. 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.

Namespace: Rygel
Package: librygel-server

## Content:

### Methods:

- public abstract List<HTTPResponseElement>? preroll (HTTPSeekRequest? seek, PlaySpeedRequest? playspeed) throws Error
  Preroll the data with the given seek and playspeed.
- public abstract void start () throws Error
  Start producing the data.
- public abstract void freeze ()
  Temporarily stop data generation.
- public abstract void thaw ()
  Resume data generation from a previous freeze call.
- public abstract void stop ()
  Stop producing data. After calling stop(), calling start() should produce data from the beginning and not resume streaming.

### Signals:

- public signal void data_available (uint8[] data)
  Emitted when the source has produced some data.
- public signal void done ()
  Emitted when the source does not have data anymore.
- public signal void error (Error error)
  Emitted when the source encounters a problem during data generation.

### Inherited Members:

All known members inherited from class GLib.Object

- @new
- new_valist
- newv
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- freeze_notify
- @get

- get_class
- get_data
- get_property
- get_qdata
- get_type
- notify_property
- @ref
- ref_sink
- replace_data
- replace_qdata
- remove_toggle_ref
- remove_weak_pointer
- @set

- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- steal_data
- steal_qdata
- thaw_notify
- unref
- weak_ref
- weak_unref
- notify
- ref_count