[totem-pl-parser] Add "content-type" property



commit 50b0b6b5035aadd5401c807bcff27255d0bcd1bf
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Mar 17 01:20:52 2011 +0000

    Add "content-type" property

 plparse/totem-pl-parser-videosite.c |    3 +++
 plparse/totem-pl-parser.c           |    6 +++++-
 plparse/totem-pl-parser.h           |    7 +++++++
 3 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/plparse/totem-pl-parser-videosite.c b/plparse/totem-pl-parser-videosite.c
index 29cb8b3..fb69edb 100644
--- a/plparse/totem-pl-parser-videosite.c
+++ b/plparse/totem-pl-parser-videosite.c
@@ -85,6 +85,7 @@ totem_pl_parser_add_videosite (TotemPlParser *parser,
 	const char *id;
 	const char *page_uri;
 	const char *starttime;
+	const char *content_type;
 
 	if (quvi_init (&handle) != QUVI_OK)
 		return TOTEM_PL_PARSER_RESULT_ERROR;
@@ -109,6 +110,7 @@ totem_pl_parser_add_videosite (TotemPlParser *parser,
 	getprop (QUVIPROP_VIDEOID, id);
 	getprop (QUVIPROP_PAGEURL, page_uri);
 	getprop (QUVIPROP_STARTTIME, starttime);
+	getprop (QUVIPROP_VIDEOFILECONTENTTYPE, content_type);
 
 	length_str = g_strdup_printf ("%d", (int) length);
 	if (video_uri != NULL)
@@ -119,6 +121,7 @@ totem_pl_parser_add_videosite (TotemPlParser *parser,
 					 TOTEM_PL_PARSER_FIELD_URI, video_uri,
 					 TOTEM_PL_PARSER_FIELD_FILESIZE, length_str,
 					 TOTEM_PL_PARSER_FIELD_STARTTIME, starttime,
+					 TOTEM_PL_PARSER_FIELD_CONTENT_TYPE, content_type,
 					 NULL);
 	g_free (uri);
 	g_free (length_str);
diff --git a/plparse/totem-pl-parser.c b/plparse/totem-pl-parser.c
index eef200d..a92a495 100644
--- a/plparse/totem-pl-parser.c
+++ b/plparse/totem-pl-parser.c
@@ -559,10 +559,14 @@ totem_pl_parser_class_init (TotemPlParserClass *klass)
 				     "String representing the identifier for an entry", NULL,
 				     G_PARAM_READABLE & G_PARAM_WRITABLE);
 	g_param_spec_pool_insert (totem_pl_parser_pspec_pool, pspec, TOTEM_TYPE_PL_PARSER);
-	pspec = g_param_spec_string ("subtitle-uri", "uri",
+	pspec = g_param_spec_string ("subtitle-uri", "subtitle-uri",
 				     "Subtitle URI to be added", NULL,
 				     G_PARAM_READABLE & G_PARAM_WRITABLE);
 	g_param_spec_pool_insert (totem_pl_parser_pspec_pool, pspec, TOTEM_TYPE_PL_PARSER);
+	pspec = g_param_spec_string ("content-type", "content-type",
+				     "Content type for the video stream", NULL,
+				     G_PARAM_READABLE & G_PARAM_WRITABLE);
+	g_param_spec_pool_insert (totem_pl_parser_pspec_pool, pspec, TOTEM_TYPE_PL_PARSER);
 }
 
 static void
diff --git a/plparse/totem-pl-parser.h b/plparse/totem-pl-parser.h
index d5add04..d35d918 100644
--- a/plparse/totem-pl-parser.h
+++ b/plparse/totem-pl-parser.h
@@ -253,6 +253,13 @@ struct _TotemPlParser {
  * #TotemPlParser::playlist-ended signal handlers.
  **/
 #define TOTEM_PL_PARSER_FIELD_IS_PLAYLIST	"is-playlist"
+/**
+ * TOTEM_PL_PARSER_FIELD_CONTENT_TYPE:
+ *
+ * Metadata field for an entry's content-type (usually a mime-type coming
+ * from a web server).
+ **/
+#define TOTEM_PL_PARSER_FIELD_CONTENT_TYPE	"content-type"
 
 /**
  * TotemPlParserClass:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]