### Method

# GUPnPAV DIDLLiteObject get_compat_resource

#### Declaration [src]

    GUPnPDIDLLiteResource*
    gupnp_didl_lite_object_get_compat_resource (
      GUPnPDIDLLiteObject* object,
      const char* sink_protocol_info,
      gboolean lenient
    )

#### Description [src]

Use this function to get a resource from the `object` that is compatible with any of the protocols specified in the `sink_protocol_info`. The value of `sink_protocol_info` will typically be acquired from ‘Sink’ argument of ‘GetProtocolInfo’ action or ‘SinkProtocolInfo’ state-variable of a ConnectionManager service.

If `lenient` is `TRUE`, the first resource in the list is returned instead of `NULL` if none of resources and protocols are found to be compatible.

#### Parameters

`sink_protocol_info`

  Type: `const char*`

  The SinkProtocolInfo string from MediaRenderer.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`lenient`

  Type: `gboolean`

  Enable lenient mode.

#### Return value

Type: `GUPnPDIDLLiteResource`

The resource belonging to `object` that is comaptible with any of the protocols specified in `sink_protocol_info`, or `NULL`. Unref after usage.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.