Functions

enhancer_check (iface_type, scheme, host)

init (argv)

init_check (argv)

Details

Clapper.enhancer_check(iface_type, scheme, host)
Parameters:
Returns:

whether a plausible enhancer was found.

name:

return location for found enhancer name

Return type:

(bool, name: str)

Check if an enhancer of type is available for given scheme and host.

A check that compares requested capabilites of all available Clapper enhancers, thus it is fast but does not guarantee that the found one will succeed. Please note that this function will always return False if Clapper was built without enhancers loader functionality. To check that, use [const`Clapper`.WITH_ENHANCERS_LOADER].

This function can be used to quickly determine early if Clapper will at least try to handle URI and with one of its enhancers and which one.

Example:

``c gboolean supported = clapper_enhancer_check (CLAPPER_TYPE_EXTRACTABLE, “https”, “example.com”, NULL); ``

For self hosted services a custom URI scheme without host can be used. Enhancers should announce support for such schemes by defining them in their plugin info files.

``c gboolean supported = clapper_enhancer_check (CLAPPER_TYPE_EXTRACTABLE, “example”, NULL, NULL); ``

New in version 0.8.

Clapper.init(argv)
Parameters:

argv ([str] or None) – pointer to application’s argv

Returns:

pointer to application’s argv

Return type:

argv: [str]

Initializes the Clapper library. Implementations must always call this before using Clapper API.

Because Clapper uses GStreamer internally, this function will also initialize GStreamer before initializing Clapper itself for user convienience, so application does not have to do so anymore.

WARNING: This function will terminate your program if it was unable to initialize for some reason. If you want to do some fallback logic, use [func`Clapper`.init_check] instead.

Clapper.init_check(argv)
Parameters:

argv ([str] or None) – pointer to application’s argv

Returns:

True if Clapper could be initialized, False otherwise.

argv:

pointer to application’s argv

Return type:

(bool, argv: [str])

This function does the same thing as [func`Clapper`.init], but instead of terminating on failure it returns False.