Describes the constants and the types used with the API.
#define QUVIINFO_VOID 0x100000 |
void type
#define QUVIINFO_LONG 0x200000 |
long type
#define QUVIINFO_STRING 0x300000 |
string type
#define QUVIINFO_DOUBLE 0x400000 |
double type
#define QUVIINFO_TYPEMASK 0xf00000 |
type mask
#define QUVIPROPERTY_STRING 0x100000 |
string type
#define QUVIPROPERTY_LONG 0x200000 |
long type
#define QUVIPROPERTY_DOUBLE 0x300000 |
double type
#define QUVIPROPERTY_TYPEMASK 0xf00000 |
type mask
#define QUVI_WRITEFUNC_ABORT 0x10000000 |
Abort writing
typedef void* quvi_t |
libquvi session handle
typedef void* quvi_video_t |
Video parsing session handle.
typedef int(* quvi_callback_status)(long param, void *data) |
Status callback function.
Callback function for status changes.
Example:
static int status_callback (long param, void *data) { quvi_word status, type; status = quvi_loword(param); type = quvi_hiword(param); switch (status) { case QUVISTATUS_SHORTENED: switch (type) { default: printf (":: Check for shortened URL ..."); break; case QUVISTATUSTYPE_DONE: puts ("done."); break; } break; case QUVISTATUS_FETCH: switch (type) { default: printf(":: Fetch %s ...", (char *)data); break; case QUVISTATUSTYPE_CONFIG : printf(":: Fetch config ..."); break; case QUVISTATUSTYPE_PLAYLIST: printf(":: Fetch playlist ..."); break; case QUVISTATUSTYPE_DONE : puts("done."); break; } break; case QUVISTATUS_VERIFY: switch (type) { default: printf(":: Verify video link ..."); break; case QUVISTATUSTYPE_DONE: puts("done."); break; } break; } fflush(stdout); } int main (int argc, char *argv[]) { quvi_t quvi; quvi_init(&quvi); quvi_setopt(quvi, QUVIOPT_STATUSFUNCTION, status_callback); ... }
typedef int(* quvi_callback_write)(char *buffer, size_t size, size_t nitems, void *instream) |
Write callback function.
This function gets called by libquvi (or libcurl) as soon as there is data received that needs to be saved.
typedef uint32_t quvi_word |
Word type.
typedef uint8_t quvi_byte |
Byte type.
enum QUVIversion |
Types used with quvi_version()
enum QUVIcode |
Return codes
QUVI_OK |
OK |
QUVI_MEM |
Memory allocation failed |
QUVI_BADHANDLE |
Bad session handle |
QUVI_INVARG |
Invalid function argument |
QUVI_CURLINIT |
libcurl initialization failed |
QUVI_LAST |
Indicates end of list iteration |
QUVI_ABORTEDBYCALLBACK |
Aborted by callback function |
QUVI_LUAINIT |
Lua initialization failure |
QUVI_NOLUAWEBSITE |
Failed to find lua website scripts |
QUVI_NOLUAUTIL |
Failed to find lua util scripts |
_INTERNAL_QUVI_LAST |
For library internal use only |
QUVI_PCRE |
libpcre error occurred
|
QUVI_NOSUPPORT |
libquvi does not support the video host |
QUVI_CURL |
libcurl error occurred |
QUVI_ICONV |
libiconv error occurred |
QUVI_LUA |
lua error occurred |
enum QUVIstatus |
enum QUVIstatusType |
enum QUVIoption |
Option codes to be used with quvi_setopt()
If QUVIOPT_NOSHORTENED is set to >= 1, the library will not "decompress" the shortened URLs before using them. Unless shortened URLs are "decompressed", the library will report them as "unsupported".
If QUVIOPT_NOVERIFY is set to >= 1, the library will not verify the video download URL, and query the video file details (e.g. length in bytes, content type, file suffix). Unless the download URLs are verified, the library will report invalid values (0 or empty strings) for these video details.
enum QUVIcategory |
Website script category
Used (together with QUVIOPT_CATEGORY) to specify which of the website script categories the application wants to use. The library defaults to QUVIPROTO_HTTP.
enum QUVIinfo |
Info codes to be used with quvi_getinfo()
The library creates a cURL handle which is used to fetch and verify parsed video details. The cURL handle is initialized with the following libcurl options:
You can, of course, override those settings in your program. You can even use the cURL handle in your program until quvi_close() is called which will release the handle. See the src/quvi.c for an example of this. Note that libquvi uses the libcurl easy interface and not the multi interface.
enum QUVIproperty |
Video property codes to be used with quvi_getprop()