GrlMediaSource

GrlMediaSource — Abstract class for media providers

Synopsis

#include <grilo.h>

                    GrlMediaSource;
void                (*GrlMediaSourceResultCb)           (GrlMediaSource *source,
                                                         guint operation_id,
                                                         GrlMedia *media,
                                                         guint remaining,
                                                         gpointer user_data,
                                                         const GError *error);
void                (*GrlMediaSourceMetadataCb)         (GrlMediaSource *source,
                                                         GrlMedia *media,
                                                         gpointer user_data,
                                                         const GError *error);
void                (*GrlMediaSourceStoreCb)            (GrlMediaSource *source,
                                                         GrlMediaBox *parent,
                                                         GrlMedia *media,
                                                         gpointer user_data,
                                                         const GError *error);
void                (*GrlMediaSourceRemoveCb)           (GrlMediaSource *source,
                                                         GrlMedia *media,
                                                         gpointer user_data,
                                                         const GError *error);
                    GrlMediaSourceBrowseSpec;
                    GrlMediaSourceSearchSpec;
                    GrlMediaSourceQuerySpec;
                    GrlMediaSourceMetadataSpec;
                    GrlMediaSourceStoreSpec;
                    GrlMediaSourceRemoveSpec;
                    GrlMediaSourceMediaFromUriSpec;
                    GrlMediaSourceClass;
guint               grl_media_source_browse             (GrlMediaSource *source,
                                                         GrlMedia *container,
                                                         const GList *keys,
                                                         guint skip,
                                                         guint count,
                                                         GrlMetadataResolutionFlags flags,
                                                         GrlMediaSourceResultCb callback,
                                                         gpointer user_data);
GList *             grl_media_source_browse_sync        (GrlMediaSource *source,
                                                         GrlMedia *container,
                                                         const GList *keys,
                                                         guint skip,
                                                         guint count,
                                                         GrlMetadataResolutionFlags flags,
                                                         GError **error);
guint               grl_media_source_search             (GrlMediaSource *source,
                                                         const gchar *text,
                                                         const GList *keys,
                                                         guint skip,
                                                         guint count,
                                                         GrlMetadataResolutionFlags flags,
                                                         GrlMediaSourceResultCb callback,
                                                         gpointer user_data);
GList *             grl_media_source_search_sync        (GrlMediaSource *source,
                                                         const gchar *text,
                                                         const GList *keys,
                                                         guint skip,
                                                         guint count,
                                                         GrlMetadataResolutionFlags flags,
                                                         GError **error);
guint               grl_media_source_query              (GrlMediaSource *source,
                                                         const gchar *query,
                                                         const GList *keys,
                                                         guint skip,
                                                         guint count,
                                                         GrlMetadataResolutionFlags flags,
                                                         GrlMediaSourceResultCb callback,
                                                         gpointer user_data);
GList *             grl_media_source_query_sync         (GrlMediaSource *source,
                                                         const gchar *query,
                                                         const GList *keys,
                                                         guint skip,
                                                         guint count,
                                                         GrlMetadataResolutionFlags flags,
                                                         GError **error);
guint               grl_media_source_metadata           (GrlMediaSource *source,
                                                         GrlMedia *media,
                                                         const GList *keys,
                                                         GrlMetadataResolutionFlags flags,
                                                         GrlMediaSourceMetadataCb callback,
                                                         gpointer user_data);
GrlMedia *          grl_media_source_metadata_sync      (GrlMediaSource *source,
                                                         GrlMedia *media,
                                                         const GList *keys,
                                                         GrlMetadataResolutionFlags flags,
                                                         GError **error);
void                grl_media_source_store              (GrlMediaSource *source,
                                                         GrlMediaBox *parent,
                                                         GrlMedia *media,
                                                         GrlMediaSourceStoreCb callback,
                                                         gpointer user_data);
void                grl_media_source_store_sync         (GrlMediaSource *source,
                                                         GrlMediaBox *parent,
                                                         GrlMedia *media,
                                                         GError **error);
void                grl_media_source_remove             (GrlMediaSource *source,
                                                         GrlMedia *media,
                                                         GrlMediaSourceRemoveCb callback,
                                                         gpointer user_data);
void                grl_media_source_remove_sync        (GrlMediaSource *source,
                                                         GrlMedia *media,
                                                         GError **error);
void                grl_media_source_cancel             (GrlMediaSource *source,
                                                         guint operation_id);
void                grl_media_source_set_operation_data (GrlMediaSource *source,
                                                         guint operation_id,
                                                         gpointer data);
gpointer            grl_media_source_get_operation_data (GrlMediaSource *source,
                                                         guint operation_id);
void                grl_media_source_set_auto_split_threshold
                                                        (GrlMediaSource *source,
                                                         guint threshold);
guint               grl_media_source_get_auto_split_threshold
                                                        (GrlMediaSource *source);
gboolean            grl_media_source_test_media_from_uri
                                                        (GrlMediaSource *source,
                                                         const gchar *uri);
void                grl_media_source_get_media_from_uri (GrlMediaSource *source,
                                                         const gchar *uri,
                                                         const GList *keys,
                                                         GrlMetadataResolutionFlags flags,
                                                         GrlMediaSourceMetadataCb callback,
                                                         gpointer user_data);

Object Hierarchy

  GObject
   +----GrlMediaPlugin
         +----GrlMetadataSource
               +----GrlMediaSource

Properties

  "auto-split-threshold"     guint                 : Read / Write

Signals

  "content-changed"                                : Run First / Action

Description

GrlMediaSource is the abstract base class needed to construct a source of media data.

The media sources fetch media data descriptors and store them in data transfer objects represented as GrlMedia.

There are several methods to retrieve the media, such as searching a text expression, crafting a specific query, etc. And most of those methods are asynchronous.

Examples of media sources are GrlYoutubeSource, GrlJamendoSource, etc.

Details

GrlMediaSource

typedef struct _GrlMediaSource GrlMediaSource;

GrlMediaSourceResultCb ()

void                (*GrlMediaSourceResultCb)           (GrlMediaSource *source,
                                                         guint operation_id,
                                                         GrlMedia *media,
                                                         guint remaining,
                                                         gpointer user_data,
                                                         const GError *error);

Prototype for the callback passed to the media sources' methods

source :

a media source

operation_id :

operation identifier

media :

a data transfer object. [transfer full]

remaining :

the number of remaining GrlMedia to process, or GRL_SOURCE_REMAINING_UNKNOWN if it is unknown

user_data :

user data passed to the used method

error :

possible GError generated at processing. [not-error][type uint]

GrlMediaSourceMetadataCb ()

void                (*GrlMediaSourceMetadataCb)         (GrlMediaSource *source,
                                                         GrlMedia *media,
                                                         gpointer user_data,
                                                         const GError *error);

Prototype for the callback passed to grl_media_source_metadata()

source :

a media source

media :

a data transfer object. [transfer full]

user_data :

user data passed to grl_media_source_metadata()

error :

possible GError generated at processing. [not-error][type uint]

GrlMediaSourceStoreCb ()

void                (*GrlMediaSourceStoreCb)            (GrlMediaSource *source,
                                                         GrlMediaBox *parent,
                                                         GrlMedia *media,
                                                         gpointer user_data,
                                                         const GError *error);

Prototype for the callback passed to grl_media_source_store()

source :

a media source

parent :

The GrlMediaBox who parents the media

media :

a data transfer object. [transfer full]

user_data :

user data passed to grl_media_source_store()

error :

possible GError generated at processing. [not-error][type uint]

GrlMediaSourceRemoveCb ()

void                (*GrlMediaSourceRemoveCb)           (GrlMediaSource *source,
                                                         GrlMedia *media,
                                                         gpointer user_data,
                                                         const GError *error);

Prototype for the callback passed to grl_media_source_remove()

source :

a media source

media :

a data transfer object. [transfer full]

user_data :

user data passed to grl_media_source_remove()

error :

possible GError generated at processing. [not-error][type uint]

GrlMediaSourceBrowseSpec

typedef struct {
  GrlMediaSource *source;
  guint browse_id;
  GrlMedia *container;
  GList *keys;
  guint skip;
  guint count;
  GrlMetadataResolutionFlags flags;
  GrlMediaSourceResultCb callback;
  gpointer user_data;
} GrlMediaSourceBrowseSpec;

Data transport structure used internally by the plugins which support browse vmethod.

GrlMediaSource *source;

a media source

guint browse_id;

operation identifier

GrlMedia *container;

a container of data transfer objects

GList *keys;

the GList of GrlKeyIDs to request

guint skip;

the number if elements to skip in the browse operation

guint count;

the number of elements to retrieve in the browse operation

GrlMetadataResolutionFlags flags;

the resolution mode

GrlMediaSourceResultCb callback;

the user defined callback

gpointer user_data;

the user data to pass in the callback

GrlMediaSourceSearchSpec

typedef struct {
  GrlMediaSource *source;
  guint search_id;
  gchar *text;
  GList *keys;
  guint skip;
  guint count;
  GrlMetadataResolutionFlags flags;
  GrlMediaSourceResultCb callback;
  gpointer user_data;
} GrlMediaSourceSearchSpec;

Data transport structure used internally by the plugins which support search vmethod.

GrlMediaSource *source;

a media source

guint search_id;

operation identifier

gchar *text;

the text to search

GList *keys;

the GList of GrlKeyIDs to request

guint skip;

the number if elements to skip in the browse operation

guint count;

the number of elements to retrieve in the browse operation

GrlMetadataResolutionFlags flags;

the resolution mode

GrlMediaSourceResultCb callback;

the user defined callback

gpointer user_data;

the user data to pass in the callback

GrlMediaSourceQuerySpec

typedef struct {
  GrlMediaSource *source;
  guint query_id;
  gchar *query;
  GList *keys;
  guint skip;
  guint count;
  GrlMetadataResolutionFlags flags;
  GrlMediaSourceResultCb callback;
  gpointer user_data;
} GrlMediaSourceQuerySpec;

Data transport structure used internally by the plugins which support query vmethod.

GrlMediaSource *source;

a media source

guint query_id;

operation identifier

gchar *query;

the query to process

GList *keys;

the GList of GrlKeyIDs to request

guint skip;

the number if elements to skip in the browse operation

guint count;

the number of elements to retrieve in the browse operation

GrlMetadataResolutionFlags flags;

the resolution mode

GrlMediaSourceResultCb callback;

the user defined callback

gpointer user_data;

the user data to pass in the callback

GrlMediaSourceMetadataSpec

typedef struct {
  GrlMediaSource *source;
  guint metadata_id;
  GrlMedia *media;
  GList *keys;
  GrlMetadataResolutionFlags flags;
  GrlMediaSourceMetadataCb callback;
  gpointer user_data;
} GrlMediaSourceMetadataSpec;

Data transport structure used internally by the plugins which support metadata vmethod.

GrlMediaSource *source;

a media source

guint metadata_id;

operation identifier

GrlMedia *media;

a data transfer object

GList *keys;

the GList of GrlKeyIDs to request

GrlMetadataResolutionFlags flags;

the resolution mode

GrlMediaSourceMetadataCb callback;

the user defined callback

gpointer user_data;

the user data to pass in the callback

GrlMediaSourceStoreSpec

typedef struct {
  GrlMediaSource *source;
  GrlMediaBox *parent;
  GrlMedia *media;
  GrlMediaSourceStoreCb callback;
  gpointer user_data;
} GrlMediaSourceStoreSpec;

Data transport structure used internally by the plugins which support store vmethod.

GrlMediaSource *source;

a media source

GrlMediaBox *parent;

a parent to store the data transfer objects

GrlMedia *media;

a data transfer object

GrlMediaSourceStoreCb callback;

the user defined callback

gpointer user_data;

the user data to pass in the callback

GrlMediaSourceRemoveSpec

typedef struct {
  GrlMediaSource *source;
  gchar *media_id;
  GrlMedia *media;
  GrlMediaSourceRemoveCb callback;
  gpointer user_data;
} GrlMediaSourceRemoveSpec;

Data transport structure used internally by the plugins which support store vmethod.

GrlMediaSource *source;

a media source

gchar *media_id;

media identifier to remove

GrlMedia *media;

a data transfer object

GrlMediaSourceRemoveCb callback;

the user defined callback

gpointer user_data;

the user data to pass in the callback

GrlMediaSourceMediaFromUriSpec

typedef struct {
  GrlMediaSource *source;
  gchar *uri;
  GList *keys;
  GrlMetadataResolutionFlags flags;
  GrlMediaSourceMetadataCb callback;
  gpointer user_data;
} GrlMediaSourceMediaFromUriSpec;

Data transport structure used internally by the plugins which support media_from_uri vmethod.

GrlMediaSource *source;

a media source

gchar *uri;

A URI that can be used to identify a media resource

GList *keys;

Metadata keys to resolve

GrlMetadataResolutionFlags flags;

Operation flags

GrlMediaSourceMetadataCb callback;

the user defined callback

gpointer user_data;

the user data to pass in the callback

GrlMediaSourceClass

typedef struct {
  GrlMetadataSourceClass parent_class;

  guint operation_id;

  void (*browse) (GrlMediaSource *source, GrlMediaSourceBrowseSpec *bs);

  void (*search) (GrlMediaSource *source, GrlMediaSourceSearchSpec *ss);

  void (*query) (GrlMediaSource *source, GrlMediaSourceQuerySpec *qs);

  void (*cancel) (GrlMediaSource *source, guint operation_id);

  void (*metadata) (GrlMediaSource *source, GrlMediaSourceMetadataSpec *ms);

  void (*store) (GrlMediaSource *source, GrlMediaSourceStoreSpec *ss);

  void (*remove) (GrlMediaSource *source, GrlMediaSourceRemoveSpec *ss);

  gboolean (*test_media_from_uri) (GrlMediaSource *source,
				   const gchar *uri);

  void (*media_from_uri) (GrlMediaSource *source,
			  GrlMediaSourceMediaFromUriSpec *mfss);

  gboolean (*notify_change_start) (GrlMediaSource *source,
                                    GError **error);

  gboolean (*notify_change_stop) (GrlMediaSource *source,
                                  GError **error);
} GrlMediaSourceClass;

Grilo MediaSource class. Override the vmethods to implement the source functionality.

GrlMetadataSourceClass parent_class;

the parent class structure

guint operation_id;

operation identifier

browse ()

browse through a list of media

search ()

search for media

query ()

query for a specific media

cancel ()

cancel the current operation

metadata ()

request for specific metadata

store ()

store a media in a container

remove ()

remove a media from a container

test_media_from_uri ()

tests if this source can create GrlMedia instances from a given URI.

media_from_uri ()

Creates a GrlMedia instance representing the media exposed by a certain URI.

notify_change_start ()

start emitting signals about changes in content

notify_change_stop ()

stop emitting signals about changes in content

grl_media_source_browse ()

guint               grl_media_source_browse             (GrlMediaSource *source,
                                                         GrlMedia *container,
                                                         const GList *keys,
                                                         guint skip,
                                                         guint count,
                                                         GrlMetadataResolutionFlags flags,
                                                         GrlMediaSourceResultCb callback,
                                                         gpointer user_data);

Browse from skip, a count number of media elements through an available list.

This method is asynchronous.

source :

a media source

container :

a container of data transfer objects. [allow-none]

keys :

the GList of GrlKeyIDs to request. [element-type GObject.ParamSpec]

skip :

the number if elements to skip in the browse operation

count :

the number of elements to retrieve in the browse operation

flags :

the resolution mode

callback :

the user defined callback. [scope notified]

user_data :

the user data to pass in the callback

Returns :

the operation identifier

Since 0.1.4


grl_media_source_browse_sync ()

GList *             grl_media_source_browse_sync        (GrlMediaSource *source,
                                                         GrlMedia *container,
                                                         const GList *keys,
                                                         guint skip,
                                                         guint count,
                                                         GrlMetadataResolutionFlags flags,
                                                         GError **error);

Browse from skip, a count number of media elements through an available list.

This method is synchronous.

source :

a media source

container :

a container of data transfer objects. [allow-none]

keys :

the GList of GrlKeyIDs to request. [element-type GObject.ParamSpec]

skip :

the number if elements to skip in the browse operation

count :

the number of elements to retrieve in the browse operation

flags :

the resolution mode

error :

a GError, or NULL

Returns :

a GList with GrlMedia elements. After use g_object_unref() every element and g_list_free() the list. [element-type Grl.Media][transfer full Grl.Media]

Since 0.1.6


grl_media_source_search ()

guint               grl_media_source_search             (GrlMediaSource *source,
                                                         const gchar *text,
                                                         const GList *keys,
                                                         guint skip,
                                                         guint count,
                                                         GrlMetadataResolutionFlags flags,
                                                         GrlMediaSourceResultCb callback,
                                                         gpointer user_data);

Search for the text string in a media source for data identified with that string.

If text is NULL then no text filter will be applied, and thus, no media items from source will be filtered. If source does not support NULL-text search operations it should notiy the client by setting GRL_CORE_ERROR_SEARCH_NULL_UNSUPPORTED in callback's error parameter.

This method is asynchronous.

source :

a media source

text :

the text to search

keys :

the GList of GrlKeyIDs to request. [element-type GObject.ParamSpec]

skip :

the number if elements to skip in the search operation

count :

the number of elements to retrieve in the search operation

flags :

the resolution mode

callback :

the user defined callback. [scope notified]

user_data :

the user data to pass in the callback

Returns :

the operation identifier

Since 0.1.1


grl_media_source_search_sync ()

GList *             grl_media_source_search_sync        (GrlMediaSource *source,
                                                         const gchar *text,
                                                         const GList *keys,
                                                         guint skip,
                                                         guint count,
                                                         GrlMetadataResolutionFlags flags,
                                                         GError **error);

Search for the text string in a media source for data identified with that string.

If text is NULL then no text filter will be applied, and thus, no media items from source will be filtered. If source does not support NULL-text search operations it should notiy the client by setting GRL_CORE_ERROR_SEARCH_NULL_UNSUPPORTED in the error parameter.

This method is synchronous.

source :

a media source

text :

the text to search

keys :

the GList of GrlKeyIDs to request. [element-type GObject.ParamSpec]

skip :

the number if elements to skip in the search operation

count :

the number of elements to retrieve in the search operation

flags :

the resolution mode

error :

a GError, or NULL

Returns :

a GList with GrlMedia elements. After use g_object_unref() every element and g_list_free() the list. [element-type Grl.Media][transfer full Grl.Media]

Since 0.1.6


grl_media_source_query ()

guint               grl_media_source_query              (GrlMediaSource *source,
                                                         const gchar *query,
                                                         const GList *keys,
                                                         guint skip,
                                                         guint count,
                                                         GrlMetadataResolutionFlags flags,
                                                         GrlMediaSourceResultCb callback,
                                                         gpointer user_data);

Execute a specialized query (specific for each provider) on a media repository.

It is different from grl_media_source_search() semantically, because the query implies a carefully crafted string, rather than a simple string to search.

This method is asynchronous.

source :

a media source

query :

the query to process

keys :

the GList of GrlKeyIDs to request. [element-type GObject.ParamSpec]

skip :

the number if elements to skip in the query operation

count :

the number of elements to retrieve in the query operation

flags :

the resolution mode

callback :

the user defined callback. [scope notified]

user_data :

the user data to pass in the callback

Returns :

the operation identifier

Since 0.1.1


grl_media_source_query_sync ()

GList *             grl_media_source_query_sync         (GrlMediaSource *source,
                                                         const gchar *query,
                                                         const GList *keys,
                                                         guint skip,
                                                         guint count,
                                                         GrlMetadataResolutionFlags flags,
                                                         GError **error);

Execute a specialized query (specific for each provider) on a media repository.

This method is synchronous.

source :

a media source

query :

the query to process

keys :

the GList of GrlKeyIDs to request. [element-type GObject.ParamSpec]

skip :

the number if elements to skip in the query operation

count :

the number of elements to retrieve in the query operation

flags :

the resolution mode

error :

a GError, or NULL

Returns :

a GList with GrlMedia elements. After use g_object_unref() every element and g_list_free() the list. [element-type Grl.Media][transfer full Grl.Media]

Since 0.1.6


grl_media_source_metadata ()

guint               grl_media_source_metadata           (GrlMediaSource *source,
                                                         GrlMedia *media,
                                                         const GList *keys,
                                                         GrlMetadataResolutionFlags flags,
                                                         GrlMediaSourceMetadataCb callback,
                                                         gpointer user_data);

This method is intended to fetch the requested keys of metadata of a given media to the media source.

This method is asynchronous.

source :

a media source

media :

a data transfer object. [allow-none]

keys :

the GList of GrlKeyIDs to request. [element-type GObject.ParamSpec]

flags :

the resolution mode

callback :

the user defined callback. [scope notified]

user_data :

the user data to pass in the callback

Returns :

the operation identifier

Since 0.1.6


grl_media_source_metadata_sync ()

GrlMedia *          grl_media_source_metadata_sync      (GrlMediaSource *source,
                                                         GrlMedia *media,
                                                         const GList *keys,
                                                         GrlMetadataResolutionFlags flags,
                                                         GError **error);

This method is intended to fetch the requested keys of metadata of a given media to the media source.

This method is synchronous.

source :

a media source

media :

a data transfer object. [allow-none]

keys :

the GList of GrlKeyIDs to request. [element-type GObject.ParamSpec]

flags :

the resolution mode

error :

a GError, or NULL

Returns :

a filled GrlMedia. [transfer full]

Since 0.1.6


grl_media_source_store ()

void                grl_media_source_store              (GrlMediaSource *source,
                                                         GrlMediaBox *parent,
                                                         GrlMedia *media,
                                                         GrlMediaSourceStoreCb callback,
                                                         gpointer user_data);

Store the media into the parent container

This method is asynchronous.

source :

a media source

parent :

a parent to store the data transfer objects. [allow-none]

media :

a data transfer object

callback :

the user defined callback. [scope notified]

user_data :

the user data to pass in the callback

Since 0.1.4


grl_media_source_store_sync ()

void                grl_media_source_store_sync         (GrlMediaSource *source,
                                                         GrlMediaBox *parent,
                                                         GrlMedia *media,
                                                         GError **error);

Store the media into the parent container.

This method is synchronous.

source :

a media source

parent :

a GrlMediaBox to store the data transfer objects. [allow-none]

media :

a GrlMedia data transfer object

error :

a GError, or NULL

Since 0.1.6


grl_media_source_remove ()

void                grl_media_source_remove             (GrlMediaSource *source,
                                                         GrlMedia *media,
                                                         GrlMediaSourceRemoveCb callback,
                                                         gpointer user_data);

Remove a media from the source repository.

This method is asynchronous.

source :

a media source

media :

a data transfer object

callback :

the user defined callback. [scope notified]

user_data :

the user data to pass in the callback

Since 0.1.4


grl_media_source_remove_sync ()

void                grl_media_source_remove_sync        (GrlMediaSource *source,
                                                         GrlMedia *media,
                                                         GError **error);

Remove a media from the source repository.

This method is synchronous.

source :

a media source

media :

a data transfer object

error :

a GError, or NULL

Since 0.1.6


grl_media_source_cancel ()

void                grl_media_source_cancel             (GrlMediaSource *source,
                                                         guint operation_id);

Cancel a running method.

The derived class must implement the cancel vmethod in order to honour the request correctly. Otherwise, the operation will not be interrupted.

In all cases, if this function is called on an ongoing operation, the corresponding callback will be called with the GRL_CORE_ERROR_OPERATION_CANCELLED error set, and no more action will be taken for that operation after the said callback with error has been called.

source :

a media source

operation_id :

the identifier of the running operation, as returned by the function that started it

Since 0.1.1


grl_media_source_set_operation_data ()

void                grl_media_source_set_operation_data (GrlMediaSource *source,
                                                         guint operation_id,
                                                         gpointer data);

Attach a pointer to the specific operation.

source :

a media source

operation_id :

the identifier of a running operation

data :

the data to attach

Since 0.1.1


grl_media_source_get_operation_data ()

gpointer            grl_media_source_get_operation_data (GrlMediaSource *source,
                                                         guint operation_id);

Obtains the previously attached data

source :

a media source

operation_id :

the identifier of a running operation

Returns :

The previously attached data. [transfer none]

Since 0.1.1


grl_media_source_set_auto_split_threshold ()

void                grl_media_source_set_auto_split_threshold
                                                        (GrlMediaSource *source,
                                                         guint threshold);

TBD

source :

a media source

threshold :

the threshold to request

Since 0.1.1


grl_media_source_get_auto_split_threshold ()

guint               grl_media_source_get_auto_split_threshold
                                                        (GrlMediaSource *source);

TBD

source :

a media source

Returns :

the assigned threshold

Since 0.1.1


grl_media_source_test_media_from_uri ()

gboolean            grl_media_source_test_media_from_uri
                                                        (GrlMediaSource *source,
                                                         const gchar *uri);

Tests whether source can instantiate a GrlMedia object representing the media resource exposed at uri.

source :

a media source

uri :

A URI that can be used to identify a media resource

Returns :

TRUE if it can, FALSE otherwise. This method is synchronous.

Since 0.1.7


grl_media_source_get_media_from_uri ()

void                grl_media_source_get_media_from_uri (GrlMediaSource *source,
                                                         const gchar *uri,
                                                         const GList *keys,
                                                         GrlMetadataResolutionFlags flags,
                                                         GrlMediaSourceMetadataCb callback,
                                                         gpointer user_data);

Creates an instance of GrlMedia representing the media resource exposed at uri.

It is recommended to call grl_media_source_test_media_from_uri() before invoking this to check whether the target source can theoretically do the resolution.

This method is asynchronous.

source :

a media source

uri :

A URI that can be used to identify a media resource

keys :

A list of keys to resolve

flags :

the resolution mode

callback :

the user defined callback. [scope notified]

user_data :

the user data to pass in the callback

Since 0.1.7

Property Details

The "auto-split-threshold" property

  "auto-split-threshold"     guint                 : Read / Write

Transparently split queries with count requests bigger than a certain threshold into smaller queries.

Default value: 0

Signal Details

The "content-changed" signal

void                user_function                      (GrlMediaSource          *source,
                                                        GrlMedia                *media,
                                                        GrlMediaSourceChangeType change_type,
                                                        gboolean                 location_unknown,
                                                        gpointer                 user_data)             : Run First / Action

Signals that the content in the source has changed. Usually media is a GrlBox, meaning that the content of that box has changed. if location_unknown is TRUE it means the source cannot establish where the change happened: could be either in the box, in any child, or in any other descendant of the box in the hierarchy.

For the cases where the source can only signal that a change happened, but not where, it would use the root box (NULL id) and set location_unknown as to TRUE.

source :

source that has changed

media :

the media that changed or one of its ancestors

change_type :

the kind of change that ocurred

location_unknown :

TRUE if the change happened in media itself or in one of its direct children (when media is a GrlMediaBox). FALSE otherwise

user_data :

user data set when the signal handler was connected.

Since 0.1.9

See Also

GrlMediaPlugin, GrlMetadataSource, GrlMedia