## GDataMediaContent

GDataMediaContent — Media RSS content element

## Stability Level

Stable, unless otherwise indicated

## Functions

const gchar * | gdata_media_content_get_uri ()
gsize | gdata_media_content_get_filesize ()
const gchar * | gdata_media_content_get_content_type ()
GDataMediaMedium | gdata_media_content_get_medium ()
gboolean | gdata_media_content_is_default ()
GDataMediaExpression | gdata_media_content_get_expression ()
gint64 | gdata_media_content_get_duration ()
guint | gdata_media_content_get_height ()
guint | gdata_media_content_get_width ()
GDataDownloadStream * | gdata_media_content_download ()

## Properties

char * | content-type | Read
gint64 | duration | Read
GDataMediaExpression | expression | Read
gulong | filesize | Read
guint | height | Read
gboolean | is-default | Read
GDataMediaMedium | medium | Read
char * | uri | Read
guint | width | Read

## Types and Values

| GDataMediaContent
| GDataMediaContentClass
enum | GDataMediaMedium
enum | GDataMediaExpression

## Object Hierarchy

        GEnum
        ├── GDataMediaExpression
        ╰── GDataMediaMedium
        GObject
        ╰── GDataParsable
            ╰── GDataMediaContent
                ╰── GDataYouTubeContent

## Includes

    #include <gdata/media/gdata-media-content.h>

## Description

GDataMediaContent represents a "content" element from the

Media RSS specification.

The class only implements parsing, not XML output, at the moment.

## Functions

### gdata_media_content_get_uri ()

    const gchar *
    gdata_media_content_get_uri (GDataMediaContent *self);

Gets the “uri” property.

#### Parameters

self | a GDataMediaContent |

#### Returns

the content's URI

Since: 0.4.0

### gdata_media_content_get_filesize ()

    gsize
    gdata_media_content_get_filesize (GDataMediaContent *self);

Gets the “filesize” property.

#### Parameters

self | a GDataMediaContent |

#### Returns

the number of bytes in the content, or `0`

Since: 0.4.0

### gdata_media_content_get_content_type ()

    const gchar *
    gdata_media_content_get_content_type (GDataMediaContent *self);

Gets the “content-type” property.

#### Parameters

self | a GDataMediaContent |

#### Returns

the content's content (MIME) type, or `NULL`

Since: 0.4.0

### gdata_media_content_get_medium ()

    GDataMediaMedium
    gdata_media_content_get_medium (GDataMediaContent *self);

Gets the “medium” property.

#### Parameters

self | a GDataMediaContent |

#### Returns

the type of the content, or `GDATA_MEDIA_UNKNOWN`

Since: 0.4.0

### gdata_media_content_is_default ()

    gboolean
    gdata_media_content_is_default (GDataMediaContent *self);

Gets the “is-default” property.

#### Parameters

self | a GDataMediaContent |

#### Returns

`TRUE` if the GDataMediaContent is the default content for the media group, `FALSE` otherwise

Since: 0.4.0

### gdata_media_content_get_expression ()

    GDataMediaExpression
    gdata_media_content_get_expression (GDataMediaContent *self);

Gets the “expression” property.

#### Parameters

self | a GDataMediaContent |

#### Returns

the content's expression, or `GDATA_MEDIA_EXPRESSION_FULL`

Since: 0.4.0

### gdata_media_content_get_duration ()

    gint64
    gdata_media_content_get_duration (GDataMediaContent *self);

Gets the “duration” property.

#### Parameters

self | a GDataMediaContent |

#### Returns

the content's duration in seconds, or `0`

Since: 0.4.0

### gdata_media_content_get_height ()

    guint
    gdata_media_content_get_height (GDataMediaContent *self);

Gets the “height” property.

#### Parameters

self | a GDataMediaContent |

#### Returns

the content's height in pixels, or `0`

Since: 0.4.0

### gdata_media_content_get_width ()

    guint
    gdata_media_content_get_width (GDataMediaContent *self);

Gets the “width” property.

#### Parameters

self | a GDataMediaContent |

#### Returns

the content's width in pixels, or `0`

Since: 0.4.0

### gdata_media_content_download ()

    GDataDownloadStream *
    gdata_media_content_download (GDataMediaContent *self,
                                  GDataService *service,
                                  GCancellable *cancellable,
                                  GError **error);

Downloads and returns a GDataDownloadStream allowing the content represented by `self` to be read.

To get the content type of the downloaded data, `gdata_download_stream_get_content_type()` can be called on the returned GDataDownloadStream. Calling `gdata_download_stream_get_content_length()` on the stream will not return a meaningful result, however, as the stream is encoded in chunks, rather than by content length.

In order to cancel the download, a GCancellable passed in to `cancellable` must be cancelled using `g_cancellable_cancel()`. Cancelling the individual GInputStream operations on the GDataDownloadStream will not cancel the entire download; merely the read or close operation in question. See the “cancellable” for more details.

#### Parameters

self | a GDataMediaContent |
service | the GDataService |
cancellable | a GCancellable for the entire download stream, or `NULL`. | [allow-none]
error | a GError, or `NULL` |

#### Returns

a GDataDownloadStream to download the content with, or `NULL`; unref with `g_object_unref()`.

[transfer full]

Since: 0.8.0

## Types and Values

### GDataMediaContent

    typedef struct _GDataMediaContent GDataMediaContent;

All the fields in the GDataMediaContent structure are private and should never be accessed directly.

### GDataMediaContentClass

    typedef struct {
    } GDataMediaContentClass;

All the fields in the GDataMediaContentClass structure are private and should never be accessed directly.

Since: 0.4.0

### enum GDataMediaMedium

An enum representing the possible values of “medium”.

#### Members

GDATA_MEDIA_UNKNOWN | the type of the media is unknown |
GDATA_MEDIA_IMAGE | the media is an image |
GDATA_MEDIA_AUDIO | the media is an audio stream |
GDATA_MEDIA_VIDEO | the media is a video |
GDATA_MEDIA_DOCUMENT | the media is another type of document |
GDATA_MEDIA_EXECUTABLE | the media is an executable file |

Since: 0.4.0

### enum GDataMediaExpression

An enum representing the possible values of “expression”.

#### Members

GDATA_MEDIA_EXPRESSION_SAMPLE | the media is a sample of a larger video |
GDATA_MEDIA_EXPRESSION_FULL | the media is the full version |
GDATA_MEDIA_EXPRESSION_NONSTOP | the media is a continuous stream |

## Property Details

### The `“content-type”` property

      “content-type”             char *

The standard MIME type of the object.

For more information, see the Media RSS specification.

Owner: GDataMediaContent

Flags: Read

Default value: NULL

Since: 0.4.0

### The `“duration”` property

      “duration”                 gint64

The number of seconds for which the media object plays.

For more information, see the Media RSS specification.

Owner: GDataMediaContent

Flags: Read

Allowed values: >= 0

Default value: 0

Since: 0.4.0

### The `“expression”` property

      “expression”               GDataMediaExpression

Determines if the object is a sample or the full version of the object, or even if it is a continuous stream.

For more information, see the Media RSS specification.

Owner: GDataMediaContent

Flags: Read

Default value: GDATA_MEDIA_EXPRESSION_FULL

Since: 0.4.0

### The `“filesize”` property

      “filesize”                 gulong

The number of bytes of the media object.

For more information, see the Media RSS specification.

Owner: GDataMediaContent

Flags: Read

Since: 0.4.0

### The `“height”` property

      “height”                   guint

The height of the media object.

For more information, see the Media RSS specification.

Owner: GDataMediaContent

Flags: Read

Default value: 0

Since: 0.4.0

### The `“is-default”` property

      “is-default”               gboolean

Determines if this is the default content for the media group. There should only be one default object per media group.

For more information, see the Media RSS specification.

Owner: GDataMediaContent

Flags: Read

Default value: FALSE

Since: 0.4.0

### The `“medium”` property

      “medium”                   GDataMediaMedium

The type of object, complementing “content-type”. It allows the consuming application to make simpler decisions between different content objects, based on whether they're a video or audio stream, for example.

For more information, see the Media RSS specification.

Owner: GDataMediaContent

Flags: Read

Default value: GDATA_MEDIA_UNKNOWN

Since: 0.4.0

### The `“uri”` property

      “uri”                      char *

The direct URI to the media object.

For more information, see the Media RSS specification.

Owner: GDataMediaContent

Flags: Read

Default value: NULL

Since: 0.4.0

### The `“width”` property

      “width”                    guint

The width of the media object.

For more information, see the Media RSS specification.

Owner: GDataMediaContent

Flags: Read

Default value: 0

Since: 0.4.0