## GUPnPDIDLLiteResource GUPnPDIDLLiteResource — DIDL-Lite Resource |

## Functions

void | gupnp_didl_lite_resource_set_uri ()
void | gupnp_didl_lite_resource_set_import_uri ()
void | gupnp_didl_lite_resource_set_protocol_info ()
void | gupnp_didl_lite_resource_set_size ()
void | gupnp_didl_lite_resource_set_size64 ()
void | gupnp_didl_lite_resource_set_duration ()
void | gupnp_didl_lite_resource_set_bitrate ()
void | gupnp_didl_lite_resource_set_sample_freq ()
void | gupnp_didl_lite_resource_set_bits_per_sample ()
void | gupnp_didl_lite_resource_set_protection ()
void | gupnp_didl_lite_resource_set_audio_channels ()
void | gupnp_didl_lite_resource_set_width ()
void | gupnp_didl_lite_resource_set_height ()
void | gupnp_didl_lite_resource_set_color_depth ()
void | gupnp_didl_lite_resource_set_cleartext_size ()
const char * | gupnp_didl_lite_resource_get_uri ()
const char * | gupnp_didl_lite_resource_get_import_uri ()
GUPnPProtocolInfo * | gupnp_didl_lite_resource_get_protocol_info ()
long | gupnp_didl_lite_resource_get_size ()
gint64 | gupnp_didl_lite_resource_get_size64 ()
long | gupnp_didl_lite_resource_get_duration ()
int | gupnp_didl_lite_resource_get_bitrate ()
int | gupnp_didl_lite_resource_get_sample_freq ()
int | gupnp_didl_lite_resource_get_bits_per_sample ()
const char * | gupnp_didl_lite_resource_get_protection ()
int | gupnp_didl_lite_resource_get_audio_channels ()
int | gupnp_didl_lite_resource_get_width ()
int | gupnp_didl_lite_resource_get_height ()
int | gupnp_didl_lite_resource_get_color_depth ()
xmlNode * | gupnp_didl_lite_resource_get_xml_node ()
gint64 | gupnp_didl_lite_resource_get_cleartext_size ()
xmlNsPtr | gupnp_didl_lite_resource_get_dlna_namespace ()
xmlNsPtr | gupnp_didl_lite_resource_get_pv_namespace ()
guint | gupnp_didl_lite_resource_get_update_count ()
void | gupnp_didl_lite_resource_set_update_count ()
void | gupnp_didl_lite_resource_unset_update_count ()
gboolean | gupnp_didl_lite_resource_update_count_is_set ()
guint | gupnp_didl_lite_resource_get_track_total ()
void | gupnp_didl_lite_resource_set_track_total ()
gboolean | gupnp_didl_lite_resource_track_total_is_set ()
void | gupnp_didl_lite_resource_unset_track_total ()
const char * | gupnp_didl_lite_resource_get_subtitle_file_type ()
const char * | gupnp_didl_lite_resource_get_subtitle_file_uri ()
void | gupnp_didl_lite_resource_set_subtitle_file_type ()
void | gupnp_didl_lite_resource_set_subtitle_file_uri ()

## Types and Values

| GUPnPDIDLLiteResource

## Description

GUPnPDIDLLiteResource respresent a DIDL-Lite resource (res) element.

## Functions

### gupnp_didl_lite_resource_set_uri ()

    void
    gupnp_didl_lite_resource_set_uri (GUPnPDIDLLiteResource *resource,
                                      const char *uri);

Set the URI associated with the `resource` .

#### Parameters

resource | A GUPnPDIDLLiteResource |
uri | The URI as string |

### gupnp_didl_lite_resource_set_import_uri ()

    void
    gupnp_didl_lite_resource_set_import_uri
                                   (GUPnPDIDLLiteResource *resource,
                                    const char *import_uri);

Set the import URI associated with the `resource` .

#### Parameters

resource | A GUPnPDIDLLiteResource |
import_uri | The URI as string |

### gupnp_didl_lite_resource_set_protocol_info ()

    void
    gupnp_didl_lite_resource_set_protocol_info
                                   (GUPnPDIDLLiteResource *resource,
                                    GUPnPProtocolInfo *info);

Set the protocol info associated with the `resource` .

#### Parameters

resource | A GUPnPDIDLLiteResource |
info | The protocol string |

### gupnp_didl_lite_resource_set_size ()

    void
    gupnp_didl_lite_resource_set_size (GUPnPDIDLLiteResource *resource,
                                       glong size);

Set the size (in bytes) of the `resource` . Passing a negative number will unset this property.

#### Parameters

resource | A GUPnPDIDLLiteResource |
size | The size (in bytes) |

### gupnp_didl_lite_resource_set_size64 ()

    void
    gupnp_didl_lite_resource_set_size64 (GUPnPDIDLLiteResource *resource,
                                         gint64 size);

Set the size (in bytes) of the `resource` . Passing a negative number will unset this property.

#### Parameters

resource | A GUPnPDIDLLiteResource |
size | The size (in bytes) |

### gupnp_didl_lite_resource_set_duration ()

    void
    gupnp_didl_lite_resource_set_duration (GUPnPDIDLLiteResource *resource,
                                           glong duration);

Set the duration (in seconds) of the `resource` . Passing a negative number will unset this property.

#### Parameters

resource | A GUPnPDIDLLiteResource |
duration | The duration (in seconds) |

### gupnp_didl_lite_resource_set_bitrate ()

    void
    gupnp_didl_lite_resource_set_bitrate (GUPnPDIDLLiteResource *resource,
                                          int bitrate);

Set the bitrate (in bytes per second) of the `resource` . Passing a negative number will unset this property.

#### Parameters

resource | A GUPnPDIDLLiteResource |
bitrate | The bitrate |

### gupnp_didl_lite_resource_set_sample_freq ()

    void
    gupnp_didl_lite_resource_set_sample_freq
                                   (GUPnPDIDLLiteResource *resource,
                                    int sample_freq);

Set the sample frequency of the `resource` . Passing a negative number will unset this property.

#### Parameters

resource | A GUPnPDIDLLiteResource |
sample_freq | The sample frequency |

### gupnp_didl_lite_resource_set_bits_per_sample ()

    void
    gupnp_didl_lite_resource_set_bits_per_sample
                                   (GUPnPDIDLLiteResource *resource,
                                    int sample_size);

Set the sample size of the `resource` . Passing a negative number will unset this property.

#### Parameters

resource | A GUPnPDIDLLiteResource |
sample_size | The number of bits per sample |

### gupnp_didl_lite_resource_set_protection ()

    void
    gupnp_didl_lite_resource_set_protection
                                   (GUPnPDIDLLiteResource *resource,
                                    const char *protection);

Set the protection system used by the `resource` . Passing a negative number will unset this property.

#### Parameters

resource | A GUPnPDIDLLiteResource |
protection | The protection system identifier as string |

### gupnp_didl_lite_resource_set_audio_channels ()

    void
    gupnp_didl_lite_resource_set_audio_channels
                                   (GUPnPDIDLLiteResource *resource,
                                    int n_channels);

Set the number of audio channels in the `resource` . Passing a negative number will unset this property.

#### Parameters

resource | A GUPnPDIDLLiteResource |
n_channels | The number of channels |

### gupnp_didl_lite_resource_set_width ()

    void
    gupnp_didl_lite_resource_set_width (GUPnPDIDLLiteResource *resource,
                                        int width);

Set the width of this image/video resource. Setting both width and height to a negative number will unset the resolution property.

#### Parameters

resource | A GUPnPDIDLLiteResource |
width | The width |

### gupnp_didl_lite_resource_set_height ()

    void
    gupnp_didl_lite_resource_set_height (GUPnPDIDLLiteResource *resource,
                                         int height);

Set the height of this image/video resource. Setting both width and height to a negative number will unset the resolution property.

#### Parameters

resource | A GUPnPDIDLLiteResource |
height | The height |

### gupnp_didl_lite_resource_set_color_depth ()

    void
    gupnp_didl_lite_resource_set_color_depth
                                   (GUPnPDIDLLiteResource *resource,
                                    int color_depth);

Set the color-depth of this image/video resource. Passing a negative number will unset this property.

#### Parameters

resource | A GUPnPDIDLLiteResource |
color_depth | The color-depth |

### gupnp_didl_lite_resource_set_cleartext_size ()

    void
    gupnp_didl_lite_resource_set_cleartext_size
                                   (GUPnPDIDLLiteResource *resource,
                                    gint64 cleartext_size);

Set the size (in bytes) of the `resource` . Passing a negative number will unset this property.

#### Parameters

resource | A GUPnPDIDLLiteResource |
cleartext_size | The size (in bytes) |

### gupnp_didl_lite_resource_get_uri ()

    const char *
    gupnp_didl_lite_resource_get_uri (GUPnPDIDLLiteResource *resource);

Get the URI associated with the `resource` .

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The of URI the `resource` or `NULL`.

### gupnp_didl_lite_resource_get_import_uri ()

    const char *
    gupnp_didl_lite_resource_get_import_uri
                                   (GUPnPDIDLLiteResource *resource);

Get the import URI associated with the `resource` .

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The import URI or `NULL`.

### gupnp_didl_lite_resource_get_protocol_info ()

    GUPnPProtocolInfo *
    gupnp_didl_lite_resource_get_protocol_info
                                   (GUPnPDIDLLiteResource *resource);

Get the protocol info associated with the `resource` .

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The protocol info associated with the `resource` or `NULL`. The returned object must not be unrefed.

[transfer none]

### gupnp_didl_lite_resource_get_size ()

    long
    gupnp_didl_lite_resource_get_size (GUPnPDIDLLiteResource *resource);

Get the size (in bytes) of the `resource` .

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The size (in bytes) of the `resource` or -1.

### gupnp_didl_lite_resource_get_size64 ()

    gint64
    gupnp_didl_lite_resource_get_size64 (GUPnPDIDLLiteResource *resource);

Get the size (in bytes) of the `resource` .

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The size (in bytes) of the `resource` or -1.

### gupnp_didl_lite_resource_get_duration ()

    long
    gupnp_didl_lite_resource_get_duration (GUPnPDIDLLiteResource *resource);

Get the duration (in seconds) of the `resource` .

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The duration (in seconds) of the `resource` or -1.

### gupnp_didl_lite_resource_get_bitrate ()

    int
    gupnp_didl_lite_resource_get_bitrate (GUPnPDIDLLiteResource *resource);

Get the bitrate (in bytes per second) of the `resource` .

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The bitrate (in bytes per second) of the `resource` or -1.

### gupnp_didl_lite_resource_get_sample_freq ()

    int
    gupnp_didl_lite_resource_get_sample_freq
                                   (GUPnPDIDLLiteResource *resource);

Get the sample frequency of the `resource` .

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The sample frequency of the `resource` or -1.

### gupnp_didl_lite_resource_get_bits_per_sample ()

    int
    gupnp_didl_lite_resource_get_bits_per_sample
                                   (GUPnPDIDLLiteResource *resource);

Get the sample size of the `resource` .

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The number of bits per sample of the `resource` or -1.

### gupnp_didl_lite_resource_get_protection ()

    const char *
    gupnp_didl_lite_resource_get_protection
                                   (GUPnPDIDLLiteResource *resource);

Get the protection system used by the `resource` .

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The protection system in use by the `resource` or `NULL`.

### gupnp_didl_lite_resource_get_audio_channels ()

    int
    gupnp_didl_lite_resource_get_audio_channels
                                   (GUPnPDIDLLiteResource *resource);

Get the number of audio channels in the `resource` .

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The number of audio channels in the `resource` or -1.

### gupnp_didl_lite_resource_get_width ()

    int
    gupnp_didl_lite_resource_get_width (GUPnPDIDLLiteResource *resource);

Get the width of this image/video resource.

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The width of this image/video resource or -1.

### gupnp_didl_lite_resource_get_height ()

    int
    gupnp_didl_lite_resource_get_height (GUPnPDIDLLiteResource *resource);

Get the height of this image/video resource.

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The height of the `resource` or -1.

### gupnp_didl_lite_resource_get_color_depth ()

    int
    gupnp_didl_lite_resource_get_color_depth
                                   (GUPnPDIDLLiteResource *resource);

Get the color-depth of this image/video resource.

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The color depth of the `resource` or -1.

### gupnp_didl_lite_resource_get_xml_node ()

    xmlNode *
    gupnp_didl_lite_resource_get_xml_node (GUPnPDIDLLiteResource *resource);

Get the pointer to res node in XML document.

#### Parameters

resource | The GUPnPDIDLLiteResource |

#### Returns

The pointer to res node in XML document.

[transfer none]

### gupnp_didl_lite_resource_get_cleartext_size ()

    gint64
    gupnp_didl_lite_resource_get_cleartext_size
                                   (GUPnPDIDLLiteResource *resource);

Get the size (in bytes) of the `resource` .

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The size (in bytes) of the `resource` or -1.

### gupnp_didl_lite_resource_get_dlna_namespace ()

    xmlNsPtr
    gupnp_didl_lite_resource_get_dlna_namespace
                                   (GUPnPDIDLLiteResource *resource);

Get the pointer to the DLNA metadata namespace registered with the XML document containing this object.

#### Parameters

resource | The GUPnPDIDLLiteObject |

#### Returns

The pointer to DLNA namespace in XML document.

[transfer none]

### gupnp_didl_lite_resource_get_pv_namespace ()

    xmlNsPtr
    gupnp_didl_lite_resource_get_pv_namespace
                                   (GUPnPDIDLLiteResource *resource);

Get the pointer to the DLNA metadata namespace registered with the XML document containing this object.

#### Parameters

resource | The GUPnPDIDLLiteObject |

#### Returns

The pointer to DLNA namespace in XML document.

[transfer none]

### gupnp_didl_lite_resource_get_update_count ()

    guint
    gupnp_didl_lite_resource_get_update_count
                                   (GUPnPDIDLLiteResource *resource);

Get the update count of this resource.

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The update count of the `resource` .

### gupnp_didl_lite_resource_set_update_count ()

    void
    gupnp_didl_lite_resource_set_update_count
                                   (GUPnPDIDLLiteResource *resource,
                                    guint update_count);

Set the update count of this resource.

#### Parameters

resource | A GUPnPDIDLLiteResource |
update_count | The update_count |

### gupnp_didl_lite_resource_unset_update_count ()

    void
    gupnp_didl_lite_resource_unset_update_count
                                   (GUPnPDIDLLiteResource *resource);

Unset the update count of this resource.

#### Parameters

resource | A GUPnPDIDLLiteResource |

### gupnp_didl_lite_resource_update_count_is_set ()

    gboolean
    gupnp_didl_lite_resource_update_count_is_set
                                   (GUPnPDIDLLiteResource *resource);

Check whether the update count property of this resource is set.

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

`TRUE` if set, otherwise `FALSE`.

### gupnp_didl_lite_resource_get_track_total ()

    guint
    gupnp_didl_lite_resource_get_track_total
                                   (GUPnPDIDLLiteResource *resource);

Get the total track count of this resource.

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The total track count of the `resource` .

### gupnp_didl_lite_resource_set_track_total ()

    void
    gupnp_didl_lite_resource_set_track_total
                                   (GUPnPDIDLLiteResource *resource,
                                    guint track_total);

Set the total number of tracks in this resource.

#### Parameters

resource | A GUPnPDIDLLiteResource |
track_total | The total number of tracks in this resource |

### gupnp_didl_lite_resource_track_total_is_set ()

    gboolean
    gupnp_didl_lite_resource_track_total_is_set
                                   (GUPnPDIDLLiteResource *resource);

Check whether the total track count property of this resource is set.

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

`TRUE` if set, otherwise `FALSE`.

### gupnp_didl_lite_resource_unset_track_total ()

    void
    gupnp_didl_lite_resource_unset_track_total
                                   (GUPnPDIDLLiteResource *resource);

Unset the total track count of this resource.

#### Parameters

resource | A GUPnPDIDLLiteResource |

### gupnp_didl_lite_resource_get_subtitle_file_type ()

    const char *
    gupnp_didl_lite_resource_get_subtitle_file_type
                                   (GUPnPDIDLLiteResource *resource);

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The content of the subtitleFileType property or `NULL`

Since: 0.12.4

### gupnp_didl_lite_resource_get_subtitle_file_uri ()

    const char *
    gupnp_didl_lite_resource_get_subtitle_file_uri
                                   (GUPnPDIDLLiteResource *resource);

#### Parameters

resource | A GUPnPDIDLLiteResource |

#### Returns

The content of the subtitleFileUri property or `NULL` when not set.

Since: 0.12.4

### gupnp_didl_lite_resource_set_subtitle_file_type ()

    void
    gupnp_didl_lite_resource_set_subtitle_file_type
                                   (GUPnPDIDLLiteResource *resource,
                                    const char *type);

Set the type of an external subtitle file, specified via pv:subtitleFileUri using `gupnp_didl_lite_resource_set_subtitle_file_uri()`.

When `type` is `NULL` the value is removed.

#### Parameters

resource | A GUPnPDIDLLiteResource |
type | An URI to an external subtitle file. | [allow-none]

Since: 0.12.4

### gupnp_didl_lite_resource_set_subtitle_file_uri ()

    void
    gupnp_didl_lite_resource_set_subtitle_file_uri
                                   (GUPnPDIDLLiteResource *resource,
                                    const char *uri);

Set the URI of an external subtitle file to be used with this resource. When `uri` is `NULL` the value is removed.

#### Parameters

resource | A GUPnPDIDLLiteResource |
uri | An URI to an external subtitle file or `NULL` to remove. | [allow-none]

Since: 0.12.4

## Types and Values

### GUPnPDIDLLiteResource

    typedef struct {
            GObject parent;

            GUPnPDIDLLiteResourcePrivate *priv;
    } GUPnPDIDLLiteResource;