libvalhalla  2.1.0
Data Fields
valhalla_init_param_t Struct Reference

Parameters for valhalla_init(). More...

#include <valhalla.h>

Data Fields

unsigned int parser_nb
unsigned int grabber_nb
unsigned int commit_int
unsigned int decrapifier: 1
unsigned int od_meta: 1
void(* od_cb )(const char *file, valhalla_event_od_t e, const char *id, void *data)
void * od_data
void(* gl_cb )(valhalla_event_gl_t e, void *data)
void * gl_data
void(* md_cb )(valhalla_event_md_t e, const char *id, const valhalla_file_t *file, const valhalla_metadata_t *md, void *data)
void * md_data

Detailed Description

Parameters for valhalla_init().

Definition at line 495 of file valhalla.h.


Field Documentation

Number of data (set of metadata) to be inserted or updated in one pass in the database (BEGIN and COMMIT sql mechanisms). A value between 100 and 200 is a good choice. The default interval is 128.

Definition at line 516 of file valhalla.h.

If the "title" metadata is not available with a file, the decrapifier can be used to create this metadata by using the filename. This feature is very useful when the grabbing support is enabled, because the title is used as keywords in a lot of grabbers. By default the decrapifier is disabled.

Definition at line 524 of file valhalla.h.

When gl_cb is defined, events can be sent by Valhalla according to some global actions. See valhalla_event_gl_t for details on the events.

Definition at line 551 of file valhalla.h.

User data for global event callback.

Definition at line 553 of file valhalla.h.

Number of threads for grabbing (max 16); the grabbers are concurrent as long as their ID are different. The default number of threads is 2. To use many threads will not increase a lot the use of memory, but it can increase significantly the use of the bandwidth for Internet and the CPU load. Set this parameter to 1, in order to serialize the calls on the grabbers. A value of 3 or 4 is a good choice for most of the uses.

Definition at line 510 of file valhalla.h.

void(* valhalla_init_param_t::md_cb)(valhalla_event_md_t e, const char *id, const valhalla_file_t *file, const valhalla_metadata_t *md, void *data)

When md_cb is defined, events can be sent by Valhalla each time that a file metadata set is completed. Where id is the textual identifier (for example: "amazon", "exif", etc, ...) of the grabber when the event e is VALHALLA_EVENTMD_GRABBER. This callback is called for each metadata. If there are 10 metadata in one set, then this callback is called 10 times. The use of this callback is not recommanded. It may increase significantly the use of memory because all metadata are kept (and duplicated when it comes from the parser) until a set is fully read.

Definition at line 565 of file valhalla.h.

User data for metadata event callback.

Definition at line 569 of file valhalla.h.

void(* valhalla_init_param_t::od_cb)(const char *file, valhalla_event_od_t e, const char *id, void *data)

When od_cb is defined, an event is sent for each step with an on demand query. If an event arrives, the data are really inserted in the DB. The order for the events is not determinative, VALHALLA_EVENTOD_GRABBED can be sent before VALHALLA_EVENTOD_PARSED. VALHALLA_EVENTOD_GRABBED is sent for each grabber and id is its textual identifier (for example: "amazon", "exif", etc, ...). Only VALHALLA_EVENTOD_ENDED is always sent at the end, but this one has not a high priority unlike other events. If the file is already (fully) inserted in the DB, only VALHALLA_EVENTOD_ENDED is sent to the callback.

Definition at line 542 of file valhalla.h.

User data for ondemand callback.

Definition at line 545 of file valhalla.h.

If the attribute is set, then the meta keys can be retrieved from the ondemand callback by using the function valhalla_ondemand_cb_meta().

Definition at line 529 of file valhalla.h.

Number of threads for parsing (max 8); the parsers are concurrent. The default number of threads is 2.

Definition at line 500 of file valhalla.h.


The documentation for this struct was generated from the following file: