| Top | Description | Object Hierarchy |
#include <grilo.h>
GrlCaps;
GrlCapsClass;
enum GrlTypeFilter;
GrlCaps * grl_caps_new (void);
GList * grl_caps_get_key_filter (GrlCaps *caps);
GList * grl_caps_get_key_range_filter (GrlCaps *caps);
GrlTypeFilter grl_caps_get_type_filter (GrlCaps *caps);
gboolean grl_caps_is_key_filter (GrlCaps *caps,
GrlKeyID key);
gboolean grl_caps_is_key_range_filter (GrlCaps *caps,
GrlKeyID key);
void grl_caps_set_key_filter (GrlCaps *caps,
GList *keys);
void grl_caps_set_key_range_filter (GrlCaps *caps,
GList *keys);
void grl_caps_set_type_filter (GrlCaps *caps,
GrlTypeFilter filter);
gboolean grl_caps_test_option (GrlCaps *caps,
const gchar *key,
const GValue *value);
A GrlCaps instance is here to help you know if a given set of operation options is supported for a given operation.
Here is an example of how this would be used.
1 2 3 4 5 6 7 |
GrlCaps *caps = grl_metadata_source_get_caps (GRL_METADATA_SOURCE (my_source),
GRL_OP_SEARCH);
GrlOperationOptions *supported_options;
if (grl_operation_options_obey_caps (my_options, caps, &supported_options, NULL))
grl_media_source_search (my_source, "blah", interesting_keys, my_options, ...);
else // only use a subset of the options we wanted to pass
grl_media_source_search (my_source, "blah", interesting_keys, supported_options, ...); |
A GrlCaps can also be passed to grl_operation_options_new(). The created
GrlOperationOptions instance would then check any change against its caps.
typedef enum {
GRL_TYPE_FILTER_NONE = 0,
GRL_TYPE_FILTER_AUDIO = (1 << 0),
GRL_TYPE_FILTER_VIDEO = (1 << 1),
GRL_TYPE_FILTER_IMAGE = (1 << 2),
GRL_TYPE_FILTER_ALL = (GRL_TYPE_FILTER_AUDIO | GRL_TYPE_FILTER_VIDEO | GRL_TYPE_FILTER_IMAGE)
} GrlTypeFilter;
Type of media to allow.
allow no content (only GrlMediaBox) |
|
allow audio content |
|
allow video content |
|
allow image content |
|
allow any type of content |
GrlCaps * grl_caps_new (void);
Creates a new caps object.
Returns : |
a new caps object. |
Since 0.2.0
GList * grl_caps_get_key_filter (GrlCaps *caps);
|
a GrlCaps instance |
Returns : |
. [transfer none][element-type GrlKeyID] |
Since 0.2.0
GList * grl_caps_get_key_range_filter (GrlCaps *caps);
|
a GrlCaps instance |
Returns : |
. [transfer none][element-type GrlKeyID] |
Since 0.2.0
GrlTypeFilter grl_caps_get_type_filter (GrlCaps *caps);
|
a GrlCaps instance |
Returns : |
the supported GrlTypeFilter |
Since 0.2.0
gboolean grl_caps_is_key_filter (GrlCaps *caps,GrlKeyID key);
Checks if key
is supported for filtering in caps
.
Since 0.2.0
gboolean grl_caps_is_key_range_filter (GrlCaps *caps,GrlKeyID key);
Checks if key
is supported for filtering by range in caps
.
|
a grlCaps instance |
|
a GrlKeyID |
Returns : |
|
Since 0.2.0
void grl_caps_set_key_filter (GrlCaps *caps,GList *keys);
|
a GrlCaps instance |
|
. [transfer none][element-type GrlKeyID] |
Since 0.2.0
void grl_caps_set_key_range_filter (GrlCaps *caps,GList *keys);
|
a GrlCaps instance |
|
. [transfer none][element-type GrlKeyID] |
Since 0.2.0
void grl_caps_set_type_filter (GrlCaps *caps,GrlTypeFilter filter);
Sets the supported filter capability.
|
a GrlCaps instance |
|
Since 0.2.0
gboolean grl_caps_test_option (GrlCaps *caps,const gchar *key,const GValue *value);
Checks whether (key
, value
) are authorized by caps
.
|
a GrlCaps instance |
|
a key to test |
|
the value corresponding to |
Returns : |
|
Since 0.2.0