libvalhalla
2.1.0
|
#include <pthread.h>
#include <string.h>
#include "stats.h"
#include "utils.h"
Go to the source code of this file.
Data Structures | |
struct | grabber_param_t |
Structure for the init of a grabber. More... | |
struct | grabber_list_t |
Structure for a grabber. More... | |
Defines | |
#define | GRABBER_REGISTER(p_name, p_caps, p_pl, p_tw,fct_priv, fct_init, fct_uninit, fct_grab, fct_loop) |
Macro to register and populate a grabber structure. | |
Flags for the capabilities of the grabbers. | |
#define | GRABBER_CAP_AUDIO (1 << 0) |
grab for audio files | |
#define | GRABBER_CAP_VIDEO (1 << 1) |
grab for video files | |
#define | GRABBER_CAP_IMAGE (1 << 2) |
grab for image files |
GeeXboX Valhalla Grabber private API header.
To add a new grabber, a good approach is to copy an existing grabber like grabber_dummy.[ch] in order to have at least the structure. A grabber must not use global/static variables. A grabber must be thread-safe in the case where more than one instance of Valhalla are running concurrently. But, the functions in one grabber are not called in concurrency in one instance of Valhalla.
Some others points to consider:
Some utils are available for the grabbers:
Main header for all grabbers:
Definition in file grabber_common.h.
#define GRABBER_CAP_AUDIO (1 << 0) |
grab for audio files
Definition at line 71 of file grabber_common.h.
#define GRABBER_CAP_IMAGE (1 << 2) |
grab for image files
Definition at line 73 of file grabber_common.h.
#define GRABBER_CAP_VIDEO (1 << 1) |
grab for video files
Definition at line 72 of file grabber_common.h.
#define GRABBER_REGISTER | ( | p_name, | |
p_caps, | |||
p_pl, | |||
p_tw, | |||
fct_priv, | |||
fct_init, | |||
fct_uninit, | |||
fct_grab, | |||
fct_loop | |||
) |
Macro to register and populate a grabber structure.
See struct grabber_list_s for more informations on the structure and the functions.
[in] | p_name | Grabber's name. |
[in] | p_caps | Capabilities flags. |
[in] | p_pl | List of metadata priorities. |
[in] | p_tw | Min time to wait [ms] between grabber_list_t::grab(). |
[in] | fct_priv | Function to retrieve the private data pointer. |
[in] | fct_init | grabber_list_t::init(). |
[in] | fct_uninit | grabber_list_t::uninit(). |
[in] | fct_grab | grabber_list_t::grab(). |
[in] | fct_loop | grabber_list_t::loop(). |
Definition at line 209 of file grabber_common.h.