libvalhalla  2.1.0
Data Structures | Defines
grabber_common.h File Reference
#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

Detailed Description

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:

See also:
grabber_list_t for details on the functions.

Definition in file grabber_common.h.


Define Documentation

#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.

Parameters:
[in]p_nameGrabber's name.
[in]p_capsCapabilities flags.
[in]p_plList of metadata priorities.
[in]p_twMin time to wait [ms] between grabber_list_t::grab().
[in]fct_privFunction to retrieve the private data pointer.
[in]fct_initgrabber_list_t::init().
[in]fct_uninitgrabber_list_t::uninit().
[in]fct_grabgrabber_list_t::grab().
[in]fct_loopgrabber_list_t::loop().

Definition at line 209 of file grabber_common.h.