GDataMediaContent

GDataMediaContent — Media RSS content element

Stability Level

Unstable, unless otherwise indicated

Synopsis

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

                    GDataMediaContent;
                    GDataMediaContentClass;
enum                GDataMediaMedium;
enum                GDataMediaExpression;
const gchar *       gdata_media_content_get_uri         (GDataMediaContent *self);
gsize               gdata_media_content_get_filesize    (GDataMediaContent *self);
const gchar *       gdata_media_content_get_content_type
                                                        (GDataMediaContent *self);
GDataMediaMedium    gdata_media_content_get_medium      (GDataMediaContent *self);
gboolean            gdata_media_content_is_default      (GDataMediaContent *self);
GDataMediaExpression  gdata_media_content_get_expression
                                                        (GDataMediaContent *self);
gint64              gdata_media_content_get_duration    (GDataMediaContent *self);
guint               gdata_media_content_get_height      (GDataMediaContent *self);
guint               gdata_media_content_get_width       (GDataMediaContent *self);
GFile *             gdata_media_content_download        (GDataMediaContent *self,
                                                         GDataService *service,
                                                         const gchar *default_filename,
                                                         GFile *target_dest_file,
                                                         gboolean replace_file_if_exists,
                                                         GCancellable *cancellable,
                                                         GError **error);

Object Hierarchy

  GObject
   +----GDataParsable
         +----GDataMediaContent
               +----GDataYouTubeContent

Properties

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

Description

GDataMediaContent represents a "content" element from the Media RSS specification.

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

Details

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

typedef enum {
	GDATA_MEDIA_UNKNOWN,
	GDATA_MEDIA_IMAGE,
	GDATA_MEDIA_AUDIO,
	GDATA_MEDIA_VIDEO,
	GDATA_MEDIA_DOCUMENT,
	GDATA_MEDIA_EXECUTABLE
} GDataMediaMedium;

An enum representing the possible values of "medium".

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

typedef enum {
	GDATA_MEDIA_EXPRESSION_SAMPLE,
	GDATA_MEDIA_EXPRESSION_FULL,
	GDATA_MEDIA_EXPRESSION_NONSTOP
} GDataMediaExpression;

An enum representing the possible values of "expression".

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

gdata_media_content_get_uri ()

const gchar *       gdata_media_content_get_uri         (GDataMediaContent *self);

Gets the "uri" property.

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.

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.

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.

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.

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.

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.

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.

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.

self :

a GDataMediaContent

Returns :

the content's width in pixels, or 0

Since 0.4.0


gdata_media_content_download ()

GFile *             gdata_media_content_download        (GDataMediaContent *self,
                                                         GDataService *service,
                                                         const gchar *default_filename,
                                                         GFile *target_dest_file,
                                                         gboolean replace_file_if_exists,
                                                         GCancellable *cancellable,
                                                         GError **error);

Downloads and returns a GFile of the content represented by self.

If target_dest_file is a directory, then the file will be downloaded into this directory with the default filename specified in default_filename.

self :

a GDataMediaContent

service :

the GDataService

default_filename :

an optional default filename used if the user selects a directory as the destination

target_dest_file :

the destination file or directory to download to

replace_file_if_exists :

whether to replace already existing files at the download location

cancellable :

optional GCancellable object, or NULL

error :

a GError, or NULL

Returns :

the content's data, or NULL; unref with g_object_unref()

Since 0.6.0

Property Details

The "content-type" property

  "content-type"             gchar*                : Read

The standard MIME type of the object.

For more information, see the Media RSS specification.

Default value: NULL

Since 0.4.0


The "duration" property

  "duration"                 gint64                : Read

The number of seconds for which the media object plays.

For more information, see the Media RSS specification.

Allowed values: >= 0

Default value: 0

Since 0.4.0


The "expression" property

  "expression"               GDataMediaExpression  : Read

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.

Default value: GDATA_MEDIA_EXPRESSION_FULL

Since 0.4.0


The "filesize" property

  "filesize"                 gulong                : Read

The number of bytes of the media object.

For more information, see the Media RSS specification.

Since 0.4.0


The "height" property

  "height"                   guint                 : Read

The height of the media object.

For more information, see the Media RSS specification.

Default value: 0

Since 0.4.0


The "is-default" property

  "is-default"               gboolean              : Read

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

For more information, see the Media RSS specification.

Default value: FALSE

Since 0.4.0


The "medium" property

  "medium"                   GDataMediaMedium      : Read

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.

Default value: GDATA_MEDIA_UNKNOWN

Since 0.4.0


The "uri" property

  "uri"                      gchar*                : Read

The direct URI to the media object.

For more information, see the Media RSS specification.

Default value: NULL

Since 0.4.0


The "width" property

  "width"                    guint                 : Read

The width of the media object.

For more information, see the Media RSS specification.

Default value: 0

Since 0.4.0