GUPnPDLNAProfileGuesser

## GUPnPDLNAProfileGuesser GUPnPDLNAProfileGuesser — Utility API for discovering DLNA profile for given media. |

## Synopsis

                        GUPnPDLNAProfileGuesser;
                        GUPnPDLNAProfileGuesserClass;
    GUPnPDLNAProfileGuesser * gupnp_dlna_profile_guesser_new
                                                            (gboolean relaxed_mode,
                                                             gboolean extended_mode);
    gboolean            gupnp_dlna_profile_guesser_guess_profile_async
                                                            (GUPnPDLNAProfileGuesser *guesser,
                                                             const gchar *uri,
                                                             guint timeout_in_ms,
                                                             GError **error);
    GUPnPDLNAProfile *  gupnp_dlna_profile_guesser_guess_profile_sync
                                                            (GUPnPDLNAProfileGuesser *guesser,
                                                             const gchar *uri,
                                                             guint timeout_in_ms,
                                                             GUPnPDLNAInformation **dlna_info,
                                                             GError **error);
    GUPnPDLNAProfile *  gupnp_dlna_profile_guesser_guess_profile_from_info
                                                            (GUPnPDLNAProfileGuesser *guesser,
                                                             GUPnPDLNAInformation *info);
    GUPnPDLNAProfile *  gupnp_dlna_profile_guesser_get_profile
                                                            (GUPnPDLNAProfileGuesser *guesser,
                                                             const gchar *name);
    GList *             gupnp_dlna_profile_guesser_list_profiles
                                                            (GUPnPDLNAProfileGuesser *guesser);
    gboolean            gupnp_dlna_profile_guesser_get_relaxed_mode
                                                            (GUPnPDLNAProfileGuesser *guesser);
    gboolean            gupnp_dlna_profile_guesser_get_extended_mode
                                                            (GUPnPDLNAProfileGuesser *guesser);
    void                gupnp_dlna_profile_guesser_cleanup  (void);

## Object Hierarchy

      GObject
       +----GUPnPDLNAProfileGuesser

## Properties

      "extended-mode"            gboolean              : Read / Write / Construct Only
      "relaxed-mode"             gboolean              : Read / Write / Construct Only

## Signals

      "done"                                           : Run Last

## Description

The API provides synchronous and asynchronous guessing of DLNA profile. The asynchronous mode requires a running GMainLoop in the default GMainContext.

## Details

### GUPnPDLNAProfileGuesser

    typedef struct _GUPnPDLNAProfileGuesser GUPnPDLNAProfileGuesser;

The top-level object used to for DLNA profile guessing.

### GUPnPDLNAProfileGuesserClass

    typedef struct {
            GObjectClass parent_class;
    } GUPnPDLNAProfileGuesserClass;

GObjectClass `parent_class`; | A GObjectClass - parent of this class.

### gupnp_dlna_profile_guesser_new ()

    GUPnPDLNAProfileGuesser * gupnp_dlna_profile_guesser_new
                                                            (gboolean relaxed_mode,
                                                             gboolean extended_mode);

Creates a new guesser that will use specific DLNA profiles for matching - i.e. which profiles will be used depends on `relaxed_mode` and `extended_mode`.

`relaxed_mode` : | `TRUE` to enable relaxed mode support. `FALSE` otherwise.
`extended_mode` : | `TRUE` to enable extended mode support. `FALSE` otherwise.
Returns : | A new GUPnPDLNAProfileGuesser object.

### gupnp_dlna_profile_guesser_guess_profile_async ()

    gboolean            gupnp_dlna_profile_guesser_guess_profile_async
                                                            (GUPnPDLNAProfileGuesser *guesser,
                                                             const gchar *uri,
                                                             guint timeout_in_ms,
                                                             GError **error);

Asynchronously guesses DLNA profile for given `uri`. When guessing is done, ::done signal is emitted on `guesser`.

`guesser` : | GUPnPDLNAProfileGuesser object to use for guessing.
`uri` : | URI of media.
`timeout_in_ms` : | Timeout of guessing in miliseconds.
`error` : | GError object or `NULL`.
Returns : | `TRUE` if `uri` was successfully queued, `FALSE` otherwise.

### gupnp_dlna_profile_guesser_guess_profile_sync ()

    GUPnPDLNAProfile *  gupnp_dlna_profile_guesser_guess_profile_sync
                                                            (GUPnPDLNAProfileGuesser *guesser,
                                                             const gchar *uri,
                                                             guint timeout_in_ms,
                                                             GUPnPDLNAInformation **dlna_info,
                                                             GError **error);

Synchronously guesses DLNA profile for given `uri`.

`guesser` : | GUPnPDLNAProfileGuesser object to use for guessing.
`uri` : | URI of media.
`timeout_in_ms` : | Timeout of guessing in miliseconds.
`dlna_info` : | A place where to store DLNA information or `NULL`. [allow-none][transfer full][out]
`error` : | GError object or `NULL`. [allow-none]
Returns : | DLNA profile if any had matched, `NULL` otherwise. [transfer none]

### gupnp_dlna_profile_guesser_guess_profile_from_info ()

    GUPnPDLNAProfile *  gupnp_dlna_profile_guesser_guess_profile_from_info
                                                            (GUPnPDLNAProfileGuesser *guesser,
                                                             GUPnPDLNAInformation *info);

Guesses the profile which fits to passed `info`.

`guesser` : | The GUPnPDLNAProfileGuesser object.
`info` : | The GUPnPDLNAInformation object.
Returns : | A GUPnPDLNAProfile object on success, `NULL` otherwise. [transfer none]

### gupnp_dlna_profile_guesser_get_profile ()

    GUPnPDLNAProfile *  gupnp_dlna_profile_guesser_get_profile
                                                            (GUPnPDLNAProfileGuesser *guesser,
                                                             const gchar *name);

Lookups for GUPnPDLNAProfile with given `name`.

`guesser` : | The GUPnPDLNAProfileGuesser object.
`name` : | The name of the DLNA profile to be retrieved.
Returns : | A GUPnPDLNAProfile object on success, `NULL` otherwise. [transfer none]

### gupnp_dlna_profile_guesser_list_profiles ()

    GList *             gupnp_dlna_profile_guesser_list_profiles
                                                            (GUPnPDLNAProfileGuesser *guesser);

Gets a list of the all DLNA profiles supported by `guesser`.

`guesser` : | The GUPnPDLNAProfileGuesser whose profile list is required.
Returns : | A GList of GUPnPDLNAProfile on success, `NULL` otherwise. [transfer none][element-type GUPnPDLNAProfile]

### gupnp_dlna_profile_guesser_get_relaxed_mode ()

    gboolean            gupnp_dlna_profile_guesser_get_relaxed_mode
                                                            (GUPnPDLNAProfileGuesser *guesser);

`guesser` : | The GUPnPDLNAProfileGuesser object.
Returns : | `TRUE` if `guesser` is in relaxed mode, `FALSE` otherwise.

### gupnp_dlna_profile_guesser_get_extended_mode ()

    gboolean            gupnp_dlna_profile_guesser_get_extended_mode
                                                            (GUPnPDLNAProfileGuesser *guesser);

`guesser` : | The GUPnPDLNAProfileGuesser object.
Returns : | `TRUE` if `guesser` is in extended mode, `FALSE` otherwise.

### gupnp_dlna_profile_guesser_cleanup ()

    void                gupnp_dlna_profile_guesser_cleanup  (void);

Cleans up the DLNA profiles. Provided to remove Valgrind noise. Not thread-safe. Do not call it if there is even a slightest chance that profile guessing will be performed during process lifetime. The profiles are not reloaded after cleanup.

## Property Details

### The `"extended-mode"` property

      "extended-mode"            gboolean              : Read / Write / Construct Only

Whether profile matching should be done also against DLNA profiles not being a part of DLNA specification.

Default value: FALSE

### The `"relaxed-mode"` property

      "relaxed-mode"             gboolean              : Read / Write / Construct Only

Whether profile matching should not be strictly compliant with the DLNA specification.

Default value: FALSE

## Signal Details

### The `"done"` signal

    void                user_function                      (GUPnPDLNAProfileGuesser *profile_guesser,
                                                            GUPnPDLNAInformation    *info,
                                                            GUPnPDLNAProfile        *dlna,
                                                            GError                  *error,
                                                            gpointer                 user_data)            : Run Last

Will be emitted when guessing DLNA profile for a URI has finished.

`profile_guesser` : | The GUPnPDLNAProfileGuesser.
`info` : | URI metadata as GUPnPDLNAInformation. [transfer none]
`dlna` : | The results as GUPnPDLNAProfile. [allow-none][transfer none]
`error` : | Contains details of the error if discovery failed, else is `NULL`. [allow-none]
`user_data` : | user data set when the signal handler was connected.