## RygelMediaFileItem

RygelMediaFileItem — Represents a file-accessible or http-accessible media item (music file, image file, video file, etc) with some pre-established metadata or a content placeholder for uploaded content.

## Functions

RygelMediaResource * | rygel_media_file_item_get_primary_resource ()
gchar * | rygel_media_file_item_get_extension ()
gchar * | rygel_media_file_item_ext_from_mime_type ()
void | rygel_media_file_item_add_engine_resources ()
void | rygel_media_file_item_add_engine_resources_finish ()
const gchar * | rygel_media_file_item_get_mime_type ()
void | rygel_media_file_item_set_mime_type ()
const gchar * | rygel_media_file_item_get_dlna_profile ()
void | rygel_media_file_item_set_dlna_profile ()
gint64 | rygel_media_file_item_get_size ()
void | rygel_media_file_item_set_size ()
gboolean | rygel_media_file_item_get_place_holder ()
void | rygel_media_file_item_set_place_holder ()

## Properties

gchar * | dlna-profile | Read / Write
gchar * | mime-type | Read / Write
GUPnPOCMFlags | ocm-flags | Read
gboolean | place-holder | Read / Write
gint64 | size | Read / Write

## Types and Values

#define | RYGEL_TYPE_MEDIA_FILE_ITEM
struct | RygelMediaFileItem
struct | RygelMediaFileItemClass

## Object Hierarchy

        GObject
        ╰── RygelMediaObject
            ╰── RygelMediaItem
                ╰── RygelMediaFileItem
                    ├── RygelAudioItem
                    ├── RygelImageItem
                    ╰── RygelPlaylistItem

## Known Derived Interfaces

RygelMediaFileItem is required by RygelVisualItem.

## Description

Items representing non-file-accessible content should create their own MediaItem subclass.

## Functions

### rygel_media_file_item_get_primary_resource ()

    RygelMediaResource *
    rygel_media_file_item_get_primary_resource
                                   (RygelMediaFileItem *self);

Subclasses override this method to create the type-specific primary MediaResource.

The resource returned is presumed to represent the "internal" file resource and a uri referring to the source file. Transport-specific variants can be created by the caller.

#### Parameters

self | the RygelMediaFileItem instance |

#### Returns

a RygelMediaResource for the on-disk file represented by this instance.

### rygel_media_file_item_get_extension ()

    gchar *
    rygel_media_file_item_get_extension (RygelMediaFileItem *self);

Return the file/uri extension that best represents the item's primary resource.

#### Parameters

self | the RygelMediaFileItem instance |

### rygel_media_file_item_ext_from_mime_type ()

    gchar *
    rygel_media_file_item_ext_from_mime_type
                                   (RygelMediaFileItem *self,
                                    const gchar *mime_type);

#### Parameters

self | the RygelMediaFileItem instance |
mime_type |  |

### rygel_media_file_item_add_engine_resources ()

    void
    rygel_media_file_item_add_engine_resources
                                   (RygelMediaFileItem *self,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);

Request the media engine for the resources it can provide for this item. Typically these are the transcoded resources.

See also: `rygel_media_file_item_add_engine_resources_finish()`

#### Parameters

self | the RygelMediaFileItem instance |
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

### rygel_media_file_item_add_engine_resources_finish ()

    void
    rygel_media_file_item_add_engine_resources_finish
                                   (RygelMediaFileItem *self,
                                    GAsyncResult *_res_);

Request the media engine for the resources it can provide for this item. Typically these are the transcoded resources.

See also: `rygel_media_file_item_add_engine_resources()`

#### Parameters

self | the RygelMediaFileItem instance |
_res_ | a GAsyncResult |

### rygel_media_file_item_get_mime_type ()

    const gchar *
    rygel_media_file_item_get_mime_type (RygelMediaFileItem *self);

Get and return the current value of the "mime-type" property.

The mime type of the source content (this.uri). A null/empty value means that the mime-type is unknown

#### Parameters

self | the RygelMediaFileItem instance to query |

#### Returns

the value of the "mime-type" property

### rygel_media_file_item_set_mime_type ()

    void
    rygel_media_file_item_set_mime_type (RygelMediaFileItem *self,
                                         const gchar *value);

Set the value of the "mime-type" property to `value` .

The mime type of the source content (this.uri). A null/empty value means that the mime-type is unknown

#### Parameters

self | the RygelMediaFileItem instance to modify |
value | the new value of the "mime-type" property |

### rygel_media_file_item_get_dlna_profile ()

    const gchar *
    rygel_media_file_item_get_dlna_profile
                                   (RygelMediaFileItem *self);

Get and return the current value of the "dlna-profile" property.

The DLNA profile of the source content (this.uri). A null/empty value means that the DLNA profile is unknown

#### Parameters

self | the RygelMediaFileItem instance to query |

#### Returns

the value of the "dlna-profile" property

### rygel_media_file_item_set_dlna_profile ()

    void
    rygel_media_file_item_set_dlna_profile
                                   (RygelMediaFileItem *self,
                                    const gchar *value);

Set the value of the "dlna-profile" property to `value` .

The DLNA profile of the source content (this.uri). A null/empty value means that the DLNA profile is unknown

#### Parameters

self | the RygelMediaFileItem instance to modify |
value | the new value of the "dlna-profile" property |

### rygel_media_file_item_get_size ()

    gint64
    rygel_media_file_item_get_size (RygelMediaFileItem *self);

Get and return the current value of the "size" property.

#### Parameters

self | the RygelMediaFileItem instance to query |

#### Returns

the value of the "size" property

### rygel_media_file_item_set_size ()

    void
    rygel_media_file_item_set_size (RygelMediaFileItem *self,
                                    gint64 value);

Set the value of the "size" property to `value` .

#### Parameters

self | the RygelMediaFileItem instance to modify |
value | the new value of the "size" property |

### rygel_media_file_item_get_place_holder ()

    gboolean
    rygel_media_file_item_get_place_holder
                                   (RygelMediaFileItem *self);

Get and return the current value of the "place-holder" property.

#### Parameters

self | the RygelMediaFileItem instance to query |

#### Returns

the value of the "place-holder" property

### rygel_media_file_item_set_place_holder ()

    void
    rygel_media_file_item_set_place_holder
                                   (RygelMediaFileItem *self,
                                    gboolean value);

Set the value of the "place-holder" property to `value` .

#### Parameters

self | the RygelMediaFileItem instance to modify |
value | the new value of the "place-holder" property |

## Types and Values

### RYGEL_TYPE_MEDIA_FILE_ITEM

    #define RYGEL_TYPE_MEDIA_FILE_ITEM (rygel_media_file_item_get_type ())

The type for RygelMediaFileItem.

### struct RygelMediaFileItem

    struct RygelMediaFileItem;

Represents a file-accessible or http-accessible media item (music file, image file, video file, etc) with some pre-established metadata or a content placeholder for uploaded content.

Items representing non-file-accessible content should create their own MediaItem subclass.

### struct RygelMediaFileItemClass

    struct RygelMediaFileItemClass {
    	RygelMediaItemClass parent_class;
    	RygelMediaResource* (*get_primary_resource) (RygelMediaFileItem* self);
    	gchar* (*get_extension) (RygelMediaFileItem* self);
    	void (*add_engine_resources) (RygelMediaFileItem* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
    	void (*add_engine_resources_finish) (RygelMediaFileItem* self, GAsyncResult* _res_);
    	void (*add_additional_resources) (RygelMediaFileItem* self, RygelHTTPServer* server);
    };

The class structure for `RYGEL_TYPE_MEDIA_FILE_ITEM`. All the fields in this structure are private and should never be accessed directly.

#### Members

`get_primary_resource` () | virtual method called by `rygel_media_file_item_get_primary_resource()` |
`get_extension` () | virtual method called by `rygel_media_file_item_get_extension()` |
`add_engine_resources` () | virtual method called by `rygel_media_file_item_add_engine_resources()` |
`add_engine_resources_finish` () | asynchronous finish function for `add_engine_resources`, called by `rygel_media_file_item_add_engine_resources()` |
`add_additional_resources` () |  |

## Property Details

### The `“dlna-profile”` property

      “dlna-profile”             gchar *

The DLNA profile of the source content (this.uri). A null/empty value means that the DLNA profile is unknown

Flags: Read / Write

Default value: NULL

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

      “mime-type”                gchar *

The mime type of the source content (this.uri). A null/empty value means that the mime-type is unknown

Flags: Read / Write

Default value: NULL

### The `“ocm-flags”` property

      “ocm-flags”                GUPnPOCMFlags

ocm-flags.

Flags: Read

### The `“place-holder”` property

      “place-holder”             gboolean

place-holder.

Flags: Read / Write

Default value: FALSE

### The `“size”` property

      “size”                     gint64

size.

Flags: Read / Write

Default value: 0