| GUPnP A/V Reference Manual | ||||
|---|---|---|---|---|
GUPnPDIDLLiteWriterPrivate;
GUPnPDIDLLiteWriter;
#define GUPNP_DIDL_LITE_WRITER_NAMESPACE_DC
#define GUPNP_DIDL_LITE_WRITER_NAMESPACE_UPNP
GUPnPDIDLLiteWriter* gupnp_didl_lite_writer_new (void);
void gupnp_didl_lite_writer_start_didl_lite
(GUPnPDIDLLiteWriter *writer,
const char *lang,
SoupUri *url_base,
gboolean need_escape);
void gupnp_didl_lite_writer_end_didl_lite
(GUPnPDIDLLiteWriter *writer);
void gupnp_didl_lite_writer_start_container
(GUPnPDIDLLiteWriter *writer,
const char *id,
const char *parent_id,
gboolean restricted,
gboolean searchable);
void gupnp_didl_lite_writer_end_container
(GUPnPDIDLLiteWriter *writer);
void gupnp_didl_lite_writer_start_item (GUPnPDIDLLiteWriter *writer,
const char *id,
const char *parent_id,
const char *ref_id,
gboolean restricted);
void gupnp_didl_lite_writer_end_item (GUPnPDIDLLiteWriter *writer);
GUPnPDIDLLiteResource;
void gupnp_didl_lite_resource_reset (GUPnPDIDLLiteResource *res);
void gupnp_didl_lite_writer_add_res (GUPnPDIDLLiteWriter *writer,
GUPnPDIDLLiteResource *res);
void gupnp_didl_lite_writer_add_desc (GUPnPDIDLLiteWriter *writer,
const char *desc,
const char *id,
const char *name,
const char *ns_uri);
void gupnp_didl_lite_writer_add_string (GUPnPDIDLLiteWriter *writer,
const char *property,
const char *prefix,
const char *ns_uri,
const char *value);
void gupnp_didl_lite_writer_add_string_with_attrs
(GUPnPDIDLLiteWriter *writer,
const char *property,
const char *prefix,
const char *ns_uri,
const char *value,
...);
void gupnp_didl_lite_writer_add_string_with_attrs_valist
(GUPnPDIDLLiteWriter *writer,
const char *property,
const char *prefix,
const char *ns_uri,
const char *value,
va_list var_args);
void gupnp_didl_lite_writer_add_boolean (GUPnPDIDLLiteWriter *writer,
const char *property,
const char *prefix,
const char *ns_uri,
gboolean value);
void gupnp_didl_lite_writer_add_int (GUPnPDIDLLiteWriter *writer,
const char *property,
const char *prefix,
const char *ns_uri,
int value);
void gupnp_didl_lite_writer_add_uint (GUPnPDIDLLiteWriter *writer,
const char *property,
const char *prefix,
const char *ns_uri,
guint value);
void gupnp_didl_lite_writer_add_long (GUPnPDIDLLiteWriter *writer,
const char *property,
const char *prefix,
const char *ns_uri,
long value );
void gupnp_didl_lite_writer_add_ulong (GUPnPDIDLLiteWriter *writer,
const char *property,
const char *prefix,
const char *ns_uri,
gulong value);
const char* gupnp_didl_lite_writer_get_string (GUPnPDIDLLiteWriter *writer);
void gupnp_didl_lite_writer_reset (GUPnPDIDLLiteWriter *writer);
GUPnPDIDLLiteWriter* gupnp_didl_lite_writer_new (void);
| Returns : | A new GUPnPDIDLLiteWriter object. |
void gupnp_didl_lite_writer_start_didl_lite
(GUPnPDIDLLiteWriter *writer,
const char *lang,
SoupUri *url_base,
gboolean need_escape);
Starts the DIDL-Lite element.
writer : |
A GUPnPDIDLLiteWriter |
lang : |
The language the DIDL-Lite fragment is in, or NULL |
url_base : |
A SoupUri specifying the URI relative to which incoming URI are resolved, or NULL |
need_escape : |
TRUE to force writer to escape incoming string data
|
void gupnp_didl_lite_writer_end_didl_lite
(GUPnPDIDLLiteWriter *writer);
Closes the DIDL-Lite element.
writer : |
A GUPnPDIDLLiteWriter |
void gupnp_didl_lite_writer_start_container
(GUPnPDIDLLiteWriter *writer,
const char *id,
const char *parent_id,
gboolean restricted,
gboolean searchable);
Starts a new container element.
writer : |
A GUPnPDIDLLiteWriter |
id : |
The object ID |
parent_id : |
The parent object ID |
restricted : |
TRUE if this container is restricted |
searchable : |
TRUE if this container is searchable |
void gupnp_didl_lite_writer_end_container
(GUPnPDIDLLiteWriter *writer);
Closes the current container element.
writer : |
A GUPnPDIDLLiteWriter |
void gupnp_didl_lite_writer_start_item (GUPnPDIDLLiteWriter *writer, const char *id, const char *parent_id, const char *ref_id, gboolean restricted);
Starts a new item element.
writer : |
A GUPnPDIDLLiteWriter |
id : |
The object ID |
parent_id : |
The parent object ID |
ref_id : |
The RefID, or NULL |
restricted : |
TRUE if this item is restricted |
void gupnp_didl_lite_writer_end_item (GUPnPDIDLLiteWriter *writer);
Closes the current item element.
writer : |
A GUPnPDIDLLiteWriter |
typedef struct {
char *uri; /* Required */
char *import_uri;
char *protocol_info; /* Required */
/* Stream data */
long size;
long duration;
int bitrate;
int sample_freq;
int bits_per_sample;
char *protection;
/* Audio */
int n_audio_channels;
/* Video */
int width;
int height;
int color_depth;
} GUPnPDIDLLiteResource;
void gupnp_didl_lite_resource_reset (GUPnPDIDLLiteResource *res);
Resets all fields of res: strings to NULL and numbers to -1.
res : |
A GUPnPDIDLLiteResource |
void gupnp_didl_lite_writer_add_res (GUPnPDIDLLiteWriter *writer, GUPnPDIDLLiteResource *res);
Adds a new res (resource) element with the parameters specified in res.
Note that in order to ignore a numerical field it has to be set to -1.
writer : |
A GUPnPDIDLLiteWriter |
res : |
A pointer to a GUPnPDIDLLiteResource structure |
void gupnp_didl_lite_writer_add_desc (GUPnPDIDLLiteWriter *writer, const char *desc, const char *id, const char *name, const char *ns_uri);
Adds a new desc (description) element.
writer : |
A GUPnPDIDLLiteWriter |
desc : |
The description text |
id : |
The object ID |
name : |
|
ns_uri : |
The namespace of (possible) child elements, or NULL |
void gupnp_didl_lite_writer_add_string (GUPnPDIDLLiteWriter *writer, const char *property, const char *prefix, const char *ns_uri, const char *value);
Adds a new string property.
writer : |
A GUPnPDIDLLiteWriter |
property : |
The property name |
prefix : |
The property namespace prefix, or NULL |
ns_uri : |
The namespace URI to be used, or NULL |
value : |
The property value |
void gupnp_didl_lite_writer_add_string_with_attrs
(GUPnPDIDLLiteWriter *writer,
const char *property,
const char *prefix,
const char *ns_uri,
const char *value,
...);
Adds a new string property with attributes.
writer : |
A GUPnPDIDLLiteWriter |
property : |
The property name |
prefix : |
The property namespace prefix, or NULL |
ns_uri : |
The namespace URI to be used, or NULL |
value : |
The property value |
... : |
A NULL terminated list of attribute name-attribute value string pairs. |
void gupnp_didl_lite_writer_add_string_with_attrs_valist
(GUPnPDIDLLiteWriter *writer,
const char *property,
const char *prefix,
const char *ns_uri,
const char *value,
va_list var_args);
Adds a new string property with attributes.
writer : |
A GUPnPDIDLLiteWriter |
property : |
The property name |
prefix : |
The property namespace prefix, or NULL |
ns_uri : |
The namespace URI to be used, or NULL |
value : |
The property value |
var_args : |
A va_list with attribute name-attribute value string pairs |
void gupnp_didl_lite_writer_add_boolean (GUPnPDIDLLiteWriter *writer, const char *property, const char *prefix, const char *ns_uri, gboolean value);
Adds a new boolean property.
writer : |
A GUPnPDIDLLiteWriter |
property : |
The property name |
prefix : |
The property namespace prefix, or NULL |
ns_uri : |
The namespace URI to be used, or NULL |
value : |
The property value |
void gupnp_didl_lite_writer_add_int (GUPnPDIDLLiteWriter *writer, const char *property, const char *prefix, const char *ns_uri, int value);
Adds a new integer property.
writer : |
A GUPnPDIDLLiteWriter |
property : |
The property name |
prefix : |
The property namespace prefix, or NULL |
ns_uri : |
The namespace URI to be used, or NULL |
value : |
The property value |
void gupnp_didl_lite_writer_add_uint (GUPnPDIDLLiteWriter *writer, const char *property, const char *prefix, const char *ns_uri, guint value);
Adds a new unsigned integer property.
writer : |
A GUPnPDIDLLiteWriter |
property : |
The property name |
prefix : |
The property namespace prefix, or NULL |
ns_uri : |
The namespace URI to be used, or NULL |
value : |
The property value |
void gupnp_didl_lite_writer_add_long (GUPnPDIDLLiteWriter *writer, const char *property, const char *prefix, const char *ns_uri, long value );
Adds a new long integer property.
writer : |
A GUPnPDIDLLiteWriter |
property : |
The property name |
prefix : |
The property namespace prefix, or NULL |
ns_uri : |
The namespace URI to be used, or NULL |
Param5 : |
void gupnp_didl_lite_writer_add_ulong (GUPnPDIDLLiteWriter *writer, const char *property, const char *prefix, const char *ns_uri, gulong value);
Adds a new unsigned long integer property.
writer : |
A GUPnPDIDLLiteWriter |
property : |
The property name |
prefix : |
The property namespace prefix, or NULL |
ns_uri : |
The namespace URI to be used, or NULL |
value : |
The property value |
const char* gupnp_didl_lite_writer_get_string (GUPnPDIDLLiteWriter *writer);
Returns a pointer the generated DIDL-Lite string.
writer : |
A GUPnPDIDLLiteWriter |
| Returns : | The generated DIDL-Lite string. |
void gupnp_didl_lite_writer_reset (GUPnPDIDLLiteWriter *writer);
Resets writer.
writer : |
A GUPnPDIDLLiteWriter |