message: add timeout to progress message
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 15 Feb 2011 17:26:00 +0000 (18:26 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 15 Feb 2011 17:55:23 +0000 (18:55 +0100)
Add a timeout member to the progress messages to let the application know about
the timeout so that it can do some gui things with it.

gst/gstmessage.c
gst/gstquark.c
gst/gstquark.h

index 5d06c67..e151042 100644 (file)
@@ -2104,7 +2104,7 @@ gst_message_new_progress (GstObject * src, GstProgressType type,
 {
   GstMessage *message;
   GstStructure *structure;
-  gint percent = 100;
+  gint percent = 100, timeout = -1;
 
   g_return_val_if_fail (code != NULL, NULL);
   g_return_val_if_fail (text != NULL, NULL);
@@ -2116,7 +2116,8 @@ gst_message_new_progress (GstObject * src, GstProgressType type,
       GST_QUARK (TYPE), GST_TYPE_PROGRESS_TYPE, type,
       GST_QUARK (CODE), G_TYPE_STRING, code,
       GST_QUARK (TEXT), G_TYPE_STRING, text,
-      GST_QUARK (PERCENT), G_TYPE_INT, percent, NULL);
+      GST_QUARK (PERCENT), G_TYPE_INT, percent,
+      GST_QUARK (TIMEOUT), G_TYPE_INT, timeout, NULL);
   message = gst_message_new_custom (GST_MESSAGE_PROGRESS, src, structure);
 
   return message;
index e43ce0d..91a2012 100644 (file)
@@ -50,7 +50,7 @@ static const gchar *_quark_strings[] = {
   "intermediate", "GstMessageStepStart", "active", "eos", "sink-message",
   "message", "GstMessageQOS", "running-time", "stream-time", "jitter",
   "quality", "processed", "dropped", "buffering-ranges", "GstMessageProgress",
-  "code", "text", "percent"
+  "code", "text", "percent", "timeout"
 };
 
 GQuark _priv_gst_quark_table[GST_QUARK_MAX];
index aa0a7ef..6e16ee5 100644 (file)
@@ -131,8 +131,9 @@ typedef enum _GstQuarkId
   GST_QUARK_CODE = 102,
   GST_QUARK_TEXT = 103,
   GST_QUARK_PERCENT = 104,
+  GST_QUARK_TIMEOUT = 105,
 
-  GST_QUARK_MAX = 105
+  GST_QUARK_MAX = 106
 } GstQuarkId;
 
 extern GQuark _priv_gst_quark_table[GST_QUARK_MAX];