[totem-pl-parser] Add support for new quvi properties
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem-pl-parser] Add support for new quvi properties
- Date: Sat, 2 Apr 2011 19:44:39 +0000 (UTC)
commit aba65d92aa4a82de84a3135af2cbfb88124a319b
Author: Bastien Nocera <hadess hadess net>
Date: Fri Mar 25 01:31:39 2011 +0000
Add support for new quvi properties
Duration, and Thumbnail URL are now available.
configure.in | 2 +-
plparse/totem-pl-parser-videosite.c | 16 +++++++++++++---
2 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/configure.in b/configure.in
index 33f9268..556f364 100644
--- a/configure.in
+++ b/configure.in
@@ -40,7 +40,7 @@ AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
# Requirements
GLIB_REQS=2.21.6
GIO_REQS=2.24.0
-QUVI_REQS=0.2.11
+QUVI_REQS=0.2.15
# Before making a release, the PLPARSER_LT_VERSION string should be modified.
# The string is of the form C:R:A.
diff --git a/plparse/totem-pl-parser-videosite.c b/plparse/totem-pl-parser-videosite.c
index fb69edb..2ba474c 100644
--- a/plparse/totem-pl-parser-videosite.c
+++ b/plparse/totem-pl-parser-videosite.c
@@ -86,6 +86,9 @@ totem_pl_parser_add_videosite (TotemPlParser *parser,
const char *page_uri;
const char *starttime;
const char *content_type;
+ const char *thumb_url;
+ double duration;
+ char *duration_str;
if (quvi_init (&handle) != QUVI_OK)
return TOTEM_PL_PARSER_RESULT_ERROR;
@@ -107,12 +110,16 @@ totem_pl_parser_add_videosite (TotemPlParser *parser,
else
length_str = NULL;
getprop (QUVIPROP_PAGETITLE, title);
- getprop (QUVIPROP_VIDEOID, id);
+ getprop (QUVIPROP_MEDIAID, id);
getprop (QUVIPROP_PAGEURL, page_uri);
getprop (QUVIPROP_STARTTIME, starttime);
- getprop (QUVIPROP_VIDEOFILECONTENTTYPE, content_type);
+ getprop (QUVIPROP_MEDIACONTENTTYPE, content_type);
+ getprop (QUVIPROP_MEDIATHUMBNAILURL, thumb_url);
+ if (quvi_getprop (v, QUVIPROP_MEDIADURATION, &duration) == QUVI_OK && duration)
+ duration_str = g_strdup_printf ("%f", duration);
+ else
+ duration_str = NULL;
- length_str = g_strdup_printf ("%d", (int) length);
if (video_uri != NULL)
totem_pl_parser_add_uri (parser,
TOTEM_PL_PARSER_FIELD_TITLE, title,
@@ -122,9 +129,12 @@ totem_pl_parser_add_videosite (TotemPlParser *parser,
TOTEM_PL_PARSER_FIELD_FILESIZE, length_str,
TOTEM_PL_PARSER_FIELD_STARTTIME, starttime,
TOTEM_PL_PARSER_FIELD_CONTENT_TYPE, content_type,
+ TOTEM_PL_PARSER_FIELD_IMAGE_URI, thumb_url,
+ TOTEM_PL_PARSER_FIELD_DURATION, duration_str,
NULL);
g_free (uri);
g_free (length_str);
+ g_free (duration_str);
quvi_parse_close (&v);
quvi_close (&handle);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]