2 * Copyright (C) 2009,2010,2011 Toni Gundogdu <legatvs@gmail.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 /* simple.c -- A very basic example. See src/quvi.c for a more complete
24 #include <quvi/quvi.h>
28 /* See src/quvi.c for a more complete example of status callback
30 static int status_callback(long param
, void *data
)
32 quvi_word status
, type
;
34 status
= quvi_loword(param
);
35 type
= quvi_hiword(param
);
37 printf("status: %d, type: %d\n", status
, type
);
42 int main(int argc
, char **argv
)
44 quvi_media_t m
; /* Media handle */
45 QUVIcode rc
; /* quvi return code */
46 char *url
; /* Holds parsed media stream URL */
47 quvi_t q
; /* Session handle */
49 /* Start a new session. */
53 /* Set session options. */
54 quvi_setopt(q
, QUVIOPT_STATUSFUNCTION
, &status_callback
);
55 quvi_setopt(q
, QUVIOPT_NOVERIFY
, 1L); /* Do not verify media stream URL */
57 /* Parse media details from the specified URL. */
58 rc
= quvi_parse(q
, "http://vimeo.com/1485507", &m
);
61 /* Access the parsed media details. */
62 quvi_getprop(m
, QUVIPROP_MEDIAURL
, &url
);
65 /* When done with the parsed details, free them. */
68 /* When done, close the session. */
74 /* vim: set ts=2 sw=2 tw=72 expandtab: */